Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [runge-kutta]

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

0
votes
0answers
26 views

correct way to implement a 3/8ths-rule RK4 solver for a changing wind field

I am trying to simulate particles in a wind field. The wind field is variable and changes over both position and time. I can sample the wind vector at a given position p and a given time t using wind(...
1
vote
1answer
48 views

Step size updating scheme adaptive embedded RK methods

If I have a RK method $y$ of order $p$ and a RK method $z$ of order $p-1$ I have read I can estimate the local error as $r_{n+1} = y_{n+1} - z_{n+1}$. First of all I don't see how this estimates the ...
1
vote
2answers
63 views

TVD for temporal dicretisation

I have come across schemes where TVD (with flux limiters) is used for spatial discretisation along with Runge-kutta for Temporal discretisation. Can TVD be used for Temporal discretisation? If so ...
1
vote
1answer
42 views

Why is it assumed that $c_i = \sum_{j=1}^sa_{i,j}$ in the butcher tableau of a RK-method?

In my textbook it is stated that we make a "simplifying assumption" $$c_i = \sum_{j=1}^sa_{i,j}, $$ where $c_i, a_{i,j}$ are the constants in the butcher tableau. What's the relevancy of this ...
1
vote
2answers
40 views

Determine conditions on parameters (for consistency) on RK method $y_{n+1} = y_n + ha_1f(t_n,y_n) + ha_2f(t_n + b_1h, y_n + b_2hf(t_n,y_n))$

I'm asked to find the conditions on the coefficients $a_1,a_2,b_1,b_2$ in the RK method $$y_{n+1} = y_n + ha_1f(t_n,y_n) + ha_2f(t_n + b_1h, y_n + b_2hf(t_n,y_n))$$ such that is consistent of (a) ...
2
votes
3answers
138 views

How well do explicit Runge-Kutta “tableau” methods compare to the state of the art ODE solvers and when do they fail?

How well do explicit Runge-Kutta "tableau" methods compare to the state of the art ODE solvers and when do they fail? I've been reading Butcher's ODE book and he does a good job at introducing ...
2
votes
1answer
91 views

Euler Method Instability. Why?

I am currently enjoying writing computational codes as a hobby. Right now I've worked out an Euler method and results are pretty good with up to $x=1$. Over $x=1$, instability starts to kick in. May I ...
1
vote
1answer
55 views

Runge-Kutta when time dependence not known

As a simple exercise for a class in computational methods for physics, we've learned how to implement the RK4 (Runge-Kutta 4th-order) algorithm for a very simple exponential decay. E.g. the function y(...
4
votes
2answers
110 views

Estimating error at mid timesteps for Runge-Kutta methods

When a timestep $h$ is rejected using a Runge-Kutta pair, such as Dormand–Prince, the algorithm resumes from the same initial point $t$ with a smaller timestep. A different idea is to resume at an ...
1
vote
1answer
78 views

Stability Criteria for Numerical Solution of Windkessel Ordinary Differential Equation

I'm trying to solve this equation (Windkessel equation) numerically as: $$C \frac{d P}{d t} + \frac{P}{R} = Q(t)$$ Where $C$ is compliance, $R$ is resistance, $P$ is pressure, and $Q(t)$ is a known ...
5
votes
2answers
126 views

Methods for precise solution of an ODE whose solution terminates at a singularity

I'm working on a fun open-source project to calculate the trajectories of objects near black holes. This is obviously not the first time anyone has done this sort of thing, but I have some design ...
5
votes
1answer
142 views

How can I apply Euler's Method to predict a point in time rotating around multiple axis'

I am xposting this from my original stackoverflow question where I was presented with a coding challenge that I have been able to narrow down extensively and I think it lies with Euler's Method. Here'...
0
votes
1answer
98 views

Prescribing variables as an excitation in Runge-Kutta method

I am using Runge-Kutta to solve a $3 \times 3$ 2nd order linear ODE $$M x'' + C x' + K x = 0$$ and initial conditions are all zeros. Then I prescribe the 2nd variable to follow a given path. As for ...
0
votes
1answer
27 views

Confirmation of FSAL property for IMEX methods by Kennedy and Carpenter

This question is a continuation of Fourth order IMEX Runge-Kutta method and Implementation details for high order IMEX methods by Kennedy and Carpenter. I need confirmation that ARK3(2)4L[2]SA by ...
2
votes
1answer
83 views

Implementation details for high order IMEX methods by Kennedy and Carpenter

This question is a continuation of Fourth order IMEX Runge-Kutta method, concerning the implementation. Is seems to me that the first implicit stage value involves a direct evaluation, rather than ...
0
votes
1answer
81 views

Runge-Kutta timestep in atomic units

I'm using 4th order RK to solve the schroedinger equation in atomic units. Say I want to simulate 400fs in intervals of h=10fs, then in atomic units this is h=413a.u and 400fs=16500a.u. 4RK involves ...
5
votes
2answers
209 views

Do there exist low-storage Runge–Kutta methods with an order larger than four?

I’m trying to find a Runge–Kutta integrator that only requires the absolute minimum of storage, i.e. it fulfills one of the following three, presumably equivalent criteria: Each evaluation of the ...
3
votes
2answers
265 views

Developping PDE with Python symbolically and numericaly

I feel like publishing some previous works from my PhD thesis. I was using Mathematica to build a system of 2N partial differential equations for 2N functions by symbolic spatial Taylor expansion, ...
0
votes
1answer
507 views

4th order runge-kutta and harmonic oscillator [closed]

I am trying to solve equations of motion for an harmonic oscillator using 4th order runge kutta method, but as a result I get almost constant velocity and position; I feel that the problem is that I ...
1
vote
0answers
72 views

Successive iteration method for solving eigenvalue ploblem

I have a question concerning the branch of successive iteration methods (Newton, Runge-Kutta). I definitely know (or can read in Wikipedia) the implementation of these methods. But I was wondering ...
4
votes
2answers
189 views

Runge Kutta and Milstein – system of second-order coupled differential equations with noise

I would like to solve a system of second-order differential equations to describe the dynamics of a system of particles. Two Newton-like forces are responsible for the motion of each particle $i$: A ...
9
votes
1answer
224 views

Easily understandable argument that normal Runge–Kutta methods cannot be generalised to SDEs?

A naïve approach to solving stochastic differential equations (SDEs) would be: take a regular multi-step Runge–Kutta method, use a sufficiently fine discretisation of the underlying Wiener process, ...
6
votes
3answers
999 views

4th order Runge-Kutta for $y' = y$

My question is quite simple, but the more I look at it, the less content I am. My question is how to do a RK4 method for $y'=y$. At first I would assume the following: $$k_1=y_n$$ $$k_2=y_n+\frac{...
0
votes
1answer
107 views

ODE System doesn't work when step size (h) is bigger than 1

I am a beginner to Python. Currently I'm writing a code for developing a simple solver for non-linear ODE systems with initial value. The equations of the system are The function of myu is evaluated ...
15
votes
1answer
1k views

BDF vs implicit Runge Kutta time stepping

Are there any reasons for why one should choose high order implicit Runge Kutta (IMRK) over BDF time stepping? BDF seems much easier to me as $q$ stage IMRK needs $q$ linear solves per time step. ...
1
vote
0answers
73 views

How and when to use IMEX runge-kutta

i have come across method of IMEX Runge-Kutta written by Kennedy and Carpenter in july 2001. The method consist of two kind that is "implicit and explicit" can i use the ERK@explicit part only to ...
2
votes
0answers
626 views

Using RK2 Method to solve the simple harmonic oscillator of a horizontal mass on a spring (1D)

Being new to numerical analysis techniques, in particular RK2, I decided the best way to jump in is by using python to solve the well known mass-spring oscillator using RK2 techniques. My problem is ...
2
votes
1answer
911 views

4th order Runge-Kutta Method for Driven Damped Pendulum

Although I've been looking everywhere, I have been unable to find an answer to my question so here it is. For a driven damped pendulum the equation of motion in dimensionless units is, $$\alpha(\...
1
vote
1answer
102 views

VTK: Missing Streamlines due to error in Runge-Kutta method?

We are using Kitware VTK to visualize our models. When we display streamlines, it sometimes happens that a single streamline is left out. This can be especially seen when duplicating a model several ...
1
vote
1answer
205 views

Higher-order Verlet integration

I'm using a simple version of Verlet integration for a particle–particle interaction system with collisions. At the end of each iteration, I integrate like this: ...
2
votes
1answer
49 views

Can 3rd order TVD admit perfect shift for Upwind 1D Advection equation?

I recently coded a 1 stage and 3 stage optimal TVD-RK explicit scheme using eqn 3.3 here http://www.ams.org/journals/mcom/1998-67-221/S0025-5718-98-00913-2/ on the equation Ux+Uy=0, where x and y ...
1
vote
1answer
204 views

Numerical Free Fall Analysis with RK4

I am trying to calculate real speed and time in free fall of a body. I wrote a code in Fortran and I am trying to improve it by using RK4 method x=time y=total free fall Purple line using: ...
5
votes
2answers
417 views

Time discretization: Runge-Kutta methods vs. standard backward difference

I've recently written a code that solves the incompressible/low-Mach number formulation of the Navier-Stokes equation with high-order methods for both time and space. My advisor insisted that I use ...
1
vote
2answers
274 views

implementation of method of line and Runge-Kutta to the given equation

$$\frac{d^2 u}{dx^2} +A \frac{d^2}{dx^2}\left(\frac{du}{dt}\right)=B $$ I want to solve the equation given above. I need to first discretize it by the Method of Lines and then evolve the resulting ...
18
votes
4answers
5k views

Why are higher-order Runge–Kutta methods not used more often?

I was just curious as to why high-order (i.e. greater than 4) Runge–Kutta methods are almost never discussed/employed (at least to my knowledge). I understand it requires greater computational time ...
0
votes
1answer
210 views

Runge-Kutta Stability Regions

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 ...
-3
votes
1answer
251 views

Comparison between CashKarp Method and Dormand Prince Method - Runge Kutta Method

Can Cash Karp Method be used for integrating a nonsmooth solution ?. Because Dormand Prince method gives an error while integrating nonsmooth solution How can nonsmooth function can be integrated? I ...
3
votes
0answers
388 views

Scaling step size in adaptive runge-kutta method

I'm developing my own generic Runge-Kutta solver, and I'm currently implementing the adaptive step-size routine. I say generic because I want to be able to test different RK implementations by only ...
3
votes
1answer
197 views

Runge Kutta solution blows up for a first order ODE with very large coefficients

I am solving a first-order ODE: $\frac{\partial \rho }{\partial t} = -a \rho^2 + b |A(t)|^2 \rho +c|A(t)|^{2m}$ This is the evolution of the plasma density in the presence of a laser pulse (complex ...
1
vote
0answers
108 views

Preventing numerical oscillations with Cash-Karp method

I am implementing an ODE solver using the Cash-Karp method on equations with the following form: $$ \frac {d E}{d z} = - \frac {1}{\mu_0c} \frac {d ^2 E}{d z^2} + \frac {i}{\mu_0c}E \tag{1} $$ And ...
1
vote
0answers
124 views

Using backward difference approximations for higher order derivatives

I am trying to solve a system of equations and have a question regarding the validity of my approach when implementing a fifth-order Cash-Karp Runge-Kutta (CKRK) embedded method with the method of ...
1
vote
1answer
290 views

Solving first versus second order PDE

I am trying to numerically solve a PDE, and just had a question as to the validity of a certain approach. For example, given the PDE: $$ \frac {\partial ^2 E}{\partial t^2} = - k\frac {\partial E}{\...
12
votes
1answer
606 views

Why is leapfrog integration symplectic and RK4 not, if the latter is more accurate?

In a system where energy theoretically should be conserved, the most accurate simulation would conserve energy (as well as giving accurate positions, velocities and etc). RK4 is more accurate than ...
0
votes
1answer
207 views

Applying Runge-Kutta to nonlinear system of PDEs

I am applying a 4th order Runge-Kutta code, using the method of lines, to solve the following: \begin{equation} \frac {\partial y_1}{\partial t} = y_2 y_3 - C_1 y_1 \end{equation} \begin{equation} \...
1
vote
1answer
244 views

Object falling with air resistance using Runge-Kutta

I am not very familiar with differential equations, nor physics in general. I am trying to program an object falling with air resistance with the use of a numerical algorithm called Runge-Kutta. The ...
7
votes
2answers
3k views

Which Runge-Kutta method is more accurate: Dormand-Prince or Cash-Karp?

I simply want to know whether the Dormand-Prince Numerical Method or the Cash-Karp Numerical Method is more accurate.
2
votes
0answers
784 views

4th Order Runge Kutta: Integration of Differential Equations for Planetary Orbit

I'm supposed to integrate differential equations for $r$ and $\theta$ in order to simulate orbital motion. The differential equation I used for $r$ is second order and $\theta$ is first order. The end ...
0
votes
1answer
1k views

Equation of motion by RK4 method

I would like to sole the spring mass equation of the form: $M\ddot{Y}+B\dot{Y}+KY = F_y(t)$, where $M :$ mass, $B :$ Damping, $K : $ stiffness, $F_y :$ external force and $Y :$ displacement in ...
4
votes
2answers
216 views

Determine numerical infinity for Schrodinger equation $−\psi''(x) + x^ 2 \psi(x) = E\psi(x)$

Consider the following Schrodinger equation for the harmonic oscillator with real $x$: $$ −ψ''(x) + x^ 2 ψ(x) = Eψ(x). $$ I solve the last equation using shooting method and implicit Runge-Kutta ...
2
votes
3answers
203 views

Does it have an effect to interpolate data before using Runge-Kutta?

I am going to calculate a trajectory, by using a pre-calculated vector field. The values of the field are known on a grid which is quadratic in the horizontal direction, un-evenly spaced in the ...