Anatomical Blender heart driven by a time-varying-elastance model of both ventricles, valves and arteries.
GraphsLV pressure-volume loop (live dot) with the end-systolic line
Wiggers diagram: LV, aortic and atrial pressure over the last 4 s
LV volume over the last 4 s
Synthetic ECG aligned to the model phase
The science
Time-varying elastance. Each ventricle is a chamber whose pressure is Plv = E(t) (V - V0). The elastance rises and falls as E(t) = Emin + (Emax - Emin) sin²(π t / Ts) during systole (duration Ts = min(0.45 T, 0.16 + 0.16 T)) and stays at Emin in diastole. Emax is the contractility slider; the dashed orange line in the PV graph is the end-systolic relation P = Emax(V - V0).
Valves. Ideal diodes with a small resistance: mitral inflow qin = max(0, Pla - Plv) / Rm and aortic outflow qout = max(0, Plv - Pao) / Rao. The four phases (isovolumic contraction, ejection, isovolumic relaxation, filling) fall out of the equations, they are not scripted.
Arteries. A two-element Windkessel: C dPao/dt = qout - Pao / Rsys. In diastole the valve is shut and the pressure decays as exp(-t / Rsys C); with the default Rsys = 1.0 mmHg s/mL and C = 1.6 mL/mmHg the time constant is 1.6 s. The state (V, Pao) is integrated with fixed-step RK4 (0.5 ms).
Right heart. The right ventricle uses the same equations with a lower elastance (24 % of the left value), a pulmonary resistance and a compliance of 4.2 mL/mmHg. Its filling pressure follows the left preload slider weakly. The two circuits are not closed into one loop, so the right and left stroke volumes can differ slightly; in the body they are equal over time.
Independent checks. (1) The stroke volume from the integral of aortic flow equals EDV - ESV read from the volume trace. (2) At periodic steady state the mean arterial pressure equals Rsys times the mean outflow. (3) A log-slope fit of the closed-valve diastolic pressure gives Rsys C. (4) The pressure-volume loop area (shoelace on the sampled loop) equals the energy ledger built from the valve flows, ∫(Pao qout + Rao qout² + Rm qin² - Pin qin) dt. All four run in a fresh model of the current settings after the sliders stop moving.
Honest simplifications. The atria are passive reservoirs at fixed pressure (their squeeze on the 3D model is only drawn); there is no venous return coupling, baroreflex, valve inertia, coronary flow or ventricular interaction. The ECG trace is a sum of Gaussians placed by the model phase for orientation, not a bioelectric simulation. Chamber size in 3D follows the cube root of the computed volume. Values are typical adult textbook numbers (about 120/75 mmHg, 5-6 L/min at rest) for education, not for diagnosis.
What to try: pick Exercise and watch the PV loop move up and left with the shorter filling time; raise the afterload slider and see systolic pressure and stroke volume change; choose Heart failure (low contractility, high filling pressure) and compare the ejection fraction; stiffen the aorta and watch pulse pressure widen.