Simulating periodic input functions

27 views
Skip to first unread message

Sebastián

unread,
Oct 25, 2024, 6:49:18 PM10/25/24
to COPASI User Forum
Hi community,

I am trying to simulate a system where the input is ON for a given t_on time (e.g., 10 s) and then OFF for a given t_off time (e.g., 90 s), such that this cycle takes a total time of T = t_on + t_off (e.g., 100 s).

This is repeated throughout the process. I am currently trying events, though I am wondering if there is a more efficient way to approach this problem. Specifically, I am looking for a function that I can write directly in COPASI such that it approximates the explained behavior without using events. That is, I am looking for a function where I can specify t_on and t_off and I simulate the process at once, in a straightforward manner.

Thank you!

Best,
Sebastian

Pedro Mendes

unread,
Oct 28, 2024, 9:18:53 AM10/28/24
to copasi-u...@googlegroups.com
*** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. ***

Hi Sebastián,

Events is the most efficient way of doing this. You could define a
function with "if" statements but internally it gets converted to events
anyway. Events make it more explicit

I had previously created a file to demonstrate how to do this type of
thing, called "PulsedDrug.cps" which you can download from my models
repository at https://github.com/pmendes/models

This model shows how to turn on and off something by using a combination
of global quantities and events. Basically one event to turn on, and
another to turn off. This model uses on/off to add an inhibitor but you
can do anything (ie change any parameter or variable at the on time, and
then again at the off time). The events keep adding the correct times so
that they keep being triggered at the right times. You can adjust the
amount of time for the ON condition, as well as how long you want the
OFF condition.

There is another model called "PulsedDrugLadder.cps" which shows how to
make the actions at the ON time different every time (in this case a
simulating a drug dose ladder)

Let me know if this helps.

Pedro

On 10/25/24 18:49, Sebastián wrote:
> Hi community,
>
> I am trying to simulate a system where the input is ON for a given t_on
> time (e.g., 10 s) and then OFF for a given t_off time (e.g., 90 s), such
> that this cycle takes a total time of T = t_on + t_off (e.g., 100 s).
>
> This is repeated throughout the process. I am currently trying /events/,
> though I am wondering if there is a more efficient way to approach this
> problem. Specifically, I am looking for a function that I can write
> directly in COPASI such that it approximates the explained behavior
> without using events. That is, I am looking for a function where I can
> specify t_on and t_off and I simulate the process at once, in a
> straightforward manner.
>
> Thank you!
>
> Best,
> Sebastian
>
> --
> You received this message because you are subscribed to the Google
> Groups "COPASI User Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to copasi-user-fo...@googlegroups.com
> <mailto:copasi-user-fo...@googlegroups.com>.
> To view this discussion visit
> https://groups.google.com/d/msgid/copasi-user-forum/fd419ec3-d5a3-45ae-b377-bb312467fcc5n%40googlegroups.com <https://groups.google.com/d/msgid/copasi-user-forum/fd419ec3-d5a3-45ae-b377-bb312467fcc5n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Pedro Mendes, PhD
Professor and Director
Richard D. Berlin Center for Cell Analysis and Modeling
University of Connecticut School of Medicine
group website: http://www.comp-sys-bio.org

Sebastián

unread,
Oct 29, 2024, 10:52:00 AM10/29/24
to COPASI User Forum
Hi Pedro,

Thanks for sharing this!

I have been able to simulate the events as desired. The time course task works fine.  The problem comes when I want to run parameter estimation of my ODE system. It seems the nature of these input events makes the parameter estimation very challenging and slow (takes like 2-3 hours to get around 500-1000 function evaluations using particle swarm). Perhaps the problem deals with the stiffness and rapid changes of the input, which makes integration challenging. Just to give you an idea, my system can experience cycles of even 50 s ON, 950 s OFF, and this is repeated over more than 15 hours. I plan to approximate the input as combinations of sigmoid functions. Maybe that helps with the parameter estimation.

Best,
Sebastian
Reply all
Reply to author
Forward
0 new messages