# Questions tagged [differential-equations]

The tag has no usage guidance.

83 questions
Filter by
Sorted by
Tagged with
22 views

44 views

### Tsit5 implementation is super slow and too accurate

I have implemented Tsitouras 5(4) integrator in Python but it is sooo slow and too accurate compared to the tolerance I have set. How do I know it is slow? Because I did also implement Dormand-Prince ...
18 views

### Online Parameter Estimation

I have a system $\ y = θ^*u+d(t)$ where $\ y$ is the output , $\ u$ is the input which satisfies $\ u\epsilon L_{\infty}$, $\ θ^*$ is an unknown but constant parameter and $\ d(t)$ is an unknown ...
91 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$...
46 views

### Dealing with boundary conditions using Fourier spectral methods

I am currently working on a project where I need to use Fourier spectral methods to solve the KS equation. I found this code which is using the Fourier spectral methods to solve the classic 1D heat ...
107 views

### Numerically solving a partial differential equation in python with Runge Kutta 4

I'm supposed to solve the following partial differential equation in python using Runge-Kutta 4 method in time. $$\frac{\partial}{\partial t}v(y,t)=Lv(t,y)$$ where $L$ is the following linear ...
84 views

### Numerical Solution to Rayleigh Plesset Equation in Python

I have been trying to numerically solve the Rayleigh-Plesset equation for a sonoluminescence bubble in Python. You can read about this phenomenon here: https://iopscience.iop.org/article/10.1088/0143-...
53 views

### Stably solve transport equation with source term

I am trying to solve a transport equation of the form for the variable $\psi(t,r)$ \begin{equation} \partial_t\psi-\alpha(r)\partial_r\psi-\beta(r)^2\psi-f(t,r)=0 , \end{equation} where I am solving ...
20 views

78 views

### Crank-Nicholson for diffusion-advection vs diffusion equation

Let's consider the following 1D diffusion equation: $\frac{\partial u}{\partial t} = xk \frac{\partial}{\partial x}(\frac{1}{x}\frac{\partial u}{\partial x})$ where we assume that the diffusion ...
109 views

### Numerical integration in 2D

I would like to solve the following problem $$\vec{v}(x,y)= k\, \nabla \theta(x,y)$$ with respect to the unknown function $\theta$. Parameter $k$ is just a real constant quantity. I have two ...
19 views

### Offline Parameter Estimation for second order system - Ordinary Least Squares

I have a second order system which is described by the following differential equation: $\ \ddot{y}+α_{1}*\dot{y}=b_{0}*u$ where $\ y$ is the output of the system and $\ u$ is the input of the ...
42 views

### Imposing decaying boundary conditions on a non linear ode

I am trying to solve $a^{2}y''=y+y^3$ numerically. This equation models a potential and goes to $\infty$ for $x\to0$ hence I get the singularity to be of order $\frac{1}{x}$ by keeping only the y^{3} ...
118 views

### Solving an SDE with time-dependent parameter in R

I am trying to solve a system of SDEs in R using the Diffeqr package. Let's reduce the system to a simple ODE: ...
75 views

### How to Break Coupled ODEs down to first order for Runge-Kutta

My question might seem a bit simple. I am trying to solve a system of ODEs using Runge-Kutta method. I am having difficulty breaking down the equations into a system of first order ones required ...
73 views

### Numerical methods for non-linear diffusion

I have the following non-linear diffusion equation, for $\ z(x,t)$: $\ z_t = -C(\sin(\omega t))^m x^{hm}(hm x^{-1}(z_x)^n + n z_{xx} (z_x)^{n-1})$ Any advice for numerical (or analytical) solutions?...
28 views

### Book Recommendation: Analysis and design of mechanistic models - such as pharmacokinetics or hydrology models

I have been looking at an interesting book "Pharmacokinetic-Pharmacodynamic Modeling and Simulation" by Peter Bonate on pharmacokinetic models: the models of how medical drugs work their way through ...
56 views

### Numerical integration of SDE: choice of $dt$ and algorithm

I am working on the following Stochastic Differential Equation (SDE) in the Quantum Mechanics context: $$dX_{t} = a X_{t} dt + b X_{t} dW$$ where $X_{t}$ is my stochastic varible, $dt$ is my ...
65 views

108 views

96 views

### Numerically solving a partial differential equation

I am trying to numerically solve the following PDE, $$\frac{\partial u^A}{\partial t} = c_1\frac{\partial^2 u^A}{\partial^2x} \,,$$ where $c_1$ is a constant. The above can be discretized using the ...
81 views

### why I cannot find explicit finite difference for elliptic equation

Let us think on the Poisson equation $\nabla^2 u(\bf{x})=\rho(x)$ with Neumann boundary conditions, with $\bf{x}=\it (x,y)$ in 2D. Here is a stencil with central differences in both $x$ and $y$ (...
92 views

### How to solve an implicit ODE with forward Euler?

Consider the implicit ODE $$M(y)\dot{y} = F(t,y)$$ If $M$ is non-singular for all $y$ How to use the forward-Euler method to numerically solve for $y$ without inverting $M(y)$? I only came out ...
85 views

### PML boundary conditions

I set up two one-way wave equations for constant velocity $c$ in one-dimension. When I implement them I get a highly unstable (divergent) solution. I wonder if someone could give me a suggestion about ...
I am using a second-order finite difference in space and time approximation for the 1D wave equation. No source but initial data: $I(x)=\mathrm{e}^{-400 (x-0.5)^2}$. Velocity $c=1$, $nx=501$, $nt=... 1answer 266 views ### How write a integration loop in fortran, leapfrog scheme to solvind PDE (advection)? I want to resolve numerically this equation using of difference finite method with Leapfrog Scheme $$\frac{\partial{u}}{\partial t}+ v \frac{\partial{u}}{\partial x}= 0$$ I'm trying to write a code ... 1answer 149 views ### Can a second-order ODE be “inconsistent” with its boundary conditions? I am trying to solve a set of coupled, nonlinear ODEs. The only dependent variable is a 1-dimensional spatial coordinate, let's call it$x$. For now, I've managed to approximate away some of the ... 1answer 51 views ### Calculate forces on atoms from potential energy of system and position of atoms Background I am using a neural network to calculate the potential energy of atoms in a configuration and then adding energy of all atoms to compare it with the true energy of the configuration(label) ... 1answer 77 views ### Symplectic Algorithms for Hamilton’s Equations as opposed to just Volume-Preserving this might be a silly question, but if we’re trying to numerically solve Hamilton’s equations with some discrete scheme, sometimes when the scheme preserves phase space volume (Hamilton’s eqns are ... 2answers 59 views ### Discrete-time input matrix when one of the eigenvalues of the system matrix is zero If we have a continuous time state-equation, $$\dot{x}(t) = A x(t) + B u(t)$$ where$A \in \mathbb{R}^{n \times n}, x \in \mathbb{R}^{n\times1}, B \in \mathbb{R}^{n \times m}, u \in \mathbb{R}^{m \...
I want to calculate the stream function $\psi$ starting from a velocity field $(u,v)$ (such that $u=-\frac{\partial\psi}{\partial y}$ and $v=\frac{\partial\psi}{\partial x}$). I thus calculate the ...