Coder Social home page Coder Social logo

runge_kutta_solver_for_unity3d's Introduction

Solver for stiff ordinary differential equations

There was no free solver for ordinary differential equations available written in C-sharp and thus compatible with Unity. This repository consists of a very specific implementation of Runge-Kutta resembling the predator-prey relationship described by Lotka and Volterra. This code can potentially be adapted to simulate population dynamics for any given setting.

When I find the time, I might extend this with:

  1. a unity scene showing how to use this code
  2. a more dynamic generator for the differential equations

Example

Run the following to calculate population numbers for rabbits and wolfs over time

double rabbitStart = 10.0f;
double wolfStart = 5.0f;
double starttime = 0;
double endtime = 1f;
int steps = 10;

IntegratorLSODE integ;
double[] y = new double[2];

integ = new IntegratorLSODE ();
y [0] = rabbitStart;
y [1] = wolfStart;
while(True) {
  y = integ.integrate(starttime, endtime, steps)
  // values of y are population sizes
}

runge_kutta_solver_for_unity3d's People

Contributors

sisch avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.