Symbolic solution to a system of algebraic equations

1 vue (au cours des 30 derniers jours)
Aleem Andrew
Aleem Andrew le 1 Avr 2020
Commenté : Aleem Andrew le 1 Avr 2020
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]

Réponse acceptée

Birdman
Birdman le 1 Avr 2020
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.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by