M49. Plots in balls and cylinders

Package: K1, its first part: plot and animate draw a solution in a ball and in a cylinder, as a section: through the axis, across it, or along a surface of constant radius.

What was built

  • Sections of a ball and of a cylinder, by the coordinate that cut holds fixed:

    Domain

    Fixed

    Picture

    Ball

    the angle around the axis

    the plane through the axis, with both halves. The default, at the angle zero

    Ball

    the angle from the axis

    a cone, drawn as a disk: at \(\pi/2\) the plane of the equator

    Ball

    the radius

    a sphere, by its two angles

    Cylinder

    the coordinate along the axis

    a disk or a ring. The default, at the middle

    Cylinder

    the angle

    the plane through the axis, with both halves

    Cylinder

    the radius

    a tube, unrolled

  • Drawing by patches. A section is now a list of patches, each with the positions of its points on the page and the values there. A field on a grid or a disk is one patch, a plane through an axis is two. An animation computes the patches of a frame the same way and hands their values to what was drawn, where it set the values of one mesh before.

  • The radius by the rule of its axis. Along Gauss points a field is taken to other radii by the polynomial through them, as on a disk. Along the centres of cells, in the cylinder with vacuum outside, it is taken to be linear between them and constant beyond.

  • Up to the surface. The points of a grid stop short of the poles of a ball and of the ends of a cylinder. The field is drawn up to them by the value at the nearest point, and on the axis of a ball by the mean of the two halves, which have one value there.

What was checked

The two halves of a plane through the axis agree on the axis and mirror each other in position. A solution that is odd across the axis has opposite signs in them. The plane at the angle \(\pi\) is the plane at zero with its halves exchanged, and an angle beyond the circle is taken into it. Disks and rings reach from the inner radius to the outer, and a plane through a cylinder from one end to the other. A ball that cools is animated in all three sections, and its last frame is fainter than its first. The pictures were looked at.

Decisions

D49.1. A section follows a coordinate of the domain

Developer, 2026-11-19.

In a box a section holds one coordinate fixed, and so it does in a ball and in a cylinder. The three coordinates give the three pictures that are drawn of such domains by hand: through the axis, across it, and along a surface. A plane that follows no coordinate would need values between the points of the grid in all three directions at once, which in a ball are not there yet (K6).

D49.2. The plane through the axis is drawn whole

Developer, 2026-11-19.

Holding the angle around the axis fixed gives a half plane. The picture shows it with its other half, across the axis, at that angle plus \(\pi\): that is the section which one expects of a ball, and a field that does not depend on the angle is seen to be symmetric. The default section of a ball is this plane at the angle zero. Of a cylinder it stays the section at the middle of the last coordinate, as in a box, which is a disk.

D49.3. Between the planes of the grid a section is linear

Developer, 2026-11-19.

A cut between two planes of the grid takes the field to be linear from one to the other, as it did in boxes. That is a picture, not a value: for values there is the call of the solution, where the domain has it.

What is left

  • The surfaces of bodies with their charge, and views in space.

  • Sections that follow no coordinate.