请教如何用matlab解隐性方程:y=((9.8*T^2)/2*pi)*tanh((2*pi*d)/y)

请教如何用matlab解隐性方程:y=((9.8*T^2)/2*pi)*tanh((2*pi*d)/y)
其中T,d已知,T=input('') d=input('')
用什么函数解都行
这里应该还是要用牛顿迭代法?求得导数y‘=-((g*d*T^2)/cosh^2((2*pi*d)/y)L^2)-1
1364 1年前 已收到1个回答 举报

WILLIAMSHAN 种子

共回答了18个问题采纳率:77.8% 举报

1.直接用solve函数
T=input('');
d=input('');
f=subs('((9.8*T^2)/2*pi)*tanh((2*pi*d)/y)-y',{'T','d'},{T,d});
a=solve(f,'y')
》T=2,d=3
结果
a=-32.323847772664794935753715077212.
2.Newton迭代法
设定了迭代的最大次数100,可以自己改动的
T=input(''); d=input('');
syms xk x a i
fx=input('Please input a f(x):');
gx=x-fx/diff(fx)
x0=input('Please input a initial number x0=');
p =input('Please input a precision (即|Xk-Xk-1|/|Xk|

1年前

7
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.034 s. - webmaster@yulucn.com