Questions tagged [differential-equations]
Questions on the symbolic (DSolve, DifferentialRoot) and numerical (NDSolve) solutions of differential equations in Mathematica.
7,583
questions
3
votes
1
answer
99
views
Fitting a first-order ODE
I want to fit the following equation
$\dot{B} ( t ) = \kappa ( 1 - B ( t ) ),$
to the dataset: $\{ ( 1.17, 0.27 ), ( 2, 0.5 ), ( 4, 0.73 ), ( 6, 0.93 ), ( 8, 1 ), ( 10, 0.93 ), ( 20, 0.8 ) \}$, where ...
2
votes
0
answers
119
views
Cavity resonator modeling with Wolfram Mathematica
I am attempting to determine eigenfrequencies and the corresponding electric field distribution in a rectangular cavity resonator with perfectly conducting walls. In the simplest case of a rectangular ...
0
votes
1
answer
68
views
Solving system of differential equations - Mathematica solves a more complicated version, hoping to get a simpler solution
I have the following calculus of variations problem:
$$\mathcal{L}=-2X'(t)\ln{x'(t)}-2Y'(t)\ln{y'(t)}+\Lambda y(t)x'(t)$$
where $x(t)$ and $y(t)$ are the functions I'm interested in, and $X(t)$ and $Y(...
4
votes
1
answer
161
views
Series solution does not match numerical solution
I have a system of algebraic-differential equations (for background see this question):
$$
2 a'(u)=u x'(u),\\
4 a(u)^2 \left(3 u^2 x(u)^2+1\right)=4 x(u) \big(u a(u)+4 x(u)\big)+1.
$$
with initial ...
2
votes
1
answer
114
views
Why NDSolve can not solve this second-order nonlinear ODE
I try to solve:
eq[t_] := ddf[t] + a'[t]/a[t] df[t] + 6 f[t] - 3 a[t]^2 f[t]^2
with
...
2
votes
2
answers
98
views
Series and Numerical Solution of Second Order Boundary Value Problem using Mathematica
I am just a toddler in Mathematica, please help me in finding the numerical and series solution of the following boundary value problem:
u''[t] == - A u[t]^4,
u[0]==1, u[1]==1,
where A lies in ...
1
vote
2
answers
58
views
Solving BVP using shooting method and plotting the result
I am not able to obtain any plot with the following code.
...
3
votes
1
answer
90
views
Indeterminate Lyapunov exponenet for four-wing attractor
We are using Chris K's answer on another question for finding Lyapunov Exponents for a dynamical system (Four-Wing Attractor)
...
3
votes
2
answers
122
views
Find height of oscillating solution from NDSolve
There are a class of differential equations whose solution oscillates around some equilibrium indefinitely after settling down. Below is an implementation of such an equation
...
0
votes
1
answer
84
views
How evaluate Dsolve solution by setting constants? [closed]
Dsolve returns
...
3
votes
1
answer
112
views
NDEigensystem does not work when using nonlinear operator [closed]
I am trying to find the eigenvalues of the stationary Gross Pitaevskii equation using the NDEigensystem command via
...
5
votes
1
answer
334
views
Solving third order DE from fluid dynamics
I am trying to use DSolve to solve a differential equation from G. Batchelor: An Introduction to Fluid Dynamics, eq. 5.12.4:
[...] equation now reduces to
$$\boxed{...
3
votes
1
answer
167
views
Can not solve a relatively easy system of first order PDE
I am trying
DSolve[
{
D[f[x, y, z, t], y] z + D[f[x, y, z, t], x] t == 0,
D[f[x, y, z, t], t] x + D[f[x, y, z, t], z] y == 0
}, f, {x, y, z, t}]
but it ...
10
votes
1
answer
164
views
Precision of interpolation function after exporting and importing
I've solved a differential equation using NDSolve with a large working precision prec. The output is a few interpolating ...
2
votes
1
answer
137
views
Asymptotic solution of a system of ODEs
I have the following system of Ordinary Differential Equations (ODEs) together with initial values
...
0
votes
0
answers
72
views
Dsolve unreadable output
DSolve[{(1+x+7x^2 - 3x^3 + 2x^4) y'[x] + (4x^2 - 2x + (1 - x)y[x] + 6) xy[x] == 0,
y'[0] == 0}, y[x], x]
C[1]=1
Plot[y[x], {x, 0, 8}]
...
3
votes
2
answers
329
views
Why does DSolve return HeavisideTheta[0] which is not defined at zero?
Why does Mathematica return solution of an ODE with HeavisideTheta[0] in it, when this is not even defined at zero?
The documentation says
...
3
votes
1
answer
200
views
How to create an interactive Poincare section from the given code?
Here we discussed Poincare section for perturbed string model taken from the paper Chaotic dynamics of a suspended string
in a gravitational background with magnetic field. We try to reproduce some ...
2
votes
1
answer
70
views
2
votes
1
answer
65
views
2
votes
5
answers
130
views
NDSolve spits out mxst warning when solving ODE defining a geodesic
Here is the code I'm using for my differential equation:
...
0
votes
1
answer
73
views
How to set up "mixed" boundary conditions for NDSolve for PDE? [closed]
I have the following PDE that I am able to solve using DirichletCondition with NDSolve as the following:
...
3
votes
2
answers
240
views
How can I solve this system of nonlinear PDEs?
How can I solve these PDE analytically for $z$ and $y$?
\begin{eqnarray}
2 \dot{z} &=& \ddot{y}+ y^{-1}, ~~~ (1)\\
z' + \dot{z}' &=& - \dot{y}'. ~~~~~~~~~~ (2)
\end{eqnarray}
Where (....
6
votes
3
answers
221
views
Solving a nonlinear PDE on a mesh with a variable density
I would like to solve the following partial differential equation in 2D on a disk with the radius 10 and centered in the coordinates origin:
...
4
votes
4
answers
145
views
How to obtain the solution for this first order homogeneous ode that has a unique solution?
This ode is first order with unique solution. DSolve can't obtain the solution $y=-x$. Could someone come with workaround to make it give this solution?
$$
y'(x)=\...
1
vote
2
answers
187
views
Unexpected result for Poisson problem on torus (using PeriodicBoundaryCondition)
I want to solve the Laplace problem $-\Delta u=f$ ("analyst's Laplacian") for a given $f$ and unknown $u$ on the torus $[0,2\pi]/\sim$, i.e. a rectangle with opposite sides identified. The ...
5
votes
0
answers
138
views
What is resistivity function of a 3-bar electric switch?
I answered a question on Physics StackExchange - considered as homework - numerically. The question is: What is the resistance of three stacked identical blocks, the middle bar shifted by its half ...
7
votes
2
answers
261
views
How to improve FDM solver for unsteady viscous flow?
To solve the problem that is discussed in the paper Finite Difference Analysis of Time-Dependent Viscous Nanofluid Flow Between Parallel Plates we developed FDM solver based on the code from the blog ...
3
votes
2
answers
165
views
LinearSolve problem occurs as solving PDEs with NDSolve
I am new to Mathematica, please forgive me asking naive questions. I tried to solve PDEs numerically using NDSolve, but failed to go through due to errors. Two of three PDEs are time-dependent and ...
0
votes
1
answer
158
views
Partial differential equation with conditions
I am trying to solve this PDE with Mathematica, and I have checked the syntax a lot, but still don't get a solution
...
2
votes
3
answers
195
views
Solving a second order DE
I have this second order DE:
$$
\frac{1}{3\phi } \left( \frac{\dot{a}\dot{\phi} }{a} + \ddot{\phi} \right) + 2 \frac{\ddot{a}}{a} = \partial_x^2 \phi,
$$
where
$$
\phi(x,t) = \frac{1}{4} e^{k(t-x)...
1
vote
0
answers
33
views
Generic method to check consistency of initial conditions for PDE system
Is there a generic way to check for the consistency of IC in PDE systems?
I have the following code, but I get an NDSolveValue::icfail error:
...
0
votes
1
answer
55
views
NDSolveValue::ntdvdae and NDSolveValue::icfail while solving system of PDEs
I am trying to solve a system of PDEs, but I get the error NDSolveValue::ntdvdae:
Cannot solve to find an explicit formula for the derivatives. NDSolve will try ...
3
votes
1
answer
143
views
Dirac equation for a Coulomb potential in 2D with NDEigensystem
I want to numerically solve the ground state wave function of the hydrogen atom with the Coulomb potential using the NDEigensystem. Here is the code to get the ground state wave function from the ...
2
votes
1
answer
126
views
Solving a ODE (Peeble's Equation) with initial condition a the maximum input range
I have a differential equation which is,
$$
\frac{d X_e}{dz} = \frac{C_r(z)}{H(z)}\times \frac{1}{(1+z)}\Big[\frac{38\eta T^3}{25\pi^2}\alpha (T)X_e^2 - b(T)(1 - X_e) \Big]
$$
Where
$$
\alpha(T) = \...
4
votes
3
answers
507
views
First order ODE with unique solution can't be solved. Any workaround?
This first order ode
\begin{align*}
y'&= \frac{\cos(y)}{x}\\
y(1)&=\pi
\end{align*}
By existence and uniqueness theorem has solution and the solution is unique (on interval that include the ...
1
vote
1
answer
160
views
Could anyone please help me find the error in the code
I have a problem with DSolve and the following code:
DSolve[{D[Ψ[x], x, x] == κ^2 Ψ[x],
Ψ[0] == Ψs, Ψ[Infinity] == 0}, Ψ, x]
...
1
vote
1
answer
151
views
Using NDSolve and complex differential equations
I am trying to solve this system of equations with NDSolve
...
2
votes
1
answer
77
views
NDSolve::ndcf: Repeated convergence test failure; unable to continue
I have been trying to solve this system of differential equations:
...
3
votes
1
answer
77
views
Solving Laplace Transform IVP [closed]
I want to solve the IVP Laplace transform for the following:
$$y''-2y'+y=3e^t$$ with $$y(0)=1, \; y'(0)=1.$$
How would I input this in Wolfram Language? I've tried a bunch of different things and ...
3
votes
3
answers
193
views
Can you please help me to get streamline plot?
https://doi.org/10.1016/j.cjph.2020.08.010 , this is the DOI of the paper. I have written a code to plot graph but I need to plot it with stream lines too
...
2
votes
2
answers
213
views
Taking the derivative of Re[f]
I have looked at similar posts, such as this one, but none of the solutions have worked for me. I have an imaginary function, and I have tried to obtain its real part using ...
1
vote
0
answers
48
views
Extracting singularity or stiff point from NDSolve [duplicate]
Given the coupled non-linear differential equations:
...
1
vote
1
answer
186
views
2
votes
3
answers
196
views
Are there exact solutions for the following system of nonlinear first order ordinary differential equations?
The two equations are:
u'[t]== -(K + L v[t]) u[t]
and
v'[t] == -L u[t] v[t]
where K and L are constants. At t=0, u(0)=a ...
2
votes
0
answers
56
views
Deriving Expressions for R1, R2, and R12 , Normalized Coincident Detection Probability, and LG Mode Formalism
I am currently reviewing a research paper on orbital angular momentum entanglement between two photons (signal and idler) generated from a pump photon via SPDC. The paper introduces the following ...
2
votes
2
answers
244
views
Mathematica not solving $y'(x)=y(1/x)$ unless I rewrite it as $x^2y''(x)+y(x)=0$ [closed]
So recently I have been practicing solving differential equations using Mathematica, and have currently been trying to solve a diff. eq. that I did solve fully on my own before that I asked about on ...
0
votes
0
answers
63
views
Bug in DSolve when using GeneratedParameters?
In version 13.3, DSolve without GeneratedParameters option
DSolve[D[v1[x1, x2, x3, x4], x1]/x1 + D[v1[x1, x2, x3, x4], x2]/x2 == 0, v1, {x1, x2, x3, x4}]
gives the ...
0
votes
0
answers
100
views
Numerical solution of integro-differential equation where the integral term contains a double integral
I have the following code:
...
4
votes
1
answer
96
views
Solving delayed PDE
I tried to solve the following delayed PDE, but it's not working at all.
Almost Periodic Case:
$$
\begin{equation}
\begin{array}{lc}
\displaystyle\frac{\partial}{\partial t}w(t,x)= \frac{\...