Symbolically Solving a multi-variable system of three equations for three variables

조회 수: 17 (최근 30일)
How can I find symbolic solutions for a,b, and c expressing them with respect to the other variables using the system of equations
(-2Nsinθ)/3=mL(b)
c=-(5bLcosθ)/6+(5(a^2)Lsinθ)/6
N=m( (5bLsinθ)/6+(5(a^2)L)/6cosθ +3g)

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 4월 1일
Try this
syms a b c N theta m L b g
eq1 = (-2*N*sin(theta))/3==m*L*b;
eq2 = c == -(5*b*L*cos(theta))/6+(5*(a^2)*L*sin(theta))/6;
eq3 = N == m*((5*b*L*sin(theta))/6+(5*(a^2)*L)/6*cos(theta)+3*g);
sol = solve([eq1 eq2 eq3], [a b c]);
Result:
>> sol.a
ans =
-((8*(9*N - 27*g*m + 5*N*sin(theta)^2))/(15*L*m*cos(theta)))^(1/2)/2
((8*(9*N - 27*g*m + 5*N*sin(theta)^2))/(15*L*m*cos(theta)))^(1/2)/2
>> sol.b
ans =
-(2*N*sin(theta))/(3*L*m)
-(2*N*sin(theta))/(3*L*m)
>> sol.c
ans =
(sin(theta)*(9*N - 27*g*m + 5*N*cos(theta)^2 + 5*N*sin(theta)^2))/(9*m*cos(theta))
(sin(theta)*(9*N - 27*g*m + 5*N*cos(theta)^2 + 5*N*sin(theta)^2))/(9*m*cos(theta))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by