You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/features/callback_functions.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -347,7 +347,7 @@ should always be positive, with an event occurring at 0.
347
347
We thus want to check if the ball's height ever hits zero:
348
348
349
349
```@example callback4
350
-
function condition(u,t,integrator) # Event when event_f(u,t) == 0
350
+
function condition(u,t,integrator) # Event when condition(u,t,integrator) == 0
351
351
u[1]
352
352
end
353
353
```
@@ -668,7 +668,7 @@ Our model is that, whenever the protein `X` gets to a concentration of 1, it
668
668
triggers a cell division. So we check to see if any concentrations hit 1:
669
669
670
670
```@example callback5
671
-
function condition(u,t,integrator) # Event when event_f(u,t) == 0
671
+
function condition(u,t,integrator) # Event when condition(u,t,integrator) == 0
672
672
1-maximum(u)
673
673
end
674
674
```
@@ -756,7 +756,7 @@ end
756
756
where `u[1]` denotes `y`-coordinate, `u[2]` denotes velocity in `y`-direction, `u[3]` denotes `x`-coordinate and `u[4]` denotes velocity in `x`-direction. We will make a `VectorContinuousCallback` of length 2 - one for `x` axis collision, one for walls parallel to `y` axis.
757
757
758
758
```@example callback6
759
-
function condition(out,u,t,integrator) # Event when event_f(u,t) == 0
759
+
function condition(out,u,t,integrator) # Event when condition(out,u,t,integrator) == 0
760
760
out[1] = u[1]
761
761
out[2] = (u[3] - 10.0)u[3]
762
762
end
@@ -782,4 +782,4 @@ p = 9.8
782
782
prob = ODEProblem(f,u0,tspan,p)
783
783
sol = solve(prob,Tsit5(),callback=cb,dt=1e-3,adaptive=false)
0 commit comments