You are on page 1of 6

Tank Pressure

Cylinder Tank Pressure Calculated in Matlab

Hashmat Shinwari | ID No: 3335156 | BEng Mechanical Engineering | 10 May 2017


Contents
Contents......................................................................................................................................................1
Introduction............................................................................................................................................2
Oil Tank Pressure Problem..................................................................................................................2
Matlab Code Designed...........................................................................................................................2
FIGURE 1 CYLINDER SHAPE OIL TANK..........................................................................................................2
The Graph.................................................................................................................................................3
Graph 1 pressure against volume of tank.................................................................................................3
Discussion................................................................................................................................................4

PAGE 1
Introduction

This report is based on an oil tank pressure problem and the aim is to use the (Matlab software)
to design a Matlab code for calculating the pressure of a cylinder shape oil tank. Depending on
the level of the content (vehicle petrol) in the tank, the pressure varies from 0 – 5 meters by an
increment of 0.5 m. The oil, or the fuel that we are dealing in this problem, it is vehicle petrol and
according to “The Engineering ToolBox”. It has a density of 737 kg/m 3 in room temperature. It is
important to know about the rate of temperature when dealing with density of a material. As it is
an important factor for scientist and engineers to consider when dealing with solids, liquid or gas,
due to its influences on everything around us. Therefore, we are dealing with this oil in room
temperature which is approximately 20 degree Celsius. However, I have entered random numbers
for the other measurements, such as the height and the diameter of the oil tank and the units are
in meters. As engineers and scientist mainly consider measurements in meters when dealing with
length, height, or width and m is the IS unit for meter.

d=2.5m
Oil Tank Pressure Problem

I have created an example of the cylinder-shaped oil as shown figure 1. In this


problem, I considered that the level of oil is changing and calculated the pressure for h=5m
the different levels of volumes of fluid in the tank between 0 to 5 meters by an
increment of 0.5 meter.

Matlab Code Designed


FIGURE 1 CYLINDER SHAPE OIL
%% Pressure of Cylinder Shaped Tank filled with vehicle petrol TANK
 
d=2.5 % diameter of cylinder tank in (m) 
r=d/2 % radius of cylinder tank in (m) 
Area=pi*r^2 % area of tank in (m^2) 
Density=737 % density of vehicle petrol (kg/m^3) 
g=9.81 % gravity (m/s) 
Height=0:0.5:5 % height of tank in (m) 
Volume=Area*Height % volume of tank in (m^3) 
Force=g*Volume*Density % force exerted by oil (Newton) 
Pressure=Force/Area % pressure walls of cylinder in (Pascal) 

plot(Volume,Pressure)
itle('Oil Tank Pressure against its Volume') 
xlabel('Volume (m3)')

PAGE 2
ylabel('Pressure (Pascal)')
Results

d = 2.5000
r = 1.2500
Area = 4.9087
Density = 737
g = 9.8100
Height = 0 0.5000 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000 4.5000
5.0000
Volume = 0 2.4544 4.9087 7.3631 9.8175 12.2718 14.7262 17.1806 19.6350 22.089 24.5437
Force = 1.0e+05 *
0 0.1775 0.3549 0.5324 0.7098 0.8873 1.0647 1.2422 1.4196 1.5971 1.7745
Pressure = 1.0e+04 *
0 0.3615 0.7230 1.0845 1.4460 1.8075 2.1690 2.5305 2.8920 3.2535 3.6150

The Graph

The following graph was plotted using Matlab to show the relationship between the
volume and the pressure of an oil tank. The pressure and volume rise simultaneously and
the graph is given as a straight line.

Graph 1 pressure against volume of tank

PAGE 3
Discussion

Matlab which stands for Matrix Laboratory is a very sensitive and useful program for
calculations and coding. Whenever engineers need to perform very long calculations, it
can be very time consuming for them. Therefore, Matlab can help them to save a lot of
time when completing their calculations. Additionally, they can plot their data on graphs
in 2D and 3D.
Using Matlab program for engineering problems in the areas, such as thermofluids and
dynamics can be very helpful. For example, working with the aerodynamics of an
aircraft’s, or of a vehicle’s. Engineers will need to use long and complicated equations,
such as Bernoulli’s equation to calculate the behavior of pressure around an aircraft, or a
vehicle when moving. Matlab can make such equations easier to use and can solve a
problem a lot quicker.
Although, Matlab does require some minor considerations when using it. For example, a
small missed typed character, or letter can cause an error and the program will not be
able to calculate, or answer your request correctly. However, it does give you a suggestion
of the error and showing the line, or lines of the error in the command window, so that
you can easily fix this problem.

In Matlab each letter, or symbol means a specific command. For example, a double
percentage symbol (%) starts a new section in the workspace window and a single
percentage symbol means, you can add comment if you wanted to. Although some
scientific notations vary in Matlab. For example, entering 5x10 n in Matlab needs to be
typed as 5e+n and if the exponent power, or the n is negative. We simply enter 5e-n to
calculate the value of negative n.

Furthermore, when saving a file in Matlab, the user needs to make sure to save their file
in the correct format. A file in Matlab can be saved as word, PDF, image, or Matlab file.
To access a file again in Matlab, then it needs to be saved as Matlab file, because Matlab is
not able to open a file when it is saved as another file.

PAGE 4
Conclusion
The calculations, results and the graph which have been obtained in this report, are
shown in page 3. By using the specifically designed Matlab code, the given graph 1 shows
the relationship between the volume of the tank against the pressure exerted by the oil
inside the tank. Therefore, the graph is a straight line. In other words, when there is an
increase in the volume of the tank, simultaneously an increase occurs in the pressure of
the oil on the walls of the tank.

Note; the calculations and answers in page 3. Matlab does not give Ax10 n as a scientific
notation. Instead it gives Ae+n, where A is a number between 1 to 9 and e is the exponent,
or (x10) and n is power. If it is a negative power, then Matlab will show as –n and positive
will be +n. Although, it is possible to type in Matlab A*10^n, which means the same
thing.

Reference:

LIQUIDS AND DENSITIES


In-text: (Engineeringtoolbox.com, 2017)

Your Bibliography: Engineeringtoolbox.com. (2017). Liquids and Densities. [online] Available at:


http://www.engineeringtoolbox.com/liquids-densities-d_743.html [Accessed 7 May 2017].

MOORE, H.
MATLAB for engineers
In-text: (Moore, n.d.)
Your Bibliography: Moore, H. (n.d.). MATLAB for engineers. 3rd ed.

WHAT CAN YOU USE MATLAB FOR?

In-text: (Etools.fernuni.ch, 2017)

Your Bibliography: Etools.fernuni.ch. (2017). What Can You Use Matlab For?. [online] Available at:
http://etools.fernuni.ch/matlab/matlab2/en/html/unit_why_matlab.html [Accessed 9 May 2017].

PAGE 5

You might also like