ClearAll;
$DefaultFont = {"Times-Roman",10};
Needs["Graphics`Graphics`"];
v1[t_]:= -465(20 t - 1);
v2[t_]:= -310(3 - 10t);
v3[t_]:= -120(3 - 10t);
v4[t_]:= -60(20 t - 7);
v5[t_]:= -600(2 - 5 t);
v6[t_]:= -375(4 t - 3);
v7[t_]:= -400(3 - 4t);
v8[t_]:= -160(10 t - 9);
v[t_]:= Which[t<=1/20,0,
			  t<=1/10,v1[t],
			  t<=3/20,-465,
			  t<=3/10,v2[t],
			  t<=13/40,v3[t],
			  t<=7/20,v4[t],
			  t<=2/5,0,
			  t<=1/2,v5[t],
			  t<=11/20,300,
			  t<=3/4,v6[t],
			  t<=33/40,v7[t],
			  t<=9/10,v8[t]];
lower = Plot[v[t],{t,0.4,0.9},AxesLabel->{"t","y"},
		PlotLabel->"Venous inflow:  y = v(t)"];

R1[t_]:= Integrate[0,{w,0,t}];
R2[t_]:= Integrate[v1[w],{w,1/20,t}] + R1[1/20];
R3[t_]:= Integrate[-465,{w,1/10,t}] + R2[1/10];
R4[t_]:= Integrate[v2[w],{w,3/20,t}] + R3[3/20];
R5[t_]:= Integrate[v3[w],{w,3/10,t}] + R4[3/10];
R6[t_]:= Integrate[v4[w],{w,13/40,t}] + R5[13/40];
R7[t_]:= Integrate[0,{w,7/20,t}] + R6[7/20];
R8[t_]:= Integrate[v5[w],{w,2/5,t}] + R7[2/5];
R9[t_]:= Integrate[300,{w,1/2,t}] + R8[1/2];
R10[t_]:= Integrate[v6[w],{w,11/20,t}] + R9[11/20];
R11[t_]:= Integrate[v7[w],{w,3/4,t}] + R10[3/4];
R12[t_]:= Integrate[v8[w],{w,33/40,t}] + R11[33/40];


R[t_]:= Which[t<=1/20,R1[t],
			  t<=1/10,R2[t],
			  t<=3/20,R3[t],
			  t<=3/10,R4[t],
			  t<=13/40,R5[t],
			  t<=7/20,R6[t],
			  t<=2/5,R7[t],
			  t<=1/2,R8[t],
			  t<=11/20,R9[t],
			  t<=3/4,R10[t],
			  t<=33/40,R11[t],
			  t<=9/10,R12[t]];
upper = Plot[R[t]+69,{t,0.4,0.9},
		PlotRange->{Automatic,{0,125}},
		AxesLabel->{"t","y"},
		PlotLabel->"Ventricular recharge:  y = R(t)"];
Show[GraphicsArray[{{upper},{lower}}],PlotLabel->"Figure 9.6"];
{R8[t],R9[t],R10[t],R11[t],R12[t]}+69