# 4阶龙格库塔法求解二阶微分方程.zip

• 夏天的风1
了解作者
• matlab
开发工具
• 10KB
文件大小
• zip
文件格式
• 0
收藏次数
• 1 积分
下载积分
• 35
下载次数
• 2018-05-14 11:32
上传日期

4阶龙格库塔法求解二阶微分方程.zip
• 4阶龙格库塔法求解二阶微分方程.docx
12KB

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/626c34ba7ae5df2aa727a0d0/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/626c34ba7ae5df2aa727a0d0/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">function<span class="fc1"> ys=dbf(f,a,b,a1fa,beta,h,eps)</span></div><div class="t m0 x1 h3 y3 ff1 fs0 fc1 sc0 ls0 ws0">ff=@(x,y)[y(2),f(y(1),y(2),x)];</div><div class="t m0 x1 h3 y4 ff1 fs0 fc1 sc0 ls0 ws0"> xvalue=a:h:b;</div><div class="t m0 x1 h3 y5 ff1 fs0 fc1 sc0 ls0 ws0"> n=length(xvalue)</div><div class="t m0 x1 h3 y6 ff1 fs0 fc1 sc0 ls0 ws0"> s0=a-0.01;</div><div class="t m0 x1 h3 y7 ff1 fs0 fc1 sc0 ls0 ws0"> x0=[a1fa,s0];</div><div class="t m0 x1 h3 y8 ff1 fs0 fc1 sc0 ls0 ws0"> flag=0;</div><div class="t m0 x1 h3 y9 ff1 fs0 fc1 sc0 ls0 ws0"> y0=rk4(ff,a,x0,h,a,b);</div><div class="t m0 x1 h3 ya ff1 fs0 fc1 sc0 ls0 ws0"> <span class="fc0">if</span> abs(y0(1,n)-beta)&lt;=eps</div><div class="t m0 x1 h3 yb ff1 fs0 fc1 sc0 ls0 ws0"> flag=1;</div><div class="t m0 x1 h3 yc ff1 fs0 fc1 sc0 ls0 ws0"> y1=y0;</div><div class="t m0 x1 h3 yd ff1 fs0 fc1 sc0 ls0 ws0"> <span class="fc0">else</span></div><div class="t m0 x1 h3 ye ff1 fs0 fc1 sc0 ls0 ws0"> s1=s0+1;</div><div class="t m0 x1 h3 yf ff1 fs0 fc1 sc0 ls0 ws0"> x0=[a1fa,s1];</div><div class="t m0 x1 h3 y10 ff1 fs0 fc1 sc0 ls0 ws0"> y1=rk4(ff,a,x0,h,a,b);</div><div class="t m0 x1 h3 y11 ff1 fs0 fc1 sc0 ls0 ws0"> <span class="fc0">if</span> abs(y1(1,n)-beta)&lt;=eps</div><div class="t m0 x1 h3 y12 ff1 fs0 fc1 sc0 ls0 ws0"> flag=1;</div><div class="t m0 x1 h3 y13 ff1 fs0 fc1 sc0 ls0 ws0"> <span class="fc0">end</span></div><div class="t m0 x1 h3 y14 ff1 fs0 fc1 sc0 ls0 ws0"> <span class="fc0">end</span></div><div class="t m0 x1 h3 y15 ff1 fs0 fc0 sc0 ls0 ws0">if<span class="fc1"> flag~=1</span></div><div class="t m0 x1 h3 y16 ff1 fs0 fc1 sc0 ls0 ws0"> <span class="fc0">while</span> abs(y1(1,n)-beta)&gt;eps</div><div class="t m0 x1 h3 y17 ff1 fs0 fc1 sc0 ls0 ws0"> s2=s1-(y1(1,n)-beta)*(s1-s0)/(y1(1,n)-y0(1,n));</div><div class="t m0 x1 h3 y18 ff1 fs0 fc1 sc0 ls0 ws0"> x0=[a1fa,s2];</div><div class="t m0 x1 h3 y19 ff1 fs0 fc1 sc0 ls0 ws0"> y2=rk4(ff,a,x0,h,a,b);</div><div class="t m0 x1 h3 y1a ff1 fs0 fc1 sc0 ls0 ws0"> s0=s1;</div><div class="t m0 x1 h3 y1b ff1 fs0 fc1 sc0 ls0 ws0"> s1=s2;</div><div class="t m0 x1 h3 y1c ff1 fs0 fc1 sc0 ls0 ws0"> y0=y1;</div><div class="t m0 x1 h3 y1d ff1 fs0 fc1 sc0 ls0 ws0"> y1=y2;</div><div class="t m0 x1 h3 y1e ff1 fs0 fc1 sc0 ls0 ws0"> <span class="fc0">end</span></div><div class="t m0 x1 h3 y1f ff1 fs0 fc0 sc0 ls0 ws0">end</div><div class="t m0 x1 h3 y20 ff1 fs0 fc1 sc0 ls0 ws0">xvalue=a:h:b;</div><div class="t m0 x1 h3 y21 ff1 fs0 fc1 sc0 ls0 ws0">yvalue=y1(1,:);</div><div class="t m0 x1 h3 y22 ff1 fs0 fc1 sc0 ls0 ws0">ys=[xvalue',yvalue'];</div><div class="t m0 x1 h3 y23 ff1 fs0 fc0 sc0 ls0 ws0">function<span class="fc1"> x=rk4(f,t0,x0,h,a,b)</span></div><div class="t m0 x1 h3 y24 ff1 fs0 fc1 sc0 ls0 ws0">t=a:h:b;</div><div class="t m0 x1 h3 y25 ff1 fs0 fc1 sc0 ls0 ws0">m=length(t);</div><div class="t m0 x1 h3 y26 ff1 fs0 fc1 sc0 ls0 ws0">t(1)=t0;</div><div class="t m0 x1 h3 y27 ff1 fs0 fc1 sc0 ls0 ws0">x(:,1)=x0;</div><div class="t m0 x1 h3 y28 ff1 fs0 fc0 sc0 ls0 ws0">for<span class="fc1"> i=1:m-1</span></div><div class="t m0 x1 h3 y29 ff1 fs0 fc1 sc0 ls0 ws0"> L1=f(t(i),x(:,i)); </div><div class="t m0 x1 h3 y2a ff1 fs0 fc1 sc0 ls0 ws0"> L2=f(t(i)+h/2,x(:,i)'+(h/2)*L1);</div></div></div><div class="pi" data-data='{"ctm":[1.568627,0.000000,0.000000,1.568627,0.000000,0.000000]}'></div></div> </body> </html>

相关推荐
• 微分方程求解.rar
使用matlab求解特殊的偏微分方程，使用GUI进行交互，计算求解微分方程
• 数值方法求解微分方程.rar
数值方法求解微分方程的实验例题，由matlab语言实现
• 微分方程.zip
运用fortran求解微分方程,1.利用四阶龙格库塔法，计算t每增加h时，利用给定方程先找到变量y的k1和变量p的K1，然后利用公式得到y的k2和p的K2，如此，得到变量y的k1,k2,k3,k4和变量p的K1，K2,K3,K4
• 微分方程求解.zip
分别采用欧拉法、改进欧拉法和隐式梯形法解一阶非线性微分方程dx/dt=ax。
• 二自由度微分方程求解.rar
二自由度微分方程求解，使用的是ode45解算器
• 微分方程.zip
对一个函数流程图进行描述，并利用matlab自带的和自编的微分方程求解方法
• 微分方程建模.rar
微分方程建模是数学建模的重要方法，因为许多实际问题的数学描述将导致求解微分方程的定解问题。
• 复杂常微分方程求解.zip
对于普通的双自由度微分方程组的matlab编程，可适用于初学者学习
• 微分方程.zip
微分方程的使用方法和绘图方法，详细讲解了微分方程的写过程和可视化过程
• 微分方程求解.rar
微分方程求解，可以求解一阶和二阶线性微分方程解析解