MATLAB: How to fit a SimBiology model with data generated in different experimental conditions

SimBiologyvariants

I have a model built in SimBiology for different experiment design using dummy variables (e.g. IND = 1 or 0) for each data set from different conditions, which I treated each set as a group. For example, one of these ODEs is: d(A)dt = kf*A*(1-IND). When I added data, in the dataset, besides TIME as an independent variable, ID as group variable, and Y as a dependent variable, I put a column called IND as an indicator for each group. However, I couldn't map IND as any default setting for this variable. Next, I opened MODEL MODIFIERS to add Variants and select IND as a variant, with Type as a parameter. Value as 0, Model Value as 1. Then I ran the Task Fit Data, I selected IND as Variants to apply. The results did not look good for all ID groups. I don't know if SimBiology can read the value of IND in my dataset for each group, and how this is related to the Variant that I set up for the model. Bottom line, if I did it right. Thanks for your answers/comments,

Best Answer

Hi,
Your question is conceptually similar to this one. As I mentioned there, you cannot directly alter a model parameter based on data when doing a fit. Today (that is, as of R2016b), the data can only alter the dosing on each patient.
This does mean that you might be able to work around the limitation if you change the model so that dosing gives you the desired effect on the model. Here's one way you could do this:
  1. Change IND from a parameter to a species, and set its initial amount to 0. This allows you to change the value of IND based on dosing information in your data.
  2. Update the IND column for each ID in your data so that it's 0 or 1 (as appropriate) when TIME=0 and NaN when TIME>0.
  3. Update the dosing information in your Fit Task so that the data column named IND is interpreted as dosing for the species IND in your model.
Note that if you are using dimensional analysis or unit conversion, you may need to update your reaction rate involving IND to ensure that it's dimensionally consistent. For example, let's assume that parameter IND was originally dimensionless, and when you changed it to species IND you set the units to "mole." Then add a dummy species IND0 with the same units and an initial amount of 1. Then change the rate to kf*A*(1-IND/IND0).
Hopefully that all makes sense. If you have any followup questions, feel free to contact me directly since I don't get notified when comments are added to existing questions.
Good luck!
-Arthur