RK45(dydt, trange, yinit, tol)

RK45 is like matlab's ode45. its can be used on octave as it comes without ode solver.
336.0 次下载
更新时间 2017/11/6

查看许可证

% function solves ordinary differential equation just like ode45.
% dydt = system of first order differential equations
% trange = range of the independent variable
% yinit = initial condition
% tol = error absolute tolerance, default value = 1e-6;
% Example:
% [t,y] = RK45(@(t,y)[y(2); (1-y(1)^2)*y(2)-y(1)],[0 20],[2; 0]);
% subplot(1,2,2);
% plot(t,y,'-o')
% title('Solution of van der Pol Equation (\mu = 1) with RK45');
% xlabel('Time t');
% ylabel('Solution y');
% legend('y_1','y_2');
%
% [t2,y2] = ode45(@(t,y)[y(2); (1-y(1)^2)*y(2)-y(1)],[0 20],[2; 0]);
% subplot(1,2,1);
% plot(t2,y2,'-o')
% title('Solution of van der Pol Equation (\mu = 1) with ODE45');
% xlabel('Time t');
% ylabel('Solution y');
% legend('y_1','y_2');

引用格式

Lateef Adewale Kareem (2024). RK45(dydt, trange, yinit, tol) (https://www.mathworks.com/matlabcentral/fileexchange/64968-rk45-dydt-trange-yinit-tol), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2012b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0