egm3311quiz2

.pdf

School

Florida International University *

*We aren’t endorsed by this school

Course

3311

Subject

Mechanical Engineering

Date

Dec 6, 2023

Type

pdf

Pages

2

Uploaded by lina180801

Report
%Lina Sabkhangulova %The volume of a spherical cap can be calculated using the formula: %V = (π/6) * h * (3r^2 + h^2) %Where: %V is the volume of the fluid in the tank %π is the mathematical constant pi (approximately 3.14159) %h is the height of the fluid in the tank %r is the radius of the tank %First, let's declare the tank dimensions as variables: tank_radius = 2; % meters tank_height = 7; % meters %Next, let's define the range of fluid heights for which we want to plot the tank volume: fluid_height_range_1 = 0:0.01:2; % meters fluid_height_range_2 = 0:0.01:7; % meters %Now, let's calculate the tank volume for each fluid height in the ranges: tank_volume_1 = (pi/6) * fluid_height_range_1 .* (3 * tank_radius^2+ fluid_height_range_1.^2); tank_volume_2 = (pi/6) * fluid_height_range_2 .* (3 * tank_radius^2 + fluid_height_range_2.^2); %Now, let's create the plots: figure(1) subplot(2,2,1); plot(fluid_height_range_1, tank_volume_1); xlabel( 'Fluid Height (m)' ); ylabel( 'Tank Volume (m^3)' ); title( 'Tank Volume as a Function of Liquid Height (0 to 2m)' ); legend( '0 to 2m' ); grid on ; %Second plot subplot(2,2,3); plot(fluid_height_range_2, tank_volume_2); xlabel( 'Fluid Height (m)' ); ylabel( 'Tank Volume (m^3)' ); title( 'Tank Volume as a Function of Liquid Height (0 to 7m)' ); legend( '0 to 7m' ); grid on ;
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help