You are designing a spherical tank, as shown in figure below, to hold water for a sonll village in
a developing country. The volume of liquid it can hold can be compuned as
V=pi*h2*
(3R-h)/3
where V is the volume of water in the tank in m3, b is the height of water in the tank in m, R is
the radius of tank in m. If R is 3m and V is 30 m.
Formulate the equation in terms of height (h), from above generalized equation, representing the
present situation
Use the correct built-in function in MATLAB to determine all possible values of height (h) that
will satisfy the formulated equation i.e. determine all possible roots of the formulated equation.
From those values height (h) which one is the correct and why?
R = 3; % Radius of a tank (m)
V = 30; % Volume of a tank (m^3)
p = [-pi/3, pi*R, 0, -V]; % Equation for h as polynom:
% -pi/3*h^3 + pi*R*h^2 - V == 0
r = roots(p);
disp(r)
The correct value of height is 2.0269 because it's the only one that satisfies condition 0 <= h <= R
Comments
Leave a comment