RungeKutta4

版本 1.1.0.0 (1.1 KB) 作者: Matthew Kelly
4th-order Runge-Kutta integrator, fully vectorized.
419.0 次下载
更新时间 2015/12/11

查看许可证

This is a simple implementation of a 4th-order, fixed-step, Runge-Kutta integrator. It is fully vectorized, which allows a large number of simulations to be carried out in parallel. It is designed to be used inside of optimization code.
% z = rk4(dyn,t,z0)
%
% This function (rk4) is used to perform a 4th-order Runge-Kutta
% integration of a dynamical system.
%
% INPUTS:
% dyn = handle of the form:
% dz = userFunc(t,z)
% t = [1 x nTime] vector of times, created by linspace
% z0 = [nState (x nSim)] matrix of initial states
%
% OUTPUTS:
% z = [nState (x nSim) x nTime ] matrix of trajectories
%

引用格式

Matthew Kelly (2026). RungeKutta4 (https://ww2.mathworks.cn/matlabcentral/fileexchange/54449-rungekutta4), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2012a
兼容任何版本
平台兼容性
Windows macOS Linux
版本 已发布 发行说明
1.1.0.0

Added a text function to show usage. Improved description.

1.0.0.0