def build_tvb_model(model_configuration, zmode=numpy.array("lin")): # We use the opposite sign for K with respect to all epileptor models K = -model_configuration.K model_instance = Epileptor(x0=model_configuration.x0, Iext=model_configuration.Iext1, Iext2=model_configuration.Iext2, Ks=K, c=model_configuration.yc, a=model_configuration.a, b=model_configuration.b, d=model_configuration.d, aa=model_configuration.s) return model_instance
def build_tvb_model(model_configuration): # We use the opposite sign for K with respect to all epileptor models K = -model_configuration.K model_instance = Epileptor(x0=model_configuration.x0, Iext=model_configuration.Iext1, Iext2=model_configuration.Iext2, Ks=K, c=model_configuration.yc, a=model_configuration.a, b=model_configuration.b, d=model_configuration.d, aa=model_configuration.s, tt=model_configuration.tau1, r=1.0 / model_configuration.tau0) return model_instance
def build_tvb_model(model_configuration, a=1.0, b=3.0, d=5.0, zmode=numpy.array("lin")): x0_transformed = calc_rescaled_x0(model_configuration.x0_values, model_configuration.yc, model_configuration.Iext1, a, b - d, zmode=zmode) model_instance = Epileptor(x0=x0_transformed, Iext=model_configuration.Iext1, Ks=model_configuration.K, c=model_configuration.yc) return model_instance
def test_models_list(self): all_models_for_ui = get_ui_name_to_model() models_form = SimulatorModelFragment() simulator = Simulator() simulator.model = Epileptor() models_form.fill_from_trait(simulator) html = str(models_form) soup = BeautifulSoup(html) select_field = soup.find_all('select') assert len( select_field) == 1, 'Number of select inputs is different than 1' select_field_options = soup.find_all('option') assert len(select_field_options) == len( all_models_for_ui ), 'Number of select field options != number of models' select_field_choice = soup.find_all('option', selected=True) assert len(select_field_choice) == 1 assert 'Epileptor' in select_field_choice[0].attrs['value']
def build_tvb_model(hypothesis, variables_of_interest=["y3 - y0", "y2"], a=1.0, b=3.0, d=5.0, zmode="lin"): x0_transformed = calc_rescaled_x0(hypothesis.x0, hypothesis.yc, hypothesis.Iext1, a, b - d, zmode=zmode) model_instance = Epileptor(x0=x0_transformed.flatten(), Iext=hypothesis.Iext1.flatten(), Ks=hypothesis.K.flatten(), c=hypothesis.yc.flatten(), variables_of_interest=variables_of_interest) return model_instance
"EpileptorDP": EpileptorDP._nvar, "EpileptorDPrealistic": EpileptorDPrealistic._nvar, "EpileptorDP2D": EpileptorDP2D._nvar } EPILEPTOR_MODEL_TAU1 = { "JavaEpileptor": JavaEpileptor.tt, "Epileptor": EpileptorDP().tau1, "EpileptorDP": EpileptorDP().tau1, "EpileptorDPrealistic": EpileptorDPrealistic().tau1, "EpileptorDP2D": EpileptorDP2D().tau1 } EPILEPTOR_MODEL_TAU0 = { "JavaEpileptor": 1.0 / JavaEpileptor.r, "Epileptor": 1.0 / Epileptor().r, "EpileptorDP": EpileptorDP().tau0, "EpileptorDPrealistic": EpileptorDPrealistic().tau0, "EpileptorDP2D": EpileptorDP2D().tau0 } model_noise_intensity_dict = { "Epileptor": numpy.array([0., 0., 5e-6, 0.0, 5e-6, 0.]), "JavaEpileptor": numpy.array([0., 0., 5e-6, 0.0, 5e-6, 0.]), "EpileptorDP": numpy.array([0., 0., 5e-6, 0.0, 5e-6, 0.]), # x0_t K_t slope_t Iext1_t Iext2_T "EpileptorDPrealistic": [2.5e-4, 2.5e-4, 2e-6, 1e-7, 1e-7, 1e-5, 1e-5, 1e-5, 1e-5, 1e-5, 1e-5],
def build_EpileptorDPrealistic(**kwargs): # We use the opposite sign for K with respect to all epileptor models model_instance = Epileptor(**kwargs) return model_instance