Closed bgoli closed 7 years ago
I'll generate one or two test cases for this but otherwise it seems to be working
OK I've refined this a bit so that only "simple" distributions can be used, here is an example of the distributions that I have implemented that can be used directly in the input file as random.*
Here is an example input file to illustrated its use (an attempted SDE)
FIX: X0 X4 S3
R1: X0 = S1 (Vf1(X0/Ks1) - Vr1(S1/Kp1))/(1 + X0/Ks1 + S1/Kp1)
R2: S1 = S2 (Vf2(S1/Ks2) - Vr2(S2/Kp2))/(1 + S1/Ks2 + S2/Kp2)
R3: S2 = S3 random.gauss(S2, 0.1)
R4: S3 = X4 S3*lognormal
!F lognormal = random.lognormvariate(2,1)*0.1
X0 = 10.0 X4 = 1.0
lognormal = 0
Vf1 = 10.0 Vr1 = 1.0 Ks1 = 1.0 Kp1 = 1.0
Vf2 = 10.0 Vr2 = 1.0 Ks2 = 1.0 Kp2 = 1.0
Vf3 = 1.0 Ks3 = 1.0
S1 = 1 S2 = 1 S3 = 1
I've committed this to 0.9.5
I've added support for functions from the Python random module in the random branch, this allows statements like:
random.lognormvariate(2,1)
random.uniform(1,3)
to be used directly in the input file. This will also be useful for StochPy.