Skip to content

Commit 732c50d

Browse files
author
Fredrik Bagge Carlson
committed
fix some broken examples
1 parent 6bc7546 commit 732c50d

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

docs/Project.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
[deps]
2+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
3+
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
4+
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
25
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
6+
GalacticOptim = "a75be94c-b780-496d-a8a9-0878b188d577"
7+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
38
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
9+
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
10+
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
11+
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
12+
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
413

514
[compat]
615
Documenter = "0.27"

docs/src/basics/Composition.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Every `AbstractSystem` has a `system` keyword argument for specifying
7575
subsystems. A model is the composition of itself and its subsystems.
7676
For example, if we have:
7777

78-
```@example composition
78+
```julia
7979
@named sys = compose(ODESystem(eqs,indepvar,states,ps),subsys)
8080
```
8181

@@ -100,7 +100,7 @@ associated `SciMLProblem` type using the standard constructors. When
100100
this is done, the initial conditions and parameters must be specified
101101
in their namespaced form. For example:
102102

103-
```@example composition
103+
```julia
104104
u0 = [
105105
x => 2.0
106106
subsys.x => 2.0
@@ -190,7 +190,7 @@ N = S + I + R
190190
@named ieqn = ODESystem([D(I) ~ β*S*I/N-γ*I])
191191
@named reqn = ODESystem([D(R) ~ γ*I])
192192
193-
@named sir = compose(ODESystem([
193+
sir = compose(ODESystem([
194194
S ~ ieqn.S,
195195
I ~ seqn.I,
196196
R ~ ieqn.R,
@@ -204,7 +204,7 @@ N = S + I + R
204204
ieqn.β => β
205205
ieqn.γ => γ
206206
reqn.γ => γ
207-
]), seqn, ieqn, reqn)
207+
], name=:sir), seqn, ieqn, reqn)
208208
```
209209

210210
Note that the states are forwarded by an equality relationship, while

docs/src/mtkitize_tutorials/modelingtoolkitize.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ via the `modelingtoolkitize` function. Take, for example, the Robertson ODE
55
defined as an `ODEProblem` for DifferentialEquations.jl:
66

77
```@example mtkize
8-
using DifferentialEquations
8+
using DifferentialEquations, ModelingToolkit
99
function rober(du,u,p,t)
1010
y₁,y₂,y₃ = u
1111
k₁,k₂,k₃ = p

docs/src/mtkitize_tutorials/sparse_jacobians.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ prob = ODEProblem(brusselator_2d_loop,u0,(0.,11.5),p)
5050
Now let's use `modelingtoolkitize` to generate the symbolic version:
5151

5252
```@example sparsejac
53-
sys = modelingtoolkitize(prob_ode_brusselator_2d)
53+
sys = modelingtoolkitize(prob)
5454
```
5555

5656
Now we regenerate the problem using `jac=true` for the analytical Jacobian

0 commit comments

Comments
 (0)