Skip to content

Commit 7adc6ff

Browse files
authored
fix docs for time_dependent tutorial (#271)
1 parent fded42a commit 7adc6ff

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/src/tutorials/limit_cycles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ sweep = ParameterSweep(F0 => (0.002, 0.011), (0,T))
109109
110110
# start from initial_state, use sweep, total time is 2*T
111111
time_problem = ODEProblem(harmonic_eq, initial_state, sweep=sweep, timespan=(0,2*T))
112-
time_evo = solve(time_problem, saveat=100);
112+
time_evo = solve(time_problem, Tsit5(), saveat=100);
113113
nothing # hide
114114
```
115115
Inspecting the amplitude as a function of time,

docs/src/tutorials/time_dependent.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Given $\mathbf{u}(T_0)$, what is $\mathbf{u}(T)$ at future times?
4242

4343
For constant parameters, a [`HarmonicEquation`](@ref HarmonicBalance.HarmonicEquation) object can be fed into the constructor of [`ODEProblem`](@ref ODEProblem). The syntax is similar to DifferentialEquations.jl :
4444
```@example time_dependent
45-
using OrdinaryDiffEq
45+
using OrdinaryDiffEqTsit5
4646
x0 = [0.; 0.] # initial condition
4747
fixed = (ω0 => 1.0, γ => 1e-2, λ => 5e-2, F => 1e-3, α => 1.0, η => 0.3, θ => 0, ω => 1.0) # parameter values
4848
@@ -51,15 +51,15 @@ ode_problem = ODEProblem(harmonic_eq, fixed, x0 = x0, timespan = (0,1000))
5151
OrdinaryDiffEq.jl takes it from here - we only need to use `solve`.
5252

5353
```@example time_dependent
54-
time_evo = solve(ode_problem, saveat=1.0);
54+
time_evo = solve(ode_problem, Tsit5(), saveat=1.0);
5555
plot(time_evo, ["u1", "v1"], harmonic_eq)
5656
```
5757

5858
Running the above code with `x0 = [0.2, 0.2]` gives the plots
5959
```@example time_dependent
6060
x0 = [0.2; 0.2] # initial condition
6161
ode_problem = remake(ode_problem, u0 = x0)
62-
time_evo = solve(ode_problem, saveat=1.0);
62+
time_evo = solve(ode_problem, Tsit5(), saveat=1.0);
6363
plot(time_evo, ["u1", "v1"], harmonic_eq)
6464
```
6565

@@ -85,7 +85,7 @@ The sweep linearly interpolates between $\omega = 0.9$ at time 0 and $\omega =
8585
Let us now define a new `ODEProblem` which incorporates `sweep` and again use `solve`:
8686
```@example time_dependent
8787
ode_problem = ODEProblem(harmonic_eq, fixed, sweep=sweep, x0=[0.1;0.0], timespan=(0, 2e4))
88-
time_evo = solve(ode_problem, saveat=100)
88+
time_evo = solve(ode_problem, Tsit5(), saveat=100)
8989
plot(time_evo, "sqrt(u1^2 + v1^2)", harmonic_eq)
9090
```
9191
We see the system first evolves from the initial condition towards the low-amplitude steady state. The amplitude increases as the sweep proceeds, with a jump occurring around $\omega = 1.08$ (i.e., time 18000).

0 commit comments

Comments
 (0)