Home > Archive > Matlab > May 2005 > matlab optimization
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
matlab optimization
|
|
| Srihari 2005-05-31, 4:03 am |
| Hello everyone:
Here is an optimization problem,
maximize y
subject to:
x(2)*y-x(1)+2*x(2)<=0;
x(2)*y+x(1)-4*x(2)<=0;
x(3)*y-x(1)+1*x(3)<=0;
x(3)*y+x(1)-3*x(3)<=0;
0.222*x(3)*y-x(2)+0.333*x(3)<=0;
0.5*x(3)*y+x(2)-1*x(3)<=0;
x(1)+x(2)+x(3)=1;
x(1)>0;
x(2)>0;
x(3)>0;
The solution to the above problem when solved using GRG based solver
in excel is
y=0.838
x(1)=0.538
x(2)=0.170
x(3)=0.292
My question is how give initial points to above problem just guess
"y" when using optimization toolbox or is it necessary to mention
x(1), x(2) and x(3) in initial guess if so how to mention it
Thanx in advance
| |
| Marcelo Marazzi 2005-05-31, 4:05 pm |
| If I understand your question correctly, the answer
is yes, one needs to supply an initial guess to *all*
the unknowns - in your case to the x's and y.
One way to do this is to call "y" x(4):
maximize x(4) subject to
x(2)*x(4)-x(1)+2*x(2)<=0, etc
and thus your unknown is the vector
x = [x(1), ..., x(4)]. Please see the doc
for examples on how to pass the initial guess
(it's very easy).
-marcelo
Srihari wrote:
> Hello everyone:
> Here is an optimization problem,
>
> maximize y
>
> subject to:
>
> x(2)*y-x(1)+2*x(2)<=0;
> x(2)*y+x(1)-4*x(2)<=0;
> x(3)*y-x(1)+1*x(3)<=0;
> x(3)*y+x(1)-3*x(3)<=0;
> 0.222*x(3)*y-x(2)+0.333*x(3)<=0;
> 0.5*x(3)*y+x(2)-1*x(3)<=0;
> x(1)+x(2)+x(3)=1;
> x(1)>0;
> x(2)>0;
> x(3)>0;
>
> The solution to the above problem when solved using GRG based solver
> in excel is
> y=0.838
> x(1)=0.538
> x(2)=0.170
> x(3)=0.292
>
> My question is how give initial points to above problem just guess
> "y" when using optimization toolbox or is it necessary to mention
> x(1), x(2) and x(3) in initial guess if so how to mention it
>
> Thanx in advance
|
|
|
|
|