To find the minimum of a function which are constrained problems
Mostrar comentarios más antiguos
Pi = arg min F(P) + k* F( NPo − Pk)
P∈₱
with ₱ = [0, Pb) ∪ ( (N*Po) / (k+1) )
Pb=7;
F(P) = 1 − exp(−( (2^R – 1) / P ) ^ ( β/2) )
R =3;
β=8;
N=2;
k=floor((Po*N)/Pa);
Pa=9;
Po varies from 0 to 12
find the minimum value for Pi .....
pls suggest a code for this
5 comentarios
Ashly Kurian
el 26 de En. de 2014
Amit
el 26 de En. de 2014
So you're trying to find P such that F(P) + k*F(N*P0-Pk) is minimum?
Ashly Kurian
el 26 de En. de 2014
Amit
el 26 de En. de 2014
what is s...
Ashly Kurian
el 26 de En. de 2014
Respuesta aceptada
Más respuestas (1)
Amit
el 26 de En. de 2014
Step 1: Make you function
function Y = myFunc(P,P0)
N = 2;
Pa = 9;
k = floor((P0*N/Pa));
Y = F(P)+k*F(N*P0-P*k);
function Fp = F(P)
R = 3;
beta = 8;
Fp = 1 - exp(-((2^R-1)./P).^(beta/2));
Step 2: Minimize it within the bounds:
P0 = 9;
[Pi, FVal] = fminbnd(@(x) myFunc(x,P0),0,7);
14 comentarios
Ashly Kurian
el 26 de En. de 2014
Amit
el 26 de En. de 2014
X is a simple variable for the function. You said P0 varies from 0 to 12. From that statement, I thought that for a scenario, P0 is constant.
Please state your question clearly. That includes the objective of the problem. Also, MATLAB has a very good help. Try seeing what different function do and how can you use it.
Ashly Kurian
el 26 de En. de 2014
Amit
el 26 de En. de 2014
Is P0 integer or a real number?
Ashly Kurian
el 26 de En. de 2014
Editada: Ashly Kurian
el 26 de En. de 2014
Ashly Kurian
el 26 de En. de 2014
Amit
el 26 de En. de 2014
The way I'll do this problem is like this. I'll make 3 function files.
One for F(P) as I have done in the answer.
Second where input is [P,P0] and output will be Y. You can optimize this using fmincon for the scenario where P belongs to [0,Pb).
Third, for the case where P = N*P0/(k+1). This function will take only 1 input as P0. N*P0/(k+1) is out of [0,Pb) only when P0 >= 10.5. Thus, the P0 bounds in this case will be [10.5,12]. I can optimize this using fminbnd (as this is a single variable function).
Now I can take the minimum of both solution, which will be the value for pi.
Read MATLAB documentation for these function and try it out. If you can't succeed in doing this, I'll help you. But I need to see your effort and the code you tried.
Ashly Kurian
el 26 de En. de 2014
what error you got?
Try reading this: This might help you in understanding what I meant by 3 function files. http://www.mathworks.com/help/matlab/ref/function.html
Ashly Kurian
el 26 de En. de 2014
Amit
el 26 de En. de 2014
That means, you're not entering the right amount of input for the function. Did you see the function link I posted here.
Ashly Kurian
el 28 de En. de 2014
Ashly Kurian
el 28 de En. de 2014
Editada: Ashly Kurian
el 28 de En. de 2014
Amit
el 28 de En. de 2014
See the answer.
Categorías
Más información sobre Solver Outputs and Iterative Display en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!