Example #1
0
    # This is the 20% increase from the original parameter values - not needed in real cases
    factor = 1.2

    builder_est = TemplateBuilder()

    builder_est.add_complementary_state_variable('T', 293.15)
    builder_est.add_complementary_state_variable('Tc', 293.15)

    builder_est.set_odes_rule(rule_odes)

    for com in components:
        builder_est.add_mixture_component(com.name, com.init)

    for param in parameters:
        builder_est.add_parameter(param.name,
                                  bounds=param.bounds,
                                  init=param.init * factor)

    # New method to add state variance to the model builder
    builder_est.add_state_variance(noise)

    # New method to add times like everything else
    builder_est.set_model_times(times)

    est_param = EstimationPotential(builder_est,
                                    exp_data,
                                    simulation_data=results,
                                    verbose=True)
    est_param.estimate()
    est_param.plot_results()
Example #2
0
    data_filename = 'dow_data.csv'
    dataDirectory = Path(Path(__file__).resolve().parent, data_directory)
    filename = dataDirectory.joinpath(data_filename)
    Z_data = read_concentration_data(filename)

    factor = 1.2
    builder_est = TemplateBuilder()
    builder_est.set_odes_rule(rule_odes)

    noise = {c.name: c.sigma * 1 for c in components}

    for c in components:
        Z_data[c.name] = add_noise_to_signal(Z_data[c.name],
                                             np.sqrt(noise[c.name]))

    builder_est.add_state_variance({k: np.sqrt(v) for k, v in noise.items()})

    for com in components:
        builder_est.add_mixture_component(com.name, com.init)

    for param in kinetic_parameters:
        builder_est.add_parameter(param.name,
                                  bounds=param.bounds,
                                  init=param.init * factor)

    # New method to add state variance to the model builder
    builder_est.add_state_variance(noise)
    # New method to add times like everything else
    builder_est.set_model_times(times)

    est_param = EstimationPotential(builder_est,