Partial code below. I want to use the Va calculated at the bottom as the Vo in the next iteration, how would i do this. The initial Vo is only there to get iterations rolling.
Vn = 2:0.1:30;% iteration length.
Vo = 2;% initial Vo to calc Re and f.
%
Re = (Vo.*D) / nu;%
if Re < 2300f = 64 / Re;else darbyFormula = @(x) 1/sqrt(x)+2*log10(eoverD/3.7 + 2.51/Re/sqrt(x));f = fzero(darbyFormula,0.01);end%dPloss_1 = (f*rho*(L/D)) * ((Vn*Vo)./2);Va = (alpha*Vn)+((1-alpha)*Vo); % this to become the new Vo for next iteration.
Q=Va*A
Best Answer