Ping Pong Bi Bi and division by 0

19 views
Skip to first unread message

Nicolas Gambardella

unread,
Jan 19, 2021, 2:21:00 PM1/19/21
to COPASI User Forum

Hello,

I just noticed (well after 3 hours banging my head on my desk) that a Ping Pong Bi Bi rate law caused a division by 0 if all the involved metabolites are at 0. It seems to be the only examples in the list of predefined laws in Copasi. Did anyone bumped into this issue before? If yes, how to fix it? What would be a good "modified Ping Pong Bi Bi" that would give a rate of 0 when substrates and products are at 0?

Best regards

Hoops, Stefan (sh9cq)

unread,
Jan 19, 2021, 2:56:32 PM1/19/21
to copasi-u...@googlegroups.com
Hello Nicolas,

I remember that this was the only function where it was not possible to
avoid the division by zero. I have attached an extended COPASI Function
DB where I added the desired modified function by adding an if
statement. The modified function has the same signature and thus can be
used as a drop in replacement. Just load the attached function DB
(available under the file menu) and you are set.

Thanks,
Stefan
--
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
Ping Pong Bi Bi (modified).cpk

Nicolas Gambardella

unread,
Jan 19, 2021, 4:57:52 PM1/19/21
to copasi-u...@googlegroups.com
Thanks a lot Stefan.

The replacement works well (seamless). However I think the correct test is

if(substratea+substrateb+productp+productq != 0

and not

if(substratea*substrateb*productp*productq != 0

I made the change and everything works just fine.

Best regards

On 19/01/2021 19:56, Hoops, Stefan (sh9cq) wrote:
> Hello Nicolas,
>
> I remember that this was the only function where it was not possible to
> avoid the division by zero. I have attached an extended COPASI Function
> DB where I added the desired modified function by adding an if
> statement. The modified function has the same signature and thus can be
> used as a drop in replacement. Just load the attached function DB
> (available under the file menu) and you are set.
>
> Thanks,
> Stefan
>
>
> On Tue, 2021-01-19 at 11:21 -0800, Nicolas Gambardella wrote:
>>
>> Hello,
>>
>> I just noticed (well after 3 hours banging my head on my desk) that a
>> Ping Pong Bi Bi rate law caused a division by 0 if all the involved
>> metabolites are at 0. It seems to be the only examples in the list of
>> predefined laws in Copasi. Did anyone bumped into this issue before?
>> If yes, how to fix it? What would be a good "modified Ping Pong Bi
>> Bi" that would give a rate of 0 when substrates and products are at
>> 0?
>>
>> Best regards
>


--
aSciStance Ltd
https://ascistance.co.uk
twitter: @aSciStance
LinkedIn: aSciStance
+44 (0)7833 147074


Hoops, Stefan (sh9cq)

unread,
Jan 19, 2021, 5:04:57 PM1/19/21
to copasi-u...@googlegroups.com
You are of course right :)
Reply all
Reply to author
Forward
0 new messages