|
1 | 1 | %========================================================================== |
2 | 2 | % |
3 | | -% ode Solve initial value problems using fixed-step ODE solvers. |
| 3 | +% solve_ivp Solve initial value problems using fixed-step IVP solvers. |
4 | 4 | % |
5 | | -% [t,y] = ode(f,[t0,tf],y0,h) |
6 | | -% [t,y] = ode(f,{t0,C},y0,h) |
7 | | -% [t,y] = ode(__,method) |
8 | | -% [t,y] = ode(__,method,wb) |
| 5 | +% [t,y] = solve_ivp(f,[t0,tf],y0,h) |
| 6 | +% [t,y] = solve_ivp(f,{t0,C},y0,h) |
| 7 | +% [t,y] = solve_ivp(__,method) |
| 8 | +% [t,y] = solve_ivp(__,method,wb) |
9 | 9 | % |
10 | 10 | % Copyright © 2021 Tamas Kis |
11 | 11 | % Last Update: 2022-06-04 |
12 | 12 | % Website: https://tamaskis.github.io |
13 | 13 | % Contact: tamas.a.kis@outlook.com |
14 | 14 | % |
15 | 15 | % TOOLBOX DOCUMENTATION: |
16 | | -% https://tamaskis.github.io/ODE_Solver_Toolbox-MATLAB/ |
| 16 | +% https://tamaskis.github.io/IVP_Solver_Toolbox-MATLAB/ |
17 | 17 | % |
18 | 18 | % TECHNICAL DOCUMENTATION: |
19 | | -% https://tamaskis.github.io/documentation/Fixed_Step_ODE_Solvers.pdf |
| 19 | +% https://tamaskis.github.io/documentation/Fixed_Step_IVP_Solvers.pdf |
20 | 20 | % |
21 | 21 | %-------------------------------------------------------------------------- |
22 | 22 | % |
|
25 | 25 | % ------ |
26 | 26 | % f - (1×1 function_handle) dy/dt = f(t,y) --> multivariate, |
27 | 27 | % vector-valued function (f : ℝ×ℝᵖ → ℝᵖ) defining ODE |
28 | | -% I - defines interval over which to solve the ODE, 2 options: |
| 28 | +% I - defines interval over which to solve the IVP, 2 options: |
29 | 29 | % --> [t0,tf] - (1×2 double) initial and final times |
30 | 30 | % --> {t0,C} - (1×2 cell) initial time, t₀, and function |
31 | 31 | % handle for condition function, C(t,y) |
|
59 | 59 | % chosen to match the convention used by MATLAB's ODE suite. |
60 | 60 | % |
61 | 61 | %========================================================================== |
62 | | -function [t,y] = ode(f,I,y0,h,method,wb) |
| 62 | +function [t,y] = solve_ivp(f,I,y0,h,method,wb) |
63 | 63 |
|
64 | 64 | % -------------------- |
65 | | - % Time detection mode. |
| 65 | + % Time detection msolve_ivp. |
66 | 66 | % -------------------- |
67 | 67 |
|
68 | 68 | if ~iscell(I) |
|
97 | 97 | % turns waitbar on with default message |
98 | 98 | elseif (nargin == 6) && wb |
99 | 99 | display_waitbar = true; |
100 | | - [wb,prop] = initialize_waitbar('Solving ODE...'); |
| 100 | + [wb,prop] = initialize_waitbar('Solving IVP...'); |
101 | 101 |
|
102 | 102 | % turns waitbar off otherwise |
103 | 103 | else |
|
106 | 106 | end |
107 | 107 |
|
108 | 108 | % --------------------- |
109 | | - % Event detection mode. |
| 109 | + % Event detection msolve_ivp. |
110 | 110 | % --------------------- |
111 | 111 |
|
112 | 112 | else |
|
213 | 213 | y(:,1) = y0; |
214 | 214 |
|
215 | 215 | % --------------------------------------- |
216 | | - % Solves ODE (using single-step methods). |
| 216 | + % Solves IVP (using single-step methods). |
217 | 217 | % --------------------------------------- |
218 | 218 |
|
219 | 219 | if single_step |
|
242 | 242 | end |
243 | 243 |
|
244 | 244 | % -------------------------------------- |
245 | | - % Solves ODE (using multi-step methods). |
| 245 | + % Solves IVP (using multi-step methods). |
246 | 246 | % -------------------------------------- |
247 | 247 |
|
248 | 248 | else |
|
0 commit comments