How to solve the optimization using Matlab's optimization toolbox

Can somebody help to solve following optimization using Matlab's optimization toolbox
Max r == [ 1 + [(1-pab)/p(ab) ]* pint ] ^ 1/k
subject to 0 < pinit <= 1 ;k>0, and 0 < pab <= 1

8 个评论

There are many ways to solve this. Is p(ab) a function?
I'm unclear why you can't just solve this using fmincon. Have you looked at the documentation a?
p(ab) is a variable. can you tell me how to use the function fmincon,since i am new to Matlab.
Is there a difference between p(ab) and pab? What is p in that case? Is it a function? Are pinit and pint the same? How can we help you if we must guess what you need?
sorry, i have rewrite the equation max r= (1+ ((1-p)/p)* q)^(1/k) Subject to 0 < p <= 1 ;k>0, and 0 < q <= 1.
i have tried in Matlab following code. but it shows error "Undefined function or variable 'p'.".can you help on this
fun1 = @ (r)(1+ ((1-p)/p)* q)^(1/k);
lb = [0,0];
ub = [1,1];
A = [];
b = [];
Aeq = [];
beq = [];
x0 = [0.5,1];
r = fmincon(fun1,x0,A,b,Aeq,beq,lb,ub)
A maximum on [0:1]x[0:1] does not exist.
Hint:
See what happens for p=eps, q=1 and eps a very small positive number.
Best wishes
Torsten.
How to find the minimal value of r using the same optimization tool box?
A minimum on [0:1]x[0:1] does not exist.
Hint:
See what happens for p arbitrary, q=eps a very small positive number.
Best wishes
Torsten.
Read my answer. You CANNOT find a maximum of this function. It is unbounded.
The minimum is TRIVIAL to find. Again, use common sense!
Simply set pab == 1. r will take on the value of 1. It cannot be any lower. The other parameters are meaningless. Pick any random numbers.
USE COMMON SENSE and high school mathematics.

请先登录,再进行评论。

回答(1 个)

IF I assume that p(ab) and pab are the same, and that pinit and pint are the same thing, then...
No, fmincon will be of no real value. Common sense is sufficient.
With pint and pab both positive and no larger than 1, the expression
[(1-pab)/p(ab) ]* pint
is ALWAYS a non-negative number, only ever exactly zero based on your constraints when pab is exactly 1.
Therefore, the expression
[ 1 + [(1-pab)/p(ab) ]* pint ]
is ALWAYS at least 1, and generally larger than 1. Since you then raise it to a power (1/k) we therefore need to maximize 1/k. So make k as small as possible. Zero would be nice, but difficult to achieve, since you said k>0. So make k approach zero in a limit, and you can make r as large as you wish. r is unbounded. Choose any values for pab and pint, as long as pab is not exactly 1. As long as we can make k arbitrarily small, we can make r approach infinity as k approaches zero in the limit.
As I said, fmincon is totally unnecessary, and in fact ANY optimizer would be a complete waste of time. Just use common sense and basic mathematics.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by