--- jupyter: description: 'Field and simulation examples with planex2d in Python: an electric motor, magnets and coils, antennas, waveguides and microstrips, heat sinks, flow through valves and ducts, stress concentrations, and shapes found by level sets.' --- # Field and simulation examples - [Surface magnet motor](motor.md) - [Heat sink](heat-sink.md) - [Hilbert heater](hilbert-heater.md) - [Parallelogram flexure](parallelogram-flexure.md) - [Vivaldi antenna](vivaldi-antenna.md) - [Voronoi bone](voronoi-bone.md) - [Lens ray tracing](lens-ray-tracing.md) - [Airplane windows](airplane-windows.md) - [The Tesla valve](tesla-valve.md) - [The Venturi meter](venturi-meter.md) - [The hydraulic diameter](hydraulic-diameter.md) - [The Joukowski airfoil](joukowski-airfoil.md) - [Microstrip impedance](microstrip-impedance.md) - [The Faraday cage](faraday-cage.md) - [Sharp or blunt lightning rods](lightning-rod.md) - [The skin effect](skin-effect.md) - [Waveguide cutoff](waveguide-cutoff.md) - [A photonic crystal](photonic-crystal.md) - [Stress at a shoulder fillet](shoulder-fillet.md) - [Open and closed sections in torsion](torsion-open-closed.md) - [The Halbach array](halbach-array.md) - [Turing patterns](turing-patterns.md) - [The Helmholtz coil](helmholtz-coil.md) - [Random walks and electric networks](random-walks-and-networks.md) - [Designing an auxetic material](auxetic-cell.md) These examples compute magnetic, electric and thermal fields, flow, elasticity and diffusion on geometry drawn in planex2d. planex2d draws the part, names the edges and regions that carry the boundary conditions, and glues several materials into one geometry. In most examples, netgen meshes it and NGSolve solves the field, and the solution is compared with a closed form, an empirical law or a published value, such as Hammerstad and Jensen's microstrip formulas, Peterson's stress concentration factors or the cutoff of a WR-90 waveguide.

In this section

Surface magnet motor
Surface magnet motorA lamination glued into regions, its field, and a 12-slot design under load.
Heat sink
Heat sinkConduction and convection in an extruded profile, one fin against fin theory.
Hilbert heater
Hilbert heaterA heater track along a Hilbert curve, with current, Joule heat and temperature.
Parallelogram flexure
Parallelogram flexureA flexure stage from one block, pushed sideways in a 3D elasticity solve.
Vivaldi antenna
Vivaldi antennaAn exponential tapered slot with a round cavity and a radial stub.
Voronoi bone
Voronoi boneSome 6000 struts united at once, pressed against a scaling law.
Lens ray tracing
Lens ray tracingA biconvex lens as two intersected discs, with Snell's law and chief and marginal rays.
Airplane windows
Airplane windowsRound, oval and square windows in a pressurized skin, against Kirsch, Inglis and Williams.
The Tesla valve
The Tesla valveA valve without moving parts: no effect in Stokes flow, 1.6 times the pressure one way at Re 200.
The Venturi meter
The Venturi meterBernoulli's equation along the centerline of a Navier-Stokes flow, and the meter's discharge coefficient.
The hydraulic diameter
The hydraulic diameterLaminar flow through five duct sections against the exact solutions, and how far each is from a pipe.
The Joukowski airfoil
The Joukowski airfoilPotential flow with the Kutta condition, the circulation and the lift against the exact values.
Microstrip impedance
Microstrip impedanceA trace on FR-4 from two electrostatic solves, against Hammerstad and Jensen, and its width for 50 Ω.
The Faraday cage
The Faraday cageA ring of thin wires in the field of a line charge: shielding in proportion to the number of wires, not exponential.
Sharp or blunt lightning rods
Sharp or blunt lightning rodsThe field at the tip grows as E0 (1 + a/b), but above it a blunt rod overtakes a sharp one.
The skin effect
The skin effectAlternating current in a copper wire against the Bessel solution, and a flat bar where it gathers at the edges.
Waveguide cutoff
Waveguide cutoffThe modes of a WR-90 and a round guide against the closed forms, and a ridge that lowers the cutoff.
A photonic crystal
A photonic crystalThe TM bands of a lattice of rods from Bloch modes, and its band gap against the textbook's 31.4 %.
Stress at a shoulder fillet
Stress at a shoulder filletA stepped bar as a parametric sketch, its stress concentration factor against the body force method and Peterson's chart.
Open and closed sections in torsion
Open and closed sections in torsionA tube and the same tube slit: over a thousand times the stiffness, against Bredt and s t³/3.
The Halbach array
The Halbach arrayMagnets whose field is on one side only, as a periodic cell, against Mallinson's and Halbach's formulas.
Turing patterns
Turing patternsSpots growing out of noise at the rates the linear analysis predicts, and a tapering tail that ends in rings.
The Helmholtz coil
The Helmholtz coilTwo coils one radius apart: the field in their middle, uniform to the fourth order, against the loop formula.
Random walks and electric networks
Random walks and electric networksThe chance that a random walker leaves a hall by the front door is a voltage: a resistor network on the grid against 4000 walkers.
Designing an auxetic material
Designing an auxetic materialA periodic cell shaped by a level-set method until the lattice gets wider when pulled, then traced as a clean cell.
See [Examples](index.md) for the other collections.