Questions tagged [differential-equations]

Questions on the symbolic (DSolve, DifferentialRoot) and numerical (NDSolve) solutions of differential equations in Mathematica.

Filter by
Sorted by
Tagged with
6
votes
1answer
1k views

How to program efficient undershoot/overshoot

I would like to solve the following boundary value problem for $y(x)$ for a fixed value of $k$ between $0 < k <1$: $$y'' + \frac{3}{x} y' - y + \frac{3}{2}y^2 - \frac{k}{2}y^3=0 \\ y'(0) = 0,\...
5
votes
1answer
518 views

Incorrect results of diffusion equation with Neumann boundary conditions [duplicate]

I want to resolve a PDE model, which is 1D heat diffusion equation with Neumann boundary conditions. The key problem is that I have some trouble in solving the equation numerically. Consider the ...
2
votes
3answers
279 views

Optimization of ODE with respect to the initial condition

One has a (system) of ODEs with a one-parameter family of initial conditions. For example, ...
2
votes
2answers
4k views

No result from DSolve

I don't get any answer when I evaluate the following expression: ...
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 ...
14
votes
3answers
3k views

Determine frequency of oscillations

I am wondering how I could determine the frequency of oscillations of a differential model equation? How could I find the frequency from this example given in Mathematica Documentation: ...
14
votes
3answers
5k views

NDSolve with vectors

I'm stumped. I'm trying to write this using vectors, but the 2nd derivative isn't being expanded like I expected it to be. This is a system of equations for a projectile with quadratic drag and ...
13
votes
1answer
4k views

Numerically solving an inhomogeneous partial differential equation

I'm trying to solve a cylindrical partial differential equation with boundary conditions. But I got an error message saying ...
26
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 \...
17
votes
1answer
1k views

How to solve the tsunami model and animate the shallow water wave?

Backslide introduced in 9.0, persisting through 11.3. Recently when I was learning differential equations, I noticed there is a shallow water wave equation to model the tsunami propagation. How to ...
10
votes
1answer
1k views

Transcritical Bifurcation phase portraits

An example equation for a Transcritical Bifurcations is given by: $$\dfrac{dx}{dt} = f(x, r) = r x - x^2$$ In Mathematica, we can define the function as: ...
10
votes
4answers
6k views

Plotting a Bifurcation diagram

I have the following system equation v'(t)=2*G*J1[v(t-τ)]cos(w*τ)-v(t) How do you plot the bifurcation diagram, τ in the x ...
7
votes
2answers
3k views

Analytic solution of dynamic Euler–Bernoulli beam equation with compatibility condition

The Euler–Bernoulli beam equation (also known as wave equation for beam) with pined-pined boundary has well-known solutions, but directly input the equation into Mathematica does not return them. $$...
10
votes
1answer
578 views

Solve PDEs with finite difference scheme by modifying NDSolve-based solver

Motivation As discussed here, NDSolve uses different difference orders for various spatial derivatives and the implicit design could cause trouble in certain cases....
10
votes
2answers
715 views

Stiff BVP of nonlinear ODE, alternative/ enhancement to shooting method

Question: I have been trying to solve this coupled ODE set. \begin{align} ( \frac{ \mu^2}{B} +1 ) \Phi^2 + \frac{1}{A} {\Phi^{\prime 2}} + \frac{1}{2}\lambda \Phi^4 - \frac{A'}{r A^...
9
votes
2answers
971 views

Click in a vector plot to plot several solutions of a system of differential equations

I am aware of the Locator button and I am aware of the Equation Trekker package, but they are not what I want to use. Here is what I specifically want to know how to do, if possible. Consider the ...
16
votes
2answers
862 views

Heat convection differential equations from 1952 - Mathematica “fails to converge”

I am trying to solve a fundamental problem in analytical convective heat transfer: laminar free convection flow and heat transfer from a flat plate parallel to the direction of the generating body ...
8
votes
2answers
1k views

Three dimensional Laplacian insulated on lateral faces and convectively exposed on transverse faces (updated)

I have the three dimensional Laplacian $\nabla^2 T(x,y,z)=0$ representing temperature distribution in a cuboid shaped wall which is exposed to two fluids flowing perpendicular to each other on either ...
6
votes
2answers
2k views

Solve stiff system by shooting method

I'm trying to solve a second order differential equation with the shooting method but, it appears to be a stiff system. This is worst for a larger parameter $\mu$. I've tried different methods: ...
4
votes
2answers
316 views

NDSolve with equation system with unknown functions defined on different domains

Based on @xzczd's excellent answer on solving an equation system with unknown functions defined on different domains, I've tried to apply the same technique to a similar system shown below: Equations: ...
4
votes
1answer
526 views

Orbit followed by a particle around Schwarzschild Black Hole

The following is a equation which describes various possible orbits of a particle around the Schwarzschild black hole spacetime in general relativity. I want to solve it from ...
21
votes
4answers
1k views

What is the definition of Curl in Mathematica?

I have a usual mathematical background in vector and tensor calculus. I was trying to use the differential operators of Mathematica, namely Grad, ...
15
votes
1answer
368 views

Possible bug with FourierTransform linearity

Each component is easily transformed but the sum is not: FourierTransform[f''[x], x, k] FourierTransform[f'[x], x, k] ...
8
votes
2answers
7k views

ndsz : step size is effectively zero; singularity or stiff system suspected

This is the first time I ask a question. I have seen many solutions to this error and tried but they are not working. Here is the code. ...
6
votes
4answers
2k views

NDSolve with Piecewise gives the incorrect answer randomly

Bug introduced in 9.0 and fixed in 11.1 NDSolve in Mathematica 9.0.0 (MacOS) is behaving strangely with a piecewise right hand side. The following code (a ...
3
votes
2answers
2k views

optimization problem with NDSolve

I want to minimize the function fcc. When fcc is calculated for a specified point the answer is correct: ...
10
votes
1answer
925 views

Why should the spatial derivative order of the ODE *not* exceed two?

Following this question I came across this strange behaviour. Let me define a 1 D interval implicitely ...
6
votes
2answers
286 views

Solving eigenvalue BVP with an interface

I have a boundary-value problem, that is defined over two adjacent regions with an interface in the middle, that contains an eigenvalue $\lambda$. The boundary conditions and the equations are ...
5
votes
2answers
700 views

Runge-Kutta implemented on Mathematica

I am trying to solve differential equations numerically, so I am trying to write a 4th -order Runge-Kutta program for Mathematica (I know NDSolve does this, but I ...
3
votes
2answers
1k views

How to avoid this kind of numerical error caused by extreme parameters when using NDSolve?

Here I use a one-dimensional heat conduction equation as the example. I found that when the thermal diffusion coefficient is small enough, Mathematica will give a result against the second law of ...
1
vote
2answers
964 views

Plotting solutions to NDSolve [closed]

Working through some problems of the book A Physicists guide to Mathematica. I'm getting the following errors when I try and plot the solution over a certain range. Any ideas?
4
votes
2answers
415 views

While loop with infinitesimal steps is too time consuming

I have two ODEs with initial conditions. I want to solve the system such that $10^{-4}<z[x]<z_{0}$. The difficulty of problem is here that the initial conditions in not fixed but the boundary ...
4
votes
3answers
665 views

Why does DSolve return two solutions for my ODE?

I wanted to solve the differential equation: $y’ = (1+2x)\sqrt{y}$ with $y(0) = 1$. It can be done by hand, and to check my answer I typed the following in Mathematica ...
1
vote
3answers
404 views

Problem solving Third order non-linear differential equation in Mathematica

I am trying to find an analytical solution of the following 3rd order non-linear differential equation in Mathematica: $a (f'(x))^2+f'''(x)=0$ with boundary conditions $f(0)=0$, $f'(0)=0$, $f(1)=1$, $...
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 (<...
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 ...
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}=\...
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 ...
12
votes
1answer
3k views

Schrödinger eigenvalue problem in two dimensions (Harmonic Oscillator)

I read here the discussion about how to solve a one-dimensional eigenvalue problem. I am wondering, how can one generalize these methods to two dimensions? For example, how to solve this equation: $$...
14
votes
1answer
2k views

Solve a PDE on a domain $\Omega$ with given boundary conditions

I'm starting to study the behavior of some PDEs and I would like to run simulations in mathematica to help me visualize solutions. For example, a prime example that I would like to study is $$ \left\{...
13
votes
3answers
5k views

help to plot Poincaré section for double pendulum

I am reading a book about classical mechanics. In the chapter about chaos, it gives the simplified and scaled equations for double pendulum as $$ \frac{d}{dt}\left[ \begin{matrix} \alpha \\[3mm] ...
20
votes
2answers
4k views

Plotting separatrices for nonlinear system

Consider the system: \begin{align*} x'&=(1-x-y)x\\ y'&=(4-7x-3y)y \end{align*} The system has a saddle point at (1/4,3/4). How can I plot the separatrices on the phase portrait having domain ...
7
votes
3answers
1k views

RK4 Gravity Simulator

I have the following RK4 solver which splits the two 2nd order ODEs, used to calculate x and y positions under the influence of a gravitating body where $$x''(t)=\frac{G m x(t)}{(x(t)^2+y(t)^2)^{3/2}}$...
21
votes
2answers
1k views

Least effort to handle a point source inside the domain of PDE(s)

By point source I mean a constrained condition at one point inside the domain of PDE(s). For example: $$\frac{\partial ^2u(t,x,y)}{\partial t^2}=\frac{\partial ^2u(t,x,y)}{\partial x^2}+\frac{\...
7
votes
1answer
1k views

NestList and Euler's method

I am new to mathematica and so just experimenting with various programming constructs. Recently have been looking at NestList and how I could use this to implement ...
22
votes
2answers
764 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 ...
15
votes
1answer
1k views

Speed up NDSolve compared to Python (calls to LSODA)

I migrated a numerical model code from Python to Mathematica and am surprised how much faster the Python version runs. Profiling of the Python version tells me that it is about 100 times faster (120 ...
12
votes
4answers
679 views

3D FEM Vector Potential

I am trying to reproduce an FEM result in a paper. Due to possible copyright I cannot show the result directly but fortunately there is a free link An Incomplete Gauge for 3D Nodal Finite Element ...
11
votes
2answers
293 views

Reveal the formal PDE of FiniteElement

When FiniteElement method is used, the differential equations will first be transformed to certain standard form (named as formal PDE in recent FEM document), and ...
8
votes
1answer
804 views

Calculating the error in the solution of a system of ODEs

I have solved system of ODEs by using NDSolve. I want to calculate the error of the solutions. So far I have calculated error by plotting results of each equation. ...

1 2
3
4 5
25