Two states of Bratu’s problem

One nonlinear equation between two walls and its two solutions, each found from its own starting value.

import sympy as sp
import pdemagic as pm

x = sp.symbols("x", real=True)
v = sp.Function("v")(x)
walls = pm.Box({x: (0, 1)})
bratu = sp.Eq(v.diff(x, 2) + sp.exp(v), 0)

lower = pm.solve(pm.Problem(bratu, domain=walls, boundary=sp.Eq(v, 0)))
upper = pm.solve(
    pm.Problem(bratu, domain=walls, boundary=sp.Eq(v, 0), guess={v: 16 * x * (1 - x)})
)

axes = lower.plot()
upper.plot(ax=axes)
The figure that the example above draws. The figure that the example above draws.

What it shows

The problem of Bratu, \(v'' + e^v = 0\) with \(v = 0\) at both walls. It is a model of a substance that heats itself the faster the warmer it is, between two cold walls. The equation is nonlinear, and it has two solutions. In the lower one the heating stays weak, and the middle reaches 0.14. In the upper one the heating feeds itself, and the middle reaches 4.09. Newton’s method finds the solution that it reaches from its start: the lower one from zero, and the upper one from the starting value that guess= gives.

What pdemagic decided

The planner chose Newton’s method on collocation at Chebyshev points (collocation_newton), and its plan says that it finds the solution that Newton’s method reaches from its start. Each step is a linear equation with a coefficient that varies, solved by an iteration on the direct solve. The lower solution is resolved on 24 points and the upper one, which is steeper at the walls, on 96.

More