资 源 简 介
function [tout, yout] = rk4(ypfun, tspan, y0, h)
%定步长四阶Runge-Kutta法求常微分方程(组)数值解
%[tout,yout] = rk4( ypfun , tspan, y0,h)
% 这里字符串ypfun是用以表示f(t, y)的M文件名,
% tspan=[t0, tfinal]表示自变量初值t0和终值tf
% y0表示初值向量y0,h是步长。
% 输出列向量tout表示节点 (t0 , t1 , … , tn)
% 输出矩阵yout 表示数值解,每一列对应y的一个分量-function [tout, yout] = rk4 (ypfun. tspan, y0, h)% fixed step four-stage Runge- Kutta method for ordinary differential equations (Group) numerical solution% [tout. yout] = rk4 (ypfun, tspan, y0, h)% string ypfun here is used to indicate that f (t, y) M name, tspan% = [t0. tfinal] said variable initial and final t0 tf% y0 said initial vector y0, h is a step. % Output column vector tout said Node (t0, t1, ..., tn)% output matrix yout said numerical solution, each y counterparts out of a weight