# 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.

528 questions
Filter by
Sorted by
Tagged with
53 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. ...
1 vote
61 views

677 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?
105 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 ...
474 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 ...
133 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 ...
142 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: ...
1k 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 ...
308 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 ...
64 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 ...
524 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. ...
57 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 ...
1k 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 ...
122 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 ...
905 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 ...
1 vote
135 views

824 views

### Solving nonlinear PDE in Python with LSODA

I am attempting to solve a nonlinear diffusion equation of the form $\partial_t u = \partial_x (\kappa(u) \partial_x u)$, where the conductivity function $\kappa(u)$ is a power law $\kappa = u^{5/2}$, ...
1 vote
44 views

### stable solutions for Large-scale ODEs under boundary value problem

I'm doing FEM and have a problem about getting numerically stable solution for ODEs problems like: $$\frac{\mathrm{d}}{\mathrm{d}x}\mathbf{Y} = \mathbf{AY}, x\in[x_1,x_2]$$ in which $\mathbf{Y}$ ...
303 views

### How does non-dimensionalization improve the behavior of ODE solvers?

I have a set of coupled ODEs that I'm solving numerically. The independent variable is time and runs from values of $10^{15}$ to $10^{17}$ in units of seconds. The state variables in their usual ...
155 views

### Numerical solution to the Tolman-Oppenheimer-Volkoff equations for any equation of state (numerical or analytical)

I've been working on a code to solve the Tolman-Oppenheimer-Volkoff (TOV) equations for a while and recently I've got it right but only for one specific equation of state, the bag model, which is not ...
1 vote
31 views

### How to classify ODE equilibria that are stable but slowly changing in value with time?

I'm numerically solving a system of coupled ODEs where time is the independent variable. At each time, I can solve for the equilibrium values of my state variables where their respective derivatives ...
So I am trying to solve two equations simultaneously. The goal is to find values for $\frac{de}{dt}$ and $\frac{d}{dt}$ which are the rates of change of the variables $a$ and $e$. I am then ...