mass conservation says that in = out. with an initial height of 1 meter Vr0 = Vr_max*(h0/hr_dam)^0.3 == 5.8419e+05
which is the volume in the reservor at t=0. we also know that dv/dt = the give 50 m^3/s in flow minus the q(t,h(t)) of the pipe and the wier. dh/dt is solvable by taking Vr0 and changing t for dh which produces dh = nthroot((VR+Q_in-Qout)/Vr0, 0.3) so now for any volume we have the coresponding h value.
%% Reservoir Mass Conservation Equation (below spillway)
% dV/dt = Vr-max(h/hr_dam)^0.3
Vr0 = Vr_max*(h0/hr_dam)^0.3
dh = h0;
for t=0:.01:10
Vr = Vr_max*(dh/hr_dam)^0.3;
Qpipe =diff(C_1*Ac*sqrt(2*g*dh));
Qwier =diff((C_1*Ac*sqrt(2*g*dh)+C_2*L_w*(dh-Hspill).^3/2));
Q_out = Qpipe + Qwier;
dh = nthroot((Vr+Q_in-Q_out)/Vr0, 0.3);
end
is where I am at right now It does not work. I am trying to understand how to equate all the givens. Any help would of course be apriciated