This code is an implementation of the IPID-1 algorithm from the paper Inferring oscillator's phase and amplitude response from a scalar signal exploiting test stimulation. It infers the phase response curve and isostable response curve from observations of a scalar oscillatory signal and a scalar perturbation signal.
Note that this is for inference from observations only. If you have the system equations available there is a different, straightforward algorithm that you should use, see my other repository on isostable coordinates.
The implementation was originally in Python and then important parts were rewritten in c for efficiency. All the algorithms are in the directory 'code', the rest of the directories are there to organize the input and output. It is ran from a single bash script: run.sh. The code uses Eigen for a short linear algebra part.
- clone/download the repository,
- add Eigen library files to the folder 'code/Eigen' (or link them when compiling in the next step),
- compile the code by going to the 'code' directory and run
bash compile_c.sh
The parameters are in the file parameters.py. Put the signal observations in 'signal/signal_x.txt' file, and the perturbation signal in the 'forcing/forcing.txt' one value per line (no commas). Run it by executing the bash script run.sh:
bash run.sh
The script run_example.sh is already set with an example. It first generates the data by integrating a simple system, and then runs the algorithm to infer the curves, and plots them.