27 votes
Accepted

Symbolic solution(s) to generalized Heat equation

A first step would be to implement a convenience function that can automatically apply the method of separation of variables to separable types of equations. To show that the steps could in principle ...
user avatar
  • 95.2k
27 votes

Nonlinear differential equation: numerical solution

Introduction I think there are several questions on this site about ODEs of the form $$(x-a)^2 u''(x) = F(x,u,u')$$ with an initial condition at $x=a$. There is no general guarantee that solutions ...
user avatar
  • 216k
23 votes
Accepted

Numerically solve the initial value problem for the 1-D wave equation

I've waited for this question for a long time :) Fully NDSolve-based Numerical Solution There actually exist 2 issues here: NDSolve can't handle unsmooth i.c. ...
user avatar
  • 52.5k
22 votes

Symbolic solution(s) to generalized Heat equation

Here is extensions to @Jens answer (I think) also relying on possible separation of variable. It is not meant as an independent answer, but complements it. First extend his answer to 2D ...
user avatar
  • 21.7k
20 votes

How to solve ODE with boundary at infinity

The finite element method can be used on this problem if we make a change of variables to convert the domain $[0, \infty)$ to a finite interval. I believe only ...
user avatar
  • 216k
20 votes
Accepted

How to solve ODE with boundary at infinity

You can use ParametricNDSolve to implement a shooting method. Define a finite version of "infinity". inf = 5; Define the ...
user avatar
19 votes

How to solve ODE with boundary at infinity

Spectral methods I present two general ways to approach a second-order linear BVP of the form $$\gamma(x)\, y''(x) + \beta(x)\, y'(x) + \alpha(x)\, y(x) + \varphi(x) = 0,\ y(0) = y_1,\ y(\infty) = ...
user avatar
  • 216k
16 votes

Why does NDSolve blow up when given my ODE but bvp4c in Matlab does not?

First, there is a mistake in the sign k. And secondly, for such tasks we use a special method that expands the possibilities of the shooting method. I will ...
user avatar
  • 34.1k
15 votes

Numerically solve the initial value problem for the 1-D wave equation

Here is a FEM-based solution: ...
user avatar
  • 36.1k
15 votes
Accepted

${\frac {\partial^{2} u}{\partial {x}^{2}}} +{\frac {\partial ^{2} u}{\partial {y}^{2}}} =0$ with one boundary at infinity

Using the symbolic boundary condition u[t, y] == 0 instead of the infinite one, and then taking the limit $$ t \to \infty,$$ inside the sum seems to do the trick ...
user avatar
14 votes

Where is the numerical solving breaking down?

Some experimentation shows that the NDSolve problem is associated exclusively with z with no feedback to ...
user avatar
  • 58.4k
12 votes

Numerical solution of coupled ODEs with boundary conditions

This is the most difficult of the nearly two dozen nonlinear ODE separatrix computations that I have encountered on Mathematica.SE. Nonetheless, it can be can be solved by a systematically refined ...
user avatar
  • 58.4k
12 votes
Accepted

Heat convection differential equations from 1952 - Mathematica "fails to converge"

The problem is with the default starting initial conditions used by the shooting method in NDSolve. The shooting method is where ...
user avatar
  • 216k
12 votes
Accepted

Laplace's equation in spherical coordinates with Neumann b.c

Two issues here. First of all, you've chosen 100 to approximate Infinity, which is way too large in this case. Something like <...
user avatar
  • 52.5k
12 votes

Numerical solutions of active 1D wave equations

This problem can be solved with method of lines and with FDM as well. Using NDSolve we have ...
user avatar
  • 34.1k
11 votes

Symbolic solution(s) to generalized Heat equation

Let me start addressing the Green function part of the question. Lets define a Heat equation and its generic solution (see above) ...
user avatar
  • 21.7k
11 votes

Boundary Condition for Schrödinger Equation in Infinite Range

Let's remember Schrodinger's equation: $i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t)$ For the harmonic ...
user avatar
11 votes

Solving stiff boundary value problem

Relaxation solution Your ODE is $$ k \frac{d^2 T}{dx^2} - T^4 = 0, \qquad T(0) = 0.9, \qquad T(1) = 1 $$ where $T$ is a function of $x$. We attempt instead to solve the related PDE $$ k \frac{\...
user avatar
10 votes
Accepted

Frequency domain Maxwell equations with PML boundary conditions

I'm not that familiar with electromagnetism, either, but I think there're at least 4 issues in your solving process: There's no need to "consider only the magnetic field", because electric field is ...
user avatar
  • 52.5k
10 votes
Accepted

Boundary Condition for Schrödinger Equation in Infinite Range

Since OP has found this interesting post, let me try to implement the exterior complex scaling method mentioned there. First, make the transform $x= \left\{\begin{array}{cc} & \begin{array}{cc}...
user avatar
  • 52.5k
10 votes
Accepted

Error when solving 't Hooft-Polyakov radial equations using NDSolve

Once again, compared to "Shooting" method that is the default and currently the only available method for solving nonlinear boundary value problem (BVP) ...
user avatar
  • 52.5k
10 votes

An ODE system easily polluted with spurious eigenvalues

NDEigenValues handles the pair of first-order equations in the question much more accurately, when it is converted into a single second-order equation. ...
user avatar
  • 58.4k
10 votes
Accepted

An ODE system easily polluted with spurious eigenvalues

The additional problem added to the end of the question can be solved in a similar manner. Begin with ...
user avatar
  • 58.4k
10 votes
Accepted

Where is the numerical solving breaking down?

For this problem, you must specify a solution method. Since the system of equations is nonlinear and the equation for y does not contain derivatives with respect to ...
user avatar
  • 34.1k
10 votes

Where is the numerical solving breaking down?

Fully NDSolve-based Solution Adjustion for spatial step size together with temporal step size helps. I've used parameters mentioned in the comment for testing: <...
user avatar
  • 52.5k
10 votes
Accepted

Numerical solutions of active 1D wave equations

NDSolve-based Solution ...
user avatar
  • 52.5k
9 votes

Nonlinear differential equation: numerical solution

This question seeks the separatrix of a nonlinear ODE over the range {0, Infinity}. As noted by Michael E2, many such problems have been presented on this site. (...
user avatar
  • 58.4k
9 votes
Accepted

Using DSolve with a boundary condition at -Infinity

This is the solution of your equation without the boundary conditions: ...
user avatar
9 votes
Accepted

Numerical solution of nonlinear boundary value problem

This system of second-order nonlinear ODEs, like many others in this site, is difficult to solve numerically, because the desired asymptotic solution is a separatrix. As a consequence, infinitesimal ...
user avatar
  • 58.4k
9 votes

Laplace's equation in spherical coordinates with Neumann b.c

In a previous answer 240190, I showed how one could use anisotropic meshing to add a DirichletCondition at "infinity" for a 1D problem. In this answer, I ...
user avatar
  • 16k

Only top scored, non community-wiki answers of a minimum length are eligible