Skip to content

Commit

Permalink
use more robust definition of initial conditions for perturbation exa…
Browse files Browse the repository at this point in the history
…mple
  • Loading branch information
Karl Wessel committed Oct 8, 2024
1 parent a7adb53 commit 8eaa427
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/src/examples/perturbation.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ unknowns(sys)
```@example perturbation
# the initial conditions
# everything is zero except the initial velocity
u0 = zeros(2order + 2)
u0[2] = 1.0 # yˍt₁
u0 = Dict([unknowns(sys) .=> 0; D(y[1]) => 1])
prob = ODEProblem(sys, u0, (0, 3.0))
sol = solve(prob; dtmax = 0.01);
Expand Down Expand Up @@ -169,8 +168,7 @@ We continue with converting 'eqs' to an `ODEProblem`, solving it, and finally pl

```@example perturbation
# the initial conditions
u0 = zeros(2order + 2)
u0[1] = 1.0 # yˍt₁
u0 = Dict([unknowns(sys) .=> 0; D(y[1]) => 1])
prob = ODEProblem(sys, u0, (0, 50.0))
sol = solve(prob; dtmax = 0.01)
Expand Down

0 comments on commit 8eaa427

Please sign in to comment.