Last active
October 1, 2015 16:12
-
-
Save jmuhlich/a4eae9494064a36935f4 to your computer and use it in GitHub Desktop.
pysb fridlyand diabetes model test
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
from pysb import * | |
Model() | |
Monomer('Glucose') | |
Monomer('Vp') | |
Parameter('kf', .015) | |
Parameter('kr', .015) | |
Parameter('Vsk', -18) | |
Parameter('Vp0', -60) | |
Parameter('K', 5) | |
Parameter('n', 3) | |
Observable('Glu_obs', Glucose()) | |
Expression('Vpc', Vsk + Vp0 * (1 - Glu_obs ** n / (K ** n + Glu_obs ** n) )) | |
# Encode explicit differential equation expression for Vp by using a synthesis | |
# rule. This allows us to write an expression that won't be implicitly | |
# multiplied by d[Vp]/dt. However the degradation *is* implicitly multiplied by | |
# it, which in this case is exactly what is wanted anyway. | |
Expression('Vp_synth_rate', kf * Vpc) | |
Rule('Vp_synth', None >> Vp(), Vp_synth_rate) | |
Rule('Vp_deg', Vp() >> None, kr) | |
Parameter('Glucose_0', 20) | |
Initial(Glucose(), Glucose_0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment