Skip to content

Commit

Permalink
pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
sosiristseng committed Dec 15, 2024
1 parent f2b52e2 commit ec50529
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
7 changes: 6 additions & 1 deletion Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.11.2"
manifest_format = "2.0"
project_hash = "bae0226fd7bb98a46eb96d2e9ced0f3a76d44c4a"
project_hash = "7f95fd10ab0dcaae8174877b8b813d1c583b0887"

[[deps.ADTypes]]
git-tree-sha1 = "72af59f5b8f09faee36b4ec48e014a79210f2f4f"
Expand Down Expand Up @@ -577,6 +577,11 @@ weakdeps = ["ChainRulesCore", "EnzymeCore"]
DispatchDoctorChainRulesCoreExt = "ChainRulesCore"
DispatchDoctorEnzymeCoreExt = "EnzymeCore"

[[deps.DisplayAs]]
git-tree-sha1 = "43c017d5dd3a48d56486055973f443f8a39bb6d9"
uuid = "0b91fe84-8a4c-11e9-3e1d-67c38462b6d6"
version = "0.1.6"

[[deps.Distances]]
deps = ["LinearAlgebra", "Statistics", "StatsAPI"]
git-tree-sha1 = "c7e3a542b999843086e2f29dac96a618c105be1d"
Expand Down
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
DisplayAs = "0b91fe84-8a4c-11e9-3e1d-67c38462b6d6"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
Expand Down
12 changes: 7 additions & 5 deletions docs/intro-04-gillespie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using Plots
using Interpolations
using Statistics ## mean()
using Random ## randexp()
Random.seed!(2022)
Random.seed!(2024)

#===
Stochastic chemical reaction: Gillespie Algorithm (direct method)
Expand Down Expand Up @@ -77,8 +77,8 @@ u0 = [200, 0]
tend = 10.0

# Solve the problem using both direct and first reaction method
soldirect = ssa_direct(model, u0, tend, parameters, stoich)
solfirst = ssa_first(model, u0, tend, parameters, stoich)
@time soldirect = ssa_direct(model, u0, tend, parameters, stoich)
@time solfirst = ssa_first(model, u0, tend, parameters, stoich)

# Plot the solution from the direct method
plot(soldirect.t, soldirect.u,
Expand Down Expand Up @@ -126,7 +126,7 @@ plot!(fig1, b_avg, 0.0, tend, linecolor=:black, linewidth=3, linestyle = :dash,
fig1 |> display

#===
## Using Catalyst
## Using Catalyst (recommended)
[Catalyst.jl](https://github.com/SciML/Catalyst.jl) is a domain-specific language (DSL) package to solve law of mass action problems.
===#
Expand Down Expand Up @@ -156,9 +156,11 @@ plot(sol)
# Parallel ensemble simulation
ensprob = EnsembleProblem(jumpProb)
sim = solve(ensprob, SSAStepper(), EnsembleThreads(); trajectories=50)
plot(sim, alpha=0.1, color=[:blue :red])

#---
plot(sim, alpha=0.1, color=[:blue :red], fmt=:png)

#---
summ = EnsembleSummary(sim, 0:0.1:10)
plot(summ,fillalpha=0.5)

Expand Down

0 comments on commit ec50529

Please sign in to comment.