function massflow_error = massflow_fid(p2_adj)
global R mu1 mu2 mu3 p1 p2 p3 D1 D2 D3 T1 T2 T3 L1 L2 L3
q1 = 0.001;
q2 = 0.001;
%q3 = 0.001;
for i = 1:10
    Re1 = 4*q1/(pi*mu1(2)*D1(2));
    Re2 = 4*q2/(pi*mu2(2)*D2(2));
    %Re3 = 4*q3/(pi*mu3(2)*D3(2));
    f1 = 0.316/4*Re1^(0.25);
    f2 = 0.316/4*Re2^(0.25);
    %f3 = 0.316/4*Re3^(0.25);
    q1 = pi*D1(2)^2/4*sqrt((p1(2)^2-p2_adj^2)/(2*R*T1(2)*(2*f1*L1(2)/D1(2)+log(p1(2)/p2_adj))));
    q2 = pi*D2(2)^2/4*sqrt((p2_adj^2-p2(2)^2)/(2*R*T2(2)*(2*f2*L2(2)/D2(2)+log(p2_adj/p2(2)))));
    %q3 = pi*D3(2)^2/4*sqrt((p2(2)^2-p3(2)^2)/(2*R*T3(2)*(2*L3(2)*f3/D3(2)+log(p2(2)/p3(2)))));
end;
massflow_error = abs(q1-q2);