midpoint_adaptive
midpoint_adaptive,
an Octave code which
solves one or more ordinary differential equations (ODE)
using the (implicit) midpoint method, relying on fsolve()
to solve the implicit equation, and using an adaptive timestep.
Plots of the solution and timestep history are created.
Licensing:
The information on this web page is distributed under the MIT license.
Languages:
midpoint_adaptive is available in
a C version and
a C++ version and
a Fortran90 version and
a MATLAB version and
an Octave version and
a Python version.
Related Data and codes:
midpoint_adaptive_test
octave_ode_solver,
an Octave code which
solves one or more differential equations (ODE) using a method of a
particular order, either explicit or implicit. Some methods require
a nonlinear equation solver. Some methods used a fixed stepsize,
while others adapt the stepsize based on an error estimate.
Reference:
-
William Milne,
Numerical Integration of Ordinary Differential Equations,
American Mathematical Monthly,
Volume 33, number 9, pages 455–460, 1926.
-
Ernst Hairer, Syvert Norsett, Gerhard Wanner,
Solving ordinary differential equations, I. Nonstiff problems,
Springer Series in Computational Mathematics, Number 8,
Springer-Verlag, Berlin, 1987.
-
Catalin Trenchea, John Burkardt,
Refactorization of the midpoint rule,
Applied Mathematics Letters,
Volume 107, September 2020.
Source Code:
-
mad_compute.m,
solves one or more ordinary differential equations (ODE)
using the (implicit) midpoint method, relying on fsolve()
to solve the implicit equation, and using an adaptive timestep.
-
mad_lte.m,
called by mad_compute() to estimate the local truncation error.
-
mad_phase_plot.m,
makes a phase plane plot.
-
mad_setup.m,
an interactive code which first prompts the user for any missing
input, and then calls mad_compute().
-
mad_solution_plot.m,
plots the solution.
-
mad_stats.m,
after the execution of mad_compute(), this function can print
and plot some time and timestep information.
-
mad_step.m,
takes one more step using the implicit midpoint method.
-
mad_timestep_plot.m,
plots the sequence of timesteps.
Last revised on 10 July 2024.