Cython: Runge-Kutta

The follow set of scripts calculate the response of a specific single-degree-of-freedom system to an arbitrary base input time history, via the Runge-Kutta fourth order method.

The scripts also demonstrate the passing of numpy arrays to the function, which processes the the data and then returns the resulting arrays to the main Python script.

The scripts on this page require the utility module tompy.py

The function is defined in: sdof_rk4.pyx

The setup file is: sdof_rk4_setup.py

The function is complied in command-line mode via: python sdof_rk4_setup.py build_ext –inplace
The main Python script which imports the function is: arbit_rk4_c.py

Tom Irvine

One thought on “Cython: Runge-Kutta

Leave a comment