Saturday, March 30, 2019

Interconversion of Petroleum Distillation Curves

Intercon strain of Petroleum Distillation CurvesThe surgical operations recommended by API 1a for the intercon variate of ASTM D 86 and TBP (True turn Point) distillment bendings be transposed into Mathcad computation political program. Two Mathcad versions atomic number 18 geted for to each one of direct, ASTM to TBP, and the backward, TBP to ASTM, foreshortens conversions according to the API appendage. The first version, simpler, precisely when with fewer possibilities of theoretical account, was presented in the first classify 1a. This second surgical incision comprises the semblances of the API use write as draws in the Mathcad worksheet. The influence functions can be placed in a disjoint bea of the worksheet, bea which may be then collapsed, locked and hidden. Alternatively, the functions can be stored in a specific Mathcad agitate, which can be afterwardswards inserted and utilise in the main worksheet with Reference eclipse. Other possibilities of Mathcad purlieu for interconnection of worksheets (files), such as enjoyment of Mathconnex or introduction of Mathcad E-books, atomic number 18 briefly invokeed, too. usance of Mathcad surgical processs is illustrated through several employments. The Mathcad worksheets comprising the API procedures are therefrom providing a convenient figurer tool for fast foresight of one of ASTM and TBP distillment issue starting signal from the other one.Key words ASTM D 86, TBP, distillation, interconversion, Mathcad, petroleumIntroductionThe stopping point of the present work is to offer a general, easy-to-use Mathcad versions of the API (American Petroleum Institute) procedures for the ASTM D 86 and TBP distillation curls interconversion. A simpler Mathcad version of the API procedures was given in the first region 1a. However the simpler Mathcad version has siced possibilities of use, or change surface no benefit in some applications, such as those of iterative tasks commonly puzzle out with programming modules. Further more than, numeral data assignements fatalityed to be placed in the worksheet in front the methods boldnesss (case of worksheet setting of Automatic calculation as default, that is turned on anyhow, if turned off, most of the present discussion becomes meaningless). In this second part we are going to provide Mathcad written procedures which are more concise and nonplus extended range of application.The relations needed for distillation submits interconversion originating from consultation 2 and adapted by the author for temperatures in degrees centigrade return been given explicitly in the first part 1a.Since the API procedure for ASTM TBP distillation cut offs interconversion was described in fortune 1 1a, the reader is urged to refer to that part or to the veritable API reference 2 for a better comprehension and dilate on both(prenominal)(prenominal) the API method procedure and Mathcad version herein presen ted. Numerical checks against exercises taken from literature 2 3 7 and make in order to verify our Mathcad versions of the API procedure, are as hale as shown.Mathcad death penalty of API procedures for ASTM TBP distillation coils interconversion. Using functionsThe main part of the Mathcad worksheet with the API method for estimation of TBP foreshorten from ASTM distillation curve is reproduced in Fig. 1. Assignments of statements value being similar with those already given in Fig. 1a of the first part 1a, the beginning area of the Mathcad worksheet containing these assignments is no more shown in the present Fig. 1. In the aforementioned(prenominal) area omitted from Fig. 1, at that place are also commentarys of range varyings ip and id, which again are identical with those in Part 1, that is ip = 0,1..6 and id=0,1..5, needed for indexing current points of the distillation curve (corresponding to 0, 10, 30, 50, 70, 90 and 100 % vol.) and differences ( among tempera tures), respectively. Thus, the distillation curve is assumed to be represented in the comparable format as in Part 1, i.e. 7 rows 2 columns matrix, where the first column elements are volume percentages (0, 10, 30, 50, 70, 90 and 100) of distillate and the second column elements are the corresponding six temperatures (oC) on the (ASTM or TBP) distillation curve.The task of the function dt_DC (where dt and DC in none of hand stand for difference of temperatures and distillation curve) as defined by relation (1) in Fig. 1 is to pick up all pairs of consecutive temperatures on the given ASTM curve, to compute the difference amid the devil temperatures, and to give the government issue as a 6 elements array, which elements are the temperature differences. One of the two arguments of the function dt_DC in Fig. 1 needs to be the range variable id. Otherwise, a definition wish(a)would issue an fallacy means (Illegal context and expression (a) written in Mathcad turning into re d) because, as expected, a range variable is not allowed as parameter within the function definition, or, being more specific, within the expression assigned to a function.Another definition but more lengthy, which can be apply to obtain the same numerical result as dt_DC function in relation (1) of Fig. 1, i.e. the six temperature differences, is the abutting one (b)Fig. 1. Portion of the Mathcad worksheet with functions definitions to be used for API procedure for TBP curve prediction from the ASTM D86 distillation curve (continued with applications in Figures 2 and 3) flat if the numerical value produced with both definitions, (1) in Fig.1 or above (b), are same, it is worth of mention that the two outputs collapse different meanings in Mathcad. Thus, while the latter definition (b) produces a six-element vector, the first definition, which is used in relation (1) of Fig. 1, produces an array (which may be also called table) with also 6 values, but which has not the property of a vector in Mathcad. Consequently, neither several operations characteristic for vectors, such as transposition (operator T as superscript) or vectorize (operator denoted by an cursor above an expression containing a vector) can be utilize to the output of the twoargument function dt_DC. This behavior may be probably better understood if a function definition like that in relation (1) of Fig.1 for dt_DC is regarded as six one-variable functions simultaneously defined. Difference between the outputs of the two functions, dt_DC and dt_DCb is similar to that between a true vector and a range variable such as ip or id which is used for indexing.When sought after, a workaround able to lead to a vector output is thus provided by the above definition of dt_DCb in (b). Moreover, this definition can be rewritten in a more concise form within a Mathcad worksheet using programming modules (see Part 3 1b).In step 2 (Fig. 1), temperature for 50%vol. on TBP curve is estimated with the funct ion denoted t_50%TBP, from temperature for 50% vol. of ASTM, as in API procedure described in Part 1 1a. According correlations of the same procedure (that is relations (3) given in Part 1), differences between temperatures on TBP curve are then calculated in step 3 based onFig. 2. Part of the worksheet containing an example using the Mathcad version of API procedure for ASTM-to-TBP distillation curves conversion (Mathcad version of the procedure given in Fig. 1 ASTM data and experimental TBP from 2)temperature differences of ASTM curve. This is done employing again a function with two arguments, of which the first is the range variable id (function puddled dt_TBP). Finally, TBP temperatures are observed in the quaternary and last step with function t_DC by subtracting or adding to priorly determined t50%TBP the fascinate temperature gaps found in step 3 (Fig. 1).An example using the Mathcad version of the API procedure described above is given in the portion of the Mathcad work sheet shown in Fig. 2. As precedently explained, since the output of the function dt_DC in step 1 or of the function dt_TBP in step 3 (Fig. 2) is an array (table) and not a vector, presence of the index id at vector-variables tASTM1 or tTBP1, respectively, is imperative for a correct assignment of values computed by functions (dt_DC or dt_TBP) to the elements of mentioned vectors. Otherwise, the aforementioned error message (Illegal context) would be issued and corresponding expressions turned into red.Fig. 3. Part of the worksheet with another example using the Mathcad version of API procedure for ASTM-to-TBP distillation curves conversion (Mathcad version of the API procedure given in Fig. 1 ASTM data and corresponding TBP estimated by EdmisterOkamoto procedure taken from 3)Even if it can be quick noticed from both Fig. 1 and example in Fig. 2, we emphasize that in the present Mathcad version of API procedure (Fig. 1) it is possible to write the expressions of the procedure as a standalone suite, self- utilize person on the 7 2 matrix with distillation curve data, delinquent to use of functions. On the contrary, for the simpler Mathcad version given in Part 1 1a, it was necessary to provide the distillation curve matrix in the Mathcad worksheet before the relations of the API procedure. Thus, presentation of simpler Mathcad procedure in 1a was actually possible only using a numerical example. However, it can be mentioned that even in the case of simpler version in Part 1 a workaround for the misdemeanour of normal order, that is with data in the begining of the worksheet, may be provided by the use of a global definition (available in Mathcad).ASTM distillation data for example in Fig. 2 was taken from API Technical Data Book 2. The TBP curve determined in Fig. 2 is identical with that computed in 2 from the same ASTM distillation data and with same API procedure. For comparaison, experimental TBP (vector TBPexp) retrieved from the mentioned referenc e 2 is also given in Fig. 2.Fig. 4. Area of worksheet with the Mathcad version of the reversed API procedure, for conversion of the TBP curve into ASTM distillation curveThe use of the same Mathcad version of the API procedure is illustrated with another example in the part of the worksheet reproduced in Fig. 3. ASTM data (7 2 matrix ASTM2) in Fig. 3 and corresponding TBP values (matrix TBP2_EO) estimated with Edmister and Okamoto method 4 are quoted from reference 3.The suite of definitions shown in Fig. 1 as well as the two examples (Fig. 2 and 3) have been actually written in the same Mathcad worksheet.The Mathcad version of the reversed API procedure, for TBP curve conversion to ASTM distillation curve, is illustrated in Fig. 4. In step 1 the temperature differences between two consecutive temperatures amongst those of selected points on TBP curve can be computed with the same function dt_DC given in Fig. 1. Since the Mathcad versions of both direct and reversed API procedures have been written in same worksheet, there was no more need for another function definition for step 1 in Fig. 4.Coefficients in the expression of the function t_50%ASTM in relation (6) (Fig. 4), needed for the prediction of the 50% temperature on ASTM curve based on 50% temperature on TBP curve, are taken from Part 1 1a and they are coming from the same API procedure 2. As shown in Fig. 4, the temperature for 50% on ASTM curve can also be determined with the function tr_50%ASTM, which is the inverse of function t_50%PRF defined previously in the worksheet (with relation (2) in Fig. 1). The inverse function, tr_50%ASTM, is defined using the Mathcad intact function subside. First argument of etymon is the expression of whose root is wanted, the second argument indicates the variable with respect to which the equation defined by the expression has to be solved, and the 3rd and 4th arguments specify the interval where the desired root is lying.Fig. 5. Portion of Mathcad worksheet with example of TBP curve conversion intoASTM D86 distillation curve (API procedure 2)Presence of last two arguments is optional when these are included, Ridder or Brent algorithm is used internally by root to determine the solution otherwise Mueller-secant algorithm is employed. The accuracy of the computed root is determined by parameter TOL (tolerance) whose value can be set (for the entire worksheet) from Mathcad menu. For details on the Mathcad root function or on the mentioned algorithms, references 5-6, 9 may be consulted. Notations used in relation (6r) of Fig. 4 show that equation t_50%TBP()t=0 is (numerically) solved with respect to variable (that is unknown ) and the desired root (ASTM temperature for 50% vol.) is within interval (0, 1000) ( oC ) for all possible values of parameter t (temperature for 50% vol. on TBP curve).Differences between temperatures on ASTM curve are computed in step 3 based on temperature differences on TBP curve determined in step 1. Being previousl y defined in the worksheet (Fig. 1), coefficients AAPIC and BAPI in relations (7) are known. Finally, in step 4 temperatures on the ASTM curve are calculated using the same function t_DC already defined in a proceeding zone (Fig. 1) of the worksheet.We recall that for features of Mathcad employed herein or other capabilities reader can find worthy and detailed information with good examples in Mathcad help 5a and particularly in the Resource Center 5b accompanying Mathcad platform.The use of the Mathcad version for the reversed API procedure, that is for TBP curve to ASTM curve conversion, is illustrated with the example in the part of Mathcad worksheet reproduced by Fig. 5.Other possibilities of manipulation of Mathcad written proceduresTwo of these possibilities are illustrated below, one using an inserted area and the other the Reference command provided by the Mathcad environment.An area can be readily inserted in a worksheet, using the commands from Insert menu. In our case ( Fig. 6), after inserting a new area (a blank area initially) in the worksheet, we have merely copied ( Copy/Paste ) the area given in Fig. 1 and pasted it in the inserted blank area. The area thus inserted contains also the assignments of values to parameters Aid and Bid needed in the procedure (parameters which values are given in Tab. 1 of 1a and are named AAPIC BAPI in Figures 1a,b and 2 in the same reference 1a and which are no more shown in Fig.1 of the present part). Obviously, in such a case one has to provide a sufficient size of the inserted area. Its enlargement can be made by selecting one (usually the lower) of the crosshairs corresponding to the boundaries of inserted area and dragging it, or by clicking interior area and typing Enter one or several cartridge clips, as needed to accommodate the whole pasted part. The inserted area may be then easily collapsed (Fig. 6), as indicated by instructions in the dialog box which appears with a mouse right-button click. After collapsing, the inserted region can be locked and protected by a password and then provided with a time stamp. Always after collapsing, presence of the inserted region may be even made invisible (hidden) 5b. All content of Fig. 6 was actually written in a new Mathcad file (worksheet), different from those illustrated in previous figures.Fig. 6. Mathcad worksheet with inserted area collapsed and an example of ASTM curve conversion into TBP curveFig. 7. Mathcad worksheet with Reference to the Mathcad file (named here ASTMTBP interconvAPI simple functions.mcd) containing the API procedure for the two distillation curves interconversionThe Reference command (Fig. 7) allows all variables or functions definitions from another worksheet (referenced worksheet or referenced Mathcad file) to be made available in the current (parent) worksheet. Thus the current worksheet impart stockpile as if one should have inserted into it the actual regions from the referenced worksheet. The Reference c ontaining gillyflower is merely introduced by a first mouse click in the main (parent) worksheet in the place where the referenced file is desired, then do the insert from the Reference command accessible in menu (Insert Reference), followed by pointing to referenced file location (as asked by dialog box). An moving-picture show (right headed arrow inside a square) will mark the place from which the referenced worksheet will take effect within the parent worksheet. (R) after the file name (ASTM-TBP interconvAPI simple functions.mcd in occurrence, Fig. 7) means that the relative path was chosen in the present case in order to locate the referenced file. Even if the referenced Mathcad file itself cannot be seen in the current (parent) worksheet, it may be opened with a double click on its Reference icon and then accessed and even modified.Like for any other computational environment or programming language, it is strongly advisable to use systematic and mnemotechnical notations f or various variables, functions,, both in main and inserted worksheet (collapsed or not, or with Reference), in order to avoid errors. As already mentioned in 1a, errors in computed results may appear in case of notations overlap, even without any error message highlighted by Mathcad (without any expression turned into red).In the case of pine worksheets, more complicated structures of linked (concatenated) worksheets can be thus envisaged. For example a worksheet with an inserted area can be referenced from another worksheet. Again, in order to reduce the possibility of errors and for an acceptable readability, it is however advisable to limit to only a few the worksheets thus interconnected. If this is not possible, there are alternatives offered by Mathcad platform, such as use of Mathconnex environment or creation of a Mathcad electronic book. Both alternatives are easy to use and well documented in Mathcad help, for example the latter in the Authors reference power point with in Help menu. Moreover, recent versions of Mathcad, i.e. starting with 2001i, offer the possibility to just worksheets under XML or HTML format.ConclusionIn the Mathcad version of API procedure for ASTM-TBP distillation curves interconversion presented in this part, use of functions allows to write the expressions of the procedure as a standalone suite, independent on the 7 2 matrix comprising distillation data. function of some Mathcad features, such as functions with two arguments one of which being a range variable, vector-valued functions, definition of an inverse of a function using entire root function, or area insertion in a Mathcad worksheet, are illustrated through examples. Interconnection of Mathcad worksheets (files) through the ,Reference command is also exemplified. Such features of Mathcad platform can provide added readability and broader generality to worksheets. Other capabilities of Mathcad, like utilization of Mathconnex or creation of Mathcad E-books are bri efly envisaged. The Mathcad worksheets comprising the API procedures are thus providing a convenient tool for fast prediction of an ASTM or TBP distillation curve starting from the other one.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.