using OrdinaryDiffEq
using CairoMakiesol = ODEProblem((u, p, t) -> p * (1.0 - u), 0.0, 10.0, 1.0) |> solveretcode: Success
Interpolation: 3rd order Hermite
t: 19-element Vector{Float64}:
0.0
9.999999999999999e-5
0.0010999999999999998
0.011099999999999997
0.07674208845992711
0.2256219867768681
0.44557597917511127
0.7272504630079983
1.0899642942915928
1.5331652370027047
2.069723955810927
2.7057504549713167
3.456244462021674
4.337840321152434
5.377903699066161
6.614654221185871
8.10735076979757
9.946895330133984
10.0
u: 19-element Vector{Float64}:
0.0
9.999500016666247e-5
0.001099395221772342
0.011038622307372232
0.07387131791398742
0.2019802926086037
0.3595447107874156
0.5167641226215504
0.6637713517844293
0.7841482172374694
0.8737783990851791
0.9331779826853478
0.9684489619038241
0.9869310637446783
0.9953772830552643
0.9986536796628318
0.9996930417189613
0.999947197179355
0.9999499281015908Fig 2.46
fig = Figure()
ax = Axis(
fig[1, 1],
xlabel="Time",
ylabel="Concentration",
title="Prob. 2.4.6"
)
lines!(ax, 0 .. 10.0, t -> sol(t), label="u(t)")
axislegend(ax, position=:rb)
fig
This notebook was generated using Literate.jl.