RK45(dydt, trange, yinit, tol)

RK45 is like matlab's ode45. its can be used on octave as it comes without ode solver.
335 descargas
Actualizado 6 nov 2017

Ver licencia

% 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');

Citar como

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. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2012b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Ordinary Differential Equations en Help Center y MATLAB Answers.

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0