用matlab解方程!!!急用!!!
发布网友
发布时间:2022-05-17 03:54
我来回答
共5个回答
热心网友
时间:2023-09-30 20:12
哇哈哈 看看我能拿到分么
首先需要把d化简出来,让d单独在一边
编写M文件
E0=20,L=8,I=4000;h=8
while h<=12
d=sqrt(sqrt((-8000*h/(4000*h/(256+h^2)^(3/2)-E0))^3)-256-h^2)
h=h+0.1
end
运行得结果
E0 =
20
L =
8
h =
8
d =
543.7584
h =
8.1000
d =
549.6379
h =
8.2000
d =
555.4887
h =
8.3000
d =
561.3102
h =
8.4000
d =
567.1020
h =
8.5000
d =
572.8634
h =
8.6000
d =
578.5942
h =
8.7000
d =
584.2937
h =
8.8000
d =
589.9617
h =
8.9000
d =
595.5975
h =
9.0000
d =
601.2010
h =
9.1000
d =
606.7718
h =
9.2000
d =
612.3094
h =
9.3000
d =
617.8136
h =
9.4000
d =
623.2841
h =
9.5000
d =
628.7206
h =
9.6000
d =
634.1230
h =
9.7000
d =
639.4909
h =
9.8000
d =
644.8242
h =
9.9000
d =
650.1227
h =
10.0000
d =
655.3862
h =
10.1000
d =
660.6147
h =
10.2000
d =
665.8081
h =
10.3000
d =
670.9662
h =
10.4000
d =
676.0889
h =
10.5000
d =
681.1764
h =
10.6000
d =
686.2284
h =
10.7000
d =
691.2451
h =
10.8000
d =
696.2264
h =
10.9000
d =
701.1725
h =
11.0000
d =
706.0832
h =
11.1000
d =
710.9588
h =
11.2000
d =
715.7993
h =
11.3000
d =
720.6048
h =
11.4000
d =
725.3755
h =
11.5000
d =
730.1114
h =
11.6000
d =
734.8128
h =
11.7000
d =
739.4798
h =
11.8000
d =
744.1126
h =
11.9000
d =
748.7114
h =
12.0000
d =
753.2764
h =
12.1000
现在你可以拟合了
另外你的问题1.matlab可以解带参数的方程 用solve即可
2.它程序中的syms 表示定义后面的函数 不然matlab无法识别 在m文件中编写可以免去定义
3.ans表示中间结果 比如你打a=2+3 结果为a=5 但是 你光打2+3 则结果为ans=5
4d的解与h的值 一一对应 自己看好了HOHO
热心网友
时间:2023-09-30 20:12
不好意思说一句:
你的d以平方形式存在,你该告诉大家要正值还是负值。
-------------------------------------
我的解法,解都是负数,也就是没实数解。方程错了自己改吧,全过程都给你了。
syms h d;
E0=20;
L=8;
I=4000;
I*h/(4*L^2+h^2)^(3/2)+2*I*h/(d^2+4*L^2+h^2)^(3/2)
ans =
4000*h/(256+h^2)^(3/2)+8000*h/(d^2+256+h^2)^(3/2)
>> solve('20=4000*h/(256+h^2)^(3/2)+8000*h/(d^2+256+h^2)^(3/2)','d')
Warning: Warning, solutions may have been lost
ans =
1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(1024*h^6+4294967296+77348864*h^2+433216*h^4-4*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)))^(1/2)
-1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(1024*h^6+4294967296+77348864*h^2+433216*h^4-4*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)))^(1/2)
1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-2*i*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)*3^(1/2)+4294967296+77348864*h^2+433216*h^4+1024*h^6-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)+2*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)))^(1/2)
-1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-2*i*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)*3^(1/2)+4294967296+77348864*h^2+433216*h^4+1024*h^6-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)+2*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)))^(1/2)
1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(2*i*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)*3^(1/2)+4294967296+77348864*h^2+433216*h^4+1024*h^6-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)+2*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)))^(1/2)
-1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(2*i*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)*3^(1/2)+4294967296+77348864*h^2+433216*h^4+1024*h^6-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)+2*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)))^(1/2)
>> for h=8:12
d=eval(ans)
end
d =
5.3213 +21.9867i
-5.3213 -21.9867i
5.3213 -21.9867i
-5.3213 +21.9867i
0.0000 - 7.0571i
-0.0000 + 7.0571i
d =
5.6290 +22.7242i
-5.6290 -22.7242i
5.6290 -22.7242i
-5.6290 +22.7242i
0.0000 - 6.4493i
-0.0000 + 6.4493i
d =
5.8881 +23.4551i
-5.8881 -23.4551i
5.8881 -23.4551i
-5.8881 +23.4551i
0.0000 - 6.0874i
-0.0000 + 6.0874i
d =
6.1027 +24.1791i
-6.1027 -24.1791i
6.1027 -24.1791i
-6.1027 +24.1791i
0.0000 - 6.0191i
-0.0000 + 6.0191i
d =
6.2774 +24.8972i
-6.2774 -24.8972i
6.2774 -24.8972i
-6.2774 +24.8972i
0.0000 - 6.2502i
-0.0000 + 6.2502i
>>
参考资料:http://www.matlabfan.com/?fromuid=1217
热心网友
时间:2023-09-30 20:13
不可能有解,你看光右边第一项已经大于E0了,右边第一项分子分母同时除以h^1.5,用简单的不等式知识就可以证明,这一项>E0,所以不可能有解,一定是方程的问题,或者参数错误
热心网友
时间:2023-09-30 20:13
syms h d
d=solve('4000*h/((4*64+h^2)^(3/2))+2*4000*h/(d^2+4*64+h^2)^(3/2)-1','d')
得到了六个结果
1/(16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*(-(16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*(16393216*h^4+4163108864*h^2-2048000*h*(256+h^2)^(3/2)+4294967296-400*(-h*(256+h^2)^(3/2)*(4000*h-(256+h^2)^(3/2))^2)^(2/3)+1024*h^6-8000*h^3*(256+h^2)^(3/2)+h^8))^(1/2)
-1/(16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*(-(16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*(16393216*h^4+4163108864*h^2-2048000*h*(256+h^2)^(3/2)+4294967296-400*(-h*(256+h^2)^(3/2)*(4000*h-(256+h^2)^(3/2))^2)^(2/3)+1024*h^6-8000*h^3*(256+h^2)^(3/2)+h^8))^(1/2)
1/(16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*((16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*(200*i*(-h*(256+h^2)^(3/2)*(4000*h-(256+h^2)^(3/2))^2)^(2/3)*3^(1/2)-4163108864*h^2+2048000*h*(256+h^2)^(3/2)-4294967296-16393216*h^4-1024*h^6+8000*h^3*(256+h^2)^(3/2)-h^8-200*(-h*(256+h^2)^(3/2)*(4000*h-(256+h^2)^(3/2))^2)^(2/3)))^(1/2)
-1/(16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*((16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*(200*i*(-h*(256+h^2)^(3/2)*(4000*h-(256+h^2)^(3/2))^2)^(2/3)*3^(1/2)-4163108864*h^2+2048000*h*(256+h^2)^(3/2)-4294967296-16393216*h^4-1024*h^6+8000*h^3*(256+h^2)^(3/2)-h^8-200*(-h*(256+h^2)^(3/2)*(4000*h-(256+h^2)^(3/2))^2)^(2/3)))^(1/2)
1/(16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*(-(16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*(200*i*(-h*(256+h^2)^(3/2)*(4000*h-(256+h^2)^(3/2))^2)^(2/3)*3^(1/2)+4163108864*h^2-2048000*h*(256+h^2)^(3/2)+4294967296+16393216*h^4+1024*h^6-8000*h^3*(256+h^2)^(3/2)+h^8+200*(-h*(256+h^2)^(3/2)*(4000*h-(256+h^2)^(3/2))^2)^(2/3)))^(1/2)
-1/(16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*(-(16196608*h^2-8000*h*(256+h^2)^(3/2)+16777216+768*h^4+h^6)*(200*i*(-h*(256+h^2)^(3/2)*(4000*h-(256+h^2)^(3/2))^2)^(2/3)*3^(1/2)+4163108864*h^2-2048000*h*(256+h^2)^(3/2)+4294967296+16393216*h^4+1024*h^6-8000*h^3*(256+h^2)^(3/2)+h^8+200*(-h*(256+h^2)^(3/2)*(4000*h-(256+h^2)^(3/2))^2)^(2/3)))^(1/2)
好像看不清,自己运行一下吧,取符合条件的把函数式 复制一下,变量清空一下
h=8:0.01:12
d=结果复制到这边,注意加点就好了
热心网友
时间:2023-09-30 20:14
syms h d;
E0=20;
L=8;
I=4000;
I*h/(4*L^2+h^2)^(3/2)+2*I*h/(d^2+4*L^2+h^2)^(3/2)
ans =
4000*h/(256+h^2)^(3/2)+8000*h/(d^2+256+h^2)^(3/2)
>> solve('20=4000*h/(256+h^2)^(3/2)+8000*h/(d^2+256+h^2)^(3/2)','d')
Warning: Warning, solutions may have been lost
ans =
1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(1024*h^6+4294967296+77348864*h^2+433216*h^4-4*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)))^(1/2)
-1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(1024*h^6+4294967296+77348864*h^2+433216*h^4-4*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)))^(1/2)
1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-2*i*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)*3^(1/2)+4294967296+77348864*h^2+433216*h^4+1024*h^6-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)+2*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)))^(1/2)
-1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-2*i*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)*3^(1/2)+4294967296+77348864*h^2+433216*h^4+1024*h^6-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)+2*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)))^(1/2)
1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(2*i*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)*3^(1/2)+4294967296+77348864*h^2+433216*h^4+1024*h^6-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)+2*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)))^(1/2)
-1/(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(-(16777216+236608*h^2+768*h^4+h^6-400*h*(256+h^2)^(3/2))*(2*i*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)*3^(1/2)+4294967296+77348864*h^2+433216*h^4+1024*h^6-102400*h*(256+h^2)^(3/2)+h^8-400*h^3*(256+h^2)^(3/2)+2*(-50*h*(256+h^2)^(3/2)*(-(256+h^2)^(3/2)+200*h)^2)^(2/3)))^(1/2)
>> for h=8:12
d=eval(ans)
end
d =
5.3213 +21.9867i
-5.3213 -21.9867i
5.3213 -21.9867i
-5.3213 +21.9867i
0.0000 - 7.0571i
-0.0000 + 7.0571i
d =
5.6290 +22.7242i
-5.6290 -22.7242i
5.6290 -22.7242i
-5.6290 +22.7242i
0.0000 - 6.4493i
-0.0000 + 6.4493i
d =
5.8881 +23.4551i
-5.8881 -23.4551i
5.8881 -23.4551i
-5.8881 +23.4551i
0.0000 - 6.0874i
-0.0000 + 6.0874i
d =
6.1027 +24.1791i
-6.1027 -24.1791i
6.1027 -24.1791i
-6.1027 +24.1791i
0.0000 - 6.0191i
-0.0000 + 6.0191i
d =
6.2774 +24.8972i
-6.2774 -24.8972i
6.2774 -24.8972i
-6.2774 +24.8972i
0.0000 - 6.2502i
-0.0000 + 6.2502i
>>
参考资料: http://www.matlabfan.com/?fromuid=1217