Skip to content

Commit 347c0e6

Browse files
committed
docs: update docs
1 parent bca35ac commit 347c0e6

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

docs/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
1515
[compat]
1616
Documenter = "1.3"
1717
Lux = "1"
18-
ModelingToolkit = "9.9"
19-
ModelingToolkitNeuralNets = "1"
18+
ModelingToolkit = "10"
19+
ModelingToolkitNeuralNets = "2"
2020
ModelingToolkitStandardLibrary = "2.7"
2121
Optimization = "3.24, 4.0"
2222
OptimizationOptimisers = "0.2.1, 0.3"
@@ -27,4 +27,4 @@ StableRNGs = "1"
2727
SymbolicIndexingInterface = "0.3.15"
2828

2929
[sources]
30-
ModelingToolkitNeuralNets = { path = ".." }
30+
ModelingToolkitNeuralNets = {path = ".."}

docs/src/friction.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function friction_true()
4949
eqs = [
5050
Dt(y) ~ Fu - friction(y)
5151
]
52-
return ODESystem(eqs, t, name = :friction_true)
52+
return System(eqs, t, name = :friction_true)
5353
end
5454
```
5555

@@ -58,7 +58,7 @@ Now that we have defined the model, we will simulate it from 0 to 0.1 seconds.
5858
```@example friction
5959
model_true = structural_simplify(friction_true())
6060
prob_true = ODEProblem(model_true, [], (0, 0.1), [])
61-
sol_ref = solve(prob_true, Rodas4(); saveat = 0.001)
61+
sol_ref = solve(prob_true, Vern7(); saveat = 0.001)
6262
```
6363

6464
Let's plot it.
@@ -85,7 +85,7 @@ function friction_ude(Fu)
8585
@named nn_out = RealOutputArray(nout = 1)
8686
eqs = [Dt(y) ~ Fu - nn_in.u[1]
8787
y ~ nn_out.u[1]]
88-
return ODESystem(eqs, t, name = :friction, systems = [nn_in, nn_out])
88+
return System(eqs, t, name = :friction, systems = [nn_in, nn_out])
8989
end
9090
9191
Fu = 120.0
@@ -98,8 +98,8 @@ chain = Lux.Chain(
9898
)
9999
@named nn = NeuralNetworkBlock(1, 1; chain = chain, rng = StableRNG(1111))
100100
101-
eqs = [connect(model.nn_in, nn.output)
102-
connect(model.nn_out, nn.input)]
101+
eqs = [connect(model.nn_in.u, nn.output)
102+
connect(model.nn_out.u, nn.input)]
103103
104104
ude_sys = complete(ODESystem(eqs, t, systems = [model, nn], name = :ude_sys))
105105
sys = structural_simplify(ude_sys)
@@ -114,7 +114,7 @@ function loss(x, (prob, sol_ref, get_vars, get_refs, set_x))
114114
new_p = set_x(prob, x)
115115
new_prob = remake(prob, p = new_p, u0 = eltype(x).(prob.u0))
116116
ts = sol_ref.t
117-
new_sol = solve(new_prob, Rodas4(), saveat = ts, abstol = 1e-8, reltol = 1e-8)
117+
new_sol = solve(new_prob, Vern7(), saveat = ts, abstol = 1e-8, reltol = 1e-8)
118118
loss = zero(eltype(x))
119119
for i in eachindex(new_sol.u)
120120
loss += sum(abs2.(get_vars(new_sol, i) .- get_refs(sol_ref, i)))
@@ -126,7 +126,7 @@ function loss(x, (prob, sol_ref, get_vars, get_refs, set_x))
126126
end
127127
end
128128
129-
of = OptimizationFunction{true}(loss, AutoForwardDiff())
129+
of = OptimizationFunction(loss, AutoForwardDiff())
130130
131131
prob = ODEProblem(sys, [], (0, 0.1), [])
132132
get_vars = getu(sys, [sys.friction.y])

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Pkg.add("ModelingToolkitNeuralNets")
2323

2424
- See the [SciML Style Guide](https://github.com/SciML/SciMLStyle) for common coding practices and other style decisions.
2525
- There are a few community forums:
26-
26+
2727
+ The #diffeq-bridged and #sciml-bridged channels in the
2828
[Julia Slack](https://julialang.org/slack/)
2929
+ The #diffeq-bridged and #sciml-bridged channels in the

0 commit comments

Comments
 (0)