Created
September 20, 2013 15:02
-
-
Save FedericoV/6638875 to your computer and use it in GitHub Desktop.
Assimulo vs odeint comparison
This file contains hidden or 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
exp_sim.iter = 'Newton' | |
exp_sim.discr = 'BDF' | |
exp_sim.rtol = 1e-4 | |
exp_sim.atol = 1e-4 | |
#exp_sim.pbar = [1,1,1] #pbar is used to estimate the tolerances for the parameters | |
exp_sim.report_continuously = True #Need to be able to store the result using the interpolate methods | |
exp_sim.sensmethod = 'SIMULTANEOUS' #Defines the sensitvity method used | |
exp_sim.suppress_sens = True | |
exp_sim.verbosity = 50 | |
t_scipy = 0 | |
t_assi = 0 | |
t_sim = np.linspace(0, 32400, 3240) | |
for p53_exp in p53_experiments: | |
# Wrapper around SciPy odeint | |
t_init_scipy = time() | |
y_sim = p53_exp.simulate_model(model, global_param_vector, | |
init_conditions = np.zeros(6,), | |
t_sim = t_sim) | |
t_scipy += time() - t_init_scipy | |
t_init_assi = time() | |
# Wrapper around Assimulo | |
(assi_t, assi_y, sens) = p53_exp.simulate_assimulo_model(exp_sim, | |
global_param_vector, | |
init_conditions = np.zeros(6,), | |
t_sim = None, calculate_sensitivity = True) | |
t_assi += time() - t_init_assi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment