필터 지우기
필터 지우기

Solve algebraic equation: define for which variable to solve

조회 수: 1 (최근 30일)
Jurrien Plijter
Jurrien Plijter 2020년 5월 20일
답변: Jurrien Plijter 2020년 5월 20일
Hi,
I try to solve a simple algebraic equation, defined by finding the variables for which the partial derivates of 'eqn1' are all 0. I want to solve the equation for the variables x, y and lambda. Such that those three variables are expressed as a function of the other variables. In this case, i look for the solution that:
x = 0;
lambda = - m*g / 2 / y;
y= + or - R
How can i define such an output? Thank you for your help! (This is a simplified problem of a more complicated case.)
syms x y m g R lambda L
eqn1 = L == m*g*(y+R) + lambda * (x^2 + y^2 - R^2);
dldx1 =diff(eqn1,x);
dldx2 =diff(eqn1,y);
dldlamba =diff(eqn1, lambda);
dl=[dldx1 ; dldx2 ; dldlamba]
[solx, soly, sollambda]=solve(dldx1==0, dldx2==0, dldlamba==0)

채택된 답변

Jurrien Plijter
Jurrien Plijter 2020년 5월 20일
Ah, i found it myself, you can simply define the variables for which the equation has to be solved:
[solx, soly, sollambda]=solve(dldx1==0, dldx2==0, dldlamba==0,[ x y lambda])

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by