Langrage Multipliers, Ending up with huge values

1 次查看(过去 30 天)
I was trying to use langrage multipliers to solve for the minimum and maximum of the following functions; however, upon using the following commands, I end up with enormous values for the critical points, which I don't think are correct. Please help!:
syms x;
syms y;
syms w;
syms z;
f=5.0*y - 1.0*w*x - 9.0*w*y + 5.0*w*z + 10.0*x*y + x^2
g=0.06964*w*x + 0.1368*w*z + 0.1525*x*y + 0.114*x*z + 0.247*y*z + 0.3672*w^2 + 0.3393*x^2 + 0.4146*y^2 + 0.1505*z^2
Dfw=diff(f,w)
Dfx=diff(f,x)
Dfy=diff(f,y)
Dfz=diff(f,z)
Dgw=diff(g,w)
Dgx=diff(g,x)
Dgy=diff(g,y)
Dgz=diff(g,z)
syms L
assume(L, 'real')
[LSols2, wSols2, xSols2, ySols2, zSols2]=solve([Dfw==L*Dgw, Dfx==L*Dgx, Dfy==L*Dgy, Dfz==L*Dgz, g==1], [L,w,x,y,z])
-And then the values for LSols2, wSols2, xSols2, ySols2, zSols2 are all, gigantic.
  1 个评论
the cyclist
the cyclist 2019-11-14
It's vastly better to post code, rather than images of code. That way people can copy & paste your code for testing.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear Algebra 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by