Skip to content

Commit

Permalink
format again
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Mar 3, 2024
1 parent 4e5ab7c commit f6f6a07
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions docs/src/integrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,32 @@ IntegrandValuesSum

```@example integrating
using OrdinaryDiffEq, DiffEqCallbacks, Test
prob = ODEProblem((u,p,t)->[1.0], [0.0], (0.0,1.0))
prob = ODEProblem((u, p, t) -> [1.0], [0.0], (0.0, 1.0))
integrated = IntegrandValues(Float64, Vector{Float64})
sol = solve(prob, Euler(),
callback = IntegratingCallback(
(u, t, integrator) -> [1.0], integrated, Float64[0.0]),
dt=0.1)
callback = IntegratingCallback(
(u, t, integrator) -> [1.0], integrated, Float64[0.0]),
dt = 0.1)
@test all(integrated.integrand .≈ [[0.1] for i in 1:10])
integrated = IntegrandValues(Float64, Vector{Float64})
sol = solve(prob, Euler(),
callback = IntegratingCallback(
(u, t, integrator) -> [u[1]], integrated, Float64[0.0]),
dt=0.1)
@test all(integrated.integrand .≈ [[((n * 0.1) ^2 - ((n-1) * (0.1))^2) / 2] for n in 1:10])
callback = IntegratingCallback(
(u, t, integrator) -> [u[1]], integrated, Float64[0.0]),
dt = 0.1)
@test all(integrated.integrand .≈ [[((n * 0.1)^2 - ((n - 1) * (0.1))^2) / 2] for n in 1:10])
@test sum(integrated.integrand)[1] ≈ 0.5
integrated = IntegrandValuesSum(zeros(1))
sol = solve(prob, Euler(),
callback = IntegratingSumCallback(
(u, t, integrator) -> [1.0], integrated, Float64[0.0]),
dt=0.1)
callback = IntegratingSumCallback(
(u, t, integrator) -> [1.0], integrated, Float64[0.0]),
dt = 0.1)
@test integrated.integrand[1] == 1
integrated = IntegrandValuesSum(zeros(1))
sol = solve(prob, Euler(),
callback = IntegratingSumCallback(
(u, t, integrator) -> [u[1]], integrated, Float64[0.0]),
dt=0.1)
callback = IntegratingSumCallback(
(u, t, integrator) -> [u[1]], integrated, Float64[0.0]),
dt = 0.1)
@test integrated.integrand[1] == 0.5
```

0 comments on commit f6f6a07

Please sign in to comment.