Questions tagged [runge-kutta]

The Runge–Kutta methods are a set of numerical methods for ordinary differential equations for the approximation of their solutions.

Filter by
Sorted by
Tagged with
0 votes
0 answers
52 views

ENO-Runge-Kutta discretization

One beginner's question about discretization of a Hamilton-Jacobi equation(non-linear) $$ u_t = H(u_x) $$ $u_x$ is discreated with 2nd order ENO-FD 1st order: $D_1^{\pm}u = \pm [u_{x\pm1} - u_x ] / \...
solanin's user avatar
1 vote
2 answers
112 views

Is there any way to reduce an RK4 method's dependence on step size?

I am working in the sphere of orbital simulations, where orbital trajectories are computed using the differential equations describing gravity. Due to the great timescales of orbits, a step size of ...
JS4137's user avatar
  • 133
1 vote
0 answers
63 views

How to prove a truncation error of integration when using runge-kutta to approximate exponential function

If I using the $s$ stage $p$ order explicit Runge-Kutta method with the following Butcher table $$ \begin{array}{c|cccc} c_{0} & 0 & & & \\ c_{1} & a_{2,0} & 0 & & \\ \...
Owen Jun's user avatar
3 votes
1 answer
143 views

Estimating the spectral radius when applying the method of lines

Some time integrators, notably the Runge-Kutta-Chebyshev method, implemented in the RKC code from Sommeijer & Verwer, gives the user an option to provide a callback with an estimate of the ...
IPribec's user avatar
  • 544
2 votes
1 answer
156 views

Does this second-order implicit Runge-Kutta method have a name?

I am studying the time-integration of the following paper, Young, L. C. (1981). A finite-element method for reservoir simulation. Society of Petroleum Engineers Journal, 21(01), 115-128. A copy (PDF)...
IPribec's user avatar
  • 544
2 votes
0 answers
90 views

Runge Kutta 4th order: unexpected result

My problem in brief: in some situations, the Runge Kutta 4th order method (RK4) doesn't seem to give 4th order improvement when using a smaller time step. I wonder how this worse-than-expected result ...
gamma1954's user avatar
  • 121
6 votes
0 answers
128 views

Runge-Kutta methods, higher derivative methods, and collocation methods

Consider an ODE system $$\dot x = f(t, x), \quad x(0) = \xi.$$ A collocation method to solve this ODE (1) assumes that $x$ can be approximated as a polynomial $x(t) \approx \sum_kx_kp_k(t)$ and (2) ...
Daniel Shapero's user avatar
1 vote
0 answers
75 views

Solving perturbed Einstein Boltzmann equations using RK4

I'm trying to learn to numerically solve the perturbed Boltzmann-Einstein equations in cosmology using the RK4 method. These are the equations: $$\dot{\Theta}_{r,0}+k\Theta_{r,1}=-\dot{\Phi}$$ $$\dot{\...
hidenori's user avatar
2 votes
1 answer
156 views

Runge Kutta Procedures for Incompressible Navier Stokes

I was playing a little bit with the Runge-Kutta procedure for the Incompressible Navier-Stokes equation and came up with something strange, so I would like to know where I'm wrong or doing something I ...
Marco's user avatar
  • 23
2 votes
0 answers
66 views

Order of local error when integrating ODE with discontinous derivatives

I'm working with ODEs, $$\dot{x} = f(x, t),$$ where the (higher) derivatives of the right-hand side have discontinuities. In particular, $f(x, t)$ is obtained by interpolation of discrete samples, and ...
Tor's user avatar
  • 181
2 votes
1 answer
239 views

Motion of the particle trapped in potential

I have lots of difficulties trying to make a phase plot for the motion of the particle trapped in Lennard-Jones potential: $$V(q)=\epsilon\left[\left(\frac{q_\mathrm{min}}{q}\right)^{12}-2\left(\frac{...
Jimmy Yang's user avatar
1 vote
2 answers
1k views

Fix step size with scipy.integrate.RK45 and scipy.integrate.LSODA

I am trying to numerically integrate a differential equation using scipy.integrate.RK45 and/or scipy.integrate.LSODA. Now, I am trying to fix the integration step sizes of both solvers. This, however, ...
Octavius's user avatar
  • 185
8 votes
2 answers
2k views

Energy conservation in RK4 integration scheme in C++

My colleague and I are trying to study the three-body problem, with different integration schemes, starting from the two-body problem. We implemented the symplectic Euler scheme and the Runge–Kutta ...
jack23456's user avatar
  • 171
1 vote
1 answer
396 views

RK4 integration of the three-bodies problem with C++

first of all thank you for all the answers you gave me yesterday for the integration via Symplectic Euler's method of the three-body problem. We managed to implement both Euler's and Runge Kutta 4's ...
jack23456's user avatar
  • 171
2 votes
0 answers
49 views

Dispersion of Runge-Kutta methods when applied to systems of ODEs

I am interested in computing the dispersion / phase error(s ?) of an (explicit) Runge-Kutta method when applied to a linear system of ODEs $$ u'(t) = A u(t). \tag{1} \label{1} $$ To begin, consider ...
Dan Doe's user avatar
  • 904
4 votes
1 answer
101 views

Stabilized Many Stage Runge-Kutta methods instead of Local/Multirate Time Stepping

Locally refined meshes are often inevitable for accurate, yet feasible computations. In the context of time-dependent PDEs, however, this comes at the cost that (due to the CFL condition) reducing the ...
Dan Doe's user avatar
  • 904
-1 votes
1 answer
47 views

What is the ERRCON parameter in rkqs?

Ive take a course in computational physics and was asked to implement some numerical methods to solve ODES. I was reading up on the algorithms described in the textbook: NUMERICAL RECIPES IN FORTRAN. ...
Vishal Jain's user avatar
1 vote
0 answers
172 views

Solving 1D Advection Equation Using Midpoint-Rule and Finite-Differences

I want to solve the advection equation ($v_0 \in \mathbb R$) $$ \frac{\partial f}{\partial t} + v_0 \frac{\partial f}{\partial x} = 0 $$ using 2nd order Runge Kutta like the midpoint rule for the time ...
xotix's user avatar
  • 241
2 votes
1 answer
593 views

Why is my Runge-Kutta 4 solution to the 1-D advection equation decaying so quickly?

I am trying to numerically solve the advection equation $y_t + y_x = 0$ using a the "classical" Runge-Kutta 4 explicit timestepping method, along with a left-hand finite difference ...
bosco98's user avatar
  • 23
1 vote
1 answer
90 views

Direct integration of 2D Euler Equations with Runge Kutta shows oscillating Courant-Friedrichs-Lewy coefficient. Stiff or Bug?

By writing the direct integration of the 2D Euler Equations in a wide and short box where the fluid enters and exits through the horizontal faces using the Runge Kutta O(4) method I have found that ...
Gaston's user avatar
  • 113
11 votes
2 answers
1k views

Why is RK45 used as the "default" method for non-stiff ODEs rather than a multistep one?

From what I read, the "default" go-to method for non-stiff ODEs is the Dormand-Prince Runge-Kutta pair; for instance, in Matlab docs, "Most of the time, ...
Federico Poloni's user avatar
2 votes
0 answers
156 views

Jacobian matrix cutoff in ODE solver

I am studying an implementation of a 3rd semi-implicit Runge Kutta method (siRK3) from the book by Villadsen & Michelsen (1978), Solution of differential equation models by polynomial ...
IPribec's user avatar
  • 544
2 votes
1 answer
1k views

N-body problem with differents solvers (RK2, RK4, Euler symplectic, Stormer-Verlet) : planets drift to infinity

I'm trying to write an integrator for the 2 and 3-body problem. I choose to start from a generalisation to N-body problem so I can just pass my bodies to the same integrator in the two cases. I'm ...
Mathieu Rousseau's user avatar
2 votes
0 answers
142 views

Divergence on wave equation simulation

I'm currenly working on my own PDE solver for non-linear simulations in python. I've done succesfully simulations for KdV and Fisher's equation, but now I'm playing with second order derivatives in ...
Rafael Riveros Ávila's user avatar
0 votes
1 answer
202 views

Perturbation problem using Runge-Kutta 4

I'm trying to evaluate the perturbations magnitude between 2 body orbiting a central one in three dimensions. In order to do this I need to have an estimate of the error, which I did using Richardson ...
Zebx's user avatar
  • 101
6 votes
1 answer
465 views

Special-case Runge-Kutta methods to exploit structure in linear ODE?

I am interested in numerical solutions of a linear, time-dependent ODE of the form $$ \dot y = A(t)y - Ry, $$ A good model is the following problem in $\mathbb R^2$: $$ A(t) = \begin{bmatrix}0 & -\...
johannestoger's user avatar
3 votes
2 answers
383 views

Using the BDF and RK4 methods to solve this coupled system of ODEs in C++

I'm trying to solve a system of ODEs using the BDF order 4 method. I find the first 3 points using RK4, then for the implicit part of the BDF, I use Newton-Raphson iteration. Unfortunately my solution ...
Michael B's user avatar
2 votes
1 answer
155 views

What is the derivation of the values of a1, a2, p1 and 11 in the Second Order Runge Kutta Method?

So currently I am studying about the Runge Kutta Second Order Method used to estimate first order ordinary differential equations. The following show the formulas. $$ y_{i+1} = y_i + (a_1k_1+a_2k_2)h $...
AndroidV11's user avatar
0 votes
1 answer
1k views

Python evaluating a second order ODE with RK4

Pasted below is my python code. It is a 4th order runge kutta that evaluates the 2nd order ode: y'' +4y'+2y=0 with initial conditions y(0)=1, y'(0)=3. I need help fixing it. When I run my code, my ...
J Wright's user avatar
3 votes
1 answer
157 views

How to get a more accurate cancelation

I shall try to get to the point, so let me know if there is something left and you need more details. I am solving a couple of equations that are not coupled explicitly, but their corresponding ...
user avatar
1 vote
1 answer
898 views

DOP853 integration method is missing (SciPy)

I was checking some integration methods provided by SciPy, in which the DOP853 should be included according to the webpage (https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate....
user avatar
1 vote
1 answer
353 views

Coupled second-order differential equations using runge kutta 45

As a little summer project I have tried to make a ballistic calculator for when I play football, (following an example from a book), just to learn some numerical methods while doing so. My problem is ...
Peter's user avatar
  • 33
1 vote
1 answer
99 views

How is the final result calculated in RK-Dopri(4,5)?

I have found a toy implementation of RK-Dopri(4,5), written in Python. I am concerned however, about line 118: y = y + h * (b1*K1+b3*K3+b4*K4+b5*K5+b6*K6) Has the ...
bzm3r's user avatar
  • 669
1 vote
0 answers
101 views

RK4-method starts oscillating above certain input parameters

I am trying to solve an equation of the following type $$\partial_zE(z)=-c_0J$$ with $$J=c_1\beta E^3(z)$$ using the boost::odeint-framework and a fixed time stepper, with $c_0$, $c_1$ and $\beta$ ...
arc_lupus's user avatar
  • 543
0 votes
1 answer
162 views

Method of Lines Runge-Kutta nonlinear stability and behavior

I have a system of 4 nonlinear 1st-order PDEs. I want to solve them numerically by method of lines, first discretizing space. This leads to the system of $N\times 4$ coupled ODEs. $$ \mathbf{u}_{i} =...
user8384493's user avatar
0 votes
1 answer
235 views

Two RK4 method in one program

I want to solve this integral using RK4 by coding in Fortran: $$R=∫1/a(t) dt → dR/dt=1/a(t) =f(t)$$ Initial point: t=0 (or a=0.001) and R=0 And I have to get a(t) by solving another ...
Elham Q's user avatar
  • 11
3 votes
1 answer
170 views

Time independent Runge Kutta integration of SDE

I am trying to compare the result of numerical integration of time independent Runge_Kutta, github page for stochastic differential equations with the analytical solution. True answer match the ...
Abolfazl's user avatar
  • 131
1 vote
3 answers
199 views

Runge-Kutta method for an ODE with initial value which is root of denominator

I wrote a code in Fortran to solve this differential equation using RK4 method: $$ \frac{dy}{dx}=A\sqrt{\frac{B}{y}+\frac{C}{y^2}} $$ $A$, $B$, and $C$ are some known constants. The problem is that ...
Elham Q's user avatar
  • 11
0 votes
3 answers
170 views

Changing variables in integral to avoid infinity

I want to write a code in Fortran to solve this integral numerically: $$\int_{1095}^\infty \frac{dx}{x\sqrt{(x+644.153)(4.17 \cdot 10^{-5} x+0.145)}}$$ What is the best method for it? I tried Monte-...
Elham Q's user avatar
0 votes
0 answers
2k views

Solving nonlinear pendulum using Runge-Kutta 4 for smaller steps

I am trying to solve nonlinear pendulum using 4th order Runge-Kutta method for limits between a=0.0 to b=110 seconds and simulated the results to observe the pendulum movement. But when I increase the ...
147875's user avatar
  • 276
2 votes
1 answer
125 views

Adaptive Runge-Kutta for Stochastic (Projected) Gross-Pitaevskii Equation

I am using the XMDS library for solving the stochastic (projected) Gross-Pitaevskii equation $$i \hbar \partial \Phi\left(\mathbf{r},t\right)_t=\hat{\mathcal{P}}\left\{(1-i \gamma)\left(\hat{H}_{\...
Jack G's user avatar
  • 21
2 votes
1 answer
1k views

Solving ODEs with nonlinear constraints

I'm trying to solve an ODE problem. Let's say $\mathbf{x}(t)$ represents the position of a particle at time $t$, and $\mathbf{u}(\mathbf{x},t)$ is a velocity field defined in Cartesian coordinates on ...
VarunShankar's user avatar
1 vote
0 answers
118 views

Shooting Method with RK4 and Thermal Radiation

I am attempting to numerically solve the following problem. I decompose it into a system of two first order ODEs and then solve via the shooting method. I use the fourth order Runge-Kutta (RK4) method ...
Nukesub's user avatar
  • 131
0 votes
3 answers
1k views

Solving coupled ODEs using Runge-Kutta method

I want to solve the following sets of $n$ coupled equations. Initial values of $x_{n}(t)$ and $p_{n}(t)$ are specified. The problem is, I have an 1D lattice where every particle is bound with ...
user157588's user avatar
3 votes
1 answer
164 views

Type of Rosenbrock method by its coefficients

A Fortran code that solves stiff PDE systems contains the following arrays of Rosenbrock-Wanner method coefficients: ...
sequence's user avatar
  • 216
1 vote
0 answers
2k views

Numerically solving a partial differential equation in python with Runge Kutta 4

I'm supposed to solve the following partial differential equation in python using Runge-Kutta 4 method in time. $$ \frac{\partial}{\partial t}v(y,t)=Lv(t,y) $$ where $L$ is the following linear ...
Andrew K's user avatar
3 votes
1 answer
465 views

The Formula of Explicit Runge-Kutta Fourteen order

I need an explicit Runge-Kutta 14th order formula. If you know about some reference that discusses at least 10th order (or higher, since I'm looking for the 14th) of Runge-Kutta and there is ...
user516076's user avatar
0 votes
1 answer
709 views

Solving differential equation in Python with discretized variable coefficients

I am trying to solve a differential equation with discretized variable coefficients which are calculated from a time serie. In this case the Runge-Kutta step size is fixed by the frequency in the time ...
Bouarfa Mahi's user avatar
6 votes
2 answers
1k views

Runge-Kutta in the presence of an attractor

Suppose you are solving a system of equations numerically that possesses an attractor (no matter the initial conditions set, all the different solutions will approach a specific set of values that ...
user avatar
2 votes
0 answers
240 views

What exactly is the cause(s) of blow-up for too-large step size in a method like RK4?

I have been working on creating a few home-made numerical methods, and I am using them to visualize text-book problems from my Strogatz dynamics textbook. It feels like a good way to learn numerical ...
rocksNwaves's user avatar