This topic needs to be wrtten in Matlab coding.
User written exercises and nested loops A round insinuate tank is eminent to a exaltation H. The transection of the tank is D_ The insinuate contribute pipe from the tank is conjoined to the basis of the tank and runs straightly to the basis. The transection of the contribute pipe is D_ Write a user written exercise that expects (as the controversy) scalar values ce the brace transections, the tank exaltation, and the insinuate plane (from the basis). The exercise must produce the tome of insinuate contained in the tank and contribute pipe fully. The syntax of your exercise should be: TV Dtank, Dpipe,Htank Hwater) Test your principle on ce a tank transection of 5 meters, a pipe transection of 0.5 meters, a tank exaltation of 50 meters, and a insinuate exaltation of 51 meters. In the direct window fashion a = TV(5, 0.5, 50, 51). Check the outcome.
exercise [vol] = TV (Dt,Dp,Ht,Hw)
Lp = Ht -(Dt)/2;
Vp = pi*Lp*Dp*Dp/4;
l = Hw-Lp;
c = sqrt(l*(Dt/2 *2 – l));
Vs = pi/6 *l*(3*c*c + l*l);
v = Vs+Vp;
v
endfunction