Langrage Multipliers, Ending up with huge values

조회 수: 1 (최근 30일)
Ragini Ravichandren
Ragini Ravichandren 2019년 11월 14일
편집: Ragini Ravichandren 2019년 11월 14일
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