/*------------------------------------------------------------------------------------
ハイパーカオス方程式のリアプノフスペクトラムの計算
calculating the Lyapunov spectrum of the Hyperchaos equations
dx/dt = -y - z
dy/dt = x + A * y + w
dz/dt = B + x * z
dw/dt = C * z + D * w
hyperchaos_lyap.h
------------------------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define ITERATION 10000000
#define SKIP 100000
#define DELTA_T 0.001 /* step size of the fourth-order Runge-Kutta method */
// parameters
#define A 0.25
#define B 3.00
#define C -0.50
#define D 0.05
// 初期値
// initial values
#define X0 -10.0
#define Y0 -6.0
#define Z0 0.0
#define W0 10.0
/* Lyapunov spectrum (log with base-e) 0.112, 0.019, 0, -25.188 */
// 変数の数
// number of variables
#define DIM 4
/*------------------------------------------------------*/
extern void solve_hyperchaos_eqs_using_RK4( double v[DIM], double u[DIM][DIM] );
extern void hyperchaos_eqs( double v[DIM], double dfu[DIM][DIM], double dvdt[DIM], double df_k[DIM][DIM] );
extern void gram_schmidt_orth( double u[DIM][DIM], double e[DIM][DIM] );
extern double calc_lyap_dim( double lambda[DIM] );
extern double log2( double x );