IV. Differential equations and advanced analysis
38. Partial differential equations
Type the equation with subscripts u_t, u_xx, u_xy (from a photo the app also reads ∂u/∂t and ∂²u/∂x²), the Laplacian as Δu; the conditions and the domain a semicolon apart. Without conditions the app finds a linear second-order equation’s type (elliptic, parabolic, hyperbolic – by region for variable coefficients), the characteristic equation, the canonical form and, without lower-order terms, the general solution. A first-order equation a·u_x + b·u_y + c·u = f is solved by characteristics with a check.
With boundary and initial conditions it solves by separation of variables the heat equation u_t = k·u_xx and the wave equation u_tt = c²·u_xx on an interval (ends held at a temperature or insulated, nonzero values via the steady state) and Laplace’s equation on a rectangle and in a disk (or outside it). The Fourier coefficients come as a formula in n; an initial function that is a sum of eigenfunctions gives a finite sum. On the whole line it uses d’Alembert’s formula and the Fourier transform (the heat kernel), on a half-line x > 0 the Laplace transform in time. It also handles a source f(x, t) (Duhamel’s principle), a heat flux at an end, boundary values changing in time and, for Laplace’s equation, derivatives on the sides. Of the nonlinear equations it solves Burgers’ – by characteristics until a shock forms, with viscosity by the Cole-Hopf transformation; the wave equation on the line is also shown by the Fourier transform. Poisson’s equation Δu = f on a rectangle is solved by a double Fourier series (the source as a sum of products p(x)·q(y)); with all four sides given by the derivative the solvability condition is checked and the solution comes up to a constant. Equations with the variable coefficients αx²u_xx + βxu_x turn into a Sturm–Liouville problem with a weight.
Numerically on a grid with the scheme as the head, as with the other numerical methods: the heat equation explicitly (ftcs), implicitly (btcs), by Crank-Nicolson (cranknicolson) and the θ-method (theta) – the implicit systems by the Thomas algorithm, with von Neumann’s stability analysis; the transport equation by upwind, laxwendroff and leapfrog with the CFL condition, the wave equation by leapfrog; Laplace’s (Poisson’s) equation by the five-point scheme and the iterations jacobi, gaussseidel and sor with their iteration counts compared. Named values: h the space step, k the time step, to the final time, theta, omega, tol, max. The heat equation is also a form in Numerical methods. Heat in 2D on a rectangle is solved by the schemes ftcs and adi (alternating directions), Laplace’s equation also by conjugate gradients (cg), multigrid (multigrid) and finite elements with triangles (fem); Burgers’ equation by Godunov’s scheme (upwind). The transport and Laplace equations are also forms in the field Numerical methods, the applications (a rod, a string, a drum, diffusion) forms in physics and chemistry. For conservation laws there are the schemes laxfriedrichs and muscl (with the minmod limiter) – for the transport and Burgers’ equation, the latter also with viscosity (compared with the Cole–Hopf transformation). The finite element method (fem) also works on a general polygon given by its vertices, polygon = (0,0), (2,0), …, with the boundary value u = …; the mesh comes from ear clipping and splitting the triangles. Heat in a plate is a form in physics.
The result is a graph of u(x, t): a curve in time with a slider and a play button, and a 3D surface to turn; a numerical solution has the exact one dashed. Laplace’s stationary u(x, y) is a 3D surface.
How to enter it
u_t = 4u_xx; u(0,t) = 0; u(π,t) = 0; u(x,0) = x(π - x) | The equation, boundary and initial conditions; a derivative in a condition as u_t(x,0) or u_x(0,t). |
u_t = u_xx; x ∈ ℝ; u(x,0) = e^(-x^2) | The domain: x ∈ ℝ, x > 0 or 0 < x < π; without boundary conditions the whole line. |
Δu = 0; r < 2; u(2,φ) = cos φ | Laplace’s equation in a disk: Δu, the radius r and the angle φ (or θ). |
ftcs(u_t = u_xx; u(x,0) = sin(pi x); u(0,t) = 0; u(1,t) = 0; h = 0.1; k = 0.004; to = 0.1) | Numerically: the scheme as the head, the steps h and k and the final time to. |
adi(u_t = u_xx + u_yy; 0 < x < 1; 0 < y < 1; u(x,y,0) = x(1-x)y(1-y); T = 0.1) | Heat in 2D: u(x,y,t), conditions like u(x,y,0) = … and u(0,y,t) = …; sides without a condition are 0. |
fem(Δu = -4; polygon = (0,0), (2,0), (2,1), (1,1), (1,2), (0,2); u = 0; h = 0.25) | Finite elements on a polygon: the vertices after polygon =, the boundary value u = …, the longest edge h. |
Examples
u_xx + 4u_xy + u_yy = 0


y u_xx + u_yy = 0
u_t + 2u_x = 0; u(x,0) = e^(-x^2)


u_t = 4u_xx; u(0,t) = 0; u(π,t) = 0; u(x,0) = x(π - x)


u_t = 2u_xx; u(0,t) = 1; u(2,t) = 3; u(x,0) = 0


u_tt = 4u_xx; u(0,t) = 0; u(1,t) = 0; u(x,0) = x(1 - x); u_t(x,0) = 0


u_xx + u_yy = 0; 0 < x < π; 0 < y < 1; u(x,1) = sin x


Δu = 0; r < 1; u(1,φ) = sin(φ)^2


u_tt = u_xx; x ∈ ℝ; u(x,0) = e^(-x^2); u_t(x,0) = 0


u_t = u_xx; x ∈ ℝ; u(x,0) = e^(-x^2)


u_t = 4u_xx; x > 0; u(0,t) = 100; u(x,0) = 20


ftcs(u_t = u_xx; u(x,0) = x(1-x); u(0,t) = 0; u(1,t) = 0; h = 0.1; k = 0.007; to = 1)


cranknicolson(u_t = u_xx; u(x,0) = sin(pi x); u(0,t) = 0; u(1,t) = 0; h = 0.1; k = 0.01; to = 0.1)


laxwendroff(u_t + u_x = 0; u(x,0) = e^(-50(x-0.3)^2); 0 < x < 1; h = 0.02; k = 0.016; to = 0.4)



sor(u_xx + u_yy = 0; u(x,1) = sin(pi x); u(x,0) = 0; u(0,y) = 0; u(1,y) = 0; h = 0.1)


u_t = u_xx + sin(x)e^(-t); u(0,t) = 0; u(π,t) = 0; u(x,0) = 0


u_t = u_xx + 1; u(0,t) = 0; u(1,t) = 0; u(x,0) = 0


u_t = u_xx; u_x(0,t) = 0; u_x(π,t) = 1; u(x,0) = 0


u_tt = u_xx; u(0,t) = 0; u(π,t) = sin(t); u(x,0) = 0; u_t(x,0) = 0


Δu = 0; u_y(x,0) = 0; u(x,1) = sin(pi x); u(0,y) = 0; u(1,y) = 0


u_t + u u_x = 0; u(x,0) = e^(-x^2)


u_t + u u_x = 0.1u_xx; u(x,0) = -tanh(x)


upwind(u_t + u u_x = 0; u(x,0) = (1 - tanh(10x))/2; -2 < x < 4; h = 0.1; T = 2)


adi(u_t = u_xx + u_yy; 0 < x < 1; 0 < y < 1; u(x,y,0) = sin(pi x)sin(pi y); h = 0.1; k = 0.01; T = 0.1)


cg(u_xx + u_yy = 0; u(x,1) = sin(pi x); u(x,0) = 0; u(0,y) = 0; u(1,y) = 0; h = 0.125)


multigrid(u_xx + u_yy = -2; 0 < x < 1; 0 < y < 1; h = 0.0625)


fem(u_xx + u_yy = -2; 0 < x < 1; 0 < y < 1; h = 0.25)


Δu = -2; u(0,y) = 0; u(1,y) = 0; u(x,0) = 0; u(x,1) = 0


u_xx + u_yy = 0; u_x(0,y) = 0; u_x(1,y) = 1; u_y(x,0) = 0; u_y(x,1) = -1 + cos(πx)


u_t = x^2u_xx + x u_x; u(1,t) = 0; u(e^π,t) = 0; u(x,0) = 1


muscl(u_t + u_x = 0; u(x,0) = e^(-50(x-0.3)^2); 0 < x < 1; h = 0.02; k = 0.016; to = 0.4)



muscl(u_t + u u_x = 0.05u_xx; u(x,0) = (1 - tanh(x))/2; -5 < x < 5; T = 1)


fem(Δu = -4; polygon = (0,0), (2,0), (2,1), (1,1), (1,2), (0,2); u = 0; h = 0.25)


Known limitations
- Analytically only linear equations with one unknown function u of two variables, and Burgers’ equation; other nonlinear equations and systems not.
- By separation of variables the heat and wave equations on an interval; a source only as a sum of products p(x)·q(t), for Poisson’s equation at most three products p(x)·q(y). Variable coefficients only of Euler’s type αx²u_xx + βxu_x with zero values at the ends.
- The Fourier transform in closed form for a Gaussian, a polynomial and functions with f″ = λf; otherwise the convolution stays and the graph is computed numerically.
- Numerically in 2D the heat and Laplace’s equations on a rectangle with a regular grid; on a polygon only the finite element method with linear triangles and a boundary value (not a derivative), without holes and with at most 40 vertices.