An interactive introduction to MATLAB

(Jeff_L) #1
3.1script files 37

Exercise 5: Scripts


Write your own script files to solve the following problems:



  1. The absolute pressure at the bottom of a liquid store tank that is vented
    to the atmosphere is given by:


Pabs,bottom=ρgh+Poutside,

where:

Pabs,bottom=the absolute pressure at the bottom of the storage tank (Pa)
ρ=liquid density (kg/m^3 )
g=acceleration due to gravity (m/s^2 )
h=height of the liquid (m)
Poutside=outside atmospheric pressure (Pa)

FindPabs,bottomin SI units ifρ=1000 kg/m^3 ,g=32.2 ft/s^2 ,h=7 yd,
andPoutside=1 atm.
Here are some tips to help you get started:


  • Remember your header section and variable dictionary.

  • Useinputfunctions to gather information from the user.

  • Convert all units to SI before performing the calculation. Use the
    following conversion factors:
    ft_to_m = 0.3048
    yd_to_m = 0.9144
    atm_to_Pa = 1.013E5

  • CalculatePabs,bottom
    [Answers: 164121 Pa ]
    Example adapted from Patzer (2003)

Free download pdf