Skip to content

Commit 72fb7cf

Browse files
author
Sathvik Bhagavan
committed
docs: use output of the neural network for plotting
1 parent c7b07d5 commit 72fb7cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/friction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ res_p = SciMLStructures.replace(Tunable(), prob.p, res)
151151
res_prob = remake(prob, p = res_p)
152152
res_sol = solve(res_prob, Rodas4(), saveat = sol_ref.t)
153153
@test first.(sol_ref.u)≈first.(res_sol.u) rtol=1e-3 #hide
154-
@test friction.(first.(sol_ref.u))≈(Fu .- first.(res_sol(res_sol.t, Val{1}).u)) rtol=1e-1 #hide
154+
@test friction.(first.(sol_ref.u))≈(getindex.(res_sol[sys.nn.output.u], 1)) rtol=1e-1 #hide
155155
nothing #hide
156156
```
157157

@@ -173,7 +173,7 @@ It matches the data well! Let's also check the predictions for the friction forc
173173

174174
```@example friction
175175
scatter(sol_ref.t, friction.(first.(sol_ref.u)), label = "ground truth friction")
176-
plot!(res_sol.t, Fu .- first.(res_sol(res_sol.t, Val{1}).u),
176+
plot!(res_sol.t, getindex.(res_sol[sys.nn.output.u], 1),
177177
label = "friction from neural network")
178178
```
179179

0 commit comments

Comments
 (0)