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

NaN returned in total biomass log due to default biomass parameters #53

Open
zoey-rw opened this issue May 26, 2024 · 3 comments
Open

Comments

@zoey-rw
Copy link

zoey-rw commented May 26, 2024

Screenshot 2024-05-25 at 10 37 23 PM

Total biomass log contains values of "NaN" for every model, partway through a simulation, and results/errors didn't return to sim.run_output. Happened after changing the biomassMotionStyle to "Convection 2D" (without changing default convection parameters).

@zoey-rw
Copy link
Author

zoey-rw commented May 26, 2024

This is due to the default convective-diffusion parameters causing huge amounts of biomass. For setting convective-diffusion, there are the four sets of "example" parameters throughout the code/documentation, but I can't figure out how these 4 parameters map to the biomass propagation equations described in the Protocols paper supplement. I also wasn't sure about units - e.g. do the values need to be modified if I change my "spaceWidth" parameter?

Default function parameters

mod.add_convection_parameters(1., 0.5, 2., 10.e-5)

Round colony: https://segrelab.github.io/comets-manual/circular_colony/

mod.add_convection_parameters(packedDensity = 0.5,elasticModulus = 1.e-4,frictionConstant = 1.0,convDiffConstant = 0.0)

Branching colony: https://segrelab.github.io/comets-manual/branching_colony/

mod.add_convection_parameters(packedDensity = 1.2,elasticModulus = 5.e-3,frictionConstant = 1.0,convDiffConstant = 0.0)

Petri dish: https://segrelab.github.io/comets-manual/petri_dish/

mod.add_convection_parameters(packedDensity = 0.022,elasticModulus = 1.e-10,frictionConstant = 1.0,convDiffConstant = 0.0)

@zoey-rw zoey-rw changed the title NaN returned in total biomass log NaN returned in total biomass log due to default biomass parameters May 26, 2024
@zoey-rw
Copy link
Author

zoey-rw commented May 26, 2024

Reducing the convDiffConstant parameter to "2.e-6" helped to prevent the expansion of growing biomass. The default non-growing biomass diffusion parameter of "flowDiffRate" of 1e7 also became activated when switching biomass styles - it seems this allowed microbes to increase in biomass even if their biomass had an upper bound of zero?

I couldn't figure out the effect of the packedDensity and elasticModulus parameters. Should a lower packedDensity result in more compact growth, and a higher value result in branching growth?

I think it would be useful to give a warning when the biomassMotionStyle is changed from the default, perhaps with a link to example parameters & explanations.

@zoey-rw
Copy link
Author

zoey-rw commented Aug 22, 2024

Follow up question on these 2D convection parameters, and the flowDiffRate:

Should varying the biomass diffusion parameters have any effect for a 1x1 grid layout, or should they only affect biomass spreading between multiple grid cells?

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

1 participant