Fortran90 examples of simple dynamic systems, for an introductory university class. Aside from the code, all examples include a:
Makefile
for ease of cleaning/compilation*_plotter.plt
(sub the*
with the program name) Gnuplot script for the plots required by the class assignments*_runner.sh
(see above for the*
) bash helper script to create data folders and run both the compiled example and gnuplot
In addition, examples 3 and 4 include a parameters.txt
file from which the *_runner.sh
script takes the needed input values. To use these examples stand-alone, just uncomment the values i left in the code and comment all the get_command_argument
related lines.
Feel free to alter the code to fit your needs, just don't keep it to yourself, fortran90 is already hard enough to use and/or get accustomed to, people need all the help they can get! I sure did.
All examples come already compiled and with data generated.
In order to run them from scratch:
- Open your terminal of choice and navigate to the example folder
- Either use the
make clean
comand to remove the compiled example and all data and plots, or do so manually - Either use the
make
comand to compile, or do so with preferred/required method of choice - Type
./*_runner.sh
to run the helper script (you may need to runchmod +x *_runner.sh
to make it executable) in order to execute both the example and Gnuplot, or comment the gnuplot line if other plotting/fitting methods are preferred/required.
Important: should you choose not to use the included Makefile
and/or *_runner.sh
script, make sure to create the needed data folders and to feed the examples the right input values (like for examples 3 and 4).
- Integration using Runge-Kutta 4th order algorithm in two ways:
- Increasing values of
$\sigma$ . Starting from the second$\sigma$ value onward, for each evolution the starting conditions are the last values of the previous one. - Decreasing values of
$\sigma$ . Same procedure as above.
- Increasing values of
- Study of maxima behavior in function of
$\sigma$ once the forcing effects have subsided for the two kinds of evolution above mentioned - Comparison between the maxima behavior in function of
$\sigma$ for the increasing and decreasing$\sigma$ evolutions
- Integration using Euler method
- Calculation of all possible Lyapunov coefficients for different
$\mu$ values
- Integration using Euler method
- Lyapunov coefficient calculation with Benettin algorithm, for single and double trajectory
- Fractal dimension calculation with Grassberger-Procaccia algorithm and comparison with Kaplan-Yorke conjecture
- Integration with Runge-Kutta 4th order
- Lyapunov coefficient calculation with Benettin algorithm, for single and triple trajectory
- Fractal dimension calculation with Grassberger-Procaccia algorithm and comparison with Kaplan-Yorke conjecture
Generation and study of a multifractal measure with the multiplicative process
- Runge-Kutta algorithm (Wikipedia)
- Euler method (Wikipedia)
- Lyapunov exponent (Wikipedia)
- Fractal dimension (Wikipedia)
- Benettin algorithm (CERN)
- Kaplan-Yorke conjecture (Wikipedia)
- Grassberger-Procaccia algorithm (Scholarpedia)
- Logistic map (Wikipedia)
- Henon map (Wikipedia)
- Lorenz model (Wikipedia)
The file carepackage.f90
is a homemade compilation of useful subroutines not present by default in fortran90. Right now it contains
- Ports of
arange
andlinspace
from python - A subroutine for linear fitting (without error calculation) with efficiency comparable with Gnuplot's fitting function, developed with antonio-evangelista
- A subroutine for searching the max value of a 1D vector, can be easily manipulated to find the minimum
All Work was done on Ubuntu 20.04.5 LTS and Arch Linux using the following tools, available for all linux platforms (to my knowledge). Gnuplot and Make are optional, depending on user preference.
-
gfortran (gcc fortran compiler)
-
for Ubuntu/Debian based systems
sudo apt install gfortran
-
For Arch based systems
sudo pacman -S gfortran
-
-
Gnuplot (powerful plotting software, also useful for data fitting)
-
for Ubuntu/Debian based systems
sudo apt install gnuplot
-
For Arch based systems
sudo pacman -S gnuplot
-
-
Make (build system, usually already present on system)
-
for Ubuntu/Debian based systems
sudo apt install make
-
For Arch based systems
sudo pacman -S make
-