Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A simple runge-kutta 4 integrator

Project Description

A simple implementation of Runge-Kutta for python.

Setup

Install

pip install pyrk

Develop

git clone https://github.com/walchko/pyrk
cd pyrk
pip install -e .

Usage

See the examples in the docs folder or a simple one:

from __future__ import division, print_function
from pyrk import RK4
import numpy as np
import matplotlib.pyplot as plt

def vanderpol(t, xi, u):
        dx, x = xi
        mu = 4.0 # damping

        ddx = mu*(1-x**2)*dx-x
        dx = dx

        return np.array([ddx, dx])

rk = RK4(vanderpol)
t, y = rk.solve(np.array([0, 1]), .01, 200)

y1 = []
y2 = []
for v in y:
        y1.append(v[0])
        y2.append(v[1])

plt.plot(y1, y2)
plt.ylabel('velocity')
plt.xlabel('position')
plt.grid(True)
plt.show()

Release History

This version
History Node

0.9.0

History Node

0.6.1

History Node

0.6.0

History Node

0.5.4

History Node

0.5.3

History Node

0.5.2

History Node

0.5.1

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
pyrk-0.9.0-py2-none-any.whl
(4.3 kB) Copy SHA256 Hash SHA256
Wheel py2 Apr 11, 2017
pyrk-0.9.0-py3-none-any.whl
(4.3 kB) Copy SHA256 Hash SHA256
Wheel py3 Apr 11, 2017
pyrk-0.9.0.tar.gz
(2.7 kB) Copy SHA256 Hash SHA256
Source None Apr 11, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting