Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [differential-equations]

The tag has no usage guidance.

0
votes
1answer
41 views

What is required for a numerical method to solve an IVP? [on hold]

I have an ODE with the initial condition: $y'=2r\sqrt{y}$, $y(r=0)=1$. I am thinking of using either Forward-Euler method or Leap-Frog to solve this numerically. However before I implement a ...
0
votes
1answer
51 views

Unexpected solutions solving an ODE using odeint

I am trying to solve a system of 8 coupled differential equations using scipy's odeint. I have already written my code and it runs fine, but the solutions I get are completely different from what I ...
0
votes
0answers
44 views

Social Force Model for Pedestrian Dynamics by Euler Method

The social force model is a model using Newtonian forces to describe the movement of individuals. As seen page 1 Each individual feels the following forces: A driving force towards the goal $$ m_i\...
-1
votes
0answers
43 views

Is my approach for this third order Eigenvalue BVP correct?

I (with help from a MSE user) used the following substitution to seperate variables in a second order linear PDE $$\theta_w = e^{-\beta_hx}F'(x)e^{-\beta_cy}G'(y)$$ The following two ODEs (...
0
votes
0answers
23 views

Determining the pseudo-time period of a system of $n$-pendulums via Kane's method in Python

We can use Kane's method to integrate the equations of motion for a system of $n$ pendulums with arbitrary masses and lengths (see derivation). In particular, if $(x_i,y_i)$ denotes the Cartesian ...
1
vote
1answer
36 views

Wrong results for $2$ stage multistep method $y_{n+2} - y_n = h\left[(1/3)f_{n+2} + (4/3)f_{n+1} + (1/3)f_n\right]$

I need to fix a code to utilise the $2$ stage multistep method : $$y_{n+2} - y_n = h\left[(1/3)f_{n+2} + (4/3)f_{n+1} + (1/3)f_n\right]$$ Since this is an implicit method, I used a Newton-Raphson ...
1
vote
0answers
36 views

Numerically solving a system of parabolic PDEs and 1st order ODEs

I'm trying to solve the following system of differential equations numerically. What are the available finite difference approaches and matlab solvers to solve such a system? Other approaches to solve ...
5
votes
1answer
103 views

Numerical solution of two coupled nonlinear eigenvalue problems

I would like to numerically solve the following system of coupled nonlinear differential equations: $$ -\frac{\hbar^2}{2m_a} \frac{\partial^2}{\partial x^2}\psi_a + V_{ext}\psi_a + \left( g_a |...
2
votes
1answer
86 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 ...
1
vote
0answers
72 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$ (...
1
vote
0answers
86 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 ...
2
votes
1answer
57 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 ...
5
votes
3answers
133 views

Finite difference for 1D wave equation: why the spike initial data results in a noisy output?

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=...
2
votes
0answers
110 views

How to solve Hamiltonian problems in Julia?

Unfortunately, I have not fountd any comprehensive example for Julia's 1.0 DiffEq.jl Hamiltonian problems. I am trying this: ...
0
votes
1answer
142 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 ...
1
vote
1answer
125 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 ...
0
votes
1answer
44 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) ...
4
votes
1answer
69 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 ...
-1
votes
0answers
36 views

Resolution of a sequence of system of non-linear differential equations

Let, for all $k\in[\![1;N]\!]$ : $$ \begin{align} \dfrac{d I_k(t)}{d t} &= -\delta I_k(t) + \beta kS_k(t)\Theta(t)\\ \dfrac{d S_k(t)}{d t} &= - \beta kS_k(t)\Theta(t)\\ \dfrac{d R_k(t)}{...
2
votes
2answers
56 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 \...
1
vote
0answers
49 views

fourth order Poisson iterative solver --in Matlab

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 ...
3
votes
1answer
35 views

Apart from initial discontinuities, what is tricky about neutral DDEs?

Background A neutral delay differential equation is one where the derivative does not only depend on its past state, but also the derivative at a past point: $$ \dot{y}(t) = f\big(t, y(t), y(t-τ_1), ...
23
votes
2answers
1k views

What does “symplectic” mean in reference to numerical integrators, and does SciPy's odeint use them?

In this comment I wrote: ...default SciPy integrator, which I'm assuming only uses symplectic methods. in which I am refering to SciPy's odeint, which uses ...
1
vote
0answers
12 views

Procedure to identify characteristic properties of unknown functions in a DAE model

I have a system of 1st order odes given by $$ \dot{x_1}(t) = \alpha_1 f_1(x_1,t) + \beta_1 u(t) \\ \dot{x_2}(t) = \alpha_2 f_2(x_2,t) + \beta_2 u(t) $$ They are constrained by an algebraic equation ...
2
votes
1answer
68 views

Jump-Diffusion process: practical solver beyond Euler method?

A jump-diffusion process is a stochastic process where both continuous noise (in my case complex Wiener noise $dZ,dZ^*$ such that $dZ^2=dZ^{*2}=0,|dZ|^2=dt$) and discrete Jumps (in my case Poissonian $...
1
vote
1answer
50 views

Integrating a nonlinear ordinary differential equation

I am solving an equation of the form $(*)$ $0 = a(f) (\partial_rf)^2 + b(f) (\partial_rf) + c(f),$ where $f$ is a real function of $r\in \mathbb{R}$, and $a,b,c$ are real functions of $f$. The ...
0
votes
1answer
293 views

Crank–Nicolson method for nonlinear differential equation

I want to solve the following differential equation from a paper with the boundary condition: The paper used the Crank–Nicolson method for solving it. I think I understand the method after googling ...
0
votes
1answer
79 views

Runge-Kutta timestep in atomic units

I'm using 4th order RK to solve the schroedinger equation in atomic units. Say I want to simulate 400fs in intervals of h=10fs, then in atomic units this is h=413a.u and 400fs=16500a.u. 4RK involves ...
6
votes
2answers
131 views

Algorithm for finding initial conditions of differential equations given trajectory

Let's say I'm given a system of three first-order differential equations in three variables, where all of the equations are known, and we additionally know the trajectory of two of the variables at a ...
1
vote
0answers
41 views

Second-order PDE with seven variables

I need to solve the following partial differential equation in seven variables with four boundary conditions. I don't think Mathematica has the capacity to solve this differential equation. Do you ...
1
vote
0answers
44 views

Eigenvalue ODE in Spherical Coordinates--Numerical

I wish to solve an eigenvalue problem: $$\nabla^{2}f=Ef $$ If I assume spherical symmetry $f(r,\theta,\phi)=f(r)$, I can reduce the problem to 1D: $$(\frac{2}{r}\frac{d}{dr}+\frac{d^{2}}{dr^{2}})f=...
1
vote
1answer
71 views

finite difference for a second order ode

I saw in a code for discretization of something like $\frac{d^2T(x)}{d^2x}$ , ( $x = sin(\theta)$ ) tries ...
1
vote
0answers
99 views

Solving complicated coupled ODE using RK4/ODE45 in Matlab

I have the following coupled differential equations also known as Guiding Center Approximation. It is used to explain the position- and velocity change of particles (electrons and protons, N = 1000) ...
3
votes
1answer
70 views

SIRS Model doesn't depend on initial conditions?

So i have been working (as an undergrad, by working i mean "Redoing a few things my professor does") in a SIRS model for epidemies. SIRS stands here for: Susceptible -> Infected -> Recovered -> ...
1
vote
0answers
83 views

Code for solving the heat equation on the semi-infinite rod

Cross posted in mathematica.SE. Question : I want to test the solution which is given below is right by Matlab/Maple/Mathematica. Please look the post in mathstackexhange or Please look below. ...
2
votes
1answer
110 views

Some questions on Trace (operators) on the boundary in the context of PDEs

Background: The solution space of original problem (which requires a fine enough mesh to resolve the microstructure) can be split into a macroscale solution space and microscale solution space. This ...
4
votes
3answers
106 views

Numerically finding constants of motion

Given a set of ODE's $ \dot{z} = f(z) $ (or discrete time $ z_{t+1} = f(z_t) $), is there a way to numerically find constants of motion? For $ f(z_t) \approx M z_t $, diagonalizing the matrix $ M $ ...
4
votes
2answers
179 views

Runge Kutta and Milstein – system of second-order coupled differential equations with noise

I would like to solve a system of second-order differential equations to describe the dynamics of a system of particles. Two Newton-like forces are responsible for the motion of each particle $i$: A ...
1
vote
1answer
2k views

How to simulate 3D diffusion in python?

I want to simulate a simple 3D diffusion (e.g., an ink released from one side of a vessel) using SciPy. There are some tutorials for one-dimensional diffusion. ...
1
vote
0answers
99 views

Implementing Neumann boundary condition in nonlinear integro-differential equation

Problem I would like to solve a nonlinear integro-differential equations on a 2D square domain $\Omega$ subject to Neumann boundary conditions using finite differences: $$\frac{\partial u}{\partial t}...
1
vote
1answer
167 views

solution of system of coupled partial differential equations [closed]

I have following system of coupled Partial differential equations. How can I solve the system by Maple? \begin{align} m_1\frac{\partial^2 u_1}{\partial t^2}+A_1\frac{\partial ^4u_1(x,t)}{\partial x^...
6
votes
3answers
986 views

4th order Runge-Kutta for $y' = y$

My question is quite simple, but the more I look at it, the less content I am. My question is how to do a RK4 method for $y'=y$. At first I would assume the following: $$k_1=y_n$$ $$k_2=y_n+\frac{...
4
votes
1answer
127 views

Stability of PDE Discretizations with Multistep Time Discretizations

Let's pretend we have a spatially discretized PDE of the following form: \begin{align} \frac{\partial^2 \boldsymbol{u}^k}{\partial t^2} = D\boldsymbol{u}^k \end{align} where $D$ can be any form for ...
6
votes
3answers
246 views

Visualizing the solutions of the Differential equations by varying different parameters

Actually I am interested in analyzing the soution to the ODE given as $\frac{dy}{dx} = A + By + C\sin(y) , y(l) = m$ and check how the solution gets affected like whether they exist or not depending ...
1
vote
0answers
44 views

How is the Gastner-Newman equation implemented to create value-by-area cartograms?

There is a paper called "Density-equalizing map projections: Diffusion-based algorithm and applications" by Michael T. Gastner and M. E. J. Newman, which explains their algorithm (which is based in ...
0
votes
1answer
92 views

Stability of dark solitons in a harmonic trap

This question is based upon a research article which I am trying to reproduce. One of the main result of this paper is the condition on transverse confinement of the Bose-Einstein Condensate(BEC) to ...
2
votes
1answer
87 views

Mysterious Mirroring in Analytical Solution of a delay differential equation (DDE)

I'm struggling now for several weeks with a very bizarre problem with a system of delay differential equations. First, here the system: $$\dot a = 1 - \Theta(b(t-\tau)-\kappa) \,- a(t) \\ \dot b = \,...
1
vote
0answers
120 views

Nonlinear 2D thermoconductivity equation(numerical solution) [closed]

I have to write a solver for 2D equation: $$\partial_t u = u^2(\partial_x ^2 u + \partial_y ^2 u)$$ I try to use explicit method: $$\partial_t u = \frac{u_{i,j}^{k+1} - u_{i,j}^k}{\tau}$$ and $$\...
4
votes
0answers
213 views

MATLAB: solving multiple ODE systems in parallel

I have a system of parameterized ODEs that I would like to solve using MATLAB and its ode45 solver, and was wondering if it is possible to perform such a task in ...
2
votes
1answer
791 views

Solving an iterative, implicit Euler method in MATLAB

I'm trying to solve an iterative problem that includes an implicit (backwards) Euler method to find successive time values for a given function. The numerical problem is shown here: $$ \begin{...