You are on page 1of 1

13/05/22 8:51 PM /Users/koders.../SystemCurveWorkshop3.

m 1 of 1

% clear workspace variables, clear command window and close all figures at the start
clear all
clc
close all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Measured values from experiment %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Q_L_per_min = [13.98 13.69 13.10 11.65 9.90 8.44 5.24 2.63 2.04 1.47 0] % enter
values for flowrate in L/min
DP_mbar = [112 115 120 130 141 150 167 183 190 196 200] % enter values for
pressur drop in mbar

%-----------------------------------------------------------------------------------
% below are some mock values (not real experimental values)that you can try out with
% Q_L_per_min = [20 19 18 16 14 10 7 3];
% DP_mbar = [100 110 120 130 140 150 170 180];
%-----------------------------------------------------------------------------------

%%%%%%%%%%%%%%%%%%%%%%%%%%
% Calculation %
%%%%%%%%%%%%%%%%%%%%%%%%%%

% specify contants
rho = 998 % in kg/m3
D = 0.021 % in m
g = 9.81

Q_m3_per_s = Q_L_per_min./60000 % convert Q from L/min to m3/s


DP_Pa = DP_mbar.*100 % convert pressure drop from mbar to Pa
A = pi*D^2/4; % calculate cross section area of pipe (in m2)
h = DP_Pa/(rho*g) % calculate pump head in m

EP = 8.075e-3.*(Q_L_per_min).^2+5.616e-2.*Q_L_per_min +17.35 % calculate electrical


power from expirical formula in W
efficiency = Q_m3_per_s.*DP_Pa./EP*100 % calculate efficiency in %
eff = max(efficiency);
%%%%%%%%%%%%%%
% Plotting %
%%%%%%%%%%%%%%

% plot pump curve, [h(m) vs Q(L/min)] on the left axis using the 'yyaxis'
% function. Label ths left y-axis
yyaxis left
plot(Q_L_per_min, h, "bs-")
ylabel("h(m)")
xlabel("Q(L/min)")
% plot efficiency curve, [n(%) vs Q(L/min)] on the right axis using the
%'yyaxis' function. Label the right y-axis
yyaxis right
plot(Q_L_per_min,efficiency, "ro-")
ylabel("Pump efficiencty (%)")

% plot formatting (title, x-axis label, legend and grid)


grid on
title("Pump Head and Efficiency vs Flow Rate", "FontSize",12)
legend("Pump Head (m)", "Pump efficiency")
disp("Max Pump Efficiency is:")
disp(eff)

You might also like