optimization problem with two variable maxima and minima

can any one give me the solution or help me out in solving this equation mathamatically
Y=2x(1)^2 + 23.08x(2)^2 +4(6+x(1))^2 +24+14(x(1)^2 +x(2)^2)^0.5 +3(x(1)^2 + x(2)^2)
the other equation is 1=x(1)*x(2)

7 件のコメント

Matt J
Matt J 2019 年 9 月 6 日
Which variable is the unknown? You only have 1 equation, so only one of the variables can be.
manish kumar
manish kumar 2019 年 9 月 6 日
here x(1) and x(2) are unkown you can use other equation as
1=x(1)*x(2)
Torsten
Torsten 2019 年 9 月 6 日
Differentiate Y with respect to x(1) and x(2), set the derivatives to 0 and solve for x(1) and x(2).
help diff
help solve
manish kumar
manish kumar 2019 年 9 月 6 日
if i am differentiating the equation with respect to x(1) then the term under square root x(2) is coming
please guide under this matter
Torsten
Torsten 2019 年 9 月 6 日
I don't understand what you mean.
manish kumar
manish kumar 2019 年 9 月 6 日
first step :
by differentiating y with respect to x(1)
then by putting it equal to zero the term x(2) is coming due to square root term
how to solve this
and if we are putting x(2)=1/x(1) then complex term is coming
can you help me out
Torsten
Torsten 2019 年 9 月 6 日
Please show your code.

サインインしてコメントする。

回答 (1 件)

Catalytic
Catalytic 2019 年 9 月 6 日
編集済み: Matt J 2019 年 9 月 9 日

0 投票

fun=@(x) [2*x(1)^2+23.08*x(2)^2+4*(6+x(1))^2+24+14*(x(1)^2 +x(2)^2)^0.5+3*(x(1)^2+x(2)^2)-Y;...
prod(x)-1];
x=fsolve(fun,initial_guess)

9 件のコメント

manish kumar
manish kumar 2019 年 9 月 9 日
i am unable to run your code
plesae provide the code for x(1)' and x(2)'
Matt J
Matt J 2019 年 9 月 9 日
You probably need to remove all the spaces in the expression for fun.
fun=@(x) [2*x(1)^2+23.08*x(2)^2+4*(6+x(1))^2+24+14*(x(1)^2 +x(2)^2)^0.5+3*(x(1)^2+x(2)^2)-Y;...
prod(x)-1];
x=fsolve(fun,initial_guess)
manish kumar
manish kumar 2019 年 9 月 11 日
it says
Undefined function or variable 'initial_guess'.
Walter Roberson
Walter Roberson 2019 年 9 月 11 日
You should have used
initial_guess = [-42, pi];
manish kumar
manish kumar 2019 年 9 月 11 日
can you please provide combined code in a single script
as the data provided by you is not working
Torsten
Torsten 2019 年 9 月 11 日
It's still not clear to me what you are trying to do.
Do you want to solve the two equations
Y=2x(1)^2 + 23.08x(2)^2 +4(6+x(1))^2 +24+14(x(1)^2 +x(2)^2)^0.5 +3(x(1)^2 + x(2)^2)
1=x(1)*x(2)
for x(1) and x(2) (for a given value of Y)
or do you want to determine maximum and minimum of
Y(x(1),x(2)) = 2x(1)^2 + 23.08x(2)^2 +4(6+x(1))^2 +24+14(x(1)^2 +x(2)^2)^0.5 +3(x(1)^2 + x(2)^2)
under the constraint
1 = x(1)*x(2)
or ...
manish kumar
manish kumar 2019 年 9 月 11 日
i want to minimize
Y(x(1),x(2)) = 2x(1)^2 + 23.08x(2)^2 +4(6+x(1))^2 +24+14(x(1)^2 +x(2)^2)^0.5 +3(x(1)^2 + x(2)^2)
under the constraint
1 = x(1)*x(2)
Torsten
Torsten 2019 年 9 月 11 日
fun= @(x)2*x.^2+23.08*(1./x).^2+4*(6+x).^2+24+14*(x.^2+(1./x).^2).^0.5+3*(x.^2+(1./x).^2)
x0 = 1.0;
xmin = fminsearch(fun,x0)
Bruno Luong
Bruno Luong 2019 年 9 月 11 日
編集済み: Bruno Luong 2019 年 9 月 11 日
Careful on local minimum
>> xmin = fminsearch(fun,1), fun(xmin) % not global minimum
xmin =
0.9418
ans =
270.4623
>> xmin = fminsearch(fun,-2), fun(xmin)
xmin =
-2.2066
ans =
142.7984
>>

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

質問済み:

2019 年 9 月 6 日

編集済み:

2019 年 9 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by