Numerical analysis of van der Pol equation by using Runge-Kutta method
常微分方程式、坂井秀隆、東京大学出版会に収録されているコードを転載した。 Gnuplotを用いて、出力された2次元のデータを可視化した図も収録されている。 #include #include #define xinitval 2 #define yinitval -3 #define step 0.01 #define max 1024 double fx(double x, double y){ return y; } double fy(double x, double y){ return -x + 1.5*(1-x*x)*y; } int main(void){ int j; double K1, K2, K3, K4, L1, L2, L3, L4; double x[max], y[max]; x[0]=xinitval, y[0]=yinitval; for(j=0; j
2021. 8. 13.