scijs/ode-midpoint

Name: ode-midpoint

Owner: scijs

Description: Integrate a system of ODEs using the Second Order Runge-Kutta (Midpoint) method

Created: 2015-07-24 15:49:59.0

Updated: 2015-08-01 19:15:39.0

Pushed: 2015-08-01 17:46:34.0

Homepage: null

Size: 172

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ode-midpoint Build Status npm version Dependency Status

Integrate a system of ODEs using the Second Order Runge-Kutta (Midpoint) method

Introduction

This module integrates a system of ordinary differential equations of the form

undefined

undefined

where undefined is a vector of length undefined. Given time step undefined, the midpoint method integrates the ODE with update

undefined

Install
m install ode-midpoint
Example
midpoint = require('ode-midpoint')

deriv = function(dydt, y, t) {
dt[0] = -y[1]
dt[1] =  y[0]


y0 = [1,0]
n = 1000
t0 = 0
dt = 2.0 * Math.PI / n

integrator = midpoint( y0, deriv, t0, dt )

ntegrate 1000 steps:
grator.steps(n)

ntegrate all the way around a circle:
> integrator.y = [ 1.0000001939636542, 0.000041341220643982546 ]
API
require('ode-midpoint')( y0, deriv, t0, dt )

Arguments:

Returns: Initialized integrator object.

Properties:

Methods:

Credits

(c) 2015 Ricky Reusser. MIT License


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.