Skip to content

Commit

Permalink
fix tutorial syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Oct 8, 2023
1 parent 0d5ab59 commit 7370a45
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/src/tutorials/acausal_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ end
@mtkbuild rc_model = RCModel(resistor.R = 2.0)
u0 = [
rc_model.capacitorv => 0.0,
rc_model.capacitor.v => 0.0,
]
prob = ODAEProblem(rc_model, u0, (0, 10.0))
sol = solve(prob, Tsit5())
Expand Down Expand Up @@ -315,8 +315,8 @@ DAE solver](https://docs.sciml.ai/DiffEqDocs/stable/solvers/dae_solve/#OrdinaryD
This is done as follows:

```@example acausal
u0 = [rc_model.capacitorv => 0.0
rc_model.capacitor₊p₊i => 0.0]
u0 = [rc_model.capacitor.v => 0.0
rc_model.capacitor.p.i => 0.0]
prob = ODEProblem(sys, u0, (0, 10.0))
sol = solve(prob, Rodas4())
Expand All @@ -329,7 +329,7 @@ letter `A`):

```@example acausal
u0 = [
rc_model.capacitorv => 0.0,
rc_model.capacitor.v => 0.0,
]
prob = ODAEProblem(sys, u0, (0, 10.0))
sol = solve(prob, Rodas4())
Expand All @@ -356,11 +356,11 @@ The solution object can be accessed via its symbols. For example, let's retrieve
the voltage of the resistor over time:

```@example acausal
sol[rc_model.resistorv]
sol[rc_model.resistor.v]
```

or we can plot the timeseries of the resistor's voltage:

```@example acausal
plot(sol, idxs = [rc_model.resistorv])
plot(sol, idxs = [rc_model.resistor.v])
```

0 comments on commit 7370a45

Please sign in to comment.