예제 #1
0
# import Hybrid Solver

from pyme.Hybrid_FSP import Hybrid_FSP_solver

"""
("S_1 = Zombies","S_2 = People")
* S_1 is considered stochastic 
* S_2 will be approximated by marginal distributions
"""
stoc_vector = np.array([True,False]) 

# initialising the Hybrid Solver
Zombie_solver = Hybrid_FSP_solver(Zombie_model,stoc_vector,"MRCE",1e-7)
Zombie_solver.set_initial_values(Zombie_OFSP.domain_states,Zombie_OFSP.p,t=Zombie_OFSP.t)


T = np.arange(Zombie_OFSP.t,2.0,0.1)

for t in T:
	Zombie_solver.step(t)
	Zombie_solver.print_stats

Zombie_solver.plot()







예제 #2
0
####### Hybrid Solver Class ########

from pyme.Hybrid_FSP import Hybrid_FSP_solver

### Hybrid MRCE Computation
stoc_vector = np.array([True,False,False,True])
"""
Templetes and Virons are stochastic.
Genome and Structures are modelled by conditional / marginal expectations.
"""


MRCE_obj = Hybrid_FSP_solver(Viral_D_model,stoc_vector,"MRCE",1e-7,jac=Jac_Mat)
MRCE_obj.set_initial_values(OFSP_obj.domain_states,OFSP_obj.p,t=0.005)

for t in T:
	MRCE_obj.step(t)
	MRCE_obj.print_stats
	MRCE_obj.plot(inter=True)

### Hybrid HL Computation

HL_obj = Hybrid_FSP_solver(Viral_D_model,stoc_vector,"HL",1e-7)
HL_obj.set_initial_values(OFSP_obj.domain_states,OFSP_obj.p,t=0.005)
for t in T:
	HL_obj.step(t)
	HL_obj.print_stats


예제 #3
0
Author Vikram Sunkara
"""
import numpy as np

#import model
from Zombie_model import *

# import Hybrid Solver

from pyme.Hybrid_FSP import Hybrid_FSP_solver
"""
("S_1 = Zombies","S_2 = People")
* S_1 is considered stochastic 
* S_2 will be approximated by marginal distributions
"""
stoc_vector = np.array([True, False])

# initialising the Hybrid Solver
Zombie_solver = Hybrid_FSP_solver(Zombie_model, stoc_vector, "MRCE", 1e-7)
Zombie_solver.set_initial_values(Zombie_OFSP.domain_states,
                                 Zombie_OFSP.p,
                                 t=Zombie_OFSP.t)

T = np.arange(Zombie_OFSP.t, 2.0, 0.1)

for t in T:
    Zombie_solver.step(t)
    Zombie_solver.print_stats

Zombie_solver.plot()