[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TISEAN: decision about porting a function

From: Piotr Held
Subject: Re: TISEAN: decision about porting a function
Date: Tue, 16 Jun 2015 13:03:58 -0600

2015-06-16 0:34 GMT-06:00 Juan Pablo Carbajal <address@hidden>:
On Mon, Jun 15, 2015 at 8:17 PM, Piotr Held <address@hidden> wrote:
> Hi Juan,
> I encountered a problem (more like a decision) about some of the functions.
> The problem is that the output is dependent on time (that is execution
> time). The reason why the TISEAN programs were implemented this way was to
> get some results without waiting for the program to finish (which I assume
> could have taken a very long time). What happens is that when a certain
> amount of time passes the program outputs wherever it's at and then
> continues on computing. This applies to 'lyap_spec', 'd2' and maybe others.
> For further reading see:
> * 'Description of output' section of:
> http://www.mpipks-dresden.mpg.de/~tisean/Tisean_3.0.1/docs/docs_c/lyap_spec.html
> * lines 429-442 of:
> https://bitbucket.org/josiah425/tisean/src/cf22e24e3e20fbf7d8575929098d9ba08d296219/src/__lyap_spec__.cc?at=devel
> * my discussion on github with 'heggus':
> https://github.com/heggus/Tisean/issues/9
> The solution I thought of was to add an option to the program (similar to
> 'q' in 'more') that would terminate the program and return the latest output
> it had calculated.
> What do you propose to solve this issue?
> :)

Basically this is emulating an event. Instead of terminating the
program you can ask for a handle to a function that will plot/print
the data provided every time in a while (could be another parameter,
something like "ShowEvery" and an integer indicating the number of
iterations to wait before showing a result). This is how it is done in
the odepkg package[1], so you can continue with the calculation but
from time to time update a plot with the current values. How do you
see this?

TISEAN uses time instead of iterations. So I left the time (it will automatically show the output after 10 seconds) and I added what you proposed (it's in the 'devel' branch). I tested it manually, did not add new tests.
You could implement this part in an m-file and have a call to the C++
code only to do the calculation.
Some thing like
(assume ShowEvery was given)

while (calculation is not finished)
    L = __calculate_lyap__ (..., ShowEvery);
    print/plot L;

The last argument of calculate_lyap is just indicating how many
iterations should be calculated. This means that at each call all the
necessary data has to be provided. It would be easier if one could
have a reference to the variables being updated, but I do not know if
this is possible (that is updating a plot/print from within the C++
code). I will check and report back.

In the case of lyap_spec there is no need to plot anything. That could be useful with d2. 

For 'd2' it would be also useful to implement a program interruption that will give you the most recent output as output. So that you could do something like 'ctrl+c' and get the most recent output (I started porting 'd2' in branch: 'devel-0.2.0').

Should the intermediary steps for 'lyap_spec' be part of the output? (that's the way it's implemented in TISEAN), I am not sure that is best. Right now the output contains only the last iteration.

Also, in the issue on git ( https://github.com/heggus/Tisean/issues/9 ), he told me I could feed a delayed input into lyap_spec. I thought about it and I couldn't figure out what parameters to use. If I want to call lyap_spec ([1:100;1:100], 'm',4,'d',6), what should the parameters be that I pass to delay?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]