Questions tagged [differential-equations]
Questions on the symbolic (DSolve, DifferentialRoot) and numerical (NDSolve) solutions of differential equations in Mathematica.
5,532
questions
73
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 ...
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 ...
53
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.
...
52
votes
2answers
2k views
A geometric multigrid solver for Mathematica?
Cross posted to community.wolfram.com
Mathematica ships a variety of linear solvers through the interface
LinearSolve[A, b, Method -> method]
the most ...
52
votes
2answers
3k views
Numerically solving Helmholtz equation in 3D for arbitrary shapes
Context
While studying manifold Learning I got interested in finding the eigenvectors of the Laplacian.
(also in connection to this problem of solving the heat equation)
Following this and that ...
49
votes
3answers
4k views
Mathematica vs. Comsol for finite element analysis?
Being relatively new to finite element analysis, I was wondering how expert users assess Mathematica's capabilities in solving PDEs via the finite element method compared to other commercial tools (e....
44
votes
3answers
4k views
Symbolic solution(s) to generalized Heat equation
Symbolic solution(s) to Heat equation?
or more generally,(eventually) Green functions to known PDEs
I am interested in variations of the heat equation:
or more generally
or even more generally (<...
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 ...
42
votes
1answer
990 views
In what way can M11.3's system modelling features be used by those who don't have SystemModeler?
Mathematica 11.3 includes some functionality from SystemModeler, but not the full SystemModeler environment.
I assume that most people here are familiar with Mathematica, but not SystemModeler, or ...
40
votes
2answers
2k views
Variable naming changes everything
Bug fixed in 10.0.0
I am having a rather unusual problem I do not understand with Mathematica where renaming one of the variables of my function causes the function to stop "working". Here is the ...
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 ...
39
votes
2answers
6k views
Efficient Langevin Equation Solver
This question is not about good algorithms for solving stochastic differential equations. It is about how to implement simple codes in Mathematica efficiently exploiting Mathematica's programming ...
38
votes
3answers
57k 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 ...
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.
...
35
votes
1answer
3k views
Calculating a potential function using the finite element method
This is my first attempt to use the Finite Element method available in version 10. There are questions and I am very open to suggestions. My example is flow around a cylinder which is a well known ...
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 ...
32
votes
4answers
2k views
How to use NDSolve to track equilibrium?
I am looking for an extension of NDSolve where integration runs until certain variables are settled at an equilibrium. Now I have a working solution in my sleeves ...
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 ...
31
votes
7answers
53k 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 ...
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}\...
31
votes
1answer
589 views
Detecting collisions in FEM
Say I want to study the deformation of a pitchfork when you have it fixed on the bottom and push one side.
...
31
votes
1answer
849 views
Finite element simulation of Airy waves
I am attempting to solve for waves on a water surface starting with a two dimensional solution. The equations are that the water must satisfy Laplace's equation everywhere with a time dependent ...
30
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, ...
29
votes
2answers
2k views
Numerical optimal control
I was hoping to tackle optimal control using Mathematica in order to learn how I can use Mathematica's built in numerical integration and optimization functions together in order to solve an optimal ...
29
votes
1answer
910 views
Publishing results obtained in Mathematica
I've been using Mathematica to solve nonlinear partial differential equations for my doctoral research for the last 2 years or so. I am not an expert in Mathematica or mathematics and I am an engineer ...
28
votes
4answers
12k 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 ...
28
votes
3answers
4k views
Programming a numerical method in the functional style
I am new to Mathematica and I would like to learn a bit more about functional programming.
At the moment I have assignments like programming different numerical methods (for integration: ...
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 ...
28
votes
1answer
3k views
Stress calculations using finite elements
A standard engineering problem is to calculate stresses in a structure due to applied forces. With the inclusion of the finite element method in version 10 this question attempts to investigate how ...
26
votes
2answers
2k views
Phase portrait on a cylinder
It is very nice and very easy to make a sketch of a phase portrait with StreamPlot. For example, for the classical pendulum, defined by
\begin{eqnarray*}
\dot x&...
26
votes
4answers
2k views
Fractal basins of attraction in a Magnetic Pendulum
I am trying to write a Mathematica program that realizes a graphical approximation of the basins of attraction in a Magnetic pendulum subject to friction and gravity, in which the three magnets are ...
26
votes
1answer
5k views
How to numerically solve a 1-d time-independent Schrödinger equation?
The point is to solve the eigensystem of the given Hamiltonian.
I tried ParametricNDSolve combined with FindRoot to search for ...
25
votes
1answer
3k views
How do I use the new nonlinear finite element in Mathematica 12 for this equation?
With Mathematica 12 we get new technology for nonlinear finite elements. Out of curiosity, I just wanted to solve the following equation
$$
\frac{d}{dx} \left( c(x) \left[\frac{d}{dx} u(x)\right]^p \...
24
votes
3answers
826 views
Is there any possibility to implement a structure like a ProgressIndicator into NDSolve?
It is already formulated in the title. NDSolve takes sometimes a considerable piece of time. It would be very practical to have some information on how long it is still to wait.
So, any ideas?
To ...
24
votes
4answers
2k 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 <...
24
votes
2answers
2k views
3D orbits and inaccuracy over time
I wrote a little program to use Newton's Law of Universal Gravitation to animate 3 planets orbiting a central star, but I have run into a problem. Here is the code that I used to create the program (I ...
24
votes
2answers
3k views
Optimizing a Numerical Laplace Equation Solver
Laplace's Equation is an equation on a scalar in which, given the value of the scalar on the boundaries (the boundary conditions), one can determine the value of the scalar at any point in the region ...
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 ...
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 ...
23
votes
3answers
2k views
Ball Bouncing on Hilly Terrain
There is a maple code for the bouncing ball on the given curve.
I tried to make this animation by using Mathematica
Why does the following code not work?
...
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:
...
23
votes
1answer
968 views
Implement fractional Laplacian
What is a way to implement the Fractional Laplacian with Mathematica?
How can we apply such implementation to numerically solve the problem
$$(-\Delta)^su = 1 \text{ in } B_1(0), \\
u = 0 \text{ in ...
23
votes
1answer
4k views
Solving Killing equations
Is it possible to solve Killing equations in Mathematica for a general vector?
I am looking for a way to create Killing equations and then find what the vectors are, but I have a problem with this.
...
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 ...
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 ...
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{...
22
votes
2answers
745 views
Getting rid of spikes in the PDE solution
Bug introduced in 10.0 and fixed in 10.3
Note: In 10.0, Rationalize[fd, 0] was needed or mesh generation would fail.
Preamble: I am solving a PDE in a domain ...
22
votes
1answer
490 views
29 Differential equations hang/not solved in version 11 compared to 10.4, looking for cause
I run Kamke differential equations in version 11 and compared the result to version 10.4. Found 29 differential equations that ...
22
votes
1answer
735 views
Mismatch between Mathematica and COMSOL in 3D FEM problem
I would like to solve an advection-diffusion problem on a torus domain. There are three Dirichlet conditions: One at the inlet (concentration $c=0$), one at the outlet ($c=0.5$) and one at the wall ($...
21
votes
4answers
5k views
How do I solve a PDE with a strange boundary condition?
How do I solve the PDE with boundary value like this
$$u(t,x,y)=0, \textrm{when } F(x,y)=0$$
using DSolve?
As a specific example, I want to solve heat equation
$$\frac{\partial u}{\partial t}=\...