Questions tagged [runge-kutta]

Runge–Kutta methods are an important family of implicit and explicit iterative methods, which are used in temporal discretization for the approximation of solutions of ordinary differential equations.

In numerical analysis, the Runge–Kutta methods (German pronunciation: [ˌʁʊŋəˈkʊta]) are an important family of implicit and explicit iterative methods, which are used in temporal discretization for the approximation of solutions of ordinary differential equations. These techniques were developed around 1900 by the German mathematicians C. Runge and M. W. Kutta.

Wikipedia definition about Runge-Kutta

379 questions
1
vote
1 answer

General purpose runge-kutta function for second order differential equations in Modern Fortran

How to make a function func2(func1,t,y0) which receives another function func1 as an argument, but where func1 is a function that returns a 1D real(kind=8), dimension(:) array? I have the following code written in Matlab, and I would like to write…
1
vote
1 answer

Runge-Kutta Implementation for a system of two differential equations

I have the following system of differential equations: And according to the paper they told I can solve it numerically by using RK 4th order. As you can see, two last equations are coupled and I constructed a matrix (Probability) that associates xn…
1
vote
0 answers

pymc3 model with ODE solver using theano

I am using a model where the mean response depends on the solution to an ODE. I am trying to fit this model using pymc3, but am running into problems (relating to missing test values) when joining the ODE solver to the model. Model y_t is…
1
vote
1 answer

Mathematica NDSolve giving error

I need to solve a diferential equation of the form w'=g(t,w(t)) where g is defined as follows g[t_, w_] := {f1[t, {w[[3]], w[[4]]}], f2[t, {w[[3]], w[[4]]}], w[[1]],w[[2]]}; and f1, f2 are f1[t_, y_] := Sum[\[Mu][[i]] (s[[i]] - y)/Norm[s[[i]] -…
1
vote
0 answers

Error for convergence for Runge-Kutta in Python

I have this piece of code (I put just a part of it) in Python: from __future__ import division import numpy as np from pylab import * from numpy import linalg as LA a =…
JohnDoe122
  • 638
  • 9
  • 23
1
vote
1 answer

Runge-Kutta 4th order Particle Advection code sample

I have been trying to implement RK4 integration into a simulation that I am doing. The function below is my best attempt at using RK4 to integrate over a force field in 3 dimensions, based on the equations on page 12 at this site. In my code, the…
Simon Ewing
  • 125
  • 1
  • 5
1
vote
1 answer

Why is my code using 4th Runge-Kutta isn't giving me the expected values?

I'm having a little trouble trying to understand what's wrong with me code, any help would be extremely helpful. I wanted to solve this simple equation However, the values my code gives doesn't match with my book ones or wolfram ones as y goes up…
Orbitz
  • 53
  • 5
1
vote
2 answers

Why is exponential integrator method giving poor results?

//u' + Au = g(t,u) can be solved by exponential integrators also //Following snippet is for exp INtegrators A = -full(Strang(11)) A[end,1]=1;A[1,end]=1; g(t,u) = 2-u u0 = zeros(11);u0[6]=1 nsteps = 1000 tmax = 10.0 h = tmax/nsteps u = u0 t = 0 for…
1
vote
2 answers

Runge-Kutta N-Body Implementation not working

I've implemented in Java the Runge-Kutta 4 algorithm as described from this paper. http://spiff.rit.edu/richmond/nbody/OrbitRungeKutta4.pdf However, the movements are erratic. Even with only two bodies, there are no periodic movements. protected…
Bloc97
  • 274
  • 1
  • 13
1
vote
1 answer

C code for simple pendulum doesn't give expected results

I am trying to write a code for a network of FitzHugh NAgumo neurons in C, using RK4 integrator. As that wasn't working, I decided to try something simpler, a simple pendulum system. I am using separate functions - one to return the differential…
1
vote
1 answer

Three-body p‌r‌o‌b‌l‌e‌m (Burrau's pythagorean p‌r‌o‌b‌l‌e‌m.) with Runge-Kutta 4 integration method (c language)

I'm trying to solve the Three-body problem known as Burrau's pythagorean problem (initial conditions m1=3, m2=4, m3=5, x1 = 1, y1 = 3, x2 = -2, y2 = -1, x3 = 1, y3 = -1) with the Runge-Kutta 4 method to solve the differential equations, but when I…
tnnm95
  • 13
  • 3
1
vote
1 answer

Runge–Kutta of 4th order

Lets consider I have a system of 4 ODE: dX/dt = F(X), where X is a vector(4-demension) and F: R^4 -> R^4. F is called vectorDE_total_function, and I'm trying to calculate the solution using RK-4. def solvingDES(): previous_vector = np.array…
1
vote
1 answer

Python 2.7 Runge Kutta Orbit GUI

I'm trying to create a GUI in Python using Tkinter that plots the orbital path of a mass using the Runge-Kutta method. My GUI works fine but my issue is that it only plots a straight line no matter what values I input to the GUI. I was hoping…
S.H
  • 41
  • 5
1
vote
1 answer

Python : Speeding up my Runge-Kutta integration code challenge

I am using the attached code to integrate a version of Fitzhugh-Nagumo model : from scipy.integrate import odeint import numpy as np import time P = {'epsilon':0.1, 'a1':1.0, 'a2':1.0, 'b':2.0, 'c':0.2} def fhn_rhs(V,t,P): …
Ohm
  • 2,312
  • 4
  • 36
  • 75
1
vote
0 answers

Why are no oscillations appearing in my Lotka-Volterra time series plots in Matlab?

I am trying to model the Lotka-Volterra Predator-Prey system, using the coupled DE's: dy(1)/dt = rx(1-x/k) - ay(1)y(2) % prey population dy(2)/dt = aby(1)y(2) - dy(2) % predator population Here is the code I have : % Solves equations using…