Info about Time Course simulation with COPASI

162 views
Skip to first unread message

Fabio de Nicolo

unread,
Jan 14, 2018, 5:29:07 AM1/14/18
to COPASI User Forum
Good morning to the community!
I am an ex-Biotechnology student who used COPASI some years ago, and made some simulations with the nice Schlögl network (deterministic model), which is normally referred to as an example of bistable system.
The thing is, I wanted to run some simulations (see attached images n° 1-3) but I can only define a fixed initial [X], while I remember that when I was in university I could set a range of [X] to run the simulations with such variable parameter (see attached image n° 4).
Do you know if it is still possible to do this with COPASI? How?
Thanks,
Fabio de Nicolo (Milan, Italy)
1.Simulation - Initial concentrations.png
2.Simulation - Time Course.png
3.Simulation - Output plot.png
4.Simulation - Old Graph.png

Fabio de Nicolo

unread,
Jan 14, 2018, 5:56:25 AM1/14/18
to COPASI User Forum
Hello again,
I found the "Parameter Scan" task and now I know it is still possible to run simulations with variable initial [X].
Now, second problem: I wanted to reach a high level of detail, but apparently the current program release allows to a precision of 5 decimal digits only (see attached images n° 5-6, n° 6 was captured just after changing the current window for a while after writing the parameters seen in n° 5), while in the past it was much higher (see image n° 7, an old graph produced with COPASI, I think v. 4.8).
Can you confirm the precision level is now lower than some years ago? Am I doing something wrong?
Thanks,
Fabio de Nicolo
5.Simulation - Input parameters.png
6.Simulation - Rounded parameters.png
7.Simulation - Old Graph.png

Melanie Stefan

unread,
Jan 14, 2018, 6:45:13 AM1/14/18
to copasi-u...@googlegroups.com

Hi Fabio,

You can get more precision by increasing the number of intervals in your parameter scan. At the moment, you are sampling 10 concentrations between your "min" and your "max" value. But if you increase that number, you can sample more concentrations and therefore smaller concentration increments. Would that work?

Melanie

--
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 post to this group, send email to copasi-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/copasi-user-forum/80baae60-dab4-4587-acb8-a5080ee43a75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fabio de Nicolo

unread,
Jan 14, 2018, 12:05:30 PM1/14/18
to COPASI User Forum
Hi Melanie, thanks for your suggestion; it worked somehow!
Apparently, the input decimal precision can be up to 8 digits (I was able to run simulations with initial [X] ranging from 1.01963357 to 1.01963358, in 60 and 200 intervals).
The nice outcome of the plot is attached.
I would say that either COPASI has some limitations, or the Schlögl network in reality is tri-stable!
According to the graphs, it looks like with initial [X] roughly comprised between 1.0196335738 and 1.0196335758, it doesn't change over the time.
Do you agree on this?
Kindly,
Fabio de Nicolo
8.Simulation - Input parameters.png
9.Simulation - Output plot.png
10.Simulation - Output plot (zoom).png
11.Simulation - Output plot (50 sec).png
12.Simulation - Output plot (50 sec, zoom).png
13.Simulation - Output plot (200 intervals).png
14.Simulation - Output plot (200 intervals, zoom up).png
15.Simulation - Output plot (200 intervals, zoom down).png

Frank Bergmann

unread,
Jan 15, 2018, 8:46:22 AM1/15/18
to COPASI User Forum
Hello Fabio, 

thanks for letting us know, I can confirm that the current COPASI versions indeed use a lower precision in the front end. I have committed a fix to our repository, and it will be solved in our next release. In the meantime the only work around would be to use assignment expressions and scan over ranges that require only 6 digits precision to circumvent this issue. 

best
Frank

Fabio de Nicolo

unread,
Jan 19, 2018, 3:16:51 PM1/19/18
to COPASI User Forum
Thank you Frank fro your your feedback!
What is going to be next COPASI release? 4.23? Do you know when will it be released?
Last two questions: what is going to be the front end/back end decimal precision in the next release? Still 8 digits or more?
Finally, do you know the Schlögl network? In your opinion, can it have a steady state with a constant [X] over time, or is it a false outcome given by the software limitations?
Kind regards,
Fabio de Nicolo

Frank Bergmann

unread,
Jan 22, 2018, 2:45:46 AM1/22/18
to COPASI User Forum
Hello Fabio, 

the way I committed it, all double/float values that can be modified by the user interface will have a default precision of 10, however, you will be able to modify that in the preferences in the next version, so that you could change it. This can be useful in cases, where you want to really look into numerical artifacts (which are bound to occur at higher levels of precision). I'm not sure when the next release will be done. If you cannot wait please contact me with your os / architecture of choice and I will be able to provide an experimental build. 

I am, not familiar with the schloegl network and could not find a reference to it by googling so i cannot comment on that. 

cheers
Frank

juergen

unread,
Jan 22, 2018, 9:04:04 AM1/22/18
to COPASI User Forum
Hello Fabio,

The Schlögl model has three steady states, with the highest and lowest stable and the one in the middle unstable.

Please confer the original publication:
@Article{schloegl_72,                                                                                                                                                                                                                 
author = "F. Schl{\"o}gl",                                                                                                                                                                                                            
title = "Chemical Reaction Models for Non-Equilibrium Phase Transitions",                                                                                                                                                             
journal = "Z. Physik",                                                                                                                                                                                                                
volume = "253",                                                                                                                                                                                                                       
number = "2",                                                                                                                                                                                                                         
pages = "147--161",                                                                                                                                                                                                                   
doi = "10.1007/BF01379769",                                                                                                                                                                                                           
year = "1972"                                                                                                                                                                                                                         
}

Hope that helps!
Juergen

Fabio de Nicolo

unread,
Jan 23, 2018, 4:36:12 PM1/23/18
to COPASI User Forum
Hi Frank,
Thank you very much for your kindness and your explanation!
Just to know, what is going to be the highest level of precision achievable with the current implementation framework? Does it correspond to the maximum allowed from the code point of view?
I know in Delphi (object-Pascal) a "doube" variable can have up to 15-16 decimal digits, but I ignore if COPASI is written in C# or other languages...
In case it is fast and effort-less for you to produce the experimental build, I would be much grateful to have it, otherwise I will wait for the official release!
Concerning OS/architecture, I'm running Win10 on a 64 bit machine, but I assume a 32 bit program would run also, or a version for Win7!
I will comment on Juergen post about the Schlögl network.
Thanks,
Fabio de Nicolo

Fabio de Nicolo

unread,
Jan 23, 2018, 4:38:45 PM1/23/18
to COPASI User Forum
Thank you Juergen!
Maybe my university professor didn't explain it in a completely correct way, given that we were told it is a bi-stable system!
Given that my university account expired a few years ago, would you be so kind to send me the .pdf of that article, or shall I retrieve it somewhere else?
Thanks,
Fabio de Nicolo

Frank Bergmann

unread,
Jan 24, 2018, 7:25:51 AM1/24/18
to COPASI User Forum
Copasi is written in C++ and nothing much has changed with double precision :). In any case here you go: 


in case you experience any trouble running the executable, you might need to install the x86 version of: 


best
Frank

Pedro Mendes

unread,
Jan 24, 2018, 8:50:36 AM1/24/18
to copasi-u...@googlegroups.com
Fabio,

the precision of representation of reals as floating point is far from
trivial. There are many problems with floating point numbers that,
unfortunately, are mostly only mentioned in Numerical Analysis classes
(sometimes not even that). See the link below for the main issues

https://www.codeproject.com/Articles/29637/Five-Tips-for-Floating-Point-Programming

note that this affects any program, written in any language, that uses
floating point numbers...

But even more basic is the fact that solving ODEs (and inverting
matrices, etc.) is carried out by asymptotic algorithms. These
approximate the solutions iteratively and the numbers that come out can
only be trusted to a certain limit (usually this is more restrictive
than the floating point issues mentioned above).

So when in COPASI you solve ODEs, the algorithm is governed by the
absolute tolerance and the relative tolerance values. If you have an
absolute tolerance of 1e-12 (the default in COPASI) you should expect
that values smaller than this are not reliable and are essentially the
same as zero (ie if you see a concentrations of 1e-23 or -1e-16, etc.
these are basically the same as 0).

In the steady state analysis the steady state (which should have fluxes
of 0), the tolerance also determines the error in the solution. So if
your tolerance is 1e-9 you should not expect much rates below this value
to be meaningful.

This all means that at some point you cannot rely on all of the digits
of solutions. Personally I don't trust much more than 5 or 6 significant
digits.
> --
> 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 post to this group, send email to copasi-u...@googlegroups.com
> <mailto:copasi-u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/copasi-user-forum/1b130697-039e-496e-beb6-d01362f0a2d2%40googlegroups.com
> <https://groups.google.com/d/msgid/copasi-user-forum/1b130697-039e-496e-beb6-d01362f0a2d2%40googlegroups.com?utm_medium=email&utm_source=footer>.

Fabio de Nicolo

unread,
Jan 24, 2018, 3:01:54 PM1/24/18
to COPASI User Forum
Thank you very much Frank, I'll give it a try!
Kind regards,
Fabio de Nicolo

Fabio de Nicolo

unread,
Jan 24, 2018, 3:05:57 PM1/24/18
to COPASI User Forum
Thank you Pedro for your contribution; I will try to have a look at the article you linked and to understand it, but I hope not to just find out that all these simulations are not reliable in the end!
This would be a very sad conclusion...   =(
Kind regards,
Fabio de Nicolo

Fabio de Nicolo

unread,
Jan 26, 2018, 3:35:42 PM1/26/18
to COPASI User Forum
Hello Frank, I start testing your experimental build and I run into this repeatable error (see attachments for output and parameters set).
Strangely, this doesn't happen at the same moment (see attach. 1 and 4) in two separate simulation runs.
Do you have any idea about the reason? Does this possibly relate to what Pedro Mendes wrote?
Kindly,
Fabio de Nicolo
Error_1.png
Error_2.png
Error_3.png
Error_4.png

Pedro Mendes

unread,
Jan 26, 2018, 3:47:39 PM1/26/18
to copasi-u...@googlegroups.com
Hi Fabio,

the error you are getting is unrelated with what we discussed before.
This error is basically that COPASI is running out of memory on your
computer. You are just having too many time points in each time course
(200000) and then you are doing 100 time courses (2e7 time points).
Since you cannot plot things at such a high time resolution (your screen
has less than 4000 pixels wide, probably only 2048) I suggest that you
sample the time course with less data points. Try changing the value of
200000 down to 10000. That is still more detail more than the plot can
show and COPASI will have to hold 20x less data in memory. If that is
not enough, try reducing a bit more (probably not needed).

Pedro
> <https://www.microsoft.com/en-us/download/details.aspx?id=48145>
>
> best
> Frank
>
> --
> 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 post to this group, send email to copasi-u...@googlegroups.com
> <mailto:copasi-u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/copasi-user-forum/bac63f16-808d-4157-87d8-4647ca1b1f4c%40googlegroups.com
> <https://groups.google.com/d/msgid/copasi-user-forum/bac63f16-808d-4157-87d8-4647ca1b1f4c%40googlegroups.com?utm_medium=email&utm_source=footer>.

Fabio de Nicolo

unread,
Jan 26, 2018, 5:16:59 PM1/26/18
to COPASI User Forum
Thank you Pedro, I was able to successfully run the simulation by lowering the intervals to 50000!
I just think it is more precise if this number is higher, but you already said to me that I am probably looking at unreliable data, therefore I am likely to be wrong...
Anyway, the plots are nice! Maybe I'm doing more art than science.   =P

Nevertheless, I wanted to ask you (all) one thing: while looking at the plots being populated with curves, I noticed that some horizontal lines (relating to the third steady state) appear before the low curves end (the ones pointing to the low equilibrium placed at about 0.23 - see attachment).
On the contrary, I thought that for increasing [X]i the three curve families (low equilibrium, third steady state, high equilibrium) would be displayed in a consecutive manner!
Is it possible, or again does it show how this data is just intrinsically fragile?
Regards,
Fabio de Nicolo
Graph.png

Stefan Hoops

unread,
Jan 29, 2018, 10:04:41 AM1/29/18
to COPASI User Forum
On Fri, 26 Jan 2018 14:16:59 -0800 (PST)
Fabio de Nicolo <dida_con_le...@msn.com> wrote:

> Thank you Pedro, I was able to successfully run the simulation by
> lowering the intervals to 50000!
> I just think it is more precise if this number is higher, but you
> already said to me that I am probably looking at unreliable data,
> therefore I am likely to be wrong...

Hello Fabio,

The number of steps has absolutely nothing to do with the accuracy of
the calculation. In some cases it might actually be detrimental. You
should only require as much output as you can see in a plot or as much
as you need for you further analysis.

I do not expect you will look at 50,000 data points

Regarding your observation I suspect that you are looking at numerical
artifacts which you will observe very frequently near an unstable
steady-state which is where you are doing your analysis.

I hope that helps,
Stefan

> Anyway, the plots are nice! Maybe I'm doing more art than science.
> =P
>
> Nevertheless, I wanted to ask you (all) one thing: while looking at
> the plots being populated with curves, I noticed that some horizontal
> lines (relating to the third steady state) appear *before* the low
--
Stefan Hoops, Ph.D.
Research Assistant Professor
Director, Biochemical Networks Modeling Group
Faculty of Health Sciences (FHS)
Biocomplexity Institute of Virginia Tech
1015 Life Science Circle (0477)
Blacksburg, Va 24061, USA

Phone: (540) 231-1799
Fax: (540) 231-2606
Email: sho...@vt.edu

Fabio de Nicolo

unread,
Jan 29, 2018, 2:32:22 PM1/29/18
to COPASI User Forum
Hi Stefan, thanks for your contribution!
I will take it into consideration in the next steps of my research.
Kindest regards,
Fabio de Nicolo
Reply all
Reply to author
Forward
0 new messages