-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Api doc proposed changes #862
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,5 +66,5 @@ pages = Any[ | |
# # Repository structure. | ||
# ], | ||
#"FAQs" => "faqs.md", | ||
#"API" => "api.md" | ||
"API" => "api.md" | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,37 +35,41 @@ corresponding chemical reaction ODE models, chemical Langevin equation SDE | |
models, and stochastic chemical kinetics jump process models. | ||
|
||
```@example ex1 | ||
using Catalyst, DifferentialEquations, Plots | ||
using Catalyst, OrdinaryDiffEq, StochasticDiffEq, JumpProcesses, Plots | ||
t = default_t() | ||
@parameters β γ | ||
@species S(t) I(t) R(t) | ||
|
||
rxs = [Reaction(β, [S,I], [I], [1,1], [2]) | ||
Reaction(γ, [I], [R])] | ||
@named rs = ReactionSystem(rxs, t) | ||
rs = complete(rs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. completeness is now required for all systems. |
||
|
||
u₀map = [S => 999.0, I => 1.0, R => 0.0] | ||
parammap = [β => 1/10000, γ => 0.01] | ||
tspan = (0.0, 250.0) | ||
|
||
# solve as ODEs | ||
odesys = convert(ODESystem, rs) | ||
odesys = complete(odesys) | ||
oprob = ODEProblem(odesys, u₀map, tspan, parammap) | ||
sol = solve(oprob, Tsit5()) | ||
p1 = plot(sol, title = "ODE") | ||
|
||
# solve as SDEs | ||
sdesys = convert(SDESystem, rs) | ||
sdesys = complete(sdesys) | ||
sprob = SDEProblem(sdesys, u₀map, tspan, parammap) | ||
sol = solve(sprob, EM(), dt=.01) | ||
sol = solve(sprob, EM(), dt=.01, saveat = 2.0) | ||
p2 = plot(sol, title = "SDE") | ||
|
||
# solve as jump process | ||
jumpsys = convert(JumpSystem, rs) | ||
jumpsys = complete(jumpsys) | ||
u₀map = [S => 999, I => 1, R => 0] | ||
dprob = DiscreteProblem(jumpsys, u₀map, tspan, parammap) | ||
jprob = JumpProblem(jumpsys, dprob, Direct()) | ||
sol = solve(jprob, SSAStepper()) | ||
jprob = JumpProblem(jumpsys, dprob, Direct(); save_positions = (false,false)) | ||
sol = solve(jprob, SSAStepper(), saveat = 2.0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When going through the doc build times, the rendering of large figures was the biggest problem. When building the docs (containing only the API) locally, reducing the saveat for these stochastic simulations reduced the build time from over 250 seconds to 15 seconds. |
||
p3 = plot(sol, title = "jump") | ||
|
||
plot(p1, p2, p3; layout = (3,1)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried to remove all cases of DifferentialEquations