The science
String. A stiff damped string obeys utt = c²uxx − κ²uxxxx − 2b1ut + 2b2utxx with c = √(T/μ) and κ² = EI/μ. It is solved on a grid (explicit finite differences, 44.1 kHz time step, ends simply supported). Stiffness makes the partials inharmonic: fn = n f0√(1 + B n²), B = π²EI/(TL²).
Hammer. A mass mh = 3 g hits the string with speed v0. The felt pushes back with the nonlinear law F = K·ηp (η = felt compression, p = 2.5, after Chaigne & Askenfelt). A harder felt (larger K) means a shorter contact, a sharper force pulse and more energy in the high partials: brighter sound. A strike at L/n suppresses the n-th partial (that mode has a node there).
Sound. What you hear is the force the string exerts on the bridge, T·ux(L), played directly. A real piano filters this through the soundboard and room, and uses several strings per note and wound bass strings.
Simplifications: one vibration polarisation (vertical), one string per note, 1 mm steel wire at every pitch with a simplified scale length, no soundboard, no longitudinal waves, no hammer shank flexibility, no two-stage decay (aftersound). Numbers such as K are in the realistic range but are not measurements of any specific instrument.
Art: hammer, soundboard and bridge sprites were rendered in Blender (Cycles) and are drawn on a Canvas; the physics runs in the page.