numerical solution of equation
2 次查看(过去 30 天)
显示 更早的评论
syms m_c_theta1 m_c0 M theta1 j_L0 j_L_theta1 l
syms m_c_gama k1 gama j_L_gama
j_L_theta1=1.5;
theta1=120;
k1=0.423;
gama=180;
m_c_gama=0.9;
j_L_gama=0.3;
l=0.218;
eqn1=m_c_theta1==(m_c0-1/M+1)*cos(theta1)+j_L0*sin(theta1)+1/M-1;
eqn2=j_L_theta1==(-m_c0+1/M-1)*sin(theta1)+j_L0*cos(theta1);
%eqn3=m_m_theta1==1;
%eqn3=j_Lm_theta1==j_Lm0+l*theta1;
%eqn4=m_c_theta2==j_L_theta1*sin(theta2-theta1)+(m_c_theta1+1)*cos(theta2-theta1)-1;
%eqn5=j_L_theta2==j_L_theta1*cos(theta2-theta1)-(m_c_theta1+1)*sin(theta2-theta1);
%m_m_theta2=1;
%qn6=j_Lm_theta2==j_Lm0+l*theta2;
eqn7=m_c_gama==(1/k1)*j_L_theta1*sin(k1*((gama-theta1)*(pi/180))*(180/pi))+m_c_theta1*cos(k1*((gama-theta1)*(pi/180))*(180/pi));
eqn8=j_L_gama==j_L_theta1*cos(k1*((gama-theta1)*(pi/180))*(180/pi))-k1*m_c_theta1*sin(k1*((gama-theta1)*(pi/180))*(180/pi));
%eqn9=j_Lm_gama==j_L_gama;
%m_m_gama=(-m_c_theta2*cos(k1*(gama-theta2))-(1/k1)*j_L_theta2*sin(k1*(gama-theta2)))/(1+l)
m_c_gama=-m_c0;
j_L_gama=-j_L0;
j_L_theta1=(theta1*(pi/180)*l)/2;
j_L_gama=j_L_theta1-l*(gama-theta1)*(pi/180);
%j_L_theta2=j_Lm_theta2;
%j_Lm0=-j_Lm_gama;
%j_L_gama=j_Lm_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?
0 个评论
采纳的回答
Walter Roberson
2017-2-20
You have
theta1=120;
and
eqn1=m_c_theta1==(m_c0-1/M+1)*cos(theta1)+j_L0*sin(theta1)+1/M-1;
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
15 个评论
Walter Roberson
2017-3-15
Your code has
m_c_gama=Q(1.06);
j_L_gama=Q(0.196);
m_c_gama=-m_c0;
Notice you overwrite m_c_gama. Later you have
m_c0=Q(-0.39289591378964274585530032992682);
so that is where the 0.39* is coming from.
更多回答(1 个)
John D'Errico
2017-2-20
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.
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!