A cylindrical tank filled to a height of 25 feet with tribromoethylene has been pressurized to 3 atmospheres (Psurface = 3 atmospheres). The total pressure in at the bottom of the tank is 5 atmospheres. Write a MATLAB function that to determine the d

4 views (last 30 days)
A cylindrical tank filled to a height of 25 feet with tribromoethylene has been pressurized to 3 atmospheres (Psurface = 3 atmospheres). The total pressure in at the bottom of the tank is 5 atmospheres. Write a MATLAB function that to determine the density of tribromoethylene in units of kilograms per cubic meter given the height in feet, tank pressure in atmospheres, and total pressure in atmospheres.

Answers (2)

Mohammed Ali
Mohammed Ali on 27 Mar 2016
Edited: Walter Roberson on 27 Mar 2016
% Calculate the Density of tribromoethylene
% Variables
% H - Height [ft]
% SP - Surface Pressure [atm]
% TP - Total Pressure [atm]
% HP - Hydro Pressure [atm]
% g - Acceleration due to gravity [m/s^2]
% rho_C2HBr3 - Density of tribromoethylene [kg/m^3]
% Housekeeping
% Clear workspace, command window, close figures
clc
clear
close all
% set input variables and constants
H = 25;
% Convert Height from feet into metres
H = H/3.28;
SP = 3;
TP = 5;
HP = TP-SP;
% Converting Hydro Pressure from atm to Pascals
HP = HP*101325;
g = 9.8;
rho_C2HBr3 = HP/(g*H)

John BG
John BG on 8 Feb 2016
Have a look if you can get hands on the Simhydraulics toolbox
there should be an example close to what you are after.
If no access to that toolbox, then peak and shovel. Are you familiar with PV=nRT? P: Pressure V: Volume T: Temperature R: constant n: amount of moles
Basically you have to solve a differential equation, or two, that should give a group of curves similar to this pressurized CO2 example:
Good news, there is MATLAB script that solves it all available online you will find interesting:
If you find this answer of any help solving your question, please click on the thumbs-up vote link above, thanks in advance
John

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!