Closed hareball90 closed 5 years ago
The plot function does not give an output.
from pygom import DeterministicOde, Transition, TransitionType import numpy as np
from pygom import DeterministicOde, Transition, TransitionType
import numpy as np
states= ['S', 'I', 'R'] params = {'beta':0.3, 'gamma':0.5} t = np.arange(0, 100, 0.5) transitions = [Transition(origin='S', destination='I', equation='beta*S*I', transition_type='T'), Transition(origin='I', destination='R', equation='gamma*I', transition_type='T')]
states= ['S', 'I', 'R']
params = {'beta':0.3, 'gamma':0.5}
t = np.arange(0, 100, 0.5)
transitions = [Transition(origin='S', destination='I', equation='beta*S*I', transition_type='T'),
Transition(origin='I', destination='R', equation='gamma*I', transition_type='T')]
model = DeterministicOde(states, params, transition=transitions) model.get_ode_eqn() model.initial_values = ([95, 5, 0], t[0]) model.parameters = {'beta':0.3, 'gamma':0.5} solution, output = model.integrate(t[1::], full_output=True) model.plot()
model = DeterministicOde(states, params, transition=transitions)
model.get_ode_eqn()
model.initial_values = ([95, 5, 0], t[0])
model.parameters = {'beta':0.3, 'gamma':0.5}
solution, output = model.integrate(t[1::], full_output=True)
model.plot()
should work as of 0.1.4.dev47+g71975dd.d20190819
The plot function does not give an output.
from pygom import DeterministicOde, Transition, TransitionType
import numpy as np
states= ['S', 'I', 'R']
params = {'beta':0.3, 'gamma':0.5}
t = np.arange(0, 100, 0.5)
transitions = [Transition(origin='S', destination='I', equation='beta*S*I', transition_type='T'),
Transition(origin='I', destination='R', equation='gamma*I', transition_type='T')]
model = DeterministicOde(states, params, transition=transitions)
model.get_ode_eqn()
model.initial_values = ([95, 5, 0], t[0])
model.parameters = {'beta':0.3, 'gamma':0.5}
solution, output = model.integrate(t[1::], full_output=True)
model.plot()