Closed Loop Control System
Solution
Report
Problem a:
Steady state right atrial pressure: 4.2850 mm Hg
Cardiac output: 5.4270 L/min
Problem b:
Steady state right atrial pressure: 3.4540 mm Hg
Cardiac output: 3.5442 L/min
Problem c:
Steady state right atrial pressure: 5 mm Hg
Cardiac output: 7 L/min
%%Cardiac Output Curve Data
Pra = 0:13; %%in mm Hg
Co = [0 0.3 1.0 2.5 4.8 7.0 9.0 10.5 11.0 11.3 11.5 …
11.6 11.6 11.6]; %%in L/min
%%Venous return characteristics
symsQr(P);
Qr(P)= piecewise(P <=0, 14, 0 < P < 7 , 14 – 2*P, 0);
Q = Qr(Pra);
%%plot
figure(1)
plot(Pra,Co,’o-‘,Pra,Q);
grid on;
xlabel(‘Right Atrial Pressure,Pra (mm Hg)’)
ylabel(‘Cardiac Output of Venous Return(L/min)’)
legend(‘Cardiac Output Curve’,’Venous Return Curve’)
title(‘Problem 1’)
%%From the plot we get that the intesection lies between
%% Pra=4 and Pra=5, so we now search for the exact point
%%of intersection
%%We use linear interpolation with Pra=4 and Pra=5
tol = 0.005;
x1 = Pra(5);x2 = Pra(6);y1 = Co(5);y2 = Co(6);
for Pressure=x1:0.001:x2
Co_linear = (y2-y1)/(x2-x1)*(Pressure-x1) + y1;
if abs(Qr(Pressure)- Co_linear)<tol
Co_result = Co_linear;
break;
end
end
%%Part 1 solution
steady_state_pressure_Prob1 = Pressure;
cardiac_output_Prob1 = Co_result;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%From eq. 3.35b we get that Qr is inversely proportional to total
%%resistance. This implies if the total resistance is doubled Qr will be
%%halved.
symsQr_doubleResistance(P);
Qr_doubleResistance(P)= piecewise(P <=0, 14/2, 0 < P < 7 , (14 – 2*P)/2, 0);
Q_doubleResistance = Qr_doubleResistance(Pra);
%%plot
figure(2)
plot(Pra,Co,’o-‘,Pra,Q_doubleResistance);
grid on;
xlabel(‘Right Atrial Pressure,Pra (mm Hg)’)
ylabel(‘Cardiac Output of Venous Return(L/min)’)
legend(‘Cardiac Output Curve’,’Venous Return Curve’)
title(‘Problem 2’)
%%From the plot we get that the intesection lies between
%% Pra=3 and Pra=4, so we now search for the exact point
%%of intersection
%%We use linear interpolation with Pra=3 and Pra=4
tol = 0.005;
x1 = Pra(4);x2 = Pra(5);y1 = Co(4);y2 = Co(5);
for Pressure=x1:0.001:x2
Co_linear = (y2-y1)/(x2-x1)*(Pressure-x1) + y1;
if abs(Qr_doubleResistance(Pressure)- Co_linear)<tol
Co_result = Co_linear;
break;
end
end
%%Part 2 solution
steady_state_pressure_Prob2 = Pressure;
cardiac_output_Prob2 = Co_linear;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%From eq. 3.35b we get that Qr=(Pms-Pra)/(Rv+(Ra*Ca)/(Ca+Cv))
%%If mean systemic pressure is increased by 5mm Hg Pms in the expression
%%will be replaced by Pms+5
symsQr_sysPressure(P);
Qr_sysPressure(P)= piecewise(P <=0, 7 + 5, 0 < P < 12 , (14 – 2*P)/2 + 5, 0);
Q_sysPressure = Qr_sysPressure(Pra);
%%plot
figure(3)
plot(Pra,Co,’o-‘,Pra,Q_sysPressure);
grid on;
xlabel(‘Right Atrial Pressure,Pra (mm Hg)’)
ylabel(‘Cardiac Output of Venous Return(L/min)’)
legend(‘Cardiac Output Curve’,’Venous Return Curve’)
title(‘Problem 3’)
%%From the plot we get that the intesection lies between
%% Pra=5 and Pra=6, so we now search for the exact point
%%of intersection
%%We use linear interpolation with Pra=5 and Pra=6
tol = 0.005;
x1 = Pra(6);x2 = Pra(7);y1 = Co(6);y2 = Co(7);
for Pressure=x1:0.001:x2
Co_linear = (y2-y1)/(x2-x1)*(Pressure-x1) + y1;
if abs(Qr_sysPressure(Pressure)- Co_linear)<tol
Co_result = Co_linear;
break;
end
end
%%Part 3 solution
steady_state_pressure_Prob3 = Pressure;
cardiac_output_Prob3 = Co_result;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%