Symbolic solution to a system of algebraic equations

조회 수: 1 (최근 30일)
Aleem Andrew
Aleem Andrew 2020년 4월 1일
댓글: Aleem Andrew 2020년 4월 1일
I get an error message stating "Reference to non existent field b" when I try to solve for b in the following system of algebraic equations.
How can I modify the code?
syms a b x N g b L m
eqns = [(1/b)*(-2*N*sin(a))/3==m*L, x/b==-(5*L*cos(a))/6+(5*a^2*L*sin(a))/6, N/b==m*(5*L*sin(a))/6+(5*a^2*L)/(6*cos(a) +3*g)];
S = solve(eqns);
sol = [S.b]

채택된 답변

Birdman
Birdman 2020년 4월 1일
syms a b x N g b L m
eqns = [(1/b)*(-2*N*sin(a))/3==m*L, x/b==-(5*L*cos(a))/6+(5*a^2*L*sin(a))/6, N/b==m*(5*L*sin(a))/6+(5*a^2*L)/(6*cos(a) +3*g)];
S = solve(eqns,[b m x]);
sol = S.b
This will give you the solution.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by