Simbiology: using a dummy species to fit data to a sum of real species with sbiofit

1 view (last 30 days)
Hello,
Let's say I have a model with two species:
addspecies('compartment1',s1,'InitialAmount',100,'InitialAmountUnits','nanomole')
addspecies('compartment1',s2,'InitialAmount',50,'InitialAmountUnits','nanomole')
and now I am trying to fit a trace 'DATA' to the sum of these two species using sbiofit. I thought I could simply do this in two steps:
1) add a dummy species to track the sum
addspecies('compartment1',sDummy,'InitialAmount',0,'InitialAmountUnits','nanomole')
addrule(model,'sDummy = compartment1.s1 + compartment1.s2')
2) and then in my sbiofit, do a responseMap as follows to map the sum to my data:
responseMap = {'sDummy = DATA'};
However, I can't even get past step 1. Every time I add my sDummy species to the model and add that rule, it simply zeros out species1 and species2, it's very bizarre.
My questions are:
  • Does adding a dummy species work the way I have described above, or is my conception of using addrule to do that wrong to begin with?
  • is there a better way altogether to fit my data to a sum of species?

Accepted Answer

Arthur Goldsipe
Arthur Goldsipe on 29 Oct 2018
I think your idea is reasonable. I believe the problem is with the rule you added. As written, addrule adds an initial assignment rule to the model, which is only evaluated at time=0. If you want the rule to be in effect at all times, then you need to create a repeated assignment rule. You can do that by changing the line of code to the following:
addrule(model,'sDummy = compartment1.s1 + compartment1.s2', 'repeatedAssignment');
If that doesn't solve the problem, let us know here.

More Answers (0)

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!