What is Runge-kutta: Definition and 67 Discussions

In numerical analysis, the Runge–Kutta methods (English: (listen) RUUNG-ə-KUUT-tah) are a family of implicit and explicit iterative methods, which include the well-known routine called the Euler Method, used in temporal discretization for the approximate solutions of ordinary differential equations. These methods were developed around 1900 by the German mathematicians Carl Runge and Wilhelm Kutta.

View More On Wikipedia.org
  1. bremenfallturm

    I Runge-Kutta 4 w/ some sugar on the top: How to do error approximation?

    Hello! I'm currently working with a problem which allows modelling ball motion $$\begin{aligned} m \ddot{x} & =-k_x \dot{x} \sqrt{\dot{x}^2+\dot{y}^2} \\ m \ddot{y} & =-k_y \dot{y} \sqrt{\dot{x}^2+\dot{y}^2}-m g \end{aligned}$$ Given that ##k_x, k_y=0.005##, ##m=0.01## and ##g=9.81## and when...
  2. T

    I Solving 3D TDSE with Runge-Kutta Method

    Hey all, For the Runge-Kutta method in 3-D (specifically to solve the 3-D TDSE), I was wondering if there were any subtleties I should expect, or if I could just simply use the 1-d method and add on the respective contributions from the other 2 dimensions. Thanks.
  3. VexCarido

    Runge-Kutta Projectile Approximation From Initial Conditions

    Hi everyone. I'm a new member, great to be here:) I have a few questions that I wanted to ask you guys regarding the method by which we implement the Runge-Kutta approximation of Projectile Motion if we should do it using a numerical iterative method with a Spreadsheet like Excel. I have...
  4. M

    MHB Numerical Methods: Second Order Runge-Kutta Scheme

    I'm unsure how to begin and solve this question. Any help would be appreciated, thanks.
  5. P

    MHB Mahesh's question via email about a Runge-Kutta scheme

    To apply this Runge-Kutta scheme, we will need to write our second order DE as a system of first order DEs. Let $\displaystyle u = y $ and $\displaystyle v = y' $, then we have $\displaystyle \begin{align*} y'' + 4\,v - 7\,u^2 &= 0.2 \\ y'' &= 0.2 - 4\,v + 7\,u^2 \end{align*} $ So our system...
  6. FahdEl

    Equation of motion using Runge-kutta 4 and Verlet algorithm

    import numpy as np import matplotlib.pyplot as plt G=6.67408e-11 M=1.989e30 m=5.972e24 X0=-147095000000 Y0=0 VX0=0 VY0=-30300 T=365*24*60 def rk(ax,ay,x,y,vx,vy,h): t=0 n=int(T/h) A=[[t],[x],[y],[vx],[vy]] for i in range(1,n): k1x=vx k1y=vy q1x=ax(x,y)...
  7. V

    Fortran Runge-Kutta using Numerical Recipes

    Hello, I try to solve a system of ODE's by Runge-Kutta method from here: https://websites.pmc.ucsc.edu/~fnimmo/eart290c_17/NumericalRecipesinF77.pdf, page 704 in the book (not pdf). Bellow is also a code. In function rk4dumb I don't understand how are implemented differential equations. Input...
  8. quasarLie

    Help with using the Runge-Kutta 4th order method

    Homework Statement I have this equations of motion, I have this equations of motion for a schwarchild black hole, I wish to use the 4th order Runge-Kutta method to solve them for a body falling to the black hole from a distance r0 and with L = 0. My problem is I am struggling to apply this...
  9. D

    Runge-Kutta on Elliptical Orbits

    Homework Statement Run a numerical analysis on elliptical orbits using the standard Runka-Kutta method. I already have the equations from Euler-Lagrange method in cartesian x,y-coordinates. d2x/dt2 = -K x (x2 + y2 )-3/2 d2y/dt2 = -K y (x2 + y2 )-3/2 Homework Equations I find it a little to...
  10. Telemachus

    I Resolution of a PDE with second order Runge-Kutta

    Hi, I want to solve the p.d.e.: ##\frac{\partial u(x,t)}{\partial t} - \frac{\partial^2 u(x,t)}{\partial x^2}=f(x,t)##, with periodic boundary conditions ##u(x,t)=u(L,t)##. using a second order Runge-Kutta method in time. However, I am not having the proper results when I apply this method to...
  11. C

    Second order(?) ODE + Runge-Kutta method question

    Homework Statement When a rocket launches, it burns fuel at a constant rate of (kg/s) as it accelerates, maintaining a constant thrust of T. The weight of the rocket, including fuel is 1200 kg (including 900 kg of fuel). So, the mass of the rocket changes as it accelerates: m(t) = 1200 - m_ft...
  12. sefiroths

    Java Runge-Kutta method for Simple pendulum in java

    Hi, I'm trying to study Runge-Kutta method and apply on a simple pendulum. Using a timestep dt=0.1 (h=0.1) the pendulum increses energy of 1% every period... while in this site: https://www.myphysicslab.com/pendulum/pendulum/pendulum-en.html decreses energy about 0.01% What am I doing wrong...
  13. T

    I Exploring the Limits of Stability for Runge-Kutta Numerical Methods

    Based on this link, in particular Figure 1, what is the exact meaning of the plot? To my understanding, it implies that for a given differential equation: $$ \frac {dy}{dt} = \lambda y $$ that the value ##\lambda \Delta t## has to be within the complex region shown in Figure 1 corresponding...
  14. Leonardo Machado

    Runge-Kutta 4th order program copying array element

    Hello, thanks for your interest in may help me, i appreciate it, really. My question is, I've wrote this code to solve an physical EDO system. But for some reason it copies the element k[1][3] at k[2][3]. After i call the initials elements the code becomes: for ( int n=1 ; n<=1; n++ ){...
  15. Leonardo Machado

    Problems with Runge-Kutta method

    I'm writing a program to compute an ODE solution of the Kepler's problem based on Runge-Kutta 4th order method and today I've past the whole day trying to made it work, but I've failed, maybe you could help me to kill the problem ? The solutions is cartesian. int main(){ int n...
  16. S

    C/C++ Why Do My Simulated Orbits Appear as Spirals in C++ Runge-Kutta Simulation?

    Hi! I have this code in C++ that simulates 2 body interacting through gravity using Runge-Kutta 4th order method. I plotted the trajectory of the 2 bodies and as you can see in the first picture they seems to be what I expect, 2 circles. But when I zoom in on one of them (second image) it looks...
  17. N

    I 4th order Runge-Kutta with system of coupled 2nd order ode motion equations

    MX''=Fn(cosΦ−usinΦ) MZ''=Fn(sinΦ+ucosΦ)−Mg MΦ''=Fn(Bxx+uBz) I tried using Runge-Kutta methods to approximate motion equations in MATLAB but it turn out wrong. I also tired finding and researching forums and web for solution but to no avail. Fn,M,θ,u is constant fn/M = 0.866 it seems that i...
  18. S

    C/C++ Runge-Kutta methond for n body C++

    Hi! I am trying to simulate the rotation of a planet around a star, using the 2nd order Runge-Kutta method (I am starting with this and I will try 4th order later, I am new to this topic). I have this code but it doesn't work. When I plot y(x) I should get a circle, but I don't get it. Any idea...
  19. T

    Runge-Kutta method - Orbital mechanics

    Homework Statement Given: Initial orbital elements of a satellite a=6652.555663km; e=0.075; i=28.5 degrees; Ω=40 degrees; w=30 degrees; n=0 degrees;Tasks(using MATLAB): 1. Convert orbital elements to position and velocity vectors 2. Use these vectors to initialize the Runge-Kutta...
  20. evinda

    MHB Runge-Kutta Method: Showing Order of Accuracy is 2

    Hello! (Wave) The following Runge-Kutta method is given: $$\begin{vmatrix} 0 & 0 & | 0\\ \frac{1}{2} & \frac{1}{2} & | 1 \\ \\ \frac{1}{2} & \frac{1}{2} \end{vmatrix} \\$$ and I want to show that its order of accuracy is $2$. I have tried the following: $$t^{n,1}=t^n \\ t^{n,2}=t^n+...
  21. M

    Python, solving Schrodinger equation using Runge-Kutta

    Homework Statement I'm currently working on a project in which I have to solve the energy eigenvalues of the Schrodinger equation to compute the mass of certain Mesons. We've been taught very little programming (so apologies that my understanding is very basic), and are therefore given any...
  22. U

    Runge Kutta for 4 coupled differential equations

    Hi, I'm not a bright programmer , but I have to solve the fallowing equations: ##\frac{df}{dt} = \alpha f -\beta f + \theta g - (f+h)f## ##\frac{dg}{dt} = \psi f- \phi g## ##\frac{dh}{dt} = \xi f+ \mu h -\tau h + \epsilon w- (f+h)h## ##\frac{dw}{dt} = \nu h - \chi h## Where ##f(t)## ...
  23. T

    C/C++ Looking for Runge-Kutta 8th order in C/C++

    Greetings all ! This is my first post on the forum, so please kindly let me know if I am not asking a proper question or on a proper board. I would like to use Runge-Kutta 8th order method (89) in a celestial mechanics / astrodynamics application, written in C++. Therefore I wonder if...
  24. M

    Runge-Kutta Method - Need help with the calculus

    When deriving the Runge-Kutta Method to solve y'=f(x) we need to use Taylor expansion. Hence we need to differentiate the function many times. y'(x)=f(y(x)) y''(x)=f'(y(x))y'(x) = f'(y(x))f(y(x)) y''' = f''(y(x))(f(y(x)),y'(x)) + f'(y(x))f'(y(x))y'(x) I can understand the second...
  25. M

    Runge-Kutta 4 order method. Severe 161: Array bounds exceeded.

    So here I am trying to solve Rayleigh's differential equation using Rungen-Kutta 4th order analytic method. This is what the exercise gives me: X(0 to 40), Y1(0)=0.1, Y2(0)=0, H=0.1, μ=0.5 This is what I ve written and gives me this error: IMPLICIT REAL*8(A-K,O-Z) DIMENSION...
  26. heycoa

    Runge-Kutta Method for a double pendulum

    Hello, I am trying to program a double pendulum via the 4th order Runge-Kutta method and I cannot seem to be getting the right output. At first I used the Euler-Cromer method, but now I am aiming to make it more accurate. Homework Statement I have the equations of motion: d(omega)/dt and...
  27. dwdoyle8854

    4th Order Runge-Kutta method and over/under estimates

    Homework Statement "Use Excel to approximate dF/dt=-0.1F+70, F(0)=0 to generate approximations for F at t=1,2 and 4 using step size 0.1. Explain whether these approximation are greater than or less than the exact values. Determine whether the shape of the solution curve is increasing...
  28. M

    Calculation of Neutron star pressure/mass using 4th order Runge-Kutta

    Hi all, this is my first post here and i apologize if some rules aren't followed. I have to complete the Project 13.1 (studies of neutron stars: p 346-350) http://www.cec.uchile.cl/cinetica/pcordero/MC_libros/Hjorth-Jensen2008.pdf When browsing using pdf pages 346 to 350, assignments 1...
  29. P

    Solving a system of ODEs using Runge-Kutta

    Using the 4th-order Runge-Kutta method, I have been able to successfully compute the solutions to a coupled pair of two first order differential equations using the following formula: When solving systems of ODEs with more than two equations I am unsure if I am properly expanding on the...
  30. H

    Runge-Kutta 4th order method (RK4) for second order Diff Eq

    Homework Statement Hello, maybe this is due to my lack of understand of RK4, but I have an equation: x'' + b^2*x=0 (derivatives with respect to variable t) and I need to use RK4 to find the solution on an interval. I can readily find solutions analytically, but my understanding of RK4...
  31. L

    Solving second-order ODE with Runge-Kutta 4

    Homework Statement Note: I think there is a typo here but I'm not sure. Is there supposed to be a comma between the delta t/2 and y_n on K2 and K3, and delta t and y_n on K4? Homework Equations See above.The Attempt at a Solution Substituting dy/t = z gives \frac{dz}{dt} = 3z - 2ty - cos(t)...
  32. G

    Runge-Kutta method for ut = f(x,y)?

    Hi, I am trying to solve something similar to ut = f(x,y), and ut = f(t,x,y) using RK4. I asked a few friends, and nobody knew for sure how to go about it. I've also looked online, without much success. Can anyone give me a hint on this one? In reality, it is probably preferable to...
  33. L

    C/C++ [C++] Using Runge-Kutta order 4 to solve system of ODEs

    (DISCLOSURE: I have already posted this problem in http://math.stackexchange.com/questions/256393/calculate-runge-kutta-order-4s-order-of-error-experimentally, but found no satisfactory answer) The problem is this. I need to experimentally check that RK4 method has an error of order 4...
  34. S

    Runge-kutta method for a force acting upon a charged particle

    I have this project that involves the runge-kutta method, and I honestly have no clue what I am doing. I never learned about this before, and I don't know much about ordinary differential equations. I am learning all of this next semester but it is required information for this project. In...
  35. H

    Symbolically solving Wikipedia Runge-Kutta example?

    The Wikipedia page for "Runge-Kutta methods"[1] gives the following example: y' = tan y + 1 y(1) = 1 t in [1, 1.1] Using a step-size of h = .025, this solution is found: y(1.1) = 1.335079087 I decided to check this solution by solving symbolically. But my attempts to symbolically...
  36. R

    Runge-Kutta for gravitational N-Body simulation - prediction of acceleration

    Runge-Kutta for gravitational N-Body simulation - "prediction" of acceleration Hey! I'm Raph, as you can see this is my first post, so, thus I'll start saying that it's nice to be here ;). I've got the following question: I'm simulating a system of N gravitationally interacting objects...
  37. N

    Wiki says that Runge-Kutta is iterative?

    Hi, As you can seeh here, according to wikipedia, the Runge-Kutta methods are iterative, but I don't see what is iterative about it. As I see it, starting from a certain value of x where you know y, you calculate y at x+h, then at x+2h, etc. Where is the iteration?
  38. M

    Proving the exactness of the Runge-Kutta algorithm to the second order in step-size

    Homework Statement We're supposed to prove that y_{n+1} = y_n + \frac{k_1 + 2k_2 + 2k_3 + k_4}{6} k_1 = hf(t_n, y_n) k_2 = hf(t_n + \frac{h}{2}, y_n + \frac{k_1}{2}) k_3 = hf(t_n + \frac{h}{2}, y_n + \frac{k_2}{2}) k_4 = hf(t_n + h, y_n + k_3) f(t, y) = \frac{dy}{dt} is equivalent to...
  39. J

    Accuracy of Runge-Kutta method when no analytical solution

    Homework Statement I have to find eigenvalues to \frac{d^2y}{dx^2} + p^2 e^x y = 0,\, y(0)=0,y(1)=0 using the Runge-Kutta single step method to solve the ODE (splitting it up), with step length h and then another numerical method. This is not a problem. However, I need to be able to find...
  40. E

    Finite difference and Runge-Kutta for PDEs

    I made a small program to simulate the time development of a 1D wavepacket obeying the Schrodinger equation, mostly in order to learn a new programming language - so in order to not have to invoke big numerical methods packages, I opted for the simplest solution: The standard three-point...
  41. S

    4th order runge-kutta not improving w/ step size

    Homework Statement Hi. I've written a program to find the solution of the differential equation [ -d/dx^2 + d/dx + l(l+1) + r^2(V(x)-E) ]P(x) = 0 where l is an integer constant, V(x) is defined on a grid, and E is a real number. The boundary condition is P(xi) = 1, dP/dx(xi) = l. I'm using...
  42. C

    Modelling the spread of disease (in MatLab, Runge-Kutta)

    Homework Statement Hi! I'm to build a model which solves the basic dynamic eqns in the so called SIR model in epidemology. I'm using MatLab and RK4. There are tree populations in this model: Succeptible S, infected I and recovered R. Homework Equations The eqations are dS/dt =...
  43. L

    Solving the Kinematic Equations using Runge-Kutta

    Homework Statement I am attempting to write a physics simulation program using the kinematic equations and using Runge-Kutta to solve them to determine how an object will move through space subject to certain gravitational forces etc. Homework Equations I have x=vt+(at^2)/2 as the equation i...
  44. N

    Kepler problem with Runge-Kutta

    Homework Statement Solve the Kepler problem by Runge-Kutta method, where initial conditions x(0)=x0, y(0)=y0, vx(0)=vx0, vy(0)=vy0 Homework Equations dvx/dt = -GMx/(x2+y2)3/2 (1) dvy/dt = -GMy/(x2+y2)3/2 (2) dx/dt = vx...
  45. D

    Implicit Runge-Kutta method

    Hey folks I'm experimenting with symplectic integrators and I'm trying to figure out how to deal with fourth order implicit Runge-Kutta methods as shown here (symplectic version second link). http://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods#Implicit_Runge.E2.80.93Kutta_methods...
  46. L

    Solving 2nd Order ODEs with Euler & Runge-Kutta 4

    For weeks I've been coding a program to simulate waves on a string. Currently I am working on some numerical methods. Namely Euler and Runge-Kutta. I have Euler working fine as far as I can see for a variety of input waveforms (of course after it runs for a while it goes a bit beserk due to...
  47. M

    How to Solve a Differential Equation Using the Runge-Kutta Method?

    Hey all! I'm trying to use the Runge-Kutta method on this differential equation but I am getting nowhere and it's starting to confuse me :S Any help would be greatly appreciated! \frac{dx_{1}}{dt} = g_{2} \frac{y_{2} - y_{1}}{{|r_{2} - r_{1}|}^2}
  48. H

    Runge-Kutta for sovling 2nd ODE

    Hi, Could someone please show me how to solve the following simple problem using the Runge-Kutta (RK4) integration method? (tw')' + tw = 0 with w(0) = 1, w'(0) = 0 on the interval [0,1] by introducing the new variable v=tw' and considering the resulting first order differential system...
  49. S

    White Dwarf Star Coupled Runge-Kutta

    Homework Statement Use a coupled fourth order Runge-Kutta, to find the structure of white dwarf stars. I think I am applying the Runge-kutta method wrong? Variables defined in C code notes Homework Equations Equations in c code. and in attached images. The Attempt at a Solution This is...
  50. A

    Runge-Kutta 4 with 2nd Order: Solving Variables (x,y,Q)

    i would like to programing in MATLAB with runge kutta 4 with 2nd order the variables (x with y and Q) where x distance , y hight of water and Q discharge from the following tow equation dydx = (s0-(((Q0^2*n^2)/(B^2.*y^(10/3))*(1+2.*y/B)^(4/3))+dQdx))/(1-Q0^2/(g*B^2*y.^3)); dQdx =...