-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding pysb-pyurdme wrapper, and one simple example
- Loading branch information
1 parent
a184f9e
commit 47374cd
Showing
3 changed files
with
90 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from pysb.examples.simple_reaction_pyurdme import model | ||
from pysb.tools.pysb_pyurdme import run_pyurdme | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import pyurdme | ||
from pysb.integrate import odesolve | ||
|
||
|
||
|
||
model.diffusivities = [('E(b=None)',0.001), ('P(b=None)',0.2)] | ||
|
||
|
||
initial_dist = {'E(b=None)':['set_initial_condition_place_near', [0.5,0.5]], | ||
'S(b=None)':['set_initial_condition_place_near', [1,0.5]]} | ||
|
||
mesh = pyurdme.URDMEMesh.generate_unit_square_mesh(40,40) | ||
|
||
tspan = np.linspace(0, 5, 500) | ||
y=odesolve(model,tspan) | ||
# plt.plot(tspan,y['__s2']) | ||
# plt.show() | ||
result = run_pyurdme(model, tspan, mesh, initial_dist) | ||
result.export_to_vtk("__s0", "simple_output_s0") | ||
result.export_to_vtk("__s1", "simple_output_s1") | ||
result.export_to_vtk("__s2", "simple_output_s2") | ||
result.export_to_vtk("__s3", "simple_output_s3") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from pysb import * | ||
from pysb.macros import * | ||
Model() | ||
|
||
|
||
|
||
# Parameter('kf', 2) | ||
# Parameter('kr', 2) | ||
|
||
Monomer('E', ['b']) | ||
Monomer('S', ['b']) | ||
Monomer('P') | ||
catalyze(E(), 'b', S(), 'b', P(), (1e-4, 1e-1, 1)) | ||
|
||
Parameter('E_0',100000) | ||
Parameter('S_0', 50000) | ||
Initial(E(b=None), E_0) | ||
Initial(S(b=None), S_0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters