Exemplo n.º 1
0
def eqtn_fparams_vars(x0_var,
                      slope_var,
                      Iext1_var,
                      Iext2_var,
                      K_var,
                      x0,
                      slope,
                      Iext1,
                      Iext2,
                      K,
                      tau1,
                      tau0,
                      pmode="const",
                      z=None,
                      g=None):

    fx0 = eqtn_fx0(x0_var, x0, tau1)

    from tvb_epilepsy.tvb_api.epileptor_models import EpileptorDPrealistic
    slope_eq, Iext2_eq = EpileptorDPrealistic.fun_slope_Iext2(
        z, g, pmode, slope, Iext2)

    fslope = eqtn_fslope(slope_var, slope_eq, tau1)

    fIext1 = eqtn_fIext1(Iext1_var, Iext1, tau1, tau0)

    fIext2 = eqtn_fIext2(Iext2_var, Iext2_eq, tau1)

    fK = eqtn_fK(K_var, K, tau1, tau0)

    return fx0, fslope, fIext1, fIext2, fK
def build_ep_11sv_model(model_configuration, zmode=numpy.array("lin"), pmode=numpy.array("z")):
    # We use the opposite sign for K with respect to all epileptor models
    K = -model_configuration.K
    model = EpileptorDPrealistic(x0=model_configuration.x0, Iext1=model_configuration.Iext1,
                                 Iext2=model_configuration.Iext2, K=K, yc=model_configuration.yc,
                                 a=model_configuration.a, b=model_configuration.b, d=model_configuration.d,
                                 s=model_configuration.s, gamma=model_configuration.gamma, zmode=zmode, pmode=pmode)

    return model
def build_ep_11sv_model(model_configuration, zmode=numpy.array("lin")):
    x0_transformed = calc_rescaled_x0(model_configuration.x0_values,
                                      model_configuration.yc,
                                      model_configuration.Iext1)
    model = EpileptorDPrealistic(x0=x0_transformed,
                                 Iext1=model_configuration.Iext1,
                                 K=model_configuration.K,
                                 yc=model_configuration.yc,
                                 zmode=zmode)

    return model
Exemplo n.º 4
0
def symbol_eqtn_fIext2(n, pmode=array("const"), shape=None):

    Iext2_var, z, g, Iext2, tau1, vars_dict = symbol_vars(n, ["Iext2_var", "z", "g", "Iext2", "tau1"], shape=shape)

    from tvb_epilepsy.tvb_api.epileptor_models import EpileptorDPrealistic
    Iext2_eq = EpileptorDPrealistic.fun_slope_Iext2(z, g, pmode, 0.0, Iext2)[1]

    fIext2 = Array(eqtn_fIext2(Iext2_var, Iext2_eq, tau1))

    vars_dict["pmode"] = pmode

    if pmode=="z":
        fIext2_lambda = lambdify([Iext2_var, z, tau1], fIext2, "numpy")
    elif pmode == "g":
        fIext2_lambda = lambdify([Iext2_var, g, tau1], fIext2, "numpy")
    elif pmode == "z*g":
        fIext2_lambda = lambdify([Iext2_var, z, g, tau1], fIext2, "numpy")
    else:
        fIext2_lambda = lambdify([Iext2_var, Iext2, tau1], fIext2, "numpy")

    return fIext2_lambda, fIext2, vars_dict
Exemplo n.º 5
0
def symbol_eqtn_fslope(n, pmode=array("const"), shape=None):

    slope_var, z, g, slope, tau1, vars_dict = symbol_vars(n, ["slope_var", "z", "g", "slope", "tau1"], shape=shape)

    from tvb_epilepsy.tvb_api.epileptor_models import EpileptorDPrealistic
    slope_eq = EpileptorDPrealistic.fun_slope_Iext2(z, g, pmode, slope, 0.0)[0]

    fslope = Array(eqtn_fslope(slope_var, slope_eq, tau1))

    vars_dict["pmode"] = pmode

    if pmode=="z":
        fslope_lambda = lambdify([slope_var, z, tau1], fslope, "numpy")
    elif pmode == "g":
        fslope_lambda = lambdify([slope_var, g, tau1], fslope, "numpy"),
    elif pmode == "z*g":
        fslope_lambda = lambdify([slope_var, z, g, tau1], fslope, "numpy")
    else:
        fslope_lambda = lambdify([slope_var, slope, tau1], fslope, "numpy")

    return fslope_lambda, fslope, vars_dict