Writing expression as function of time

Nicky on 21 Jun 2023
Latest activity Reply by Arthur Goldsipe on 23 Jun 2023

I am trying to simulate model of blood lymphocyte count from a paper using Simbiology. The rate of in or out following circadian rythym is kp(t)=km + kb cos [(t-tpeak)*2pi/24] Where and how do I write the expression ? I dont think I can write in repeated assignment ?
Nicky
Nicky on 22 Jun 2023
Hi Arthur,
Thanks for the help. I have a follow up questions. Since the species base line (Lymphocyte) is changing according to the rate of kp, how do I expres % Inhibition of lymphocyte count if I have drug ? I normally express species_intial = constant then %inhibition = (species intial- species)/species_initial *100, but now species initial is a fuction of time. How do i define the baseline as fuction of time ?
Arthur Goldsipe
Arthur Goldsipe on 22 Jun 2023
I can think of a couple of options, but it really depends on how you need to use % inhibition.
Is % inhibition used to calculate anything else in the model? If not, you can calculate % inihibition with an observable. In that case, the expression is a calculation using the entire time course vector of species values. So you could use an expression of the form "(species(1)-species)/species(1)*100", since species(1) would refer to the initial condition.
Another option would be to create a parameter to store the initial value of the species using an initial assignment rule, and then reference this parameter in a repeated assignment. So the initial assignment would just be "species_initial = species", and then the repeated assignment would be pretty much what you wrote in your comment above.
Does that make sense?
Nicky
Nicky on 23 Jun 2023
Hi Arthur,
Yes the % inhibition will be used for calculating other species response. If I input "species_initial = species" in "Initial Assgnment". Simbiology seem to refer species_initial = species at time 0, not the values over the simulation time. Now I cant put that "repeated assignment" since the inhibition expression will be 0.
Arthur Goldsipe
Arthur Goldsipe on 23 Jun 2023
I guess I misunderstood your question. I thought species_initial was supposed to represent the value of species at time=0. Can you clarify what you want to do? Ideally, I would like to see the detailed mathemtical equations that describe your model. And then I could help you figure out how to implement them in SimBiology.
I worry a bit about the difficulty of using this medium to solving a problem like this that requires so much back-and-forth. Feel free to contact me via my MathWorks profile, if you want to look into other options. And you can also contact MathWorks Technical Support.
Arthur Goldsipe
Arthur Goldsipe on 21 Jun 2023
You should be able to implement this circadian rhythm using a repeated assignment. One thing to note is that you represent time in SimBiology expressions as "time" rather than as "t". You will also need to write your mathemtical expression in MATLAB syntax. So it might look something like this: kp = km + kb*cos((time-tpeak)*2*pi/24)
Nicky
1
Post
2
Replies

Tags

No tags entered yet.