Second argument must be a vector of symbolic variables error
2 views (last 30 days)
Show older comments
When trying to solve this equation system I get the error stated in the title
syms l1 l2 l3 H B phi gamma theta omega1 omega2 omega3 t
l1 = 0.12;
l2 = 0.29;
l3 = 0.157;
H = 0.15;
B = 0.238;
theta = (pi/900)*t;
eq3 = l1*cos(theta) + l2*cos(phi) - l3*sin(gamma) - H == 0
eq4 = B + l1*sin(theta) - l2*sin(phi) - l3*cos(gamma) == 0
sol1 = solve([eq3, eq4], [phi, gamma])
syms omega1 omega2 omega3 vA vB vC
omega1_v = [0 0 omega1]
omega2_v = [0 0 omega2]
omega3_v = [0 0 omega3]
AB = [l1*cos(theta) l1*sin(theta) 0]
BC = [l2*cos(phi) l2*sin(phi) 0]
CD = [l2*cos(gamma) l2*sin(gamma) 0]
eq5 = vB == cross(omega1_v, AB)
eq6 = vC == vB + cross(omega2_v, BC)
eq7 = 0 == vC + cross(omega3_v, CD)
sol2 = solve([eq5, eq6, eq7], [omega1_v, omega2_v, omega3_v])
How can I solve this?
1 Comment
Answers (1)
Walter Roberson
on 15 Jan 2023
omega1_v = [0 0 omega1]
That is a vector that includes numeric values. You cannot solve for a numeric value. You should be asking to solve for omega1 not for omega1_v
0 Comments
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!