numerical solution of equation
7 views (last 30 days)
Show older comments
safi58 on 20 Feb 2017
Commented: Walter Roberson on 15 Mar 2017
syms m_c_theta1 m_c0 M theta1 j_L0 j_L_theta1 l
syms m_c_gama k1 gama j_L_gama
eqns = subs([eqn1, eqn2, eqn7, eqn8]);
sol = vpasolve(eqns, m_c0, j_L0, m_c_theta1,M)
Hi all I want solve these equations numerically and I have given all the values required. but it is showing something like that: % m_c0: [0x1 sym] j_L0: [0x1 sym] m_c_theta1: [0x1 sym] M: [0x1 sym]
I am not sure what is the problem. Can anyone help please?
Walter Roberson on 20 Feb 2017
is theta1 in degrees or in radians?
Your expressions are really polluted with pi/180 and 180/pi . You should work entirely in radians and only covert to degrees if the user interface demands it.
If you do convert theta1 from degrees to radians you will still get no solution. Your four equations in eqns are not independent. If you solve the first three for m_c0, j_L0, m_c_theta1 and substitute the results into the last one, the remaining equation is independent of the final variable, M. Instead it has constants expressions on both sides, and the values on the two sides are quite different, one being 3/10 and the other being a value that is close to (but not exactly) pi/2
Walter Roberson on 15 Mar 2017
Your code has
Notice you overwrite m_c_gama. Later you have
so that is where the 0.39* is coming from.
More Answers (1)
John D'Errico on 20 Feb 2017
I recall an old phrase: "If wishes were horses, then beggars would ride."
Just wanting a solution to a set of nonlinear equations to exist does not make that so. Not all such systems of equations must have a solution. MATLAB has told you that no solution was found, although that does not ensure none exists.
Find more on Equation Solving 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!