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]).

Filter by
Sorted by
Tagged with
-1
votes
0answers
36 views

Identifying Noetherian symmetries from general Lie symmetries of a differential equation

I know the Lie symmetry group of the harmonic oscillator differential equation from the literature. It is an 8 parameter Lie group. 5 of these generators generate Noether symmetry: $$G_1=\sin(2t)\frac{...
0
votes
0answers
48 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 ...
3
votes
2answers
113 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? Sample outputs from ...
2
votes
1answer
80 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$ ...
0
votes
2answers
142 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 ...
2
votes
0answers
95 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: ...
1
vote
1answer
194 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 ...
0
votes
1answer
29 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 ...
9
votes
1answer
511 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 ...
3
votes
4answers
152 views

Solving the eigenvalue from a set of coupled second order differential equation numerically

I met a problem in solving a set of coupled differential equation, as shown below: $$A_1\psi_1(z)+A_2\frac{d^2\psi_1(z)}{dz^2}+A_3\frac{d\psi_2(z)}{dz}=\lambda\psi_1(z)$$ $$A_4\psi_2(z)+A_5\frac{d^2\...
3
votes
0answers
85 views

Numerical Soultion to Background equations of cosmology

I am trying to solve the background equations of cosmology numerically using Runge-Kutta Dormand Prince method with simplified assumption $8\pi G=1$ and $c=1$. The equations are $$\ddot a = - \frac{1}{...
0
votes
0answers
20 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 ...
7
votes
0answers
145 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 ...
0
votes
1answer
27 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 ...
4
votes
1answer
74 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 ...
0
votes
0answers
23 views

Why does this Non-Standard FDTD implementation lead to infinite increase in the magnitude of an EM pulse?

I have been working on a Particle-In-Cell Framework in Python and have noticed an issue where the magnitude of a EM pulse increasing infinitely as the simulation updates. Currently, I am using the Non-...
5
votes
2answers
563 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 ...
0
votes
0answers
54 views

Can I get a symbolic solution for these coupled ODEs?

I found this IPython notebook called ‘Roller Coaster’ from", "numfys.net, where they model the movement of a ball over a path described by a third-degree polynomial $y(x)$ with slope $\...
3
votes
1answer
302 views

Solving numerically the 1D Kuramoto-Sivashinsky Equation using spectral methods

Lately, I've been trying to solve numerically the 1D Kuramoto-Sivashinsky Equation using spectral methods. Let $\nu$ be the viscosity and $[0,L]$ the domain. The 1D equation is, $$ u_t + uu_x + u_{xx} ...
4
votes
1answer
79 views

Geometric integrators besides midpoint/Crank-Nicolson?

I have a first-order ODE $$ \dot{x} = a(t) \times x, \quad x(0) \in\mathbb{R}^3. $$ with $\|a(t)\| = 1 \;\forall t$. Consequently, $\|x(t)\|=\|x(0)\|$ for all $t>0$. I would like this to be ...
3
votes
2answers
242 views

How to solve second order coupled non linear differential equations

For a project I am doing, I have to solve the following system of differential equations numerically using my own code: $$ x^2K'' = KH^2 + K(K^2-1) $$ and, $$ x^2H'' = 2K^2H + \alpha H(H^2-x^2) $$ ...
1
vote
1answer
92 views

Numerical integrator for $a'(t)=e^{-a(t)}f(t)$

Suppose I know a function $f(t)$ and all its derivatives in $t$ in closed form. Given $a(0)$ and some $t_0>0$, I'm looking for an explicit integrator that can estimate $a(t_0)$, where $a(\cdot)$ ...
1
vote
1answer
92 views

Finite Element Method for 1D Poisson Equation with Inhomogeneous Boundary Conditions

Im trying to solve the Poisson equation in 1D: $$-u_{xx} = f(x), \hspace{6mm} u(a) = d1, \hspace{2mm} u(b) = d2$$Assuming a uniform partition such that $x_n = a + nh$, where $h = (b-a)/N$ and $n \in [...
2
votes
0answers
100 views

Find time step for Euler method in numerical solving of a system of non linear differential equations

I have a system of non linear differential equations in the form : $$\frac{dy_i}{dt}=\sum_j a_{ij} y_i y_j $$. I first tried to solve it with Python suing ...
0
votes
1answer
68 views

2 point BVP solver: how to compute errors

Background I am working with chapter 2 in LeVeque's book: https://faculty.washington.edu/rjl/fdmbook/ I have build my own solver in Python to solve the 2 point BVP: $$ \epsilon u''+u(u'-1) =0 , \\ u(0)...
1
vote
0answers
70 views

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

I'm trying to integrate the following SDE system from Dekker et al. To do that I'm using the Euler-Maruyama method which is basically a forward-Euler scheme plus a Gaussian noise term where the mean ...
4
votes
2answers
805 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-...
3
votes
0answers
57 views

Difference between wave vector and density matrix in numerical calculation of Schrödinger equation

I solved Schrödinger equation for a following tow-level time-dependent Hamiltonian numerically in two ways: ...
0
votes
0answers
244 views

Numerov method for solving Schrödinger equation

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 ...
-2
votes
1answer
48 views

Solving differential equation by setting vectorization `on` in MATLAB

This is a follow up to my previous question posted here. I've set up an ode system in MATLAB and I'm trying to vectorize the code to increase the speed of computation. The follow is the code for my ...
1
vote
1answer
56 views

solving differential equations with jacobian pattern

I'm trying to compare the simulation time for solving a system of differential equations with and without jacobian pattern for a toy model using ode15s in MATLAB. ...
2
votes
0answers
72 views

Linearising Nonlinear Coupled Partial Differential Equations - Alfvénic Diffusion

I am trying to solve the following coupled partial differential equations with a finite difference scheme: $$\partial_tf+v\partial_zf+\partial_z\frac{1}{W}\partial_zf=0$$ $$\partial_tW+v\partial_zW-\...
0
votes
2answers
553 views

Solve a system of coupled differential equations in Python

I have a system of two coupled differential equations, one is a third-order and the second is second-order. I am looking for a way to solve it in Python. I would be extremely grateful for any advice ...
7
votes
1answer
154 views

Which finite difference better approximates $uu'$?

I want to approximate $uu'$ with a finite difference. On the one hand, it seems to be $$(uu')_i=u_i\frac{u_{i+1}-u_{i-1}}{2\Delta t}=\frac{u_iu_{i+1}-u_iu_{i-1}}{2\Delta t}$$ On the other hand, $$(uu')...
-1
votes
1answer
894 views

ODEintWarning: Excess work done on this call (perhaps wrong Dfun type)

I was messing around with some numerical integration functions. I wrote an arbitrary differential equation to test my understanding, the code is as follows: ...
1
vote
0answers
64 views

Book recommendation on numerical methods for solving Integro-Differential equations

I was wondering if anyone could recommend a good book or resource on numerical methods for solving integro-differential equations? Of course I am familiar with the methods for solving ODEs and PDEs ...
1
vote
1answer
391 views

Trouble with backwards time integration in Python

I am struggling with a rather basic numerical integration task: Using Python's scipy.integrate.solve_ivp module to integrate an ODE sytem backwards in time. As a test, I am using the following ODE ...
2
votes
0answers
98 views

How to derive the adjoint sensitivity equations for a least squares objective function gradient

The Problem I would like to determine the gradient of a least squares objective function which depends on a vector of 40 parameters $p$, and the solution of a system of 32 differential equations. In ...
1
vote
1answer
175 views

Solution of Coupled Differential equation for a 2d linear flow using RK4 method in python 3

I want to study the dynamics of a 2d linear flow, whose dynamical equation is- $\begin{pmatrix} \dot{x_1}\\ \dot{x_2}\\ \end{pmatrix}=\begin{pmatrix} 1 & 1\\ 4 & -2\\ \end{pmatrix}\begin{...
1
vote
1answer
72 views

2-DOF Robotic Manipulator Trajectory Tracking Simulation

I am trying to simulate a 2-DOF planar robotic manipulator (have its joints follow a predefined trajectory) that's described by its dynamic model: $$ M(q)\ddot{q}+C(q,\dot{q})\dot{q}+G(q) = \tau $$ ...
1
vote
2answers
444 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 ...
1
vote
1answer
687 views

scipy odeint: excess work done on this call and very sensitive to initial value

I am trying out odeint and received the error 'Excess work done on this call (perhaps wrong Dfun type).'. The values returned are also super sensitive to small ...
0
votes
1answer
119 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(...
12
votes
1answer
979 views

Numerical computation of Lyapunov exponent

I'm trying to compute the Lyapunov exponent for a smooth continuous time dynamical system(say, $\dot{\bar{x}} = f(\bar x)$). I using the QR decomposition method. Here are the steps that I follow. ...
3
votes
1answer
144 views

How to get a more accurate cancelation

I shall try to get to the point, so let me know if there is something left and you need more details. I am solving a couple of equations that are not coupled explicitly, but their corresponding ...
2
votes
1answer
149 views

A problem with Poisson equation

I'm computing the Hartree potentials of atoms by solving the Poisson equation and I use hydrogen atom as a test case. The Poisson equation for hydrogen atom in atomic units is given by $$\nabla^2 V_H =...
0
votes
0answers
29 views

Set of integrators do not consistently solve an equation in Python

I must solve the following second order differential equation: $\delta \phi^{''}_{\mathbf{k}}+(3-\epsilon)\delta \phi^{'}_{\mathbf{k}}+\left(\frac{k^2}{a^2 H^2}+\frac{V_{,\phi\phi}}{H^2}-6\epsilon +4\...
3
votes
1answer
667 views

Solving the heat diffusion equation with source term

I am trying to solve the 1-D heat equation numerically with a variable source term. The system is basically a tank containing styrene in which it polymerizes to liberate heat. I have assumed that the ...
2
votes
0answers
53 views

How to increase the stability of a DAE solver?

I am trying to solve a set of linear PDEs of the form $$F\left(\vec{y},\frac{\partial \vec{y}}{\partial x},\frac{\partial^2 \vec{y}}{\partial x^2},\frac{\partial \vec{y}}{\partial t}\right)=0.$$ To ...
1
vote
0answers
39 views

Discretization formula for a system of two differential equations. "Solution to one of these is the initial condition of the other". In which sense?

Consider the following stochastic differential equation \begin{equation} dy=\left(A-\left(A+B\right)y\right)dt+C\sqrt{y\left(1-y\right)}dW\tag{1} \end{equation} where $A$, $B$ and $C$ are parameters ...