%% Student example 2

clear all;
syms s h1 h2 qin
r1 = 1;
r2 = 1;
c1 = 1;
c2 = 1;
rho = 1000;
g = 9.81;
eqn1 = c1*rho*g*s*h1 + rho*g*(h1-h2)/r1 == qin;
eqn2 = rho*g*(h2-h1)/r1 + c2*rho*g*s*h2 + rho*g*h2/r2 == 0;
[h1,h2]=solve([eqn1,eqn2],[h1,h2]);
h2/qin