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
2019년 9월 6일
Which variable is the unknown? You only have 1 equation, so only one of the variables can be.
manish kumar
2019년 9월 6일
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
2019년 9월 6일
Torsten
2019년 9월 6일
I don't understand what you mean.
manish kumar
2019년 9월 6일
Torsten
2019년 9월 6일
Please show your code.
답변 (1개)
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
2019년 9월 9일
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
2019년 9월 11일
Walter Roberson
2019년 9월 11일
You should have used
initial_guess = [-42, pi];
manish kumar
2019년 9월 11일
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
2019년 9월 11일
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
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 Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!