Skip to main content

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
3 votes
3 answers
109 views

inverse problem of predicting parameters of ODEs driven by data

Consider a system of ODEs \begin{align} u' = f(u,v)\\ v' = g(u,v) \end{align} with some unknown parameters in $f$ and $g$, where primes denote time derivatives. No data of $u(t)$ or $v(t)$ are ...
feynman's user avatar
  • 317
6 votes
2 answers
375 views

Order of numerical solver when calculating difference between forwards and backwards solution

I'm working in applied oceanography, where people are sometimes interested in calculating ``backwards trajectories'' of things floating on the ocean, i.e., going backwards in time to figure out where ...
Tor's user avatar
  • 243
1 vote
1 answer
202 views

ODEs solved by physics-informed neural networks

Is it possible that an ODE (with an IC) solution by physics informed neural networks (PINNs) turns out to be a mixture of several branch solutions of the same bulk ODE but with different ICs, even ...
feynman's user avatar
  • 317
1 vote
1 answer
107 views

Can I combine the backward and forward euler methods - simialr to modified euler method?

Constructing Modified Euler Using the same strategy as done in the construction of Modified Euler. Starting from Trapezoidal Method $$y_1 = y_0 + \dfrac{h}{2}\left(f(x_0,y_0) + f(x_1,y_1)\right)$$ ...
ray_lv's user avatar
  • 11
0 votes
2 answers
74 views

Raman model equations using RK4

I am trying to solve below ODE equations for Raman model but I am having errors, mostly overflow in multiply and add. Please I need your help. Below is the code I have written so far. I am new to ...
Nura Adamu's user avatar
2 votes
1 answer
100 views

From Runge-Kutta Butcher tableau to general linear methods matrices?

I am trying to understand how the relationship between Butcher tables for Runge-Kutta methods and their generalization to general linear methods matrices (by Butcher also). Runge-Kutta methods can be ...
Vincent's user avatar
  • 343
1 vote
1 answer
104 views

Educational Purpose: How to synchronize chaotic systems

The graph plots the X coordinate of the synchronized Lorenz chaotic system. I am self learning by reading research articles on how to synchronize identical chaotic systems. But as seen from the figure,...
Sm1's user avatar
  • 119
0 votes
1 answer
66 views

ode23, 45, 15s, 15i in matlab for conservative ODEs

Which of ode23, 45, 15s, 15i in matlab are dissipative or anti-dissipative for conservative ODEs? Do they STAY dissipative or anti-dissipative for ALL conservative ODEs nor not? If not, what about for ...
feynman's user avatar
  • 317
0 votes
1 answer
86 views

shooting method to compute the interface shape

I am trying to use a shooting method to compute the shape of liquid-gas interface given by the following differential equation: $$ \frac{d^2 \theta}{ds^2} = \frac{f(\theta)}{h(h + 3\lambda)} $$ with $\...
Sthavishtha Bhopalam's user avatar
1 vote
2 answers
126 views

How to estimate the stage error for Runge kutta method

Consider an ordinary differential equation (ODE) in the form $u_t=g(t,u(t))$ and apply the explicit Runge-Kutta method, as defined by the following Butcher tableau: $$ \mathrm{RK}(s,p):\begin{array}{c|...
Owen Jun's user avatar
  • 141
0 votes
1 answer
79 views

How to use a custom OdeSolver in Scipy's solve_ivp

In Scipy's solve_ivp documentation, we see the method argument can be either a string or a user-defined ...
Axel Wang's user avatar
  • 197
0 votes
1 answer
66 views

Local truncation error of given implicit 1-step scheme

I'm given the 1-step implicit scheme $$y_{n+1} = y_n + \frac{h}{6}[4f(t_n, y_n) + 2f(t_{n+1}, y_{n+1}) + hf'(t_n, y_n)],$$ where $y'(t) = f(t, y)$, and I'm seeking the scheme's local truncation error. ...
jackyooo's user avatar
2 votes
2 answers
949 views

Numerical implementation of ODE differs largely from analytical solution

I am trying to solve the ODE of a free fall including air resistance. I therefore defined my ODE as: def f(v, g, k, m): return g - k/m * v**2 which in my ...
Axel's user avatar
  • 123
2 votes
1 answer
179 views

Using Sundials CVODE in MATLAB

I'm currently using ode15s to solve a set of stiff differential equations. I am trying to use the MATLAB profiler to understand the section of the ode solver code which calls BLAS routines. Since the ...
Natasha's user avatar
  • 433
0 votes
1 answer
171 views

Using Crank-Nicolson to solve Non-Linear Schrödinger equation in Python

I aim to solve the (non-linear) Schrodinger equation using the Crank-Nicolson method in Python. Here are my two functions. ...
FairyLiquid's user avatar
0 votes
0 answers
138 views

Solving system of ODEs, where time derivative approaches infinity due top initial condition

I am trying to solve a problem in python using scipy's solve_ivp. The system of ODEs I am trying to solve is for coupled where I am solving for two time-dependent ...
HWIK's user avatar
  • 23
2 votes
2 answers
410 views

Solving IVP backward in time via python

I'm having difficulty solving an initial value problem (IVP) in Python backwards in time. The code is at the end of this post. First, please let me state my simplified problem. The forward IVP is ...
JesseJC's user avatar
  • 21
1 vote
1 answer
107 views

Isolating decaying solutions to nonlinear second-order ode

I need to solve a nonlinear ODE of the form $$ \frac{d^2 y}{dx^2} + \frac{1}{x}\frac{dy}{dx}-\frac{1}{x^2}\sin(y)\cos(y)+\frac{2}{\alpha}\frac{\sin^2(y)}{x}-\sin(y)=0 $$ numerically, subject to the ...
Ali Shakir's user avatar
1 vote
2 answers
701 views

How should I solve generalized eigenvalue problems in Python? (Orr-Sommerfeld equation)

I am trying to solve the Orr-Sommerfeld equation numerically, using the techniques given in this article. This leads to solving a generalized eigenvalue problem, that is, given two matrices $\mathbf A,...
K.defaoite's user avatar
0 votes
2 answers
169 views

Approximating the solution of a non-linear ODE using Python

This is my first time asking a question here, so please tell me if I have made a mistake or if anything is unclear. I am working on my high school research project on the motion of a ball falling ...
user1193197's user avatar
5 votes
2 answers
709 views

How do people know the classic Lorenz attractor is actually deterministically chaotic at infinite time?

Correct me if I am wrong, but I take it that people actually think the classic Lorenz system is fully characterized, i.e. we know what the attractor looks like and the various fractal dimensions of it,...
Axel Wang's user avatar
  • 197
4 votes
2 answers
426 views

Choice between DAE or ODE formulation for chemical systems

Consider a simple ODE system describing the evolution of two chemical species undergoing the reaction $A = B$ : $$ \frac{dn_A}{dt} = - k * n_A $$ $$ \frac{dn_B}{dt} = k * n_A $$ We can discretize ...
Anon_Chem's user avatar
1 vote
1 answer
324 views

How can we use the two boundary conditions for the Taylor-Maccoll Equations for Cone Shock Waves?

The Taylor-Maccoll equations below govern the gas dynamics around a supersonic, axially oriented cone. Using the notation from Anderson's Fundamentals of Aerodynamics, which uses a dimensionless ...
Jacob Ivanov's user avatar
2 votes
0 answers
67 views

Example: Velocity Verlet reduced accuracy

Velocity Verlet is often held to far more accurate than forward Euler while being no more expensive. Technically, this requires some degree of regularity on the potential. But, is there a convincing ...
msm's user avatar
  • 201
0 votes
1 answer
61 views

Reverse engineering phase shift and numerical damping

I've been trying to validate the physics behind a particle system framework, but I'm having some difficulties. A particle system is a set of lumped masses connected by spring-damper elements. Linear ...
AlexBatch's user avatar
2 votes
0 answers
69 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
  • 243
2 votes
1 answer
78 views

Differential Equation with Forced Behavior

I'm attempting to solve a strange differential equation problem. My goal is to know if there are kinds of ODE solver packages to solve this kind of problem. I'm solving a 1D Partial Differential ...
nicholaswogan's user avatar
3 votes
0 answers
101 views

A way to solve nonsmooth stiff ODEs

Let us considered the following ODEs \begin{align*} \dfrac{dX}{dt} = F(X), \tag{1.1} \end{align*} where the unknown $X\in \mathcal{D} \subset \mathbb{R}^l$ and it can be stiff. These ODEs can be ...
Tung Nguyen's user avatar
1 vote
1 answer
118 views

Do Explicit Methods Always Require an Analytical Solution

Following some comments from another question I wanted to ask: does an explicit method always require some sort of analytical function/solution? Let's take Euler for example. You have a function $f$ ...
cgbsu's user avatar
  • 33
0 votes
1 answer
168 views

Solve 1st order ODE in using `scipy`

I've been trying to solve the following equation $$ y(t)=-A\cdot\frac{\mathrm{d} y}{\mathrm{d} t}+B\cdot\left(\frac{\mathrm{d} y}{\mathrm{d} t}\right)^{2}+C \\ y(t=0)=y_{0}\\ $$ where $A$, $B$, and $C$...
BackSpace42's user avatar
1 vote
0 answers
101 views

System of ODEs with stochastic process

Consider system of ordinary differential equations $$ \begin{align} \frac{dx}{dt}&=\sigma(y-x)\\ \frac{dy}{dt}&=\rho x-y-xz\\ \frac{dz}{dt}&=xy-\beta z \end{align} $$ with $\sigma=10$, $\...
Midess's user avatar
  • 11
1 vote
1 answer
93 views

Solving basic barystochrone problem in python

I am trying to solve $\frac{u''}{1+u'^2} - \frac{1}{2(1-u)} = 0$ subject to $u(0)=1, u(1)=0$. If I understand how to do this properly, I first do the variable substitutions: $u = y$, $y_1 = y; y_2 = y'...
Makogan's user avatar
  • 263
0 votes
0 answers
65 views

Why do BVP solvers' APIs only allow "unknown" parameters in the derivative and residual functions but not "known" parameters?

I recently needed to solve a second order boundary value problem and noticed that both scipy.integrate.solve_bvp and Matlab's ...
user9794's user avatar
  • 465
1 vote
1 answer
542 views

Solving a 2nd order complex-valued matrix differential equation in Python

I am trying to solve the following complex-valued matrix differential equation backwards (i.e. not starting at $r=0$, but rather at $r > 0$): $F'' = 2ikF' + VF$. Here $F=F(r)$ and $V=V(r)$ are 2x2 ...
Martin C.'s user avatar
  • 229
0 votes
0 answers
71 views

accelerating solutions of ODEs with close by parameters

Suppose $\mathbf{u}^1\in\mathbb{R}^n$ is an unknown and $\mu^1\in\mathbb{R}$ is a known parameter. Suppose we have solved the non-linear system of equation for $\mathbf{u}^1$ using Newton's iterations....
NNN's user avatar
  • 760
3 votes
1 answer
236 views

Convergence-test for ODE approximates wrong limit

I am trying to numerically solve a differential equation but I am having trouble getting the convergence test to run properly. The problem is as follows: Consider an ODE $$y'(t) \enspace = \enspace f(...
Octavius's user avatar
  • 185
2 votes
2 answers
802 views

Using backward and forward Euler method to solve a certain stiff ODE

When using the backward and forward Euler methods to solve a certain stiff differential equation, what criteria does one look at before drawing the conclusion that one is more stable than the other?
Simon's user avatar
  • 23
3 votes
1 answer
123 views

Scipy solve_ivp sensitivity to random phase shifts

I am trying to solve a coupled system of ODE's using the solve_ivp function from scipy. The general form of the equation is given via $$\dot{y}(t) = M(t)y(t).$$ The time dependence of matrix is ...
raeel's user avatar
  • 31
2 votes
1 answer
716 views

How to extract intermediate calculation results from an SciPy ODE function in python?

I have a bit lengthier ODE function which was simulated by using Scipy solve_ivp function. During this simulation I calculated many parameters but as the output, I am taking out put only some other ...
Nis's user avatar
  • 21
0 votes
1 answer
203 views

Solve discontinuous ODE with lsode

I am trying to solve a discontinuous ODE using the lsode solver. I tried setting the t_crit parameter to specify the time where the discontinuity is present, but it ...
Bruno's user avatar
  • 101
0 votes
1 answer
268 views

solve_ivp not giving out any output and no error while souple 3 coupled 2nd order ODES

Please, someone tell me what is wrong in my code it does not give any outputs ( No plot nor print). The code is as below: ...
Lunthang Peter's user avatar
2 votes
1 answer
2k views

scipy.optimize.root not converging and RuntimeWarning

I am trying to solve the following problem: $$ \frac{d^2y}{dx^2}=\sinh(y) $$ Where the boundary conditions are: $y(0)=-1$, and $ \frac{dy(x\rightarrow \infty)}{dx}=0 $. Through central difference ...
HWIK's user avatar
  • 23
0 votes
1 answer
524 views

Passing additional arguments to `odeint` from `torchdiffeq` to solve an IVP

In Python I use the package torchdiffeq (as provided here) to solve initial value problems. Given an arbitrary function ...
tanasr's user avatar
  • 3
2 votes
1 answer
66 views

Solving constrained odes's using inbuilt solvers in Matlab/Octave

I would like to solve a set of coupled second order differential equations using inbuilt Matlab/Octave subroutines. These equations arise when trying to model sliding of mass ($m_2$) over a wedge of ...
Salil S. Kulkarni's user avatar
8 votes
2 answers
544 views

Are stiffness and instability equivalent?

To the best of my knowledge, stiffness of ordinary differential equations is difficult to capture but can be roughly described as problems where explicit methods don't work while implicit ones do. ...
Marten's user avatar
  • 231
0 votes
0 answers
77 views

Ratio of error norms or norm of error ratio in adaptive step size control?

Step size controllers for ODE solvers with adaptive step size usually track an error estimate $y_{\mathrm{err}}$ and compare it to the current state $y_\mathrm{current}$ to decide if a step can be ...
Marten's user avatar
  • 231
3 votes
2 answers
2k views

Inaccurate results of integration using scipy solve_ivp

I am trying to use solve_ivp to solve the following 1st order ODE: $$ \frac{d \rho}{d z} = \frac{m \theta}{(1+\theta z)} \, \rho, $$ subject to $\rho(z=0)=1$, where ...
Fryderyk's user avatar
3 votes
2 answers
132 views

Solving detailed combustion kinetics in CFD, where to start?

I have some experience solving single- and multicomponent Euler equations for modeling of gas flows, including combustible ones. The code (variations of finite-difference WENO methods) is written with ...
omican's user avatar
  • 347
9 votes
6 answers
923 views

What are good particle dynamics ODEs for an introductory scientific computing course?

I'm teaching an introductory course on scientific computing (programming in C/C++) and am looking for application problems which the assignments can be centered around. I'm thinking of ODEs for ...
Jesse Chan's user avatar
  • 3,142
1 vote
1 answer
158 views

Electric circuit model ODE leads to ODEintWarning: Excess work done on this call (perhaps wrong Dfun type)

I am trying to numerically solve the following ODE's of an electric circuit which models the battery of a vehicle: $\dot{u_{1}} = \frac{-u_{1}}{R_1C_1}+\frac{I(t)}{C_{1}}$ $\dot{u_{2}} = \frac{-u_{2}}{...
Pedro Dias Longhitano's user avatar

1
2 3 4 5
11