matlab解多元非线性方程组(方程中含已知量和未知量)
代码如下clearallb=100;h=150;t1=4;t2=8;t3=2;t4=5;b0=93;h0=138;b1=96.5;symsx1,x2,y1,y2,ya,y...
代码如下
clear all
b=100;
h=150;
t1=4;
t2=8;
t3=2;
t4=5;
b0=93;
h0=138;
b1=96.5;
syms x1,x2,y1,y2,ya,yb
e1='yb=(b0*(t1-t2)+t3*(h-2*ya)+t4*h)/(2*t4)';
e2='x1=(b0*t1*(t3+b0)/2+t4*(h-yb)*b1)/(b0*t1+t3*(h-ya)+t4*(h-yb))';
e3='y1=(t3*(h^2-ya^2)/2+b0*t1*(h-t1/2)+t4*(h^2-yb^2)/2)/(b0*t1+t3*(h-ya)+t4*(h-yb))';
e4='x2=(b0*t2*(t3+b0)/2+t4*yb*b1)/(b0*t2+t3*ya+t4*yb)';
e5='y2=(t3*ya^2/2+b0*t2^2/2+t4*yb^2/2)/(b0*t2+t3*ya+t4*yb)';
e6='b1*(x2-x1)+(yb-ya)*(y2-y1)=0';
[x1,x2,y1,y2,ya,yb]=solve(e1,e2,e3,e4,e5,e6)
需要求x1,x2,y1,y2,ya,yb,其他的b,h,t1,t2,t3,t4,b0,h0,b1均为已知量,并且需要在前面单独赋值(为了程序的通用性),但是求出来的是字符串不是数字。 展开
clear all
b=100;
h=150;
t1=4;
t2=8;
t3=2;
t4=5;
b0=93;
h0=138;
b1=96.5;
syms x1,x2,y1,y2,ya,yb
e1='yb=(b0*(t1-t2)+t3*(h-2*ya)+t4*h)/(2*t4)';
e2='x1=(b0*t1*(t3+b0)/2+t4*(h-yb)*b1)/(b0*t1+t3*(h-ya)+t4*(h-yb))';
e3='y1=(t3*(h^2-ya^2)/2+b0*t1*(h-t1/2)+t4*(h^2-yb^2)/2)/(b0*t1+t3*(h-ya)+t4*(h-yb))';
e4='x2=(b0*t2*(t3+b0)/2+t4*yb*b1)/(b0*t2+t3*ya+t4*yb)';
e5='y2=(t3*ya^2/2+b0*t2^2/2+t4*yb^2/2)/(b0*t2+t3*ya+t4*yb)';
e6='b1*(x2-x1)+(yb-ya)*(y2-y1)=0';
[x1,x2,y1,y2,ya,yb]=solve(e1,e2,e3,e4,e5,e6)
需要求x1,x2,y1,y2,ya,yb,其他的b,h,t1,t2,t3,t4,b0,h0,b1均为已知量,并且需要在前面单独赋值(为了程序的通用性),但是求出来的是字符串不是数字。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询