matlab 解方程 后结果不对
我用MATLAB解线性方程,但是最后出来的结果代回原来的方程完全不对请问是什么原因?程序和结果如下eq1='x1=(102.90*2.726-z1)/2.726'eq2=...
我用MATLAB解线性方程,但是最后出来的结果代回原来的方程完全不对请问是什么原因?程序和结果如下
eq1='x1=(102.90*2.726-z1)/2.726'
eq2='x2=x1+250*0.939'
eq3='z2=z1+250*0.3444'
eq4='x=z1/2.726-x1'
eq5='x3*x3+y3*y3=97.421*97.421'
eq6='8.234/(x-x3)=2.726'
eq7='(x2-x3)^2+y3^2+(z2-8.234)^2=250^2'
sol=solve(eq1,eq2,eq3,eq4,eq5,eq6,eq7)
部分结果如下
>> x1
x1 =
42.961521065437834509034190266075 - 152.70556402495166215698875745791i
42.961521065437834509034190266075 - 152.70556402495166215698875745791i
42.961521065437834509034190266075 + 152.70556402495166215698875745791i
42.961521065437834509034190266075 + 152.70556402495166215698875745791i
>> z1
z1 =
29.969239467281082745482904866963 + 76.352782012475831078494378728955i
29.969239467281082745482904866963 + 76.352782012475831078494378728955i
29.969239467281082745482904866963 - 76.352782012475831078494378728955i
29.969239467281082745482904866963 - 76.352782012475831078494378728955i
但是显然,把z1 x1代入第一个方程结果是不对的,请问是怎么回事? 展开
eq1='x1=(102.90*2.726-z1)/2.726'
eq2='x2=x1+250*0.939'
eq3='z2=z1+250*0.3444'
eq4='x=z1/2.726-x1'
eq5='x3*x3+y3*y3=97.421*97.421'
eq6='8.234/(x-x3)=2.726'
eq7='(x2-x3)^2+y3^2+(z2-8.234)^2=250^2'
sol=solve(eq1,eq2,eq3,eq4,eq5,eq6,eq7)
部分结果如下
>> x1
x1 =
42.961521065437834509034190266075 - 152.70556402495166215698875745791i
42.961521065437834509034190266075 - 152.70556402495166215698875745791i
42.961521065437834509034190266075 + 152.70556402495166215698875745791i
42.961521065437834509034190266075 + 152.70556402495166215698875745791i
>> z1
z1 =
29.969239467281082745482904866963 + 76.352782012475831078494378728955i
29.969239467281082745482904866963 + 76.352782012475831078494378728955i
29.969239467281082745482904866963 - 76.352782012475831078494378728955i
29.969239467281082745482904866963 - 76.352782012475831078494378728955i
但是显然,把z1 x1代入第一个方程结果是不对的,请问是怎么回事? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询