Waving Flag Cloth (2D)

Front view and a top-down cross-section of a mass-spring flag flapping in gusty wind, with live force and energy graphs.

Switch to 3D

Presets

Playback

Wind

Mean speed plus gusts and turbulence.

Cloth

Changing weight or size restarts the flag.

Layers

Model checks

The science

Model

The flag is a grid of 25 x 17 point masses joined by structural, shear and bend springs (Hooke's law plus a damper along each spring). The left column is pinned to the pole. Each time step (1/600 s) sums the forces and integrates them with semi-implicit Euler:

m dv/dt = m g + Σ [ k (L - L0) + c dL/dt ] e + Faero

Wind force

Each triangle of the cloth feels a pressure force proportional to the relative air velocity normal to its surface:

F = ½ ρ Cd A un |un| n    un = (w - v) · n

with air density 1.2 kg/m3 and Cd = 1.2 for a flat plate. A cloth lying along the wind feels almost no force; once it bulges, the normal component grows, the flag is pushed, snaps back and flutters. The wind has a steady part, a slow gust and fast turbulence.

Honest simplifications

  • No aerodynamic lift, vortex shedding or boundary layer: flutter here comes from the pressure-drag feedback plus elasticity, so frequencies are indicative only.
  • No self-collision; the explicit integrator needs small steps and moderate stiffness.
  • Real fabric bends and shears differently from isotropic springs.
What to try
  • Try Dead calm: the flag hangs still and gravity stretches the springs a little.
  • Steady flutter: read the flutter frequency; raise the wind and it rises.
  • Heavy banner: heavier fabric droops and flaps slowly.
  • Lower the stiffness and watch the maximum strain grow.
Tip displacement across the wind (m)
Kinetic energy of the cloth (mJ)
Net force along the wind (N)
Wind speed at the pole (m/s)