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

Whats wrong with my RK4 Orbital Propagator?

I am working in a RK4 orbital propagator, and I have followed the basic structure of: k1​=dt×f(tn​,yn​) k2​=dt×f(tn​+dt/2​,yn​+k1/2​​) k3​=dt×f(tn​+dt/2​,yn​+k2/2​​) k4​=dt×f(tn​+dt,yn​+k3​)​ yn+1=yn+1/6(k1+2k2+2k3+k4) tn+1=tn+dt I have…
dfernr
  • 1
  • 1
0
votes
1 answer

System of seven ODEs solve using solve_ivp or implement RK4

I'm trying solve a system of coupled ordinary differential equations, formed by 7 ODEs in python, using solve_ivp or either implement a fuction for RK4. The general physical problem is as follows: Cooling of photovoltaic modules with heat exchanger…
0
votes
1 answer

3 Body Problem Outputs a spikey ball rather than an orbital path

I'm trying to solve the 3 body problem with solve_ivp and its runge kutta sim, but instead of a nice orbital path it outputs a spiked ball of death. I've tried changing the step sizes and step lengths all sorts, I have no idea why the graphs are so…
isaact.h
  • 21
  • 3
0
votes
2 answers

How to Repeat an Iteration in a For loop, Python 3

I am currently working on implementing the numerical method RKF45 (Runge-Kutta-Fehlberg-45) with adaptive step size into python 3 and I believe I am running into a fundamental loop issue that I cannot resolve. Note, the portion of this numerical…
user11123019
0
votes
1 answer

Applying Forward Euler Method to a Three-Box Model System of ODEs

I am trying to model a system of coupled ODEs which represent a three-box ocean model of phosphorous concentration (y) in the low-latitude surface ocean (Box 1), high-latitude deep ocean (Box 2), and deep ocean (Box 3). The ODEs are given…
Savannah
  • 35
  • 1
  • 5
0
votes
2 answers

python code to solve the following initial value problem ordinary differential equation using Euler method over the interval (0 10)

i have this question Write a python code to solve the following initial value problem ordinary differential equation using Euler method over the interval (0 10) with 10 time steps. A) y'= -y -y^2 ; y(0)=1 If that exact solution was y(t) =…
0
votes
0 answers

Adaptive Runge-Kutta 4 method

I am trying to find the solution of DEQ dy/dx = 10*e^(-88.8888889(x-2)^2) - 0.6y. Function: def dydx(x,y): return -0.6*y + 10*np.exp(-(x-2)**2/(2*.075**2)) Single Step Solution: def direct(x,y,h): k1 = dydx(x,y) k2 = dydx(x+h/2,…
user15897459
0
votes
0 answers

I need to determine the velocity change that allows for an orbital rendezvous between two orbiting spacecraft

I need to perform an exercise with Fortran90 that has as its objective what is written in the title. I have a starting system formed by second degree equations with certain boundary conditions. I transformed the system to have equivalent first…
Bartim
  • 1
0
votes
1 answer

Numerically solving a pair of coupled second order ODES with odeToVectorField

I am attempting to use some of the functions in MATLAB to numerically solve a pair of coupled second order ODEs of the form \ddot{x} = f(x,y,\dot{x},\dot{y}) \ddot{y} = f(x,y,\dot{x},\dot{y}). I am able to get it to work with just one second-order…
0
votes
1 answer

C boundary value problem ,shooting method

source: https://www.ijeter.everscience.org/Manuscripts/Volume-6/Issue-4/Vol-6-issue-4-M-54.pdf this is the code for solving the boundary value problem by the shooting method . I decided to use the formula of the secant method (or in other words, the…
Vs_De_S
  • 155
  • 1
  • 6
0
votes
1 answer

Manual RK4 method for solving IVP (data formatting problem)

Currently I'm attempting to solve 4 coupled ODE's to stabilize an inverted pendulum on a cart. I have no problem doing it with ODEINT from Scipy, however, I can't make it work with a manual implementation. Most likely this is due to some weird data…
0
votes
0 answers

How do I define this differential equation to solve with Runge-Kutta method?

I am making a dynamic a dynamic model of a solar collector to find its oultet Temperature. The equation I am usin is the following: Collector equation for the dynamic model: For this equation, Tm is defined by the following equation Tm = (TFin +…
davidl8a
  • 3
  • 1
0
votes
1 answer

Solve motion equations for first ODE using scipy

I would like to solve motion first order ODE equations using scipy solve_ivp function. I can see that I'm doing something wrong because this should be an ellipse but I'm plotting only four points. Are you able to spot the mistake? import math import…
Laura V.
  • 37
  • 4
0
votes
0 answers

How can I convert this program from using for loop to indexing?

# -*- coding: utf-8 -*- """CP Q4.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1lIuthEQwk1StdYV32yUJhRjPP8PHCYEV """ # Commented out IPython magic to ensure Python…
0
votes
0 answers

How do I model for a cannonball's motion in Python?

I have a bit of code I'm struggling with; modelling a cannonball, so far I have answered task one, with the code pasted below, but I can't get my head around task two, so if someone could help me with that, I'll be very grateful! def f(r, t): …