How to set boundary conditions for a reaction to occur in SimBiology?

2 views (last 30 days)
Hi there!
I am building a model in SimBiology where I want to model the production gas vesicle proteins and subsequent formation of gas vesicles. Ideally, I want to model this such that there is a boundary condition where an X amount of gas vesicle proteins (or above the essential concentration) will lead to an assembly reaction.
I tried this by adding the chemical reaction: X [Gas vesicle protein] -> [Gas vesicle]
However, this leads to a negative values for the gas vesicle species. Is there a way in which I can set a condition for this reaction to occur (for example require that enough gas vesicle proteins are present in order for the reaction to be active)? Or could there maybe be a better way to solve this?
The model I'm building is a stiff model, and I am using the sundials solver.
Thank you in advance!

Accepted Answer

Arthur Goldsipe
Arthur Goldsipe on 1 Oct 2021
Take a look at this answer I shared. It's from several years ago, but the information is still accurate. Some additional tips are also listed here. As mentioned there, you might want to look at absolute tolerance scaling. If your model changes too quickly at the beginning of the simulation, you may need to turn off this feature or reduce the absolute tolerance step size.
If you can share your model, we might be able to offer more specific suggestions. For example, we can help decide whether the negative concentrations represent a modeling error, an acceptable value you can ignore, or a numerical instability that requires modifications to your model.
-Arthur (he/him)
Arthur Goldsipe
Arthur Goldsipe on 3 Oct 2021
Possibly. What's the reaction rate? We should see what happens to the rate if a concentration goes slightly negative. Sometimes this causes instabilities. Such problems can sometimes be fixed by replacing species X with max(0,X) in the rate. What happens if you do that in all rates involving any X that goes negative?

Sign in to comment.

More Answers (0)


More Answers in the  SimBiology Community




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!