Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
pdemagic
pdemagic

First steps

  • First steps
    • pdemagic at a glance
    • Installation
    • A first problem: charges in free space
    • A heated plate: a box and its faces
    • Heat and waves: problems in time
    • What pdemagic decided: plans and accuracy
    • A shape of your own
    • Tones and states: eigenproblems
    • What to read next

Using pdemagic

  • Topics
    • Problems, unknowns and equations
    • Domains
    • Free space and periodic directions
    • Boxes with walls
    • Disks, rings, balls, shells and cylinders
    • Shapes in the plane
    • Boundary conditions
    • Data from arrays
    • Bodies
    • Stationary equations
    • Waves of one frequency
    • Media and potentials: coefficients that vary
    • Nonlinear stationary equations
    • Beams and plates
    • Problems in time
    • Nonlinear equations in time
    • Eigenproblems: bound states
    • Modes of cavities, drums and waveguides
    • Systems of equations
    • Complex unknowns
    • The planner and its plan
    • Accuracy and diagnostics
    • Solutions
    • Plotting
  • How-to guides
    • Give one condition for all faces
    • Give each face its own condition
    • Let waves out through a wall
    • Clamp a plate
    • Draw a shape with holes
    • Name the pieces of a boundary
    • Make one direction periodic
    • Use measured data as a source
    • Start from an array
    • Put a conductor in a field
    • Read what was decided
    • Get more digits
    • Choose the grid yourself
    • Choose the times that are recorded
    • Pick the solution that Newton’s method finds
    • What to do when a plan says NOT resolved
    • Set the number of threads
    • Reuse a plan
    • Evaluate a solution at a point
    • Get the arrays and the grid
    • Integrate a solution
    • Ask for more modes
    • Save and load a solution
    • Plot a section in three dimensions
    • Animate a solution
    • Draw into your own figure
  • Gallery
    • Two charges in the plane
    • Charges inside a disk
    • A charged sphere beside a block of glass
    • A heated plate
    • A plate with a hole
    • A ball with a hot cap
    • A screened charge
    • A lens of glass
    • Ions around a charged rod
    • A source from an array
    • A membrane on an L
    • A crystal that conducts askew
    • Two antennas
    • A waveguide with a ridge
    • Waves through a lens
    • A room with an open window
    • A harbour
    • A clamped plate
    • A cantilever
    • Two states of Bratu’s problem
    • Heat that spreads
    • A rod with a flame
    • Heat in a shape
    • A cooling disk
    • A plucked string
    • A flash of light
    • A struck drum
    • A wave through a slit
    • A damped string
    • A hump that sheds ripples
    • A wave that steepens
    • Solitons that pass
    • A soliton of light
    • A kink and an antikink
    • A kink at a free end
    • Patterns from a reaction
    • A reaction in a dish
    • A pulse between walls
    • A string on a bed that hardens
    • A cloud of ions between two plates
    • A cloud of ions in a dish
    • A front that advances
    • A quantum wave packet
    • States of an oscillator
    • Hydrogen
    • A double well
    • A particle in a stadium
    • A drum
    • A round drum
    • An L-shaped drum
    • The tones of a room
    • A ball that rings
    • A plate that rings
  • Questions that come up

Reference

  • Reference
    • Problems and operators
    • Domains
    • Regions, curves and shapes
    • Data and bodies
    • Planning and solving
    • Solutions
    • Errors
    • What is solved where
    • In free space and on periodic boxes
    • On boxes with walls
    • On round domains
    • On shapes in the plane
    • The methods of a plan
    • Diagnostics
    • How accurate it is
    • Known limits
  • Methods
    • Poisson’s equation by Fourier convolution
    • Linear equations with constant coefficients
    • The Helmholtz equation in free space
    • Boxes with boundary conditions
    • Round domains with boundary conditions
    • Iteration between walls
    • Equations of fourth order on a box
    • The modes of boxes and round domains
    • Modes that are no products
    • Shapes in the plane
    • Shapes with corners
    • Grids and arrays on a shape
    • Systems on a shape
    • Nonlinear equations on a shape
    • Shapes in the plane, in time
    • The modes of a shape
    • Poisson’s equation in disks and balls
    • Poisson’s equation in a finite cylinder
    • Equations whose coefficients vary in space
    • Nonlinear stationary equations
    • Poisson’s equation with conductors and sharp-surfaced bodies
    • Linear equations in time
    • Nonlinear equations in time
    • Systems of linear equations
    • Systems between walls
    • The lowest eigenvalues
  • Glossary
  • Release notes
    • After 0.1.0, not published yet
    • 0.1.0

The project

  • The project
    • Architecture
    • Roadmap
    • Backlog
    • Ideas
    • History
    • Decisions
    • Milestones
      • M30. A backlog, and room for several sessions
      • M31. Checks in less time
      • M32. A comparison of discretizations for general shapes, and the rights settled
      • M33. Shapes in the plane: a first solve
      • M34. Time on shapes in the plane
      • M35. General linear equations on shapes in the plane
      • M36. Nonlinear stationary equations on shapes in the plane
      • M37. The documentation says what the project does
      • M38. Terms that are stepped in time on shapes in the plane
      • M39. A closed project: all rights reserved
      • M40. A mesh that shrinks towards corners
      • M41. A first version: 0.1.0
      • M42. Derivatives in terms that are stepped, on a shape
      • M43. A medium and a potential in time on a shape, propagated exactly
      • M44. A density in time on a shape
      • M45. Drift in the modes of a shape
      • M46. Values of a solution anywhere, on a shape
      • M47. Values of a solution anywhere, on grids
      • M48. Solutions in files
      • M49. Plots in balls and cylinders
      • M50. Solutions for other tools
      • M51. Integrals of a solution
      • M52. Arrays as data on a shape
      • M53. Systems on a shape, in time
      • M54. Stationary systems on a shape
      • M55. The lowest states of an operator
      • M56. Bound states in free space
      • M57. The modes of a shape
      • M58. The lowest modes of a shape, by iteration
      • M59. The modes of a box and of a round domain
      • M60. Many modes at once, and a waveguide
      • M61. Potentials that separate: hydrogen in a ball
      • M62. Spectral elements: a factorization that uses what the matrix is
      • M63. Coefficients that vary, between walls
      • M64. Nonlinear stationary equations, between walls
      • M65. Mixed derivatives, between walls
      • M66. The plate equation, between walls
      • M67. Modes between walls, by iteration
      • M68. The documentation, organized by what a reader needs
      • M69. What the rebuild of the documentation found
      • M70. Reaction and diffusion between walls
      • M71. Dispersion of higher order in free space
      • M72. A review of the architecture, and Newton’s method written once
      • M73. One driver in time over the modes
      • M74. Nonlinear waves between walls
      • M75. One way to a path
      • M76. One reading of an equation
      • M77. More systems in the modes of a domain
      • M78. Why an unknown that does not diffuse loses digits: a correction
      • M79. The checks of CI side by side, and the examples run in less time
      • M80. The tests in less time: what a test need not do
      • M81. Stepping between walls without the loss of order
      • M82. Systems in modes with an equation of second order in time
      • M83. Constraints in systems between walls and on round domains
      • M84. On a region: an unknown that does not diffuse, and a constraint
    • Workflow
    • Benchmarks
    • Discretizations for general shapes
Back to top
View this page

Gallery¶

Problems from many fields, each on a page of its own: stated in a few lines, solved with pm.solve, and drawn. Every picture is drawn by the code of its page when this website is built, so no picture can disagree with its code.

Potentials and steady states¶

Charges and the potentials they make, heat that has settled, membranes that sag.

Two charges in the plane
Two charges in the plane Two charges in the plane

The potential of a positive and a negative charge in free space, with nothing around them.

Two charges in the plane
Charges inside a disk
Charges inside a disk Charges inside a disk

Two charges of opposite sign in a disk with vacuum outside, on a grid that follows the disk.

Charges inside a disk
A charged sphere beside a block of glass
A charged sphere beside a block of glass A charged sphere beside a block of glass

A section through the potential of a conducting sphere at the potential one, with a block of glass next to it.

A charged sphere beside a block of glass
A heated plate
A heated plate A heated plate

The temperature of a square plate with three cold sides and a fourth that is heated in its middle.

A heated plate
A plate with a hole
A plate with a hole A plate with a hole

A round plate that is heated evenly and kept cold along its rim, with a hole that lets no heat through.

A plate with a hole
A ball with a hot cap
A ball with a hot cap A ball with a hot cap

A section through a ball whose surface is hot around one pole and cold elsewhere.

A ball with a hot cap
A screened charge
A screened charge A screened charge

The potential of two charges in free space, and beside it the same potential when the space around them screens it.

A screened charge
A lens of glass
A lens of glass A lens of glass

The field between two charges, drawn into a piece of glass that lies beside the straight way from one to the other.

A lens of glass
Ions around a charged rod
Ions around a charged rod Ions around a charged rod

The potential around a charged rod in salt water, where the ions that screen it respond to it exponentially.

Ions around a charged rod
A source from an array
A source from an array A source from an array

The potential of a dozen charges that are given as an array of numbers, not as a formula.

A source from an array
A membrane on an L
A membrane on an L A membrane on an L

A membrane in the shape of an L, held along its edge, that sags under an even load.

A membrane on an L
A crystal that conducts askew
A crystal that conducts askew A crystal that conducts askew

A round plate cut from a crystal that conducts heat four times as well along one diagonal, with a flame under its middle.

A crystal that conducts askew

Waves of one frequency¶

The Helmholtz equation: waves that leave into free space, that are guided, focused and let out.

Two antennas
Two antennas Two antennas

Waves of one frequency from two sources in the plane, which reinforce each other in some directions and cancel in others.

Two antennas
A waveguide with a ridge
A waveguide with a ridge A waveguide with a ridge

The wave that a metal pipe with a ridge carries first: the lowest mode of its cross section that is not constant.

A waveguide with a ridge
Waves through a lens
Waves through a lens Waves through a lens

What a lens adds to a wave that comes in from the left: almost nothing in front of it, and a beam behind it.

Waves through a lens
A room with an open window
A room with an open window A room with an open window

A steady tone in a long room with hard walls, whose far side is open and lets the sound out.

A room with an open window
A harbour
A harbour A harbour

Swell that enters a harbour through its mouth, spreads behind the quay, passes an island and runs out on the beach.

A harbour

Beams, plates and more than one solution¶

Equations of fourth order, and a nonlinear equation with two solutions.

A clamped plate
A clamped plate A clamped plate

A square plate that is clamped along all four sides and bends under an even load.

A clamped plate
A cantilever
A cantilever A cantilever

A beam that is clamped into a wall at one end and free at the other, and hangs under its own weight.

A cantilever
Two states of Bratu’s problem
Two states of Bratu's problem Two states of Bratu's problem

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

Two states of Bratu’s problem

Heat¶

Diffusion in time: in free space, in a rod, in a shape, in a disk.

Heat that spreads
Heat that spreads Heat that spreads

Two hot spots in the plane, a quarter of the way through the time span: each has widened, and they begin to merge.

Heat that spreads
A rod with a flame
A rod with a flame A rod with a flame

A flame is held to one end of a rod and taken away: the heat moves into the rod, and reaches the far end long after.

A rod with a flame
Heat in a shape
Heat in a shape Heat in a shape

A plate in the shape of an ellipse with a hole, warmed at one end: the heat flows around the hole, and nothing leaves.

Heat in a shape
A cooling disk
A cooling disk A cooling disk

A disk with a warm spot that loses its heat through the rim: the faster, the warmer the rim is.

A cooling disk

Waves in time¶

Strings, drums and light.

A plucked string
A plucked string A plucked string

A bump on a long string at five times: it splits into two halves that move apart.

A plucked string
A flash of light
A flash of light A flash of light

The electric field of two pulses of opposite sign, some time after the flash: each has spread as a ring.

A flash of light
A struck drum
A struck drum A struck drum

A round drum one unit of time after a blow off its centre: the dent has become a ring, and the near rim has thrown it back.

A struck drum
A wave through a slit
A wave through a slit A wave through a slit

A pulse of sound in a room with a partition: what passes the slit leaves it as a new wave that spreads to all sides.

A wave through a slit
A damped string
A damped string A damped string

A pulse on a damped string at five times: it runs to the wall, comes back upside down, and fades all the way.

A damped string
A hump that sheds ripples
A hump that sheds ripples A hump that sheds ripples

A hump on the line whose short waves outrun the long ones: it leans back, and a train of ripples runs off to the left.

A hump that sheds ripples

Nonlinear waves and patterns¶

Waves that steepen, solitons that keep their shape, patterns that grow.

A wave that steepens
A wave that steepens A wave that steepens

A sine wave under Burgers’ equation at five times: it leans forward into a steep front.

A wave that steepens
Solitons that pass
Solitons that pass Solitons that pass

Two solitons before, during and after their meeting: the tall one overtakes the small one, and both keep their shape.

Solitons that pass
A soliton of light
A soliton of light A soliton of light

The magnitude of a pulse of light in a glass fibre at five times: it moves and does not spread.

A soliton of light
A kink and an antikink
A kink and an antikink A kink and an antikink

A kink and an antikink of the sine-Gordon equation run into each other and pass: the turn of the field between them changes sign.

A kink and an antikink
A kink at a free end
A kink at a free end A kink at a free end

A kink of the sine-Gordon equation runs against the free end of its line and comes back turned over.

A kink at a free end
Patterns from a reaction
Patterns from a reaction Patterns from a reaction

One of two substances that diffuse and react, long after a small seed was set: it has grown into a pattern of bands.

Patterns from a reaction
A reaction in a dish
A reaction in a dish A reaction in a dish

Two substances that diffuse and react in a round dish whose rim lets nothing out: a ring that spreads from a seed, and buckles where it meets the rim.

A reaction in a dish
A pulse between walls
A pulse between walls A pulse between walls

A pulse of excitation runs along a fibre between two closed ends, at five times.

A pulse between walls
A string on a bed that hardens
A string on a bed that hardens A string on a bed that hardens

A pulse runs along a string whose bed hardens where the string has moved, at five times.

A string on a bed that hardens
A cloud of ions between two plates
A cloud of ions between two plates A cloud of ions between two plates

A cloud of ions between two grounded plates pushes itself apart, at five times.

A cloud of ions between two plates
A cloud of ions in a dish
A cloud of ions in a dish A cloud of ions in a dish

A cloud of ions in a grounded dish with the shape of an ellipse, after it has pushed itself apart for half a unit of time.

A cloud of ions in a dish
A front that advances
A front that advances A front that advances

A population that grows and spreads, at five times that are equally far apart: its front advances at a nearly steady speed.

A front that advances

Quantum mechanics¶

Wave packets, and the states of a potential.

A quantum wave packet
A quantum wave packet A quantum wave packet

The magnitude of the wave function of a free particle at five times: the packet moves and spreads.

A quantum wave packet
States of an oscillator
States of an oscillator States of an oscillator

The six lowest states of a particle in a well that is steeper along one axis: each has its own pattern of nodes.

States of an oscillator
Hydrogen
Hydrogen Hydrogen

Four states of the hydrogen atom in a section through the axis: 1s and 2s above, a 2p and a 3d state below.

Hydrogen
A double well
A double well A double well

The two lowest states of a particle in a well with two minima: one is even, one is odd, and tunnelling splits their energies.

A double well
A particle in a stadium
A particle in a stadium A particle in a stadium

A mode of a quarter of a stadium: mirrored across its two straight cuts with the sign changed, it is the 27th mode of the whole.

A particle in a stadium

Tones¶

The modes of drums, rooms, balls and plates.

A drum
A drum A drum

A square membrane that is held at its rim, a moment after it was let go from a dent off its centre.

A drum
A round drum
A round drum A round drum

A round membrane that is held at its rim, let go from a dent off its centre: the wave has reached the rim and comes back.

A round drum
An L-shaped drum
An L-shaped drum An L-shaped drum

The lowest mode of a membrane in the shape of an L: it bulges in the bend and fades into the two arms, and no formula gives it.

An L-shaped drum
The tones of a room
The tones of a room The tones of a room

One of the lowest tones of a room with hard walls: the pressure on the floor, with two nodes along the room and one across it.

The tones of a room
A ball that rings
A ball that rings A ball that rings

A mode of a ball that is held on its surface, in a section through its axis: two lobes along the axis and a belt around it.

A ball that rings
A plate that rings
A plate that rings A plate that rings

A tone of a square plate that is clamped along its sides: where the two colours meet the plate stays at rest, and sand on it would gather.

A plate that rings
Next
Two charges in the plane
Previous
Draw into your own figure
Copyright © 2026, Matthias Baer
Made with Sphinx and @pradyunsg's Furo
On this page
  • Gallery
    • Potentials and steady states
    • Waves of one frequency
    • Beams, plates and more than one solution
    • Heat
    • Waves in time
    • Nonlinear waves and patterns
    • Quantum mechanics
    • Tones