1 东南大学《数学实验》报告 实验内容:差分方程及微分方程数值解 一 实验目的 熟悉迭代法及微分方程数值方法 二 预备知识 (1)了解差分方程稳定性、周期分解、混沌等相关知识 (2)了解欧拉方法、龙格-库特方法
三 实验内容与要求 (一)Volterra 方程数值解 方程0,,,,,dcbadxycxdtdybxyaxdtdx 其中a=1,b=0
2)0(,25)0(yx 命令与结果 在函数编辑器中输入: function dxdt = euler( t,x ) dxdt=[ x(1)*(1-0
1*x(2)) x(2)*(-0
02*x(1))]; end 四阶龙格-库塔公式: 在命令窗口中输入: tspan=[0 15]; x 0=[25;2]; [t,x ]=ode45(@eu ler,tspan,x 0); plot(t,x (:,1),'r-','LineWidth',0
5); hold on; plot(t,x (:,2),'g-','LineWidth',0
5); hold on; (1) 相图 四阶龙格-库塔公式: 2 axis([0 15 0 125]) legend('x(1)','x(2)') grid on title('The Numerical Solution Of Calculable way of fourth rank Rounge-kutt') plot(x(:,1),x(:,2)) 欧拉方法: 在命令窗口中输入: tspan=[0 15]; x0=[25;2]; [t,x]=ode23(@euler,tspan,x0);