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
0
votes
0 answers

Solving a large system of coupled differential equations using RK4

I want to solve a system of differential equations using the RK4 method, like given below. So for this case, I've to solve 3 differential equations- d/dt(x0) = -2*x1 d/dt(x1) = -2* x0 -8* x1 -2√2*x2 and d/dt(x2) = -2√2*x1 -14 *x2 Initial condition…
0
votes
0 answers

Runge-Kutta oscillate and does not converging

I would like to integrate a differential equation using Runge-Kutta 4. The equations do not depend on time. When doing the integration, I don't get the correct value. The right side of my equation is obtained by entering the variables by reference…
F.Mark
  • 147
  • 6
0
votes
1 answer

Comparing results of "ODE45" function versus 4th order Runge-Kutta for Influenza disease in MATLAB

I have written a code for a system of nonlinear differential equations which models the Influenza disease. I was surprisingly shocked when I wanted to simulate this system with 4th order Runge-Kutta and ode45function. The problem is that the results…
MMd.NrC
  • 91
  • 7
0
votes
1 answer

Solve a system of equations using Runge Kutta of order 4 in python

I want to solve the following system using the numerical method Runge Kutta of order 4: y'=-x-y x'=-x+sin(t) with initial conditions x(0)=0.75 and y(0)=0 Using RungeKutta of order code 4 I tried this: def GlucoseTT(x, t, params): a = params["a"] b=…
Jojo98
  • 1
0
votes
1 answer

Double Pendulum RK4

I am trying to implement the classical RK4 algorithm to solve the system of differential equations which govern the equations of motion. However, I am having several problems for a while. The equations of motion can be written as below: Since this…
0
votes
0 answers

4th order Runge Kutta method not working for coupled equations

I have to apply the 4th order Runge Kutta method (RK) to the coupled equation in handbook of marinecraft hydrodynamics and motion control, page 154, equation 7.33, to determine v and r for every iteration. the RK method works when I use the…
Rithwik J
  • 1
  • 1
  • 2
0
votes
0 answers

what is -nan(ind) and how do I resolve the error?

Instead of getting numerical values, I get -nan(ind) when the number of iterations increases. I have applied the 4th order Runge Kutta method in the program, and the functions are given in dvdt and drdt. #include #include…
Rithwik J
  • 1
  • 1
  • 2
0
votes
1 answer

Ways to Optimize Independent N-Body Simulations

I am relatively new to parallel computing and the Numba package. I am looking for optimization methods for my stupendously parallel N-body simulation. I've applied everything I know so far with Numpy arrays, JIT compliers, and multiprocessing.…
patrick7
  • 366
  • 1
  • 11
0
votes
0 answers

Heap corrupted and strange breakpoint in Runge Kutta diff eq solver

I'm trying to implement Runga Kutta method for solving the Lorenz differential equation system. At some point, the program always stops at a breakpoint which I can't see, and then throws an error about heap corruption. Something must be wrong with…
0
votes
1 answer

How to resolve double_scalar error in numpy?

I was using the 4th order Runge Kutta method to solve differential equations of the duffing oscillator with NumPy arrays, but I had received an Error. RuntimeWarning: overflow encountered in double_scalars Does anyone know the possible sources of…
James
  • 27
  • 5
0
votes
1 answer

How to perform adaptive step size using Runge-Kutta fourth order (Matlab)?

For me, it seems like the estimated hstep takes quite a long time and long iteration to converge. I tried it with this first ODE. Basically, you perform the difference between RK4 with stepsize of h with h/2.Please note that to reach the same…
Maximus Su
  • 17
  • 7
0
votes
1 answer

ODE45 and Runge-Kutta methods with matlab for optimal control about corona

I would appreciate if someone can help with the following issue. I have the following ODE: this is the project that I have worked to create a Matlab code to it https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7376536/#Equ1 the human…
0
votes
1 answer

Planetary orbit shown as linear graph using rk4

I am trying to simulate the orbit of a planet around a star using the Runge-Kutta 4 method. After speaking to tutors my code should be correct. However, I am not generating my expected 2D orbital plot but instead a linear plot. This is my first time…
0
votes
1 answer

Plot orbit of three bodies using rk4

I have been trying to plot the trajectories of three particles using the RK4 method. I haven't been able to produce an array of results over the time period as it brings up the following error message: File "C:\Users\Local\Runge-Kutta 4 Code.py",…
0
votes
0 answers

How to use a go.Scattergeo object (Earth) as a plot in order to plot a trajectory in the same plot?

I have a code which computes the trajectory of a body considering only the gravitational force acting on it using the runge kutah integrator. I've done it using Matplotlib, and couple days ago I found out Plotly which made me interested to make the…