Template

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

Mathematical analysis and MATLAB modelling report

BEng (Hons) Chemical Engineering

Module tutor: Put your Group Tutor’s name here

Disclaimer: This report is prepared and presented as the original work of the student and has
not been copied or plagiarized in any way. It is submitted as solely my work in partial fulfilment
of the requirement of the course MATH1145: Engineering Mathematics 2. I understand the
university’s plagiarism policy and accept responsibility for every plagiarism charge where
existent in this document.
TASK ONE

1.1 Problem definition

The main aims of this mathematical analysis and computer modelling tasks are twofold;
firstly, to get a deeper insight and increase your understanding of the mathematical
theory and the various methods used in engineering analysis. Secondly, to gain
experience in computer modelling techniques by using an industry-leading mathematical
simulation package such as MATLAB.

1.2 Mathematical analysis

For the gas which show behavior of a single phase implies a relation connecting P, V, and T may
be expressed by the functional equation:
∫ ( P , V ,T )=0

This means that an equation of state exists relating pressure, molar or specific volume, and
temperature for any pure homogeneous fluid in equilibrium states. The simplest equation of state
is for an ideal gas, P V = RT, a relation which has approximate validity for the low pressure gas
region. An equation of state may be solved for any one of the three quantities P, V, or T as a
function of the other two. For example, if V is considered a function of T and P, then

V=V(T,P) dV = ( ∂∂ VT ) dT +( ∂∂ VP ) dP

Molecular interactions always take place for real gas. Whenever volume increase, the pressure of
ideal gas reduced to a constant temperature and therefore it leads to decrease the terms. For a
pressure approaching zero, Z approaches unity, not because of any change in the virial
coefficients, but because V become infinite. Thus in the limit as the pressure approaches zero, the
equation of state assumes the same simple form as for the hypothetical case, According to phase
rule, pressure and temperature are the functions of internal energy. The forces between the
molecules are the result of pressure dependency. If molecular forces are eliminated then energy
required to displace the average intermolecular forces will be zero and there will be no need of
energy for the pressure as well as volume changes for a gas which is at constant temperature. The
trend of the gas in which molecular forces are not existing and for the limit leading to pressure to
be zero is macroscopic behavior of ideal gas which is written as follow:
PV=RT
Constant volume:
The definition of heat capacity at constant volume, leads for an ideal gas to the conclusion that
Cv is a function of temperature only

2
CV = ( ∂U
∂T )
=CV (T )

H=U + PV =U (T ) + RT =H (T )

CP=( ∂∂HT )=CP(T )


CP=(
dT )
dH
=CV + R

dU =CVdT
Hence,
Δ U =∫ Cv dT
Δ H =∫ Cp dT
Since, we know that according to ideal gas equation:
PV =nRT ... …….A
Where,
P= Pressure of the gas
V=Volume of the gas
n= number of moles
R= Gas constant
T= Temperature of the gas
Considering ideal gas equation A:
m
PV = RT …….B
M

m
P= RT /M …….C
V

RT
P= ρ
M
PM
=ρ …….D
RT

Thus as per the statement that natural gas is passing through a tank which is at constant volume at
the mass flow rate of min and exit through the tank at the mass flowrate of mout while also passes
through a control valve which is present at the exit of the tank, Therefore, we can consider:
3
m=C v f ( u ) g (
p1
)

∆ p ∆ p ρ1
P0 ρ 0
…….E

Cv is the valve constant, where ∆p is the pressure drop across the valve, p 1 is the pressure before
arriving at the valve, p0 is a reference pressure, ρ is the density of the gas upstream of the valve,
ρ0 and is a reference density. Typically, the function g ∆p/p1 can be written as,
∆p ∆p
g =1−K g …….F
P1 P1

For the gas which is flowing through the out of the tank:

(
m=C v f ( u ) 1−K g
p− pa
P1 )√ p− p a ρ
P0 ρ0
…….G

¿Cv
f ( u)
√ P 0 ρ0 (
. 1−K g
p− p a
P1 )√ (p− pa ) ρ …….H

And;
f ( u)
K=Cv …….I
√ P 0 ρ0

Deriving the equation the for the gas exit the tank,

m out =C v f ( u ) g(

Putting equation F in equation J, we get


p1
)

∆ p ∆ p ρ1
P0 ρ0
…….J

mout =C v
f ( u)
√ P0 ρ 0 (
. 1−K g
p− pa
P1 )√ ( p−p a) ρ …….K

Substituting the equation I in equation K, we get;

(
mout =K . 1−K g
p− pa
P1 )√ ( p−p a) ρ …….L

By simplification, we will get;


p− pa
mout =K √ ( p− pa ) ρ−K g √( p− pa )ρ
P1

(
mout = K −K g
p− pa
P1 )√ ( p− p a) ρ …….M

4
Considering the ideal gas equation form from equation B:
m
PV = RT
M
Substituting the equation M in the above equation, we may get;

PV =
( K −K g
p− pa
P1 )√ ( p−p a )ρ
RT
M

P=
( K−K g
p− p a
P1 )√ ( p− pa ) ρ
RT
V M

Equation represent the model for a natural gas to determine the pressure if the gas is moving with
constant flowrate and at constant volume.

For density, after the determination of the pressure, we will use ideal gas equation D:
PM

RT

1.3 Modelling methodology & solutions


Understanding and correctly predicting the behavior of complicated systems depends on
mathematical models. Critical duties are made possible by these models, including:
 Forecasting and optimising system behaviour
 Designing control systems
 Determining how the machine responds

All the resources required to create mathematical models are available in Math Works products.
It offers curve fitting, statistics, optimization, ODE and PDE solving, calculus, and other
fundamental mathematical tools. It supports both numerical and symbolic modelling methods.
Simulink enhances the environment for creating embedded systems and modelling and simulating
the behavior of multidomain systems.
With the product families of MATLAB and Simulink, you can virtually model any kind of
system, including: Nonlinear and linear Dynamic and static both random and predictable, both
discrete and continuous. You can practically model any sort of system with the MATLAB and
Simulink product families, including:
 Linear and nonlinear Static and dynamic
 Deterministic and stochastic
 Discrete and continuous

5
When you have physical understanding, you can use analytical or symbolic techniques to build
models from the ground up. Techniques for data-driven modelling are particularly helpful when
you don't have enough knowledge of your system. In this situation, selecting a modelling
approach that is appropriate for your experimental or historical data will guarantee model
accuracy. Utilize tools for statistics curve fitting to investigate connections between your data.
Tools for surface fitting, classification, grouping, and linear and nonlinear regression modelling
are available. Neural networks and system identification techniques can be used to model
dynamic models that express the influence of a system's prior experiences on its present and
future behavior. Your first-principles model's coefficients can be adjusted using data-driven
methods such as response optimization and grey-box modelling to better match experimental
data.

1.5 Conclusions
Since, the model has been derived mathematically, when the gas flow at constant volume, it
behaves like a ideal gas so it was convenient to use ideal gas equation in order to derived the
models. As exiting the tank, the gas passes through the control valve therefore relation derived
for the gas which was coming out of the tank. After deriving the mass flowrate coming out from
the control valve, it was merged into the ideal gas equation and models to determine the
pressure and density were determined.

6
Task 2
2.1 Problem definition

. Using MATLAB, solve the model using the information in Table 1.

2.2 Modeling in Matlab:

7
2.3 Comparison of the modeling in Matlab:

References
Journal paper citation template:
8
Amer, L. D. et al. (2015) ‘Enzymatically degradable poly(ethylene glycol) hydrogels for the 3D
culture and release of human embryonic stem cell derived pancreatic precursor cell
aggregates.’, Acta biomaterialia, 22, pp. 103–10. doi: 10.1016/j.actbio.2015.04.013.
Available at: give link - if you got this not from the journal itself, but from any other online
repository, such as Researchgate, GALA etc)

Books citation template:


Ward, I. M. and Hadley, D. W. (1997) An Introduction to the Mechanical Properties of Solid
Polymers. England: John Wiley and Sons Ltd.
Biggs, J. and Tang, C. (2007) Teaching for quality learning at university: what the student does.
McGraw-Hill. Available at: http://books.google.co.uk/books?id=TBadAAAAMAAJ.

Websites and online sources citation template:


CDC - Centers for Disease Control and Prevention (2019) CDC - Malaria - Malaria Worldwide -
Impact of Malaria, CDC Website. Available at:
https://www.cdc.gov/malaria/malaria_worldwide/impact.html (Accessed: 28 May 2019).

Appendix A: Matlab codes


For Pressure
R=1 % bar/kgm3
T=1
M=1
9
pa= 1 % bar
Kg= 0.2
K=1.2 % Kgmin-1/sqrt(barkgm-3)
V=5 % m3
p= 1.5 % bar

Pressure = (K-Kg*(p-pa/p))*sqrt(p-pa)*p*1/V*(R*T/M)
For Density
Pressure= 0.693 % bar
Volume= 5 % m3
R=1
T=1

Density= Pressure*Volume/R*T

10

You might also like