Questions tagged [differential-equations]
Questions on the symbolic (DSolve, DifferentialRoot) and numerical (NDSolve) solutions of differential equations in Mathematica.
1,184
questions
42
votes
4answers
5k views
Dynamic Euler–Bernoulli beam equation
I am trying to solve for the vibration of a Euler–Bernoulli beam. The equation is
$\frac{\partial ^2u(t,x)}{\partial t^2}+\frac{\partial ^4u(t,x)}{\partial x^4}=0$
For the boundary conditions I ...
54
votes
1answer
5k views
Analogue for Maple's dchange - change of variables in differential expressions
Maple owns an interesting function called dchange which can change the variables of differential equations, but there seems to be no such function in Mathematica.
...
13
votes
2answers
2k views
Boundary condition with spatial derivative is ignored by NDSolve
Consider the following differential equation:
$$\begin{align*}&\rho C_p\left(\frac{\partial T}{\partial t}\right)=k\left[\frac{\partial^2 T}{\partial x^2}\right]+\dot{q}\\
&\text{at }x=0,\;\...
21
votes
2answers
6k views
Error entering equation in DSolve
I entered a command incorrectly as follows:
DSolve[{y'[x]=y[x]},y[x],x]
I am now experiencing:
...
32
votes
2answers
7k views
How to fit 3 data sets to a model of 4 differential equations?
I'm a biologist and a newbie in Mathematica. I want to fit three data sets to a model consisting of four differential equations and 10 parameters. I want to find the parameters best fitting to my ...
23
votes
4answers
11k views
Find all roots of an interpolating function (solution to a differential equation)
I'm trying to find all the roots of the solution to a differential equation.
Using NSolve or Reduce I don't get the roots, so I'm using an iterative method which I found in physicsforums.com.
This ...
39
votes
6answers
5k views
How to splice together several instances of InterpolatingFunction?
I have a set of InterpolatingFunction returned by NDSolve which are valid over different (but overall continuous) domains. How ...
16
votes
2answers
1k views
What boundary is added when boundary condition is not sufficient?
When insufficient boundary conditions are given to NDSolve for solving PDE, usually the warning NDSolve::bcart pops up:
...
28
votes
4answers
13k views
Solving an ODE in power series
How do I find a series solution to an ODE?
I do not mean taking the Taylor series of an exact solution; I want to solve nasty nonlinear differential equations locally via plug and chug. Surely, that ...
38
votes
3answers
58k views
Plotting a Phase Portrait
I'm trying to plot a phase portrait for the differential equation
$$x'' - (1 - x^2) x' + x = 0.5 \cos(1.1 t)\,.$$
The primes are derivatives with respect to $t$. I've reduced this second order ODE to ...
12
votes
2answers
12k views
Solving a system of ODEs with the Runge-Kutta method
I´m trying to solve a system of ODEs using a fourth-order Runge-Kutta method. I have to recreate certain results to obtain my degree. But I'm a beginner at Mathematica programming and with the Runge-...
23
votes
2answers
1k views
Easy way to plot ODE solutions from NDSolve?
Inspired by the closed question Beautify a NDSolve Graph ! and a comment someone made to me not too long ago:
Is there some quick way to plot NDSolve results ...
3
votes
1answer
4k views
Why my differential equations become True? [duplicate]
I've been trying to solve a system of nonlinear differential equation, but the conditions are a bit weird.
Two of the differentials equate to the same equation, but have different boundary ...
15
votes
2answers
3k views
What's behind Method -> {“EquationSimplification” -> “Residual”}
In order to solve a quite large system of differential equations, I have the habit to use the NDSolve command without changing any options.
As I wanted more ...
24
votes
4answers
3k views
Accessing Reduce from DSolve
When solving transcendental equations, Solve frequently warns us that inverse functions are being used so that some solutions may not be found.
We also see that <...
74
votes
3answers
8k views
Numerically solving Helmholtz equation in 2D for arbitrary shapes
I would like to solve the Helmholtz equation with Dirichlet boundary conditions in two dimensions for an arbitrary shape (for a qualitative comparison of the eigenstates to periodic orbits in the ...
21
votes
2answers
873 views
NDSolve uses different difference order for different spatial derivative when solving PDE
I found something this tutorial for method of line doesn't tell us.
Consider the following toy example:
...
7
votes
4answers
4k views
Nonlinear differential equation: numerical solution
I have to find and plot a numerical solution for this second order differential equation:
u''[x] + (u'[x]/x) - (u[x]/(x^2)) + u[x] - u[x]^3 = 0
where $0\leq x &...
12
votes
1answer
909 views
Implement finite Fourier transforms
Recently I came across finite Fourier transforms, which can be used for solving certain type of boundary value problem (BVP) of linear partial differential equation (PDE) with constant coefficient. ...
32
votes
7answers
54k views
How can I plot the direction field for a differential equation?
I'd like to plot the graph of the direction field for a differential equation, to get a feel for it. I'm a novice, right now, when it comes to plotting in Mathematica, so I'm hoping that someone can ...
22
votes
2answers
5k views
Basins of Attraction
How does one shade the basin(s) of attraction of a phase plot in Mathematica? I have been trying to do this using the system
$$\begin{align*}
\dot x &= y\\
\dot y &= -9\sin(x) - 0.20y
\end{...
14
votes
1answer
611 views
PDEs : automatic method choice : TensorProductGrid or FiniteElement?
A problem that arises when we solve PDEs with NDSolve[] and Method->Automatic is how to know which method has been chosen : <...
34
votes
3answers
8k views
Animation of double pendulum
Sadly, I am a completely newbie. I am studying Physics and in our theoretical physics class we got the task to solve the double pendulum using Mathematica. We just got the program, but no introduction ...
23
votes
3answers
12k views
How to solve ODE with boundary at infinity
y''[x] - x y[x] == 0
y[0] == AiryAi[0], y[∞] == 0
The analytic solution to this ODE is the Airy function
y[x] == AiryAi[x]
if ...
65
votes
4answers
4k views
Can Mathematica solve Plateau's problem (finding a minimal surface with specified boundary)?
Given a closed curve $\mathcal C$ in three dimensions, is it possible to use Mathematica's built-in functionality to compute a minimal surface whose boundary is $\mathcal C$? For simplicity, let us ...
31
votes
1answer
2k views
Has this implementation of FDM touched the speed limit of Mathematica?
Still, I'll use the implementation of the 1D FDTD method (you can simply understand it as a kind of explicit finite difference scheme for the Maxwell's equation) as the example. Just for completeness, ...
19
votes
2answers
5k views
Is it possible to do vector calculus in Mathematica?
I am trying to rearrange and manipulate some vector differential equations in Mathematica. As far as I understand you have to tell Mathematica that a variable is a vector by specifying the components ...
13
votes
4answers
6k views
DSolve not finding solution I expected
Try to solve the following ODE via DSolve
$$
\left\{\begin{aligned}
y'(x)+2 y(x) e^x-y(x)^2 &= e^{2 x}+e^x \\
y'(0) &=1
\end{aligned}\right.
$$
The ...
23
votes
2answers
2k views
I failed to solve a set of one-dimension fluid mechanics PDEs with NDSolve
The fluid here has been assumed as single component perfect gas i.e. it obeys the equation $p=ρ R T$, the thermal conductivity is assumed as a constant, so the equation set is:
...
21
votes
3answers
2k views
Only final result from NDSolve
Finally, I started to play with differential equations in Mathematica.
And I have faced the problem, which seems to me so basic that I'm afraid this question is going to be closed soon. However, I'...
13
votes
2answers
2k views
Finding a 3d curve from torsion and curvature with NDSolve
I'm trying to use the Frenet–Serret formulas to find the curve that matches the torsion and curvature I specify numerically with an InterpolatingFunction.
The ...
7
votes
2answers
2k views
Why Can't `DSolve` Find a Solution for this ODE?
I wanted to find a basis for the set of solutions of the following ODE.
$$y^{''}+\frac{1}{x^2+1}y^{'}(x)+\left[-1-\frac{1}{x^2+1}\right]y(x)=0$$
But when I try to use ...
11
votes
3answers
778 views
Position of discontinuous coefficient influences the solution of PDE
This issue is raised in the discussion under this post about heat flux continuity and I think it's better to start a new question to state it in a clearer way. Just consider the following example:
<...
38
votes
2answers
5k views
Complex valued 2+1D PDE Schrödinger equation, numerical method for `NDSolve`?
Based on the heat equation of the Mathematica Manual tutorial, I wrote the complex counterpart (Schrödinger) equation, for the free particle propagation of an initial wavepacket.
...
21
votes
4answers
8k views
Lyapunov Exponent
Does anyone know a (simple) Mathematica code for computing the Lyuponov Exponent for the Rossler System?
Thank you
Rossler System:
...
31
votes
3answers
4k views
Numerical solution of coupled ODEs with boundary conditions
I have to solve the following set of ODEs and just can't get good results using Mathematica
$$
r\frac{d}{dr}\left(\frac{1}{r}\frac{d}{dr}A(r)\right)-\xi^2F(r)^2\left(A(r)-1\right)=0
$$
$$
\frac{1}{r}\...
15
votes
1answer
2k views
Poisson solver using Mathematica
I am looking for some help with a Poisson solver I am writing in Mathematica. The code is quite long with Arrays plugged in, so the full details can be found at http://pastebin.com/uSrSDcW6
I am ...
8
votes
2answers
4k views
How to plot and solve the numerical solution of a integro-differential equation
I have a integro-differential equation of the form
$y'(t) = - \int_0^t {y(t_1 )} e^{t_1 - t} dt_1, {\rm{ t}} \in {\rm{[0,10], y(0) = 1}}$
My code is:
...
10
votes
2answers
2k views
DSolve misses a solution of a differential equation
[Note that in the cited duplicate, DSolve not finding solution I expected, the general solution returned by DSolve is missing a solution for quite different reasons ...
10
votes
2answers
1k views
2D inhomogeneous biharmonic equation
How to solve a 2D inhomogeneous biharmonic equation with NDSolve?
I tried the following code:
...
20
votes
3answers
16k views
NDSolve with Euler method
I want to solve this equation with NDSolve[] using the Euler method:
x'[t] == 0.5*x[t]-0.04*(x[t])^2
with initial condition ...
28
votes
3answers
3k views
1D Euler equations (fluid dynamics) with NDSolve
Is it possible to accurately solve the 1D Euler equations in Mathematica using NDSolve?
For example, let us consider the Sod shock tube problem. Introduction to ...
21
votes
4answers
9k views
Change variables in differential expressions
I have a fairly complicated differential expression in terms of a variable r and two unknown functions of r, B[r] and n[r]. I want to do a Taylor expansion of this around r=infinity. I want to do this ...
23
votes
1answer
4k views
2D Heat equation: inconsistent boundary and initial conditions
I'm attempting to use NDSolve on a 2D boundary value problem with initial conditions. Upon running my code, I get the following message:
"NDSolve::ibcinc: Warning: Boundary and initial conditions are ...
19
votes
3answers
2k views
Numerically solve the initial value problem for the 1-D wave equation
I want to solve the standard 1-dimensional wave equation $y_{xx}=y_{tt}$ using NDSolve (for $y(x,t)$) with the following conditions:
...
13
votes
1answer
714 views
Why does NDSolve fail to solve the PDEs and spit out mconly warning?
I try to solve two coupled PDEs with NDSolve using the following code:
Set two operators:
...
11
votes
3answers
3k views
Can NDSolve handle discontinuous data?
Backslide introduced in 9.0, persisting through 11.0.1
It is possible to numerically solve a differential equation if not-smooth data are involved?
For example the following instruction return the ...
12
votes
2answers
666 views
Extending NDSolve beyond a singularity
The $\tan$ function satisfies the following IVP:
$$y'=1+y^2 ,\quad y(0)=0 $$
and has simple poles at the points $x=\pi/2+ \pi n$ for integer $n$.
When trying to get $\tan$ via numerical integration,...
5
votes
1answer
644 views
PDE of real-world system, integral boundary condition
I've stripped all the physical-significance for clarity, but I know that u[x,t] will be everywhere positive and continuous.
here are the equations in Mathematica code:
...
9
votes
2answers
2k views
Why does NDSolve need to solve for the derivatives if the equations are already explicitly solved?
Consider the following test case:
...