Questions tagged [ode]

Ordinary Differential Equations (ODEs) contain functions of only one independent variable, and one or more of their derivatives with respect to that variable. This tag is intended for questions on modeling phenomena with ODEs, solving ODEs, and other related aspects.

Filter by
Sorted by
Tagged with
2
votes
1answer
45 views

How to select initial time step in adaptive time step ODE solver (TR-BDF2)

The Problem I am currently reconstructing a TR-BDF2 scheme which contains the following two stages: \begin{align} y_{n+\gamma} & = y_n + \gamma \frac{h}{2}\left( f_n + f_{n+\gamma} \right) \...
0
votes
1answer
54 views

If I rescale the time in a differential equation, do I need to adjust the parameters?

Imagine I have a differential equation and I have some data and the model is supposed to fit the data. If I now rescale the time in the range 0 to 1, do I need to adjust the parameters of the ...
2
votes
1answer
52 views

How to derive the simplified Newton iteration in the TR-BDF2 ODE integration scheme

The Problem The TR-BDF2 explained in this paper [1], is quite a popular numerical scheme used to integrate $\dot{y} = f(t,y)$, consistent of the following two stages: \begin{align} y_{n+\gamma} &...
0
votes
1answer
87 views

How to set up the differential equation system to speed up computation?

I've set up a system of differential equations, obtained after discretizing pde, in the following way ...
0
votes
1answer
55 views

SciPy odeint fails in unpredictable ways on deterministic system of ODEs

I've been trying to solve the following (relatively simple) system of Lotka-Volterra ODEs in Python using SciPy's odeint: $$\dot{z_1} = z_1 \left(- \sigma z_1 + \sigma z_2 + \rho z_3 - z_4 - z_5\right)...
1
vote
1answer
39 views

Is there a way to bound the values of a variable when using scipy.integrate.solve_ivp in python?

I want to solve an IVP in python with two variables, x and u, but I need the values of u to be between 0 and 1. Right now it is giving me a solution with negative values for u. Here is the code I have....
2
votes
2answers
113 views

Numerical Methods of solving a non-linear ODE?

I want to solve the nonlinear equation $\frac{d^2x}{dt^2} + k\sin x = 0$, numerically. I found that solving this elliptic integral would be cumbersome, so is there a numerical method i could use to ...
0
votes
0answers
49 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 ...
0
votes
1answer
41 views

Odeint error for nonlineal differential equations

I receive the following error when I run the code. ODEintWarning: Excess work done on this call (perhaps wrong Dfun type). Run with full_output = 1 to get quantitative information. warnings.warn(...
3
votes
0answers
74 views

Numerical Issues with DDE from SEIRU$\delta$ model

I'm new in this community. I moved this question from Math community. I'm reading the following article Article Here and my target is to replicate the results for a project. SEIRU Model: I obtained ...
2
votes
1answer
78 views

System of moving, non-colliding particles in 1D

I have a system of ODEs for functions $f_i(t)$. At each time $t$, $f_i(t)$ is the position of particle $i$. The functions $f_i$ have a monotonicity property: at all times $0 < f_1(t) < f_2(t) &...
0
votes
0answers
91 views

Nondifferentiable coordinate transforms

Suppose that we have coordinates $u=u(x,y)$ and $v=v(x,y)$ in $\mathbb{R}^2$ so that $v$ is not differentiable when $u(x,y)=u_0$ where $u_0$ is a constant. Can we solve a differential equation, such ...
-2
votes
1answer
94 views

Writing a Matlab function after calling the ode45 solver

After using ode45 to solve a set of ODEs, I want to write a Matlab function to take the initial conditions x_0 as inputs and gives the final state x_1 at time T as ...
0
votes
0answers
82 views

How would one discretize the dynamical equations for Kerr spacetime?

Using the Hamiltonian for a test particle in Kerr spacetime, we arrive at the following equations for generalized position and momenta (in natural units, $G = c = M = 1$): \begin{align} \dot{r} &= ...
2
votes
1answer
278 views

Solving Lotka-Volterra Equations on Python

I'm trying to plot Lotka-Volterra Equations using Python. I am a real beginner when it comes to Python. I have these two equations: $$\frac{dR}{dt}=\alpha R-\gamma RF$$ and $$\frac{dF}{dt}=-\beta F+\...
2
votes
1answer
117 views

Why is $1/r^2$ force law giving spiral trajectory?

I have written a program to solve for Newton's 2nd Law of motion for a given force law, in 2D polar coordinates. It is known that if the force law is of the form $k/r^2$,we get conic sections as ...
4
votes
1answer
85 views

What is a dense ODE system? What is a sparse ODE system?

Can you provide a jargon-free (as much as possible) explanation of what is meant by "dense ODE systems", and "sparse ODE systems"? Some hints I have gotten from Googling: dense ...
2
votes
1answer
113 views

Calculating the Strange Attractor of the Duffing Oscillator in C++

I am simultaneously trying to learn computational physics methods, chaos, and C++. I think this is the right site for the question, and I apologise if not. I started working through Thijssen's ...
0
votes
0answers
65 views

Why is my numerical solution to a set of ODEs infinite?

I am trying to solve the following linear PDEs $$\frac{\partial u_x}{\partial x}=-[i\omega b_{||}+\nabla_\perp u_\perp],$$ $$\frac{\partial b_{||}}{\partial x}=-\frac{i}{\omega}\mathcal{L}u_x,$$ $$\...
1
vote
1answer
90 views

ODE forth-order very stiff equation with large errors

I’m using Mathematica home edition software to numerically solve a specific inflation equation in cosmology. The ODE equation is forth- order, non-linear, stiff. I was using the stiffness switching ...
0
votes
0answers
30 views

Simulating the response of nonlinear system with stiff differential equations

I want to simulate the response of a nonlinear system given in the following form: $$ \dot{x_1} = f_1(\bar{x_1})+g_1(\bar{x_1})x_2, \ x_1(0) = 0.2 $$ $$ \dot{x_2} = f_2(\bar{x_2})+g_2(\bar{x_2})x_3, \...
0
votes
1answer
36 views

MATLAB ode45 doesn't start at initial conditions

I wrote a code in MATLAB to solve a system of differential equations, but my solution doesn't seem to take into consideration the initial conditions I specified. I am not sure how to interpret this ...
1
vote
3answers
128 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 ...
1
vote
1answer
197 views

How can I evaluate more accurate energy eigenvalues from Schrodinger equation using shooting method?

I am trying to use the "shooting method" for solving Schrodinger's equation for a reasonably arbitrary potential in 1D. But the eigenvalues so evaluated in the case of potentials that do not have hard ...
2
votes
0answers
43 views

Solving a complex ODE with large number of variables (>1e6 variables) - best practise?

I have to solve a non-linear ODE of the shape $$\partial_zA=f(A)$$ with $f$ a non-linear function and $A$ a matrix/vector with >1e6 variables (i.e. $A$ is a matrix with >1000x1000 entries). For each ...
0
votes
1answer
165 views

solve_ivp - Overflow encountered in double_scalars

I'm modeling an electron that orbits the nucleus. Of course, charged particles radiate away there energy so it'll crash into the nucleus. My approach has been to to evaluate the coulomb force and add ...
0
votes
0answers
35 views

Scipy.integrate.odeint is returning curves with almost the same frequency for different damping ratios, shouldn't they be different?

I am trying to solve the ODE for a harmonic oscillator using Scipy's odeint solver for different dampening factors. I'm using the following code, based off of this example: ...
0
votes
0answers
40 views

More efficient way of solving for transfer function between boundaries of wave equation

I am considering the wave equation with position varying material properties $$ m(x) \frac{\partial^2 u}{\partial t^2} = \frac{\partial}{\partial x}\left(k(x) \frac{\partial u}{\partial x}\right), \...
0
votes
0answers
41 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 ...
2
votes
1answer
265 views

Vectorised second order ode solving in python

I am trying to write a python program that simulates the motion of a large number of particles by numerically integrating a second order ordinary differential equation. I first split the ODE into two ...
1
vote
1answer
94 views

Numerical solution of pendulum equation

Given a system of equations: \begin{align} &f''(x) = -a \cdot \sin(f(x))\\ &f(0) = b\\ &f'(0) = c \end{align} $a, b, c, dt, N$ are arbitrary parameters. How to get a values of $f(0), f(...
2
votes
0answers
71 views

Numerical method for harmonic oscillator with jumping constant

Let $k_1 \neq k_2$ be positive reals, $t_0 > 0$ and consider the following Cauchy problem in $[0,+\infty)$: \begin{cases} y(t) + k(t)y''(t) = 0 \newline y(0) = 1/\sqrt{k_1} \newline y'(0) = 0, \end{...
2
votes
1answer
136 views

Solving numerically a linear ODE

I start by saying that I do not have a strong background in numerical analysis, so I may miss some basic things or make trivial mistakes. Motivated by some problems in digital signal processing, I ...
2
votes
1answer
204 views

Lambdifying a symbolic matrix in Julia

If I have a symbolic matrix defined as T below, is there any way to lambdify this as function of variables, say σ..., and return ...
6
votes
3answers
128 views

Coroutines for ODE solvers

Are there any ODE solver packages that use coroutines and yield their results instead of functions and returning? Briefly, a subroutine in a programming language does some computations, returns a ...
1
vote
1answer
65 views

When is a dynamical system discrete vs. continuous?

I have a basic question to ask: Let's say I am reading a paper which gives a good model that consists of a set of ordinary differential equations, with first and second derivatives. Continuity is a ...
0
votes
1answer
287 views

integrate.solve_ivp bugged

I am trying to solve an ODE with solve_ivp, but I am getting strange errors. Documentation: https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html ...
2
votes
1answer
97 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 ...
-1
votes
1answer
103 views

Solving a large system of coupled ode. (Python)

I really have a problem here. I have not found a solution yet. The system I need to solve similar to this:(Basic idea) $$c_1 = \dfrac{dx}{dr}+y$$ $$c_2 = \dfrac{dy}{dr}+x$$ Both $c_1/ c_2$ are ...
3
votes
1answer
273 views

The velocity Verlet method and variable time steps

Does the velocity Verlet handle variable time steps? I found controversial statements about it. In the paper Skeel, R. D., "Variable Step Size Destabilizes the Stömer/Leapfrog/Verlet Method", BIT ...
1
vote
1answer
105 views

Numerical integration methods: Explicit vs Semi-Implicit vs Newton-Euler 1, 2 and use in cyclone physics engine

I am trying to understand the difference between explicit Euler and semi-implicit Euler integration, where in explicit Euler the current position is calculated as $$x_{n+1} = x_n + v_n$$ and semi-...
1
vote
1answer
78 views

Unexpectedly Slow Convergence Implicit Euler

I'm solving the coupled ODE $$ \left[\begin{array}{c}x^\prime(z)\\p_x^\prime(z)\end{array}\right] = C(z)\cdot\left[\begin{array}{c}x(z)\\p_x(z)\end{array}\right] = \left[\begin{array}{cc}0& A(z)\\...
4
votes
1answer
97 views

Parareal for particle simulations

Recently I have stumbled upon this video of M. J. Gander https://www.youtube.com/watch?v=dn5vqN8ezuE and the coresponding notes that he wrote on Time Parallel Time Integration and I find it a quite ...
3
votes
2answers
208 views

Solving ODE with “Jumpy” Coefficients

I'm numerically solving a linear coupled ODE of the form $$y^{\prime}(t) = \hat{M}(t)y(t)=\left[\begin{array}{cc}0& A(t)\\ B(t)& 0\end{array}\right]y(t),$$ and the difficulty I'm running into ...
5
votes
2answers
2k views

Solving coupled differential equations in Python, 2nd order

I have a system of coupled differential equations, one of which is second-order. I am looking for a way to solve them in Python. I would be extremely grateful for any advice on how can I do that! $k$...
-1
votes
3answers
191 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 ...
5
votes
0answers
168 views

How to compute numerical fluxes in the local discontinuous galerkin method for poisson equation 1D

Some days ago I began to study the local discontinuous galerkin (LDG) method, this is my first time working with a discontinuous method, so I decided to solve the poisson equation in 1D to learn the ...
2
votes
1answer
481 views

Numerical Solution to Rayleigh Plesset Equation in Python

I have been trying to numerically solve the Rayleigh-Plesset equation for a sonoluminescence bubble in Python. You can read about this phenomenon here: https://iopscience.iop.org/article/10.1088/0143-...
2
votes
2answers
176 views

Solving a 1D diffusion equation with linear and nonlinear source terms

I would like to numerically solve the following equation: $$\frac{\partial \rho (z,t)}{\partial t} = B(N_D \rho (z,t) + \rho(z,t)^2) + D \frac{\partial^2 \rho (z,t)}{\partial z^2}$$ with the boundary ...
3
votes
1answer
329 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 ...

1
2 3 4 5
8