«Back to research topics list

Poincaré sections optimization tool

This tool can be used for optimizing a placement and orientation of a surface Σ in ℝd used for generating a Poincaré section of a multi-dimensional signal. The tool uses the Poincaré&Higuchi method [1] which produces zig-zag patterns in the case of a signal produced by a deterministic system and a smooth line in the case of a signal produced by a stochastic system. It optimizes the parameters of the Σ surface (the point P0 and the normal vector n0) in such a way that the patterns produced by the Poincaré&Higuchi method are the most prominent.

The tool implements the following methods of determining the parameters of the Σ surface:
  • Perpendicular in which the point P0 is equal to the mean of the data points and the normal vector n0 is parallel to one of the axes of the coordinate system
  • PCAmin and PCAmax in which the point P0 is equal to the mean of the data points and the normal vector is equal to the direction of minimal (in the PCAmin method) or maximal (in the PCAmax method) variance of the data points. The directions of the minimal and maximal variance are determined using the Principal Component Analysis (PCA) method.

    Note: the mathnet.iridium library (version 2008.8.16.470) is required for this method to work. This library can be obtained for free here. Download the file MathNet.Iridium-2008.8.16.470.zip and unpack the MathNet.Iridium.dll file to the directory where ps_opt.exe resides.

  • Gradient which uses a gradient descent method for optimizing both the point P0 and the normal vector n0 treated jointly as a vector in ℝ2d.
  • Evolutionary which uses an evolutionary algorithm for optimizing both the point P0 and the normal vector n0. Both parameters are encoded in a genotype which is a vector in ℝ2d.
The tool is implemented in C# and works with .NET plaform version 2.0 and higher. On Linux and other operating systems the tool can be used on the Mono platform.

[1]   A. Golestani, M. R. Jahed Motlagh, K. Ahmadian, A. H. Omidvarnia, N. Mozayani, A new criterion to distinguish stochastic and deterministic time series with the poincare section and fractal dimension, Chaos: An Interdisciplinary Journal of Nonlinear Science 19 (1) (2009) 013137.
A pattern produced by the Poincaré&Higuchi method for a signal produced by a deterministic system.

A pattern produced by the Poincaré&Higuchi method for a signal produced by a stochastic system.


The program is given without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. If you use this program, you do so at your own risk. By downloading the program you agree that the author of the program will not be held liable even if any damage or loss of profit occurs due to the usage of the program.

Terms of use

The program is provided for free for academic use only, which means that you may download, install and run the program for the purposes of teaching and research.
You may publish the results obtained with the help of this program (e.g. present them at a conference, include them in a journal article, conference proceedings, etc.), provided that you acknowledge the fact that the program has been used to obtain the results in the text of your work (e.g. presentation or paper).
Use of the program for any commercial purposes is prohibited, unless a written consent is obtained from the author.
The author retains all other rights, in particular to modify and distribute the program.

Program usage

On Windows:

        ps_opt.exe <optimization_method> <section_method> <data_file>

On Linux (using the Mono platform):

        mono --gc=sgen ./ps_opt.exe <optimization_method> <section_method> <data_file>

The --gc=sgen selects a non-default garbage collector for the Mono runtime. It is not absolutely necessary, but from my experience it works better than the default one.


<optimization_method> This parameter determines the optimization method. The method can be specified by a name (perpendicular, pca_min, pca_max, gradient or evolutionary) or a number 1-5 can be specified (1=perpendicular, 5=evolutionary).
<section_method> This parameter determines how the Poincaré section is obtained. In the intersect method points at which the flow crosses the Σ surface are generated. In the slice method the data points that are located close to the Σ surface are collected and projected onto Σ. In the second method an additional parameter is required which specifies the width of a slice on both sides of the Σ surface in which the points are collected. This parameter is, like the point P0 and the normal vector n0, also adjusted by the optimizer.
<data_file> A semicolon-delimited text file containing the data points to process. Each line in the file contains one data point. Columns correspond to dimensions and are separated by semicolons (';').

Configuration file

A configuration file ps_opt.exe.config is used for setting the parameters of the optimization methods.

General parameters used with all optimization methods.
stopAtNumIncreases  (default: 9) The number of increases in the zig-zag pattern produced by the Poincaré&Higuchi method at which the optimization stops, even if a configured number of iterations has not been completed. The default value of 9 corresponds to a zig-zag pattern in which every second segment decreases and every second segment increases. This settings is the default, because on many occasions the optimization methods are able to find good patterns relatively quickly. In order to continue optimizing even when a zig-zag pattern has already been obtained (in order to make it more pronounced), set this parameter to arbitrarily high value (e.g. 100).

Parameters used for the Perpendicular, PCAmin and PCAmax optimization methods. Used only when slice section method is selected.
minWidth  (default: 0.01) The minimum width of the slice in which the points are collected.
maxWidth  (default: 0.2) The maximum width of the slice in which the points are collected.
widthStep (default: 0.0001) The increase in the width of the slice used during optimization.

Parameters used for the Gradient optimization method.
gradientDelta  (default: 0.1) The step used for calculating gradients.
numRestarts    (default: 10) The number of times the optimization process is restarted. From all the runs the best result is kept.
numIterations  (default: 100) The number of iterations in each run of the algorithm.

Parameters used for the Evolutionary optimization method.
numGen        (default: 50) The number of generations for which the optimization runs.
popSize       (default: 1000) The nunber of specimens (candidate solutions) in the population.
crossoverProb (default: 0.9) Probability of performing a crossover operation for a pair of parent specimens. With a probability of 1 - crossoverProb both parents are copied unchanged to the next generation.
mutationProb  (default: 0.05) Probability of performing a mutation operation on each given specimen.
Input file
An input file should contain time series samples in ℝd with d > 1. Each row should contain d real numbers separated by semicolons ( ; ) which represent the coordinates at a time instant t. An example of correctly formatted input data is shown below:

Note: The ps_opt.exe tool does not perform any embedding of the original time series, which means that you have to prepare multidimensional data. In the case of a one-dimensional time series you may have to embed it in ℝd, d > 1 using the Takens theorem. A tool embed.exe is included in the download package, which performs an embedding with a given number of dimensions and a given lag. The command line syntax is:

embed.exe <data_file> <num_dim> <lag>
For example, data shown above have been generated from a time series stored in a data.csv file:


embed.exe data.csv 3 1
Output file
The program generates one output file for each run. The name of the output file is the name of the input file with the names of the optimization method and the section method appended. For example, for an input file experiment_01.csv on which an evolutionary optimizer has been run with the slice section method, the output file is named:


The output file contains two vectors stored using syntax used by such tools as Matlab or Octave.

The solution vector contains the point P0 and the normal vector n0 and, in the case of the slice section method, the width of the slice in which the points are collected as the last entry.

The log_lengths vector contains the values produced by the Poincaré&Higuchi method used for plotting the curve presented in the figures.
solution = [     0.410602161350913     0.78948290464391     0.313919673384208     2.07029806877252     0.157631461385046     1.19796223702407     0.229422994085455 ];

log_lengths = [     10.7552300241495     7.63573795033084     9.65256044749511     7.04937739658785     9.1366356309163     6.72540225357909     8.79489388165444     6.50636575213553     8.53835776639818     6.33860722834295     8.33260545807453     6.20900447433794     8.16037782860011     6.10380550549367     8.01211516893165     6.01439057835672     7.88189384449229     5.93759385837613     7.7657556292066     5.87112622927258 ];

An example of the output file.


To download the program please fill out the form below.
General info:
First and Last Name
Planned usage of the program
How did you get to know about the program:
  From other researchers
Found it on the internet
From a published paper
«Back to research topics list