using OrdinaryDiffEq
using ComponentArrays
using SimpleUnPack
using Plots
Plots.default(linewidth=2)Fig 7.28
model of synthetic pulse generating system
function model728!(D, u, p, t)
@unpack aG, bG, KC, aC, bC, k1, k2, KR, RT, A = p
@unpack G, C, R = u
fR = R / KR
fC = C / KC
Gddt = -bG * G + aG * (fR / (1 + fR + fC^2 + fR * fC^2))
Cddt = -bC * C + aC * R / (KR + R)
Rddt = -k2 * R + k1 * (RT - 2 * R)^2 * A^2
D.G = Gddt
D.C = Cddt
D.R = Rddt
nothing
endmodel728! (generic function with 1 method)
ps728 = ComponentArray(
aG = 80, # muM/min
bG = 0.07, # /min
KC= 0.008, # muM
aC= 0.5, # muM/min
bC = 0.3, # /min
k1 = 0.5, # /muM^3 /min
k2 = 0.02, # /min
KR= 0.02, # muM
RT = 0.5, # muM
A = 10.0, # muM
)
u0728 = ComponentArray(
G = 0.0,
C = 0.0,
R = 0.0,
)
tend = 50.0
prob728 = ODEProblem(model728!, u0728, (0.0, tend), ps728)ODEProblem with uType ComponentArrays.ComponentVector{Float64, Vector{Float64}, Tuple{ComponentArrays.Axis{(G = 1, C = 2, R = 3)}}} and tType Float64. In-place: true Non-trivial mass matrix: false timespan: (0.0, 50.0) u0: ComponentVector{Float64}(G = 0.0, C = 0.0, R = 0.0)
@time sol728 = solve(prob728, Tsit5()) 2.070308 seconds (8.17 M allocations: 412.208 MiB, 2.41% gc time, 99.99% compilation time)
retcode: Success
Interpolation: specialized 4th order "free" interpolation
t: 58-element Vector{Float64}:
0.0
9.999999999999999e-5
0.0002808712273886078
0.0005385770380686724
0.0009134176741307914
0.0014497117592804643
0.002220241608899128
0.003327456521230799
0.00493088307190323
0.0072784713692916995
⋮
38.85909781274149
40.56660938057199
42.29446095428485
43.93521921766175
45.418101342448054
46.747660381640486
48.01058339261659
49.30597743685047
50.0
u: 58-element Vector{ComponentArrays.ComponentVector{Float64, Vector{Float64}, Tuple{ComponentArrays.Axis{(G = 1, C = 2, R = 3)}}}}:
ComponentVector{Float64}(G = 0.0, C = 0.0, R = 0.0)
ComponentVector{Float64}(G = 0.0002392896909392188, C = 1.4955489953242212e-6, R = 0.001243779852809739)
ComponentVector{Float64}(G = 0.0017537272395049981, C = 1.096055929956087e-5, R = 0.0034622580928137456)
ComponentVector{Float64}(G = 0.005866049357478833, C = 3.666147408118319e-5, R = 0.006555641145226798)
ComponentVector{Float64}(G = 0.014951823136417016, C = 9.344608787095643e-5, R = 0.010918940492649125)
ComponentVector{Float64}(G = 0.032495143469597844, C = 0.00020311322260303048, R = 0.016896395072320568)
ComponentVector{Float64}(G = 0.06391046303714981, C = 0.0003996946525244968, R = 0.024979408364971294)
ComponentVector{Float64}(G = 0.1169293978326857, C = 0.0007326265006532333, R = 0.0356591712345212)
ComponentVector{Float64}(G = 0.20272010995429557, C = 0.0012771049211146108, R = 0.04944325418747299)
ComponentVector{Float64}(G = 0.33610821464576557, C = 0.002148770068246892, R = 0.06670084724114986)
⋮
ComponentVector{Float64}(G = 0.1618686927818645, C = 1.540896555522915, R = 0.24509326625515915)
ComponentVector{Float64}(G = 0.14684124743838672, C = 1.5408974093230676, R = 0.24511543421192836)
ComponentVector{Float64}(G = 0.13335732756919702, C = 1.5408951709898615, R = 0.24518656060251717)
ComponentVector{Float64}(G = 0.12197777443922538, C = 1.5408897297317679, R = 0.24535684146860398)
ComponentVector{Float64}(G = 0.112759213744158, C = 1.5408875188910272, R = 0.24557025743710703)
ComponentVector{Float64}(G = 0.10526936958726162, C = 1.5409010351887436, R = 0.2455034853003446)
ComponentVector{Float64}(G = 0.09877225763189022, C = 1.5409153479173887, R = 0.24528505208826476)
ComponentVector{Float64}(G = 0.09267872739629741, C = 1.5409186638911982, R = 0.2451538818127746)
ComponentVector{Float64}(G = 0.08963438151658158, C = 1.5409208331796385, R = 0.24507614538602768)
plt728 = plot(sol728, labels = ["GFP" "cI" "LuxR:AHL complex"], xlabel="Time (min)", ylabel="Concentration (μM)", title="Fig 7.28", legend=:right)
This notebook was generated using Literate.jl.
Back to top