Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Documenter, DiffEqBase, SciMLBase, OrdinaryDiffEq, OrdinaryDiffEqBDF, OrdinaryDiffEqCore, StochasticDiffEq, DelayDiffEq, SteadyStateDiffEq, DiffEqCallbacks
using Documenter, DiffEqBase, SciMLBase, OrdinaryDiffEq, OrdinaryDiffEqBDF,
OrdinaryDiffEqCore, StochasticDiffEq, DelayDiffEq, SteadyStateDiffEq, DiffEqCallbacks
import ODEProblemLibrary,
SDEProblemLibrary, DDEProblemLibrary, DAEProblemLibrary, BVProblemLibrary
using Sundials, DASKR
Expand All @@ -18,19 +19,19 @@ if isdir(ordinartdiffeq_docs_path)
# Create the OrdinaryDiffEq API directory in the docs
ordinary_diffeq_dest = joinpath(@__DIR__, "src", "api", "ordinarydiffeq")
mkpath(dirname(ordinary_diffeq_dest))

# Copy all the docs from OrdinaryDiffEq.jl
cp(ordinartdiffeq_docs_path, ordinary_diffeq_dest, force=true)
cp(ordinartdiffeq_docs_path, ordinary_diffeq_dest, force = true)

# Copy the pages.jl file from OrdinaryDiffEq.jl
ordinary_diffeq_pages_dest = joinpath(@__DIR__, "ordinarydiffeq_pages.jl")
ordinary_diffeq_pages_file = joinpath(ordinartdiffeq_docs_root, "pages.jl")
cp(ordinary_diffeq_pages_file, ordinary_diffeq_pages_dest, force=true)
cp(ordinary_diffeq_pages_file, ordinary_diffeq_pages_dest, force = true)

# Copy the common_first_steps.jl file from OrdinaryDiffEq.jl
common_first_steps_dest = joinpath(@__DIR__, "common_first_steps.jl")
common_first_steps_file = joinpath(ordinartdiffeq_docs_root, "common_first_steps.jl")
cp(common_first_steps_file, common_first_steps_dest, force=true)
cp(common_first_steps_file, common_first_steps_dest, force = true)
end

# Copy StochasticDiffEq.jl documentation
Expand All @@ -40,14 +41,14 @@ if isdir(stochasticdiffeq_docs_path)
# Create the StochasticDiffEq API directory in the docs
stochastic_diffeq_dest = joinpath(@__DIR__, "src", "api", "stochasticdiffeq")
mkpath(dirname(stochastic_diffeq_dest))

# Copy all the docs from StochasticDiffEq.jl
cp(stochasticdiffeq_docs_path, stochastic_diffeq_dest, force=true)
cp(stochasticdiffeq_docs_path, stochastic_diffeq_dest, force = true)

# Copy the pages.jl file from StochasticDiffEq.jl
stochastic_diffeq_pages_dest = joinpath(@__DIR__, "stochasticdiffeq_pages.jl")
stochastic_diffeq_pages_file = joinpath(stochasticdiffeq_docs_root, "pages.jl")
cp(stochastic_diffeq_pages_file, stochastic_diffeq_pages_dest, force=true)
cp(stochastic_diffeq_pages_file, stochastic_diffeq_pages_dest, force = true)
end

ENV["PLOTS_TEST"] = "true"
Expand Down Expand Up @@ -118,13 +119,13 @@ makedocs(
"https://github.com/SciML/ColPrac/blob/master/README.md",
"https://github.com/SciML/DiffEqDevTools.jl/blob/master/src/ode_tableaus.jl",
"https://github.com/SciML/DiffEqProblemLibrary.jl/blob/master/lib/BVProblemLibrary/src/BVProblemLibrary.jl",
"https://github.com/SciML/DiffEqProblemLibrary.jl/blob/master/lib/DDEProblemLibrary/src/DDEProblemLibrary.jl",
"https://github.com/SciML/DiffEqProblemLibrary.jl/blob/master/lib/DDEProblemLibrary/src/DDEProblemLibrary.jl"
],
doctest = false, clean = true,
warnonly = [:missing_docs, :docs_block],
format = Documenter.HTML(assets = ["assets/favicon.ico"],
canonical = "https://docs.sciml.ai/DiffEqDocs/stable/",
size_threshold = 500 * 2^10),
size_threshold = 500 * 2^10),
sitename = "DifferentialEquations.jl",
authors = "Chris Rackauckas",
pages = pages)
Expand Down
148 changes: 77 additions & 71 deletions docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ stochastic_diffeq_pages_file = joinpath(@__DIR__, "stochasticdiffeq_pages.jl")
stochastic_diffeq_pages = []
if isfile(stochastic_diffeq_pages_file)
include(stochastic_diffeq_pages_file)

# Transform StochasticDiffEq pages to have the api/stochasticdiffeq prefix
function transform_stochasticdiffeq_pages(pages_array)
transformed = []
Expand All @@ -49,77 +49,83 @@ if isfile(stochastic_diffeq_pages_file)
end
return transformed
end

stochastic_diffeq_pages = transform_stochasticdiffeq_pages(pages)
end

pages = Any["index.md",
"getting_started.md",
"Tutorials" => Any["tutorials/faster_ode_example.md",
"tutorials/advanced_ode_example.md",
"tutorials/sde_example.md",
"tutorials/rode_example.md",
"tutorials/dde_example.md",
"tutorials/dae_example.md",
"tutorials/jump_diffusion.md",
"tutorials/bvp_example.md"],
"Examples" => Any[
"Beginner" => Any["examples/classical_physics.md",
"examples/conditional_dosing.md",
"examples/kepler_problem.md",
"examples/outer_solar_system.md",
"examples/min_and_max.md"],
"Advanced" => Any["examples/spiking_neural_systems.md",
"examples/beeler_reuter.md",
"examples/diffusion_implicit_heat_equation.md"]],
"Basics" => Any["basics/overview.md",
"basics/common_solver_opts.md",
"basics/solution.md",
"basics/plot.md",
"basics/integrator.md",
"basics/problem.md",
"basics/faq.md",
"basics/compatibility_chart.md"],
"Problem Types" => Any["types/discrete_types.md",
"types/ode_types.md",
"types/nonautonomous_linear_ode.md",
"types/dynamical_types.md",
"types/split_ode_types.md",
"types/steady_state_types.md",
"types/bvp_types.md",
"types/sde_types.md",
"types/sdae_types.md",
"types/rode_types.md",
"types/dde_types.md",
"types/sdde_types.md",
"types/dae_types.md"],
"Solver Algorithms" => Any["solvers/discrete_solve.md",
"solvers/ode_solve.md",
"solvers/nonautonomous_linear_ode.md",
"solvers/dynamical_solve.md",
"solvers/split_ode_solve.md",
"solvers/steady_state_solve.md",
"solvers/bvp_solve.md",
"solvers/sde_solve.md",
"solvers/sdae_solve.md",
"solvers/rode_solve.md",
"solvers/dde_solve.md",
"solvers/sdde_solve.md",
"solvers/dae_solve.md",
"solvers/benchmarks.md"],
"Additional Features" => Any["features/performance_overloads.md",
"features/diffeq_arrays.md",
"features/diffeq_operator.md",
"features/noise_process.md",
"features/linear_nonlinear.md",
"features/callback_functions.md",
"features/callback_library.md",
"features/ensemble.md",
"features/io.md",
"features/low_dep.md",
"features/progress_bar.md"],
"External Solver APIs" => Any["api/sundials.md",
"api/daskr.md"],
"OrdinaryDiffEq.jl API" => ordinary_diffeq_pages,
"StochasticDiffEq.jl API" => stochastic_diffeq_pages,
"Extra Details" => Any["extras/timestepping.md"]]
"getting_started.md",
"Tutorials" => Any[
"tutorials/faster_ode_example.md",
"tutorials/advanced_ode_example.md",
"tutorials/sde_example.md",
"tutorials/rode_example.md",
"tutorials/dde_example.md",
"tutorials/dae_example.md",
"tutorials/jump_diffusion.md",
"tutorials/bvp_example.md"],
"Examples" => Any[
"Beginner" => Any["examples/classical_physics.md",
"examples/conditional_dosing.md",
"examples/kepler_problem.md",
"examples/outer_solar_system.md",
"examples/min_and_max.md"],
"Advanced" => Any["examples/spiking_neural_systems.md",
"examples/beeler_reuter.md",
"examples/diffusion_implicit_heat_equation.md"]],
"Basics" => Any[
"basics/overview.md",
"basics/common_solver_opts.md",
"basics/solution.md",
"basics/plot.md",
"basics/integrator.md",
"basics/problem.md",
"basics/faq.md",
"basics/compatibility_chart.md"],
"Problem Types" => Any[
"types/discrete_types.md",
"types/ode_types.md",
"types/nonautonomous_linear_ode.md",
"types/dynamical_types.md",
"types/split_ode_types.md",
"types/steady_state_types.md",
"types/bvp_types.md",
"types/sde_types.md",
"types/sdae_types.md",
"types/rode_types.md",
"types/dde_types.md",
"types/sdde_types.md",
"types/dae_types.md"],
"Solver Algorithms" => Any[
"solvers/discrete_solve.md",
"solvers/ode_solve.md",
"solvers/nonautonomous_linear_ode.md",
"solvers/dynamical_solve.md",
"solvers/split_ode_solve.md",
"solvers/steady_state_solve.md",
"solvers/bvp_solve.md",
"solvers/sde_solve.md",
"solvers/sdae_solve.md",
"solvers/rode_solve.md",
"solvers/dde_solve.md",
"solvers/sdde_solve.md",
"solvers/dae_solve.md",
"solvers/benchmarks.md"],
"Additional Features" => Any[
"features/performance_overloads.md",
"features/diffeq_arrays.md",
"features/diffeq_operator.md",
"features/noise_process.md",
"features/linear_nonlinear.md",
"features/callback_functions.md",
"features/callback_library.md",
"features/ensemble.md",
"features/io.md",
"features/low_dep.md",
"features/progress_bar.md"],
"External Solver APIs" => Any[
"api/sundials.md",
"api/daskr.md"],
"OrdinaryDiffEq.jl API" => ordinary_diffeq_pages,
"StochasticDiffEq.jl API" => stochastic_diffeq_pages,
"Extra Details" => Any["extras/timestepping.md"]]
7 changes: 4 additions & 3 deletions docs/src/basics/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ For guidelines on debugging ODE solve issues, see
First of all, don't panic. You may have experienced one of the following warnings:

> dt <= dtmin. Aborting. There is either an error in your model specification or the true solution is unstable.
>
>
> NaN dt detected. Likely a NaN value in the state, parameters, or derivative value caused this outcome.
>
>
> Instability detected. Aborting

These are all pointing to a similar behavior: for some reason or another, the
Expand Down Expand Up @@ -572,7 +572,8 @@ though, an `Error: SingularException` is also possible if the linear solver fail

```julia
import DifferentialEquations as DE, OrdinaryDiffEq as ODE, LinearSolve
DE.solve(prob, ODE.Rodas4(linsolve = LinearSolve.KLUFactorization(; reuse_symbolic = false)))
DE.solve(prob, ODE.Rodas4(linsolve = LinearSolve.KLUFactorization(;
reuse_symbolic = false)))
```

For more details about possible linear solvers, consult the [LinearSolve.jl documentation](https://docs.sciml.ai/LinearSolve/stable/)
Expand Down
3 changes: 2 additions & 1 deletion docs/src/basics/integrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ For example, if one wants to iterate but only stop at specific values, one can
choose:

```julia
integrator = DE.init(prob, DE.Tsit5(); dt = 1 // 2^(4), tstops = [0.5], advance_to_tstop = true)
integrator = DE.init(
prob, DE.Tsit5(); dt = 1 // 2^(4), tstops = [0.5], advance_to_tstop = true)
for (u, t) in tuples(integrator)
@test t ∈ [0.5, 1.0]
end
Expand Down
3 changes: 2 additions & 1 deletion docs/src/basics/plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ xy = Plots.plot(sol, plotdensity = 10000, idxs = (1, 2))
xz = Plots.plot(sol, plotdensity = 10000, idxs = (1, 3))
yz = Plots.plot(sol, plotdensity = 10000, idxs = (2, 3))
xyz = Plots.plot(sol, plotdensity = 10000, idxs = (1, 2, 3))
Plots.plot(Plots.plot(xyzt, xyz), Plots.plot(xy, xz, yz, layout = (1, 3), w = 1), layout = (2, 1))
Plots.plot(Plots.plot(xyzt, xyz), Plots.plot(xy, xz, yz, layout = (1, 3), w = 1), layout = (
2, 1))
```

An example using the functions:
Expand Down
12 changes: 7 additions & 5 deletions docs/src/basics/solution.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [Solution Handling](@id solution)

The solution is an `RecursiveArrayTools.AbstractDiffEqArray`.
The solution is an `RecursiveArrayTools.AbstractDiffEqArray`.
[See RecursiveArrayTools.jl for more information on the interface](https://docs.sciml.ai/RecursiveArrayTools/stable/).
The following is a more DiffEq-centric explanation of the interface.

Expand All @@ -19,7 +19,7 @@ derivative at each timestep `du` or the spatial discretization `x`, `y`, etc.
## Array Interface

!!! note

In 2023 the linear indexing `sol[i]` was deprecated. It previously had the behavior that
`sol[i] = sol.u[i]`. However, this is incompatible with standard `AbstractArray` interfaces,
Since if `A = VectorOfArray([[1,2],[3,4]])` and `A` is supposed to act like `[1 3; 2 4]`,
Expand Down Expand Up @@ -50,7 +50,7 @@ will address first by component and lastly by time, and thus
sol[i, j]
```

will be the `i`th component at timestep `j`. Hence, `sol[j][i] == sol[i, j]`. This is done because Julia is column-major,
will be the `i`th component at timestep `j`. Hence, `sol[j][i] == sol[i, j]`. This is done because Julia is column-major,
so the leading dimension should be contiguous in memory. If the independent variables had shape
(for example, was a matrix), then `i` is the linear index. We can also access
solutions with shape:
Expand Down Expand Up @@ -186,12 +186,14 @@ error state of the solution. Return codes are now implemented as an enum using E
rather than symbols.

To check if a solution was successful, use:

```julia
SciMLBase.successful_retcode(sol)
```

!!! warning
Previous iterations of the interface suggested using `sol.retcode == :Success`,

Previous iterations of the interface suggested using `sol.retcode == :Success`,
however, that is now not advised because there are more than one return code that can be interpreted
as successful. For example, `Terminated` is a successful run to a manual termination, and would be missed
if only checking for Success. Therefore we highly recommend you use `SciMLBase.successful_retcode(sol)` instead.
Expand All @@ -214,7 +216,7 @@ following are major return codes to know:
- `ConvergenceFailure`: The internal implicit solvers failed to converge.
- `Failure`: General uncategorized failures or errors.

For a complete list of return codes and their properties, see the
For a complete list of return codes and their properties, see the
[SciMLBase ReturnCode documentation](https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes).

## Problem-Specific Features
Expand Down
9 changes: 5 additions & 4 deletions docs/src/examples/beeler_reuter.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ end
The finite-difference Laplacian is calculated in-place by a 5-point stencil. The Neumann boundary condition is enforced.

!!! note
For more complex PDE discretizations, consider using [MethodOfLines.jl](https://docs.sciml.ai/MethodOfLines/stable/)
which can automatically generate finite difference discretizations, or [SciMLOperators.jl](https://docs.sciml.ai/SciMLOperators/stable/)

For more complex PDE discretizations, consider using [MethodOfLines.jl](https://docs.sciml.ai/MethodOfLines/stable/)
which can automatically generate finite difference discretizations, or [SciMLOperators.jl](https://docs.sciml.ai/SciMLOperators/stable/)
for defining matrix-free linear operators.

```julia
Expand Down Expand Up @@ -632,7 +633,7 @@ function (f::BeelerReuterGpu)(du, u, p, t)
ny, nx = size(u)

if Δt != 0 || t == 0
@cuda blocks=(ny ÷ L, nx ÷ L) threads=(L, L) update_gates_gpu(f.d_u, f.d_XI, f.d_M,
@cuda blocks=(ny÷L, nx÷L) threads=(L, L) update_gates_gpu(f.d_u, f.d_XI, f.d_M,
f.d_H, f.d_J, f.d_D,
f.d_F, f.d_C, Δt)
f.t = t
Expand All @@ -641,7 +642,7 @@ function (f::BeelerReuterGpu)(du, u, p, t)
laplacian(f.Δv, u)

# calculate the reaction portion
@cuda blocks=(ny ÷ L, nx ÷ L) threads=(L, L) update_du_gpu(
@cuda blocks=(ny÷L, nx÷L) threads=(L, L) update_du_gpu(
f.d_du, f.d_u, f.d_XI, f.d_M,
f.d_H, f.d_J, f.d_D, f.d_F,
f.d_C)
Expand Down
3 changes: 2 additions & 1 deletion docs/src/examples/classical_physics.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ Notice that we get the same results:

```@example physics
# Plot the orbit
Plots.plot(sol2, idxs = (3, 4), title = "The orbit of the Hénon-Heiles system", xaxis = "x",
Plots.plot(
sol2, idxs = (3, 4), title = "The orbit of the Hénon-Heiles system", xaxis = "x",
yaxis = "y", leg = false)
```

Expand Down
4 changes: 3 additions & 1 deletion docs/src/examples/kepler_problem.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ sol = ODE.solve(prob, ODE.KahanLi6(), dt = 1 // 10);
Let's plot the orbit and check the energy and angular momentum variation. We know that energy and angular momentum should be constant, and they are also called first integrals.

```@example kepler
plot_orbit(sol) = Plots.plot(sol, idxs = (3, 4), lab = "Orbit", title = "Kepler Problem Solution")
function plot_orbit(sol)
Plots.plot(sol, idxs = (3, 4), lab = "Orbit", title = "Kepler Problem Solution")
end

function plot_first_integrals(sol, H, L)
Plots.plot(initial_first_integrals[1] .- map(u -> H(u.x[2], u.x[1]), sol.u),
Expand Down
2 changes: 1 addition & 1 deletion docs/src/features/ensemble.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ compute covariance matrices similarly:

```@example ensemble4
DE.EnsembleAnalysis.timeseries_steps_meancov(sim) # Use the time steps, assume fixed dt
DE.EnsembleAnalysis.timeseries_point_meancov(sim, 0:(1 // 2^(3)):1, 0:(1 // 2^(3)):1) # Use time points, interpolate
DE.EnsembleAnalysis.timeseries_point_meancov(sim, 0:(1 // 2 ^ (3)):1, 0:(1 // 2 ^ (3)):1) # Use time points, interpolate
```

For general analysis, we can build a `EnsembleSummary` type.
Expand Down
Loading
Loading