Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Adjusted comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
acroy committed Mar 24, 2015
1 parent 42f0fd5 commit b2cc50e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/ODE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export ode4s, ode4ms, ode4
# oderosenbrock, ode4s, ode4s_kr, ode4s_s,
# ode4ms, ode_ms

###############################################################################
## HELPER FUNCTIONS
###############################################################################

# estimator for initial step based on book
# "Solving Ordinary Differential Equations I" by Hairer et al., p.169
function hinit(F, x0, t0, p, reltol, abstol)
Expand All @@ -44,6 +48,11 @@ function hinit(F, x0, t0, p, reltol, abstol)
h = min(100.0*h0, h1)
end

###############################################################################
## NON-STIFF SOLVERS
###############################################################################

# NOTE: in the near future ode23 will be replaced by ode23_bs

#ODE23 Solve non-stiff differential equations.
#
Expand Down Expand Up @@ -301,6 +310,7 @@ function oderkf(F, x0, tspan, p, a, bs, bp; reltol = 1.0e-5, abstol = 1.0e-8,
return tout, xout
end


# Bogacki–Shampine coefficients
const bs_coefficients = (3,
[ 0 0 0 0
Expand Down Expand Up @@ -336,6 +346,7 @@ const dp_coefficients = (5,
)
ode45_dp(F, x0, tspan; kwargs...) = oderkf(F, x0, tspan, dp_coefficients...; kwargs...)


# Fehlberg coefficients
const fb_coefficients = (5,
[ 0 0 0 0 0
Expand All @@ -351,6 +362,7 @@ const fb_coefficients = (5,
)
ode45_fb(F, x0, tspan; kwargs...) = oderkf(F, x0, tspan, fb_coefficients...; kwargs...)


# Cash-Karp coefficients
# Numerical Recipes in Fortran 77
const ck_coefficients = (5,
Expand Down Expand Up @@ -398,7 +410,7 @@ const ode78 = ode78_fb
# Use Dormand Prince version of ode45 by default
const ode45 = ode45_dp

# some higher-order embedded methods can be found in:
# more higher-order embedded methods can be found in:
# P.J. Prince and J.R.Dormand: High order embedded Runge-Kutta formulae, Journal of Computational and Applied Mathematics 7(1), 1981.


Expand Down Expand Up @@ -461,7 +473,7 @@ function fdjacobian(F, x, t)
end

# ODE23S Solve stiff systems based on a modified Rosenbrock triple
# (also used by MATLABS ODE23s); see Sec. 4.1 in
# (also used by MATLAB's ODE23s); see Sec. 4.1 in
#
# [SR97] L.F. Shampine and M.W. Reichelt: "The MATLAB ODE Suite," SIAM Journal on Scientific Computing, Vol. 18, 1997, pp. 1–22
#
Expand Down

0 comments on commit b2cc50e

Please sign in to comment.