Q = ((sqrt(S) * (B*H)^(5/3))/(n*(B +2*H)^(2/3)));
where Q = flow [m^3/s], S = slope [m/m], H = depth[m],
and n = the manning roughness coefficient. Develop a fixed-point iteration
scheme to solve this equation for H given Q = 5, S = 0.0002, B = 20 , and
n = 0.03. Prove that your scheme converges for all initial guesses greater
than or equal to zero.
Matlab code:
H = 0:.0001:4;
Q = 5;
S = 0.0002;
B = 20;
n = 0.03;
hold on
%Q = @(H) ((sqrt(S) * (B*H) .^(5/3))/(n*(B +2*H) .^(2/3))); %Original Q
f = @(H) (sqrt(S)*(B*H).^(5/3) ./ (n*(B+2*H).^(2/3)))-Q; %Rearranged
plot(H,f(H))
g = @(H) (((Q * (n*(B +2*H) .^(2/3))) ./ (sqrt(S))) .^(3/5))/B ; %arranged to solve for H
H = 1;
for ii = 1:10,
H = g(H);
plot(H,f(H),'*g')
end
EDU>> H
H =
0.7023
EDU>> f(H)
ans =
0
No comments:
Post a Comment