已知60=x*2*sin(pi*74/(4*x)),用matlab解此方程的语句该怎么写?

发布时间:2021-02-25 21:40:11

已知60=x*2*sin(pi*74/(4*x)),用matlab解此方程的语句该怎么写?

网友回答

solve('60=x*2*sin(pi*74/(4*x))')
ans =-31.281066120310786755821961868485
不过函数是偶函数,31.281066120310786755821961868485也因该是一个解,
通过绘图也可以看出
已知60=x*2*sin(pi*74/(4*x)),用matlab解此方程的语句该怎么写?(图1)
当然也可以用数值方法,但是对初值的依赖很大,你可以先绘图大致确定解的位置.
在图可以看出解大约在30和-30左右所以有以下程序
>> [email protected](x)60-x*2*sin(pi*74/(4*x));
>> fsolve(f,-30)
Equation solved.
fsolve pleted because the vector of function values is near zero
as measured by the default value of the function tolerance,and
the problem appears regular as measured by the gradient.
<stopping criteria details>
ans =  -31.2811
>> fsolve(f,30)
Equation solved.
fsolve pleted because the vector of function values is near zero
as measured by the default value of the function tolerance,and
the problem appears regular as measured by the gradient.
<stopping criteria details>
ans =   31.2811
以上问题属网友观点,不代表本站立场,仅供参考!