# Questions tagged [differential-equations]

For questions about solving, analyzing, or creating differential equations to model some system. If possible, include specific tags about the type of differential equation (e.g. [tag:pde], [tag:ode], [tag:stochastic-ode]).

169 questions
Filter by
Sorted by
Tagged with
32 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 ...
1 vote
42 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 ...
57 views

### Solving a system of PDEs with an ODE

I want to solve the following system of equations which consists two PDEs and one ODE: \begin{align} \rho_t+v\rho_x &= 0; \newline Y_t+vY_x &= 0 ;\newline v_t &= -\frac{1}{(\...
50 views

### How to solve advective equation with source term depending on variable

I have the following equation $$\dfrac{\partial s}{\partial t} + \nabla \cdot \left( \vec{v} s\right) = f(s)$$ Where $f(s)$ is an explicit source term that depends on $s$, e.g., ($\sin(s)\;cos(s)$). ...
52 views

### Differential equation for radioactive cooling in fortran

Today I'm trying to evaluate this differential equation for internal energy in a gas in Fortran: $$\frac{du}{dt} = - \frac{n_H^2}{\rho}\frac{\Lambda}{n_H^2}$$ Where nH is the density of hydrogen in ...
138 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 ...
• 193
89 views

238 views

• 123
64 views

### Solve simultaneous differential equations with embedded functions and a parameter estimation

The aim is to solve the below equations and plot $m$ with time, i.e. $\frac{dm}{dt}$ $k$ is unknown and needs to be estimated. For the parameter estimation, the below values in the table for m versus ...
221 views

### Is there a Python version of the ODE tool pplane?

This is the same question as this one, except for Python instead of Mathematica. Basically, the MATLAB software PPLANE is a staple in ODE courses. Is there a Python equivalent? I don't know much about ...
91 views

### Implicit integrator for ODE with quadratic right-hand side

I have an ODE for an unknown $x(t):[0,\infty)\to\mathbb R^n$ of the following form: $$x_i'(t)=a_i^\top x(t) + x(t)^\top Q_i x(t),$$ for $i\in\{1,\ldots,n\}$. Here, the vectors $a_i\in\mathbb R^n$ ...
• 1,331
1 vote
522 views

### Recommendations for ODE solvers for stiff equations

I'm continuing the research of a former Ph.D. student in my group requiring the solution of a system of ODEs. On a technical note, they wrote: The system of Boltzmann equations behaves numerically ...
• 105
118 views

### Floquet theory for periodic delay differential equations: current numerical routines

I would like to determine the stability of a system of periodic delay differential equations (a seasonal host-parasite model). I've tried to implement the method described in Lemma 2.5 in this paper: ...
• 21
1 vote
998 views

### solve_ivp from scipy does not integrate the whole range of tspan

I'm trying to use solve_ivp from scipy in Python to solve an IVP. I specified the tspan ...
1 vote
98 views

### Logistic growth curve using scipy is not quite right

I'm trying to fit a simple logistic growth model to dummy data using Python's Scipy package. The code is shown below, along with the output that I get. The correct ...
675 views

### How to solve a second order differential equation (diffusion) with boundary conditions using Python

I am having trouble implementing a model from a publication. Huang, K-L.; Holsen, T.M.; Selman, J.R. Ind. Eng. Chem. Res. 2003, 42, 15, 3620–3625 scihub link: https://sci-hub.se/10.1021/ie030109q I ...
195 views

• 39
30 views

### How to solve nonlinear second order ODE in Matlab? [duplicate]

I am working on simulating a car suspension system using Matlab. Specifically, I have to derive equation of motion using the Lagrange method and then use ode 45 to solve it. However, while using ... 161 views

### Is there a graphical interpretation or explanation of automatic differentiation compared to numerical differentiation

I have been looking at automatic differentiation for solving differential equations lately. I understand the basic ideas of using Dual numbers and such for finding derivatives, etc. However, I feel ...
• 255
48 views

### How to decrease error in (FTCS) forward time centered space method?

I am using the FTCS method for solving differential equations. I know that the condition for stable output is $$\frac{\alpha \Delta t}{\Delta x ^2} < \frac{1}{2}$$ But when I use the distance ...
• 13
111 views

### Finite Volume on Cubed Sphere

The US weather model uses an uncommon (?) discretization called 'Finite Volume on Cubed Sphere'. To avoid the singularities that occur at the poles when using lat/lon discretization, they instead ...
• 43
613 views

### Specifying ode solver options to speed up compute time

I'm specifying the 'JPattern', sparsity_pattern in the ode options to speed up the compute time of my actual system. I am sharing a sample code below to show how I ...
• 447
773 views

• 255
1 vote
103 views

### Stochastic differential equation system (SDE) : overflow encountered in double-scalars

I'm trying to integrate the following SDE system from Dekker et al.  \begin{cases} \frac{dx}{dt}=a_1x^3+a_2x+\phi+\zeta_x\\ \frac{dy}{dt}=b_1z+b_2(\kappa(x)-(y^2+z^2))y+\zeta_y\\ \frac{dz}{dt}=...
1k views

### CUDA & Python for numerical integration and solving differential equations

Can anyone please suggest some libraries which allow use CUDA in Python for numerical integration and/or solving of differential equations? My goal is to solve large (~1000 equations) of coupled non-...
I have just begun learning computer science to apply it to Physics and I am trying to write a code for solving Schrödinger's equation of the harmonic oscillator (setting $V=\frac{x^2}{2}$) in one ...