Compute time course until an event is triggered

18 views
Skip to first unread message

Marc Lefranc

unread,
Apr 4, 2025, 12:31:49 PMApr 4
to COPASI User Forum
Hi all,

I am playing with basico and this is a very useful addition to Copasi. 

I am simulating oscillations reactions (actually circadian clocks) and I would like to define the time at which an event is triggered as time 0 (beginning of the cycle)

To achieve this, I was trying to see if I could have run_time_course to stop when the event is triggered and use the resulting state as new initial condition for subsequent calculations.

Is there a way to do it ?

I do not think that setting time to zero when the event is triggered would be a good idea, is it ? 

Thank you in advance,
best regards.

Frank Bergmann

unread,
Apr 8, 2025, 7:54:20 AMApr 8
to COPASI User Forum
Hello Marc, 

You could try the following:

- create an additional event assignment for your event, that will set the time to a variable (say newStart). read the value of newStart
- run another time course simulation until newStart, ensuring that update_model=True (that will cause the initial values of your model to be update)
- ensure that the event has the flag `fire_at_initial_time=True`, otherwise it will not fire at t=0

save the resulting model. And it should be what you want, I think. 

best
Frank

Reply all
Reply to author
Forward
0 new messages