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

2nd Order ODE by Runge-Kutta 4th order scheme in C

I am using the following code to solve a simple harmonic motion which is a 2nd Order ODE. The code gives me a sinusoidal response, but the amplitude keeps getting bigger and bigger which in actual should stay constant throughout. Can anyone point…
Amir Khan
  • 13
  • 2
1
vote
2 answers

Solving system of three differential equations using Runge-Kutta 4 in python

I wrote code for Runge-Kutta 4 for solving system of 3 ODEs I think that it does not work fine for because I solved the system with Euler's method and I had have the following results But with the RK4's code attached I get a very different…
1
vote
4 answers

Runge Kutta 4th order Python

I am trying to solve this equation using Runge Kutta 4th order: applying d2Q/dt2=F(y,x,v) and dQ/dt=u Q=y in my program. I try to run the code but i get this error: Traceback (most recent call last): File…
Magnus2211
  • 47
  • 6
1
vote
0 answers

Runge Kutta Fourth Order for system of dif equations

I was trying to solve a system of 2 differential equations using python script, but it seems I'm doing something wrong. I have 2 equations: dx/dt = ax - bxy dy/dt = -cx + dxy The integration interval is [15; 45]. a, b, c, d coefficients are given…
1
vote
3 answers

How can I find out the amount of susceptible, infected and recovered individuals in time = 50, where S(50), I(50), R(50)? (SIR MODEL)

How can I find out the amount of susceptible, infected and recovered individuals in time = 50, where S(50), I(50), R(50)? (SIR MODEL) # Equações diferenciais e suas condições iniciais h = 0.05 beta = 0.8 nu = 0.3125 def derivada_S(time,I,S): …
ksa
  • 13
  • 4
1
vote
1 answer

Runge-Kutta 4th order method to solve second-order ODES of the coupled RLC circuit

I am trying to solve the system of the second-order differential equations of the coupled oscillatory circuit using Runge-Kutta 4th order method in python. The system And the initial conditions are: Condition Value L_1 =L_2 2,5E-04…
yigal
  • 23
  • 3
1
vote
1 answer

Method Runge Kutta C/ C++

I really need your help. I don't understand why my program works incorrectly. I need to solve this using Runge Kutta Method y' = x*exp(pow(-x,2)) * sin(x) -2*x*y, y(a) = 1, a = 0, b = 2; Analytical answer: y(x) = exp(pow(-x,2)) * ( sin(x) -…
Shams
  • 11
  • 1
1
vote
0 answers

Golf putting problem using 4th order Runge-Kutta and Newton-Raphson

For a uni project I was asked to code a program to solve a two-point boundary value problem. The problem is referred as the putting problem and illustrates the shooting method for two-point boundary-value problems. The differential equations are…
V A
  • 11
  • 2
1
vote
1 answer

step doubling Runge Kutta implementation stuck shrinking stepsize to machine precision

I need to integrate a system of ODES using an adaptive RK4 method with stepsize control via step doubling techniques. The problem is that the program continues forever shrinking the stepsize down to machine precision while not advancing time. the…
1
vote
1 answer

How to fix incorrect energy conservation problem in mass-spring-system simulation using RK4 method

I am making a simulation where you create different balls of certain mass, connected by springs which you can define (in the program below all springs have natural length L and spring constant k). How I do it is I created a function accel(b,BALLS),…
Simon
  • 43
  • 4
1
vote
0 answers

Which integration method is best for n-body gravity-simulations (speed vs. accuracy)?

I am currently implementing a n-body-simulation (gravity/3D) for big n (depending on how things go > 1Mio. particles) and am wondering, what integration-method to use. I guess it should have variable step-size to minimize errors. I'm using the…
Paul Aner
  • 361
  • 1
  • 8
1
vote
1 answer

How to plot the variables generated in a for loop and with " OverflowError: (34, 'Result too large') "

I am trying to solve a Differential Equation with 4th Order Runge - Kutta method in Python3. The function is deliberately made so that the solution goes to infinity. My issue is that I have been asked to plot the iterative solutions, but cant seem…
1
vote
0 answers

Order of convergence Runge-Kutta changes with time

I wrote a program in Python to solve the 1D wave equation by treating it as a first-order in time linear system, where the spatial variables are discretized (using 2nd order methods) and I integrate in time using a 4th-order Runge-Kutta. My problem…
moonknight
  • 334
  • 1
  • 7
1
vote
0 answers

Runge kutta in GLSL exploding

I am trying to play with the approach in the following Shadertoy https://www.shadertoy.com/view/lsKGRW When I tried to do this myself using my own fragment shader, my Runge Kutta just kind of "explodes", there's nothing of the nice Schrodinger wave…
buddhabrot
  • 1,558
  • 9
  • 14
1
vote
0 answers

How to solve first order ODE equations of motion with given init

I have converted an equation to the first order ODE and now i would like to solve the motion equations for multiple periods with given conditions. The equations shall be solved with the following 0 values: x(0), y(0), vx(0), vy(0) = 3, 1, 2, 1.3 ×…