Hi,
I'm trying to find the equilibrium points of a system described by 4 equations. This is the code:
clear all; clc; syms x1 x2 x3 x4 g m1 m2 l1 l2 pi eq1 = x2 eq2 = -((g*(2*m1+m2)*sin(x1)+m2*(g*sin(x1-2*x3)+2*(l2*x4^2+l1*x2^2*cos(x1- x3))*sin(x1-x3)))/(2*l1*(m1+m2-m2*cos(x1-x3)^2))); eq3 = x4 eq4 = (((m1+m2)*(l1*x2^2+g*cos(x1))+l2*m2*x4^2*cos(x1-x3))*sin(x1-x3))/(l2*(m1+m2-m2*cos(x1-x3)^2)); eq2=subs(eq2, g, 9.81); eq2=subs(eq2, m1, 2); eq2=subs(eq2, m2, 1); eq2=subs(eq2, l1, 2); eq2=subs(eq2, l2, 1) eq4=subs(eq4, g, 9.81); eq4=subs(eq4, m1, 2); eq4=subs(eq4, m2, 1); eq4=subs(eq4, l1, 2); eq4=subs(eq4, l2, 1) res=solve(0==eq1,0==eq2,0==eq3,0==eq4,x1,x2,x3,x4) [res.x1 res.x2 res.x3 res.x4]
And the result I get is:
[ 0, 0, 0, 0] [ 0, 0, pi, 0] [ pi, 0, 0, 0] [ z2, 0, z3, z4]
I have 2 problems with this result:
1) All the first 3 are valid solutions, however, the 4th row seems gibberish to me. What is the "z" variable?
2) Also, solve skipped one of the obvious solutions (its a double pendulum system) [pi, 0, pi, 0].
In advance, thank you for the replies.
Best Answer