not sure how to answer this question, class has no matlab book and is only 40 min a week.

1 view (last 30 days)
In petroleum industries, it is common that the molecular weight of an oil fraction is unknown and thus must be estimated by using a correlation. A correction that is widely used is developed by Riazi and Daubert, which is also referred to as the API (American Petroleum Institute) method. The correlation can be applied to hydrocarbons with molecular weight ranging from 70-700, which is nearly equivalent to boiling point range of 300-850K, and the API gravity range of 14.4-93. This molecular weight (M) correlation is givenas a function of the average boiling point (Tb) and the specific gravity at 60 °F (SG) of the oil fraction of interest as follows:
M=42.965*exp(2.097x10^-4 *Tb-7.78712SG+2.08476x10^-3 *TbxSG)Tb^1.26007SG^4.98308
where Tb is in K and SG is related to the API gravity (API) SG=141.5/(API+131.5)
a) Estimate the molecular weight of an oil fraction that has an average boiling point of 344.7 °C and an API gravity of 50.
b) Plot on the same graph M vs. Tb(400≤Tb≤600K) with API gravity=20, 40, and 60.
i'm pretty sure i figured out part a) but not sure how to get the different API on to the same graph

Answers (1)

KSSV
KSSV on 17 Oct 2017
SGfun = @(API) 141.5/(API+131.5) ;
Mfun = @(Tb,SG) 42.965*exp(2.097*10^-4*Tb-7.78712*SG+2.08476*10^-3 *Tb*SG)*Tb^1.26007*SG^4.98308 ;
Tb = 344.7+273 ;
API = 50 ;
%%a
SG = SGfun(API) ;
M = Mfun(Tb,SG)
%%b
figure
hold on
Tb = 400:600 ;
API = [20, 40,60] ;
for i = 1:length(API)
SG = SGfun(API(i)) ;
for j = 1:length(Tb)
M(j) = Mfun(Tb(j),SG) ;
end
plot(M,Tb)
end
legend('API=20','API=40','API=60')
  2 Comments
Jan
Jan on 18 Oct 2017
Run time does not matter here. But I like to mention that it is much cheaper to use the constant 2.097e-4 instead of the multiplication and very expensive power operation 2.097*10^-4.

Sign in to comment.

Tags

Products

Community Treasure Hunt

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

Start Hunting!