This is the 2D companion to the 3D beating-heart simulator, built on the same cardiac-cycle idea but driven by the actual Wiggers-diagram phase timing instead of a simple pulse: each heartbeat cycles through atrial systole, isovolumic contraction, ejection, isovolumic relaxation and ventricular filling, with the four valves opening and closing at fixed points in that cycle and the ECG trace tracing the electrical event that triggers each mechanical phase.
Stroke volume: SV (mL) = EDV × EF (EDV ≈ 120 mL end-diastolic volume, fixed)
Ejection frac.: EF = clamp(0.55 × contractility, 0.25, 0.80)
Cardiac output: CO (L/min) = HR (bpm) × SV (mL) / 1000
Cycle phases (fraction of one beat):
0.00-0.14 Atrial systole (P wave → AV valves open, atria contract)
0.14-0.22 Isovolumic contr. (QRS → all 4 valves closed)
0.22-0.42 Ejection (semilunar valves open, ventricles squeeze)
0.42-0.46 Isovolumic relax. (T wave → all 4 valves closed)
0.46-1.00 Ventricular filling (AV valves open, ventricles refill)
- Heart rate — beats per minute; raising it directly raises cardiac output (and animation speed) and compresses every phase of the cycle proportionally.
- Contractility — how forcefully the ventricles squeeze; raising it increases ejection fraction and stroke volume (visibly, the ventricles shrink further during ejection) without changing the electrical timing.
- The mitral/tricuspid (AV) valves and aortic/pulmonic (semilunar) valves are never open at the same time — that is what makes the heart a one-way pump instead of a sloshing bag.
- The QRS complex (ventricular depolarization) always precedes isovolumic contraction, and the T wave (ventricular repolarization) always precedes isovolumic relaxation — the electrical signal triggers the mechanical squeeze a beat later, matching how a real ECG is read against heart sounds.
Real-world relevance: clinicians read valve timing and ECG correlation together — a murmur that appears exactly between S1 (AV valve closure, start of isovolumic contraction) and S2 (semilunar valve closure, end of ejection) points to a systolic problem (e.g. aortic stenosis), while a drop in contractility (as in heart failure) lowers ejection fraction and cardiac output even at a normal heart rate, which is exactly why EF is the number doctors quote first.