Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error for the simulation example in the readme #63

Closed
johannesnicolaus opened this issue Sep 30, 2021 · 3 comments
Closed

Error for the simulation example in the readme #63

johannesnicolaus opened this issue Sep 30, 2021 · 3 comments

Comments

@johannesnicolaus
Copy link
Contributor

The following error was produced when running the example in the readme

RuntimeWarning: invalid value encountered in double_scalars
  + (y[V.Fn] / x[C.KF31]) ** x[C.nF31]

The code:

from biomass import Model, optimize
from biomass.models import Nakakuki_Cell_2010

model = Model(Nakakuki_Cell_2010.__package__).create()
run_simulation(model, viz_type="average", stdev=True)

I think it is caused by an undefined parameter and thus, I propose changing the model used in the exampleto another model that does not require manual input of parameters, or to pre-input the default parameter for the model.

Please let me know if this is a misunderstanding.

@himoto
Copy link
Contributor

himoto commented Sep 30, 2021

Hi @johannesnicolaus,

Did you perform parameter estimation using optimize() function before running run_simulation(model, viz_type="average", stdev=True)?
You need optimized parameter sets to visualize simulation results like this.

You can get them by running:

from biomass import Model, optimize
from biomass.models import Nakakuki_Cell_2010

model = Model(Nakakuki_Cell_2010.__package__).create()

optimize(model, x_id=range(1, 11))  # getting 10 parameter sets

then, visualize results through:

from biomass import run_simulation

run_simulation(model, viz_type="average", stdev=True)

Cheers,

Hiroaki

@johannesnicolaus
Copy link
Contributor Author

I see, so basically just a misunderstanding. Thanks!

@himoto
Copy link
Contributor

himoto commented Sep 30, 2021

Anytime!

@himoto himoto closed this as completed Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants