Help Needed: Discrepancy in Simulation of Equivalent Kinetic Equations

19 views
Skip to first unread message

Daniel Arismendi

unread,
Jul 30, 2025, 10:53:17 AMJul 30
to COPASI User Forum

Dear community,

I’m currently using COPASI to simulate kinetic-response models and have encountered an issue that I hope you can help me resolve.

Under the assumptions that:

  • injection1 = injection2 = 1e-8

  • targets = 1e-8

  • R = injection1 / targets = 1

I would expect the two equations, dB1/dt and dB2/dt, to produce identical time courses. Picture1.png

However, this is not the case in my simulations

example.png

I’m unsure what might be causing the discrepancy. I suspect it could be related to how I’ve defined the events, but I’m not certain.

I’ve attached the .cps file for reference. If anyone could take a look and help identify the issue, I would greatly appreciate it.

Thank you in advance!

Best regards,
Daniel Arismendi

example.cps

Hoops, Stefan (sh9cq)

unread,
Jul 30, 2025, 11:35:18 AMJul 30
to copasi-u...@googlegroups.com
Hello Daniel,

Your problem is that you do not update R during the events. The events
change injection1 and thus R must be updated too. The value would have
to be 0. However since you divide by R this leads to an invalid ODE.

I hope that helps!
Stefan


On Wed, 2025-07-30 at 07:40 -0700, Daniel Arismendi wrote:
> Dear community,
> I’m currently using COPASI to simulate kinetic-response models and
> have encountered an issue that I hope you can help me resolve.
> Under the assumptions that:
>  *
>    injection1 = injection2 = 1e-8
>  *
>    targets = 1e-8
>  *
>    R = injection1 / targets = 1
> I would expect the two equations, dB1/dt and dB2/dt, to produce
> identical time courses. Picture1.png
> However, this is not the case in my simulations
> example.png
> I’m unsure what might be causing the discrepancy. I suspect it could
> be related to how I’ve defined the events, but I’m not certain.
> I’ve attached the .cps file for reference. If anyone could take a
> look and help identify the issue, I would greatly appreciate it.
> Thank you in advance!
> Best regards,
> Daniel Arismendi

--
Stefan Hoops, Ph.D.
Research Associate Professor
Biocomplexity Institute & Initiative
University of Virginia
995 Research Park Boulevard
Charlottesville, VA 22911

Phone: +1 540 570 1301
Email: sho...@virginia.edu

Sahle, Dr. Sven

unread,
Jul 30, 2025, 1:49:14 PMJul 30
to copasi-u...@googlegroups.com
Dear Daniel, 

perhaps I am missing something obvious, but it seems to me that in the ODE for B2 the whole first term (before the „-kd*B2“) is zero if injection=0 (after the last event), while in the ODE for B1 it is not. During the injection the two ODEs seem to be equal because of your speciific choice of parameters, 

Sven


Am 30.07.2025 um 16:40 schrieb Daniel Arismendi <danielarism...@gmail.com>:

Dear community,

I’m currently using COPASI to simulate kinetic-response models and have encountered an issue that I hope you can help me resolve.

Under the assumptions that:

  • injection1 = injection2 = 1e-8

  • targets = 1e-8

  • R = injection1 / targets = 1

I would expect the two equations, dB1/dt and dB2/dt, to produce identical time courses. <Picture1.png>

However, this is not the case in my simulations

<example.png>

I’m unsure what might be causing the discrepancy. I suspect it could be related to how I’ve defined the events, but I’m not certain.

I’ve attached the .cps file for reference. If anyone could take a look and help identify the issue, I would greatly appreciate it.

Thank you in advance!

Best regards,
Daniel Arismendi


--
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.
To view this discussion visit https://groups.google.com/d/msgid/copasi-user-forum/c3d0e70a-6e7d-4561-b623-4899e6b506efn%40googlegroups.com.
<example.cps><example.png><Picture1.png>

Daniel Arismendi

unread,
Jul 30, 2025, 3:29:57 PMJul 30
to COPASI User Forum
Thank you both, 

I see the problem now, The R-parameterization is inherently problematic when [L_tot] = 0 because R loses its physical meaning.
I am wondering if it would be possible to handle with events in copasi the case of R = 0, when  [L_tot] = 0?
For example...
if [L_tot] == 0:
dB/dt = -k_d * B(t) 
else:
dB/dt = k_a * [L_tot]/R * (R - B(t)/B_max) * (B_max - B(t)) - k_d * B(t)

Thanks in advance!
Daniel

Daniel Arismendi

unread,
Aug 4, 2025, 3:40:05 PMAug 4
to COPASI User Forum
Dear all,

I managed to handle the different cases using conditional statements (see attached cps file),
Screenshot 2025-08-04 212504.png 
When using conditional statements in ODEs (like if(Time >= t_switch, equation1, equation2)), does COPASI automatically maintain state variable continuity at the switching point, or do I need to manually set initial conditions?  

Thanks in advance,
Daniel Arismendi
example.cps
Reply all
Reply to author
Forward
0 new messages