A mathematical model of left-ventricular function