Goodwin oscillator model: Goodwin model (biology)
using Startup: meshgrid, get_gradient, normalize_gradient
using DifferentialEquations
using DiffEqCallbacks
using DifferentialEquations
using Catalyst
using Plots
Plots.gr(linewidth=1.5)
@time "Build system" rn717 = @reaction_network begin
(a / (k^n + Z^n), b), 0 <--> X
(α * X, β), 0 <--> Y
(γ * Y, δ), 0 <--> Z
endBuild system: 0.014737 seconds (2.34 k allocations: 30.088 MiB, 72.18% compilation time: 100% of which was recompilation)
Loading...
alg = FBDF()
up717 = Dict(:a => 360.0, :k => 1.368, :b => 1.0, :α => 1.0, :β => 0.6, :γ => 1.0, :δ => 0.8, :n => 12.0, :X => 0.0, :Y => 0.0, :Z => 0.0)
tend = 35.0
@time "Build problem" prob717 = ODEProblem(rn717, up717, (0.0, tend))
@time "Solve problem" sol717 = solve(prob717, alg)
plot(sol717, idxs=[:X, :Y, :Z], labels=["X" "Y" "Z"], title="Fig 7.17 (A)", xlabel="Time", ylabel="Concentration")Build problem: 0.620507 seconds (689.73 k allocations: 44.195 MiB, 97.00% compilation time)
Solve problem: 0.636145 seconds (850.06 k allocations: 46.754 MiB, 99.30% compilation time)

plot(sol717, idxs=(:X, :Y, :Z), labels=false, title="Fig 7.17 (B)", size=(600, 600), xlabel="X", ylabel="Y", zlabel="Z")
This notebook was generated using Literate.jl.