# What is Runge kutta: Definition and 56 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. ### Wrong solution order using Runge Kutta 4

Hi, I'm trying to simulate a 3-body problem with a star at the center of reference system and 2 body orbiting around it using Runge Kutta 4. The 2 bodies perturb each other orbits gravitationally, so my ode system is actually a coupled armonic oscillator and I evaluate the solution of both...
2. ### 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...
3. ### Help with 2nd order Runge Kutta and series expansion

So here's my homework question: This is the reference formula along with the Rung-Kutta form with the variables mentioned in the question Here is my attempt so far: Problem is that i am unsure how to expand this to even get going. I tried referencing my text Math Methods by Boas which has...

6. ### A Runge-Kutta: Maintaining Units in Numerical Methods

When conducting numerical methods using 4th Order Runge-Kutta do the physical units have to be maintained? This never occurred to me until I was writing out all the steps in detail when showing someone I work with the method using a simple projectile motion with drag. It had 4th Order time...
7. ### A Runge Kutta finite difference of differential equations

Hi PF, initially I would like you to focus on that link https://books.google.com.tr/books?id=Dkp6CwAAQBAJ&pg=PA389&lpg=PA389&dq=runge+kutta+method++is+tvd+proof&source=bl&ots=47ULQDVwcC&sig=e2zjdnXENJ7WxBbrf6hXkSouvLI&hl=tr&sa=X&ved=0ahUKEwjU5Z2XsbXZAhUMCMAKHWpnATQ4ChDoAQhKMAQ#v=onepage&q=runge...
8. ### Runge Kutta to solve higher order ODE

Homework Statement Edit* should say F'(0) = F(0) = 0 Homework Equations I know that I typically need 3 equations for a 3rd order ODE, does this apply if the is no F'? In the picture above are the equations I came up with, am I on the right trail? Lastly I am familiar with RK4, however I have...
9. ### A I need some help with the derivation of fourth order Runge Kutta

Hey guys, I need your help regarding the derivation of the fourth runge kutta scheme. So, I found http://www.ss.ncu.edu.tw/~lyu/lecture_files_en/lyu_NSSP_Notes/Lyu_NSSP_AppendixC.pdf this derivation. Maybe you have a clue what tehy are doing in C.54. So before this they are calculating the...
10. ### Python Runge Kutta for nonlinear system of equation

I am applying a 4th order Runge-Kutta code to solve the following: $$\frac {\partial y_1}{\partial t} = y_2 y_3 - C_1 y_1$$ $$\frac {\partial y_2}{\partial t} = y_3y_1 - C_2 y_2$$ \frac {\partial y_3}{\partial z} = y_4...
11. ### Second Order Runge Kutta for Simple Harmonic Motion

Homework Statement The ordinary differential equation describing shm is d^2x/dt^2=-w^2x where x is the displacement, t is the time and w is the frequency. If x=0 at t=0, the analytical solution is x=Asin(wt), where A is the amplitude. 1) Rewite equation 1 as two first oder ode's suitable for...
12. ### MATLAB Solving Orbital Motion Equations with RK4 Using MATLAB

I'm trying to plot the solutions of the second order differential equation d^2R/dt^2 = GM/R^2 + Lz^2/R^3. I'm reducing this to a system of first order ODEs and then using RK4 to solve this system. My code is given by function RK4system() Tsim = 10...
13. ### Stability function for a basic RK method

Homework Statement Hi, can someone explain how they get this stability function. Homework Equations http://blob:http://imgur.com/840ee1fe-f09c-49ab-bdbb-7f953777f900 The Attempt at a Solution I have attempted to do it two ways, and I'm not sure if I'm just having an awfully bad day at maths...
14. ### A Numerical Solution for Complex PDE (Ginzburg-Landau Eqn.)

I am looking to numerically solve the (complex) Time Domain Ginzburg Landau Equation. I wish to write a python simulator to observe the nucleation of fluxons over a square 2D superconductor domain (eventually 3D, cubic domain). I am using a fourth order Runge Kutta solver for this which I made...
15. ### 4th order Runge Kutta Matlab with 2 2nd order ode

Homework Statement Hi There! MX''=Fn(sin θ - uCos θ ) MZ''=Fn(cos θ + uSin θ ) - Mg Fn,M,θ,u is constant fn/M = 0.866 M = 6000 θ = 30 u = 0.5774 i split my motion equation into 2 individual 1st ode, X' = Vx Z' = Vz Vx'=[fn*(sin θ - uCos θ )]/M Vz'={[fn(cos θ + uSin θ )]/M} - g...
16. ### Oribit integrator for a logarithmic potential

Hello! Right know I'm trying to make an orbit integrator for solving a logarithmic potential with the form: $$\Phi= \frac{v_0^2}{2} ln(x^2+ \frac{y^2}{u^2} + r_0^2)$$ where v0, u, and r0 are constants My approach is to use, \ddot{q} =...
17. ### 4th ODE runge kutta (hiemenz equation)

Hi all i want to write a MATLAB code by runge kutta solution for hiemenz equation. F''' + FF'' + 1 - F'^2 = 0 BCs F(0)=F'(0)=0 and F'(inf)=1 I have programmed for RK Fehlberg, RK4 and RK5 method but the results of these three methods are not matching with actual values. In the cod I defined...
18. ### What is the semantic error in my code

Note that the code I am using is Python. Currently, I am attempting to numerically solve the equations of state that give rise to the Chandrasekar limit for a white dwarf star. My code works for a simple harmonic oscillator given the correct equations of motion, but does not compute the correct...
19. ### Is this correct second order approximation?

I have a second order differential equation of the form (theta is a function of time): \theta ''=F\left(\theta ,\theta '\right) Turning them to two first order equations I get: \begin{cases} \theta '\:=\omega \\ \omega '=F\left(\theta ,\omega \right) \end{cases} And here's the algorithm...
20. ### Using the Runge Kutta Method to determine mass

I am confused on how to use the Runge Kutta method to solve for a relationship between the Chrandrasekhar Mass and radius on the following two equations of state: dx/dr = (-5/3)*(M/r^2)*[sqrt(1+x^2) /x] where x(r=0) = x_c dM/dr = +3*(r^2)*(x^3) where M(r=0) = 0 where M is the mass, r is...

22. ### Runge Kutta question, equation has dx/dt in it and non linear term ?

How does one set up the Runge Kutta for \frac {d^2y} {dt} m = b(\frac {dy} {dt} - \frac {dx} {dt}) + k (y-x) ? Set up the substitution variables: a = \frac {d^2y}{dt} v = \frac{dy} {dt} Then what ? Is there a way to get \frac{dx} {dt} out of the equation ? If not, I have to...
23. ### 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)## ...
24. ### MHB Plotting runge kutta 4 stability region

How can I plot the runge kutta 4 stability region? I know on the i axis the max is $$\pm 2\sqrt{2}$$. The plot makes a heart type shape. I don't know how to plot it though but would like to.
25. ### Runge Kutta method to solve second order ODE

Homework Statement Need to solve xy''+y'+xy=0 using Runge Kutta on x[1,3] Couldn't find algorythm to solve second order ODE using this method I know how to do 1st order Homework Equations The Attempt at a Solution I know I have to make this equation into 2 first order ODE...
26. ### Help in runge kutta problem to determine period of a comet

Hi everyone: I have trouble in an assignment I was given. The instructions are to utilize Runge-Kutta order 2 and 4 to determine the period of the comet Halley (perihelion = 0.586 AU and aphelion = 35.1 AU). The period of the orbit is given by Kepler's third law: Period = Sm3/2 where...
27. ### A basic ODE where Runge Kutta doesn't work?

From a cubic function where y(0)=1, y(1)=0, and where there is a local max at y(5/13) I created a basic separable differential equation problem. I wanted to analyze how well different ordered Runge Kutta methods works in an interval [0,1]. Here it is: dy/dt=-6(6/13)1/3(y-343/468)2/3 , y(0)=1...
28. ### Can Runge-Kutta be used for problems with more than 2 independent variables?

Hi, I am trying to use the Runge-Kutta method for a problem that looks like this: dy/dt= f(u,v,r) where y= r*L I was wondering if dy/dt can be a function of more than 2 independent variables? Also do I need to do some kind of uncoupling of r and L? (I think L can be in a way...
29. ### Solve DiffEq for Runge-Kutta 4th Order Input

Hi, Hi. I am trying to enter some differential equations into a Runge-Kutta 4th order spreadsheet which requires input in the form y' = ...? My differential equations are in the form : dvx/dt = -FDvx/mv (i.e relate velocity derivative with respect to time to acceleration). Can anyone...
30. ### Approaches to Runge Kutta step size adjustments

I've written a Runge Kutta algorithm that uses a fixed step size. It works fine for many of my problems dealing with chemical reaction kinetics but I would like to make it faster and more robust by implementing automatic step size adjustments. I have looked at the at the step-doubling...
31. ### Solving Second Order Differential Equations using Runge Kutta

Homework Statement In aerodynamics, one encounters the following initial value problem for Airy’s equations: y''(x) + xy = 0, y(0) = 1, y'(0) = 0 Using the Runge-Kutta method with h=0.005 and determine values between x=0 and x=10 sufficient to sketch the relationship...
32. ### Finding the Initial Point for Runge Kutta 4th Order

Hi guys I have two points A and B (in 2 dimensions) and want to use runge kutta 4th order to give me points between these two points starting from A __> B (NOT B___> A). How can I choose the initial point then. Cheers,:smile:
33. ### Runge Kutta for solving 2nd order ODE

Homework Statement (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 involving w and v Report your computed solution (wh(1),vh(1)) for h=1/10. Homework Equations The...
34. ### Particle rotation in galaxy - runge kutta 2nd order help

Homework Statement Hi everyone, I'm a bit stuck and have been staring at my fortran code all day. For my project this year I'm writing a program to model a spiral galaxy in which gas clouds circulate, collide and produce star formation. I've written code for gravitational acceleration due to...
35. ### How Does the 4th Order Runge-Kutta Method Solve Coupled First Order Linear ODEs?

I just need to know the general form of the 4th order Runge-Kutta method? For two coupled first order linear ODEs. I can not find it specifically written online, I need it to write a program for the structure of white dwarfs stars, but I am okay with the Physics, just I have never used the...
36. ### 4th order Runge Kutta method for 2nd order ODE

Hello, i have a bit of a problem with uderestanding how exactly we use RK4 method for solving 2nd order ODE. And last conversation with my proffesor only added up to my confiusion. Further more i couldn't find any example dealing with this problem if any1 could provide link explaining this...
37. ### How to Determine Taylor Order for M2 in Runge Kutta Method?

Homework Statement h is the timestep Y' = F(Y) Mk,1 = F(Yk) Mk,2 = F(Yk + 0.5*Mk,1) Mk,3 = F(Yk + h*Mk,2) Mk,4 = F(Yk + h*Mk,3) Yk+1 = Yk + (h/6)*(Mk,1 + 4Mk,2 + Mk,4) Show that the local error is of fourth order The Attempt at a Solution I have written down the...
38. ### Runge Kutta Sine-Gordan equaiton.

Apologies if this is in the wrong place, but could someone explain to me how I go about converting the sine-gordan equation with 2 double derivatives into one with a single derivative, or how I alter the rung-kutta algorithm to accommodate such a double derivative?
39. ### C/C++ Adaptive step size algorithm in c++ for runge kutta

Hey guys, Attempting to write an adaptive step size function into a 4th order runge kutta integrator for basic orbits. The problems (so far) are as follows: 1.) The step size does not seem to change as one would expect if the recursive definition of the StepSize function was working...
40. ### Numerical Solution for Coupled Differential Equations using Runge-Kutta Method

Hi, I have got a coupled Differential equation : \ x_1''\ =\ \frac{F_1}{M_1}\ =\ \gamma\cdot{}\left[-\,\frac{M_S}{|\overrightarrow{x_1}|^3}\cdot{}\overrightarrow{x_2}+\frac{M_2}{|\overrightarrow{x_2-x_1}|^3}\cdot{}(\overrightarrow{x_2-x_1})\right] \ x_2''\ =\ \frac{F_2}{M_2}\ =\...
41. ### Reverse Runge-Kutta: Solving e^(x) + y = dy/dx [-1,1]

Homework Statement e^(x) + y = dy/dx, [-1,1], y(0) = 1, N = 4. Homework Equations The Attempt at a Solution h = b-a / N = 0.5 x0= 0, y0 =1 x1= 0.5, y1 = 2.472 x2= 1, y2 = 5.433 x3= 1.5, y3= 11.195 x4=2, y4= 22.146 ===================== These were the values I got for the...
42. ### Solve ODE with Runge Kutta of Order 4 on [-1,1] n=5

Homework Statement apply the runge kutta of order 4 to solve the ode on [-1,1] with n = 5 of (e^x+y)dx-dy=0 Homework Equations The Attempt at a Solution the problems i have done so far gave me an initial condition to find the k values, then to plus them into the formula...i...
43. ### How can I use Runge Kutta to solve coupled first order DE's in Matlab?

Hello All, I need to utilize a Runge Kutta second order approach to solve two coupled first order DE's simultaneously given some initial conditions and a conservation relationship. The DE's are as follows: \frac{dp}{dt} = aq - bp \frac{dq}{dt} = -aq + bp Where a and b are...
44. ### Why Is My Runge Kutta Implementation Not Working for Car Simulation?

I've been browsing the forum, but I haven't found a way to solve this thing, which has been frustrating me for quite a while, I'm trying to develop a simulation of cue formation and propagation on cars on a single lane road, and of course, I have to compute the acceleration of vehicles obeying a...
45. ### Runge kutta 4 & N-body problem

Hello ppl, I'm new here. I'm trying to compute RK4 for N-body problem. But after computing I'm getting strange numbers. So here are the formulas for these problem. Start from two differential equations of first order: [1] d\vec{r}/dt = \vec{v_i} [2] \frac{d\vec{v_i}}{dt} = \gamma...
46. ### Runge Kutta Script | C++ | Beginner

Hi. I am working on a runge kutta/integral finder. my goal is to make it "exact to the dx", so to speak. im a beginner at c++, so bear with me. the compiler I am using is dev cpp, incase it matters. my main problem was that apparently i can't have a long double array of size greater than...
47. ### Runge kutta method for solving PDE

Hi! If you don't see clearly this n terms please download the word file attached here. Am a given a problem like f(x,y,y')= y''= x+y with y(0)=0, y'(0)=1 and h=0.1 and i want to solve it using Ringe Kutta. As we know y_(n+1)= y_n + h(y'_n+(A_n + B_n + C_n)/3) And y'_(n+1) =...
48. ### How Can I Model a Damped Pendulum Using Runge-Kutta in C++?

Im using a C++ class to try and model the motion of a simple pendulum using numerical analysis, at this stage of my implementation I am trying to produce oscillatory output values of theta and v denoting the displacement and velocity of the pendulum of a period of time. I have successfully...
49. ### Using Runge Kutta Method for T.I.S.E in Electron Motion Approximation

Homework Statement I really am desperate for help on this one. I need to use the runge kutta method to approximate the motion of an electron in the potential below. The T.I.S.E is known, and I have to try and use the runge kutta method to find the wavefunction of the particle. V(x) =...
50. ### Adaptive runge kutta method

Hi I am using adaptive stepsize Runge Kutta (order4) method to solve a set of Lotka Volterra system of equations. But I am getting the errors 1) Step size too small 2) Too many steps in the routine Can somebody please help me on this.