Skip to content

Commit 9f04501

Browse files
author
Brad Carman
committed
format docs
1 parent ac9d232 commit 9f04501

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/src/basics/InputOutput.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ using Plots
112112
eqs = [D(y) ~ x]
113113
114114
# Compile with inputs specified
115-
@mtkcompile sys = System(eqs, t, [x, y], []) inputs=[x]
115+
@mtkcompile sys=System(eqs, t, [x, y], []) inputs=[x]
116116
117117
prob = ODEProblem(sys, [], (0, 4))
118118
@@ -122,7 +122,7 @@ input = Input(sys.x, [1, 2, 3, 4], [0, 1, 2, 3])
122122
# Solve with the input - solver handles callbacks automatically
123123
sol = solve(prob, [input], Tsit5())
124124
125-
plot(sol; idxs=[x,y])
125+
plot(sol; idxs = [x, y])
126126
```
127127

128128
Multiple `Input` objects can be passed in a vector to handle multiple input variables simultaneously.
@@ -151,10 +151,11 @@ step!(integrator, 1.0, true)
151151
# IMPORTANT: Must call finalize! to save all input callbacks
152152
finalize!(integrator)
153153
154-
plot(sol; idxs=[x,y])
154+
plot(sol; idxs = [x, y])
155155
```
156156

157157
!!! warning "Always call `finalize!`"
158+
158159
When using `set_input!`, you must call [`finalize!`](@ref) after integration is complete. This ensures that all discrete callbacks associated with input variables are properly saved in the solution. Without this call, input values may not be correctly recorded when querying the solution.
159160

160161
## Docstrings

0 commit comments

Comments
 (0)