Repeated assignment with measured variable
Latest activity Reply by Tetiana Slavnikova
on 12 Nov 2022
Dear community,
I would like to develop a fermentation model with 4 ODEs, one of which contains variable y. A "repeated assignment", e. g. y=5x+5, contains variable x that has been measured each second. These data (columns with time and corresponding value x in each row) are recorded in the Excel file.
Does anyone have any suggestion how to implement this in symbiology?
Thank you very much in advance,
Tetiana
6 Comments
Time DescendingHi Tetiana,
You can do this by creating a repeated assignment for x that calls a function to do linear interpolation of the reported experimental values of x. The steps would be:
- create a function, lets say myfunction, to do linear interplotion of experimentally measured values of x
- create a repeated assignment for x that calls this custom function, such as: x = myfunction(time).
Please see this example for an example of this forcing function strategy. Here, the values of Plasma Ins Conc, Glu Prod, and Glu Appear Rate are controlled by repeated assignments that call such functions.
If you type edit PlasmaInsulin in MATLAB command-line you can inspect an example external function for interpolation.
Please note that we recommend that the inputs and outputs to custom functions used in SimBiology models to be dimensionless and that's the approach taken in the example I reference above.
Fulden
Sign in to participate