How do I enter time into a SimBiology model?

6 views (last 30 days)
I am trying to model exponential growth in the SimBiology Toolbox, but I am not sure how to add time to the model.
For example, I am trying to model exponential growth using the following equation:
 
a(t) = a(0)*exp(k*t)
However, as soon as I add 't' to the equation, it gives me error messages.
How do I enter time into a SimBiology model?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 12 Mar 2018
In order to add simulation time into SimBiology models, use the variable "time".  This is case-sensitive and recognized by the simulator.
If you want to translate the model above into an an equivalent system of reactions in SimBiology, please refer to the steps below.
The SimBiology toolboxes uses ordinary differential equations (ODEs) to represent the rate of reactions as functions of the concentration of individual species. You need to convert your rate equation into a differential equation in order to enter it into a SimBiology model.
For example, in order to model exponential growth, you can convert your growth equation into the following differential equation:
da/dt = k1*a
So the rate of change of the concentration of 'a' is directly proportional to the concentration of 'a'.
You can follow these steps to build a simple model of exponential growth using the SimBiology Toolbox:
  1. Open the SimBiology desktop by executing 'simbiology' in the MATLAB Command Window.
  2. On the Home tab, select Add Model then *Create New Blank Model*. Name the model when prompted.
  3. If you are not already in Diagram mode, change the model view from Full to Diagram on the Model tab.
  4. Drag and drop one species block and one reaction block inside the cell compartment.
  5. Connect the species block to the reaction block by holding down 'ctrl', clicking on the species and dragging to the reaction.
  6. Double-click on the species to edit its properties.
  7. Change the Name *of the species to 'species' and enter a non-zero value for your initial species concentration (*InitialAmount) (such as 1.0).
  8. Double-click on the reaction to edit its properties.
  9. Choose '*KineticLaw*' as '*MassAction*'.
  10. Change the name of the '*Forward Rate Parameter*' to 'k1' and the name of your species to 'species'.
  11. Enter a negative value (such as -1.0) for the '*Forward Rate Parameter*'. The reaction you are modeling is the decay of your species ('species -> null'), so by entering a negative number you are giving a value for exponential growth. For exponential decay, you can enter a positive value for the forward rate parameter.
  12. In the 'ReactionRate:' box at the bottom of the window, enter 'k1*species'.
This is where you are specifying your differential equation. # Click 'Close'.
Once this is done, you can run your simulation to see the exponential growth using the 'Run' button.
If you want to see the equations used in the model and verify that they are correct, you choose the 'Export' -> 'Export Model as Equations...' option.
A simple example called 'ExponentialGrowth' created using these instructions is attached to this document.

More Answers (0)

Communities

More Answers in the  SimBiology Community

Categories

Find more on Extend Modeling Environment in Help Center and File Exchange

Products


Release

R2013b

Community Treasure Hunt

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

Start Hunting!