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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ sol = solve(prob, Tsit5(), reltol = 1e-8, abstol = 1e-8)
using Plots
plot(sol, linewidth = 5, title = "Solution to the linear ODE with a thick line",
xaxis = "Time (t)", yaxis = "u(t) (in μm)", label = "My Thick Line!") # legend=false
plot!(sol.t, t -> 0.5 * exp(1.01t), lw = 3, ls = :dash, label = "True Solution!")
plot!(sol.t, t -> 0.5 * exp(1.01 * t), lw = 3, ls = :dash, label = "True Solution!")
```

That example uses the out-of-place syntax `f(u,p,t)`, while the inplace syntax (more efficient for systems of equations) is shown in the Lorenz example:
That example uses the out-of-place syntax `f(u,p,t)`, while the in-place syntax (more efficient for systems of equations) is shown in the Lorenz example:

```julia
using OrdinaryDiffEq
function lorenz!(du, u, p, t)
du[1] = 10.0(u[2] - u[1])
du[1] = 10.0 * (u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
du[3] = u[1] * u[2] - (8 / 3) * u[3]
end
Expand All @@ -64,7 +64,7 @@ Very fast static array versions can be specifically compiled to the size of your
```julia
using OrdinaryDiffEq, StaticArrays
function lorenz(u, p, t)
SA[10.0(u[2] - u[1]), u[1] * (28.0 - u[3]) - u[2], u[1] * u[2] - (8 / 3) * u[3]]
SA[10.0 * (u[2] - u[1]), u[1] * (28.0 - u[3]) - u[2], u[1] * u[2] - (8 / 3) * u[3]]
end
u0 = SA[1.0; 0.0; 0.0]
tspan = (0.0, 100.0)
Expand All @@ -78,7 +78,7 @@ For "refined ODEs", like dynamical equations and `SecondOrderODEProblem`s, refer
function HH_acceleration!(dv, v, u, p, t)
x, y = u
dx, dy = dv
dv[1] = -x - 2x * y
dv[1] = -x - 2 * x * y
dv[2] = y^2 - y - x^2
end
initial_positions = [0.0, 0.1]
Expand Down
4 changes: 2 additions & 2 deletions docs/src/dynamicalodeexplicit/RKN.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ you will need to install some of the other libraries listed in the navigation ba
## Example usage

```julia
using OrdinaryDiffEqOrdinaryDiffEqRKN
using OrdinaryDiffEqRKN
function HH_acceleration!(dv, v, u, p, t)
x, y = u
dx, dy = dv
dv[1] = -x - 2x * y
dv[1] = -x - 2 * x * y
dv[2] = y^2 - y - x^2
end
initial_positions = [0.0, 0.1]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/dynamicalodeexplicit/SymplecticRK.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ using OrdinaryDiffEqSymplecticRK
function HH_acceleration!(dv, v, u, p, t)
x, y = u
dx, dy = dv
dv[1] = -x - 2x * y
dv[1] = -x - 2 * x * y
dv[2] = y^2 - y - x^2
end
initial_positions = [0.0, 0.1]
Expand Down
10 changes: 5 additions & 5 deletions docs/src/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ sol = solve(prob, Tsit5(), reltol = 1e-8, abstol = 1e-8)
using Plots
plot(sol, linewidth = 5, title = "Solution to the linear ODE with a thick line",
xaxis = "Time (t)", yaxis = "u(t) (in μm)", label = "My Thick Line!") # legend=false
plot!(sol.t, t -> 0.5 * exp(1.01t), lw = 3, ls = :dash, label = "True Solution!")
plot!(sol.t, t -> 0.5 * exp(1.01 * t), lw = 3, ls = :dash, label = "True Solution!")
```

That example uses the out-of-place syntax `f(u,p,t)`, while the inplace syntax (more efficient for systems of equations) is shown in the Lorenz example:
That example uses the out-of-place syntax `f(u,p,t)`, while the in-place syntax (more efficient for systems of equations) is shown in the Lorenz example:

```julia
using OrdinaryDiffEq
function lorenz(du, u, p, t)
du[1] = 10.0(u[2] - u[1])
du[1] = 10.0 * (u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
du[3] = u[1] * u[2] - (8 / 3) * u[3]
end
Expand All @@ -37,7 +37,7 @@ Very fast static array versions can be specifically compiled to the size of your
```julia
using OrdinaryDiffEq, StaticArrays
function lorenz(u, p, t)
SA[10.0(u[2] - u[1]), u[1] * (28.0 - u[3]) - u[2], u[1] * u[2] - (8 / 3) * u[3]]
SA[10.0 * (u[2] - u[1]), u[1] * (28.0 - u[3]) - u[2], u[1] * u[2] - (8 / 3) * u[3]]
end
u0 = SA[1.0; 0.0; 0.0]
tspan = (0.0, 100.0)
Expand All @@ -51,7 +51,7 @@ For “refined ODEs”, like dynamical equations and `SecondOrderODEProblem`s, r
function HH_acceleration(dv, v, u, p, t)
x, y = u
dx, dy = dv
dv[1] = -x - 2x * y
dv[1] = -x - 2 * x * y
dv[2] = y^2 - y - x^2
end
initial_positions = [0.0, 0.1]
Expand Down
Loading