def parameter_signatures(par, model, tspan, type_sign='production'):
    """

    :param par: parameter file path or vector of parameters
    :param model: PySB model
    :param tspan: time span
    :return: tropical signatures of input parameters
    """

    try:
        if isinstance(par, str):
            parames = hf.read_pars(par)
        else:
            parames = par
        drivers = run_tropical(model, tspan, parameters=parames, type_sign=type_sign, sp_visualize=None)
        return drivers
    except:
        print(par)
        print("".join(traceback.format_exception(*sys.exc_info())))
        raise Exception("".join(traceback.format_exception(*sys.exc_info())))
Beispiel #2
0
from earm.lopez_embedded import model
from max_plus_consumption_production import run_tropical
import numpy as np
import os
import helper_functions as hf

directory = os.path.dirname(__file__)
parameters_path = os.path.join(directory, "parameters_5000")
all_parameters = hf.listdir_fullpath(parameters_path)
parameters = hf.read_pars(all_parameters[0])
t = np.linspace(0, 20000,  100)

run_tropical(model, t, parameters, diff_par=1, type_sign='consumption', sp_visualize=[6])


from mm_two_paths_model import model
from max_plus_consumption_production import run_tropical
import numpy as np

tspan = np.linspace(0, 50, 501)

run_tropical(model, tspan, diff_par=0.5, type_sign='consumption', sp_visualize=[0, 5])