meili 发表于 2022-10-27 15:18:12

Matlab牛顿加速迭代法急…………Matlab牛顿加速迭代法急…………记住是牛顿“加速”迭代法解方程是x=e^(-x)在x=0.5附近的根

<p>问题:Matlab牛顿加速迭代法急…………Matlab牛顿加速迭代法急…………记住是牛顿“加速”迭代法解方程是x=e^(-x)在x=0.5附近的根
<p>答案:↓↓↓<p class="nav-title mt10" style="border-top:1px solid #ccc;padding-top: 10px;">李天志的回答:<div class="content-b">网友采纳  clc;clear  f='x-exp(-x)'  df=diff(f)  x=0.5;  ac=;%加速因子  ac2=0.9;  fork=1:10  x=x-ac.*subs(f/df);  X(k,:)=x;  end  formatlongg  X  plot(X,'o-')  结果:  X=  0.5464177022380530.5596799028774960.566311003197218  0.5608708628768790.566387859763440.567143165034862  0.5652565692580520.5670676543873640.567143290409781  0.5665768229182110.5671357258758680.567143290409784  0.5669733095107640.5671425339470730.567143290409784  0.567092292480130.567143214763420.567143290409784  0.5671279907014570.5671432828451460.567143290409784  0.5671387004676360.567143289653320.567143290409784  0.5671419134244710.5671432903341370.567143290409784  0.567142877313950.5671432904022190.567143290409784  可见,加速系数取1,收敛速度最快.
页: [1]
查看完整版本: Matlab牛顿加速迭代法急…………Matlab牛顿加速迭代法急…………记住是牛顿“加速”迭代法解方程是x=e^(-x)在x=0.5附近的根