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
71 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
99 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
79 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 ...
10
votes
2answers
1k views

Constructing explicit Runge Kutta methods of order 9 and higher

Some older books I've seen say that the minimum number of stages of an explicit Runge-Kutta method of a specified order is unknown for orders $\geq 9$. Is this still true? What libraries are there ...
1
vote
1answer
90 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 ...
-1
votes
3answers
184 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 ...
2
votes
1answer
141 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 ...
5
votes
1answer
395 views

Is there a database/website with Butcher tableaus?

I have started investigating in mostly Runge Kutta and Runge Kutta Nyström methods and there one of the only differences between the methods of the same type is their Butcher tableu. For the most ...
1
vote
1answer
196 views

Method to solve linear, first order ODE of generalized matrix matrix form

The equation and its meaning: Consider two sets $(A)_{l=0,...,m_a},$,$(B)_{l=0,...,m_b}$ of hermitian matrices and a set of positive semidefinite matrices $(C)_{l=0,...,m_c}$. Each matrix has the ...
0
votes
1answer
116 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 ...
0
votes
1answer
591 views

How to implement an integral condition when solving a BVP in MatLab

I am trying to solve a coupled system of ODE's using MATLAB's bvp4c function. I want to impose the condition that $$\int_{0}^{\pi} y_{1}(t) y_{1}(t) dt = 1,$$ where ...
4
votes
1answer
126 views

Recommendation for a fixed-step ODE solver?

My problem involves the solution of a second-order ODE with a fixed-step (input and output). Specifically, this ODE is the radial part of Dirac and Schrödinger equation for a spherical symmetric ...
2
votes
1answer
129 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
137 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 ...
3
votes
3answers
229 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 ...
1
vote
1answer
125 views

Parallel integration of dynamical systems

I need to solve the following problem: $$ \begin{cases} \dot{\vec{x(t)}} = A\vec{x(t)} + u(t)D\vec{x(t)} + u(t)\vec{b}, & x \in (0, T), \\ \vec{x(0)} = \vec{0}, \end{cases}$$ where $u(t)$ is known ...
2
votes
1answer
347 views

Forward and backward integration — cause of errors

I write a test program to integrate foward on $[0,T_f]$ and then backward on $[T_f,0]$ from the endpoint of the forward integration an Hamiltonian system: $$ \dot q(t) = \frac{\partial H}{\partial p}(...
3
votes
1answer
326 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 ...
2
votes
1answer
300 views

Step-size selection for an Trapezoidal Method ODE solver (ode23t)

I was reading the documentation of the MatLab ODE solver ode23t, and I've seen that the trapezoidal rule is used. Moreover, the error is estimated by ...
3
votes
1answer
752 views

Comparing Algorithmic complexity, ODE Solvers (Big O)

I am currently using the following three methods to solve differential equations: 4th order Runge Kutta Method Euler Method Internal scipy methods: ...
16
votes
2answers
4k views

Options for solving ODE systems on GPUs?

I would like to farm out solving systems of ODEs onto GPUs, in a 'trivially parallelisable' setting. For example, doing a sensitivity analysis with 512 different parameter sets. Ideally I want to do ...
1
vote
1answer
473 views

What is the state of the art in solving stiff initial value problems?

I'm looking for current references on solving stiff ODEs. Most of what I know (say, BDF methods) apparently date back to the 1980's, and I feel like a lot of progress should have been made in that ...
30
votes
2answers
4k views

What does “symplectic” mean in reference to numerical integrators, and does SciPy's odeint use them?

In this comment I wrote: ...default SciPy integrator, which I'm assuming only uses symplectic methods. in which I am refering to SciPy's odeint, which uses ...
2
votes
2answers
67 views

ODE Event detection for calculating multiple roots of continuous sinusoidal equation

Hey everyone I have a paper that has a method for computing rise and set times of a satellite given a closed form solution. It is a complicated sinusoidal function and the paper has a method to ...
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
87 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
26 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, \...
1
vote
3answers
125 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 ...
0
votes
1answer
33 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
2answers
129 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 ...
1
vote
1answer
90 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 ...
0
votes
1answer
54 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 ...
2
votes
0answers
41 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
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
29 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
36 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 ...
5
votes
2answers
1k 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
vote
1answer
178 views

Integrating direct dynamics form more than 1 second does not give back the correct result

I am trying to simulate a robot manipulator dynamics in SciLab. Basically, I generated a step function that has constant acceleration for half of the time and then the same acceleration but negative ...
2
votes
1answer
126 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 ...
0
votes
1answer
145 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 ...
1
vote
1answer
93 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
1answer
2k views

2D cross section from 3D surface

I am trying to apply the "restoring force surface" method to a dynamic linear system. The idea behind this method is that, knowing acceleration, displacement, velocity and input force it is possible ...
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{...
6
votes
3answers
125 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
57 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
141 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
90 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
75 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 ...
10
votes
5answers
8k views

Dynamically ending ODE integration in SciPy

I have a light ray moving through space-time, i.e. a curve in $\mathbb{R}^4$, parametrized by some variable λ. The exact trajectory, i.e. the coordinate functions $x^μ(λ)$ of the curve are given by ...
3
votes
2answers
11k views

scipy odeint - Excess work done on this call

I'm newbie both in calculus and Python/Scipy so I apologize if this question is too dumb. I'm trying to model flow between two pressure vessels. Let's say we have two points and a link between them ...

1
2 3 4 5
8