PPIMS Training Manual Part1
PPIMS Training Manual Part1
TRAINING MANUAL
Part 1
Contents
PIMS Course Outlines 1
Essential PIMS Training...................................................................................................... 1
Intermediate PIMS Training................................................................................................. 2
Advanced PIMS Training..................................................................................................... 3
Multi-Period PIMS............................................................................................................... 4
Fundamentals of Refinery Economics and Analysis.............................................................5
Planning and Economics of Refinery Operations..................................................................6
Capital Investment Appraisal...............................................................................................7
Gasoline Blending Seminar.................................................................................................. 8
Product Blending Seminar.................................................................................................... 9
Distributive Recursion 35
Recursion........................................................................................................................... 35
What is Recursion?............................................................................................... 35
What is Distributive Recursion?.........................................................................................36
What Is the Actual DR Mechanism?...................................................................................36
Multiple Path Problems...................................................................................................... 56
II. Rules
A. Rules for PIMS Property Propagation
1. Table PCALC
2. Internal Tables BLNXXX and QPOOL
3. Distributive Recursion
B. Rules for 999 Resolution
C. Rules for Column and Row Name Construction
D. Rules for Controlling Column Activities
1. Tables BUY, SELL, UTILBUY, UTILSELL, and
BOUNDS
E. Rules for Using Table ROWS to Add Additional LP Structure
F. Rules Using E, L, and G Control Rows
G. Rules for Using PIMS Crude Architecture
1. Logical Crude Units and Crude Pools
2. Crude Cut Types in Table CRDCUTS
a. Optimized Swing Cuts
b. Deferred Cuts
3. Multiple Table ASSAYS using Table ASSAYLIB
H. Rules for “P-ROW” Utilization and Reporting
III. Help
A. On-Line Help
1. PIMS Help System
2. ERRMSG.WK1
3. Data Assistants
V. Needs
A. Client Modeling Problems
B. Specific Client PIMS Problems
V. PPIMS Reports
A. Across the Page
B. Down the Page
C. Solution Summary Report
1. Spreadsheet
2. ASCII File
X. Blending Facilities
A. Types Of Facilities
B. Refinery Operations
C. Alternatives To Knock Engines
D. State-of-the-art Blending Facility
General
Definition
A linear program (LP) is a mathematical model of a process. The process can be a refinery, chemical
plant, distribution network, or any situation with variables and constraints.
Notice there are more unknowns (variables) than equations (constraints). This means there are an
infinite number of solutions to the problem. To determine the best or optimum solution an objective
function row (OBJFN) is created. This row will include feedstock costs, operating costs, and sales
prices of products to arrive at the most profitable or optimum solution to the problem. The algorithm
attempts to maximize the value of the objective function row. This value is calculated as the
algebraic sum of each variable’s solution value multiplied by its coefficient in the objective function
row. Each variable’s solution value is also known as its “activity” in the solution.
In an LP the variables and constraints must have unique names. In our example the variables are
named X1, X2, X3, X4, and X5, while the constraints are named Eq1, Eq2, and Eq3.
Bear in mind this matrix is somewhat incomplete since we have not allowed for the disposition of
NAP, DSL, of HSF nor the production or purchase of the utilities FUL and STM.
BLSRURG = The blending of Lt. St. Run Gasoline (LSR) to Unleaded Regular Gasoline
(URG).
Note the purchase cost of ARL and the sales price of URG are entered into the objective function
row (OBJFN) with their respective values and having opposite signs. This allows the optimizer
algorithm to find the “optimum” amount of URG to sell with the least amount of ARL purchased.
Once the ARL is purchased it is “pumped” to the crude unit (SCR1) through the “pipe” VBALARL
(a material balance row). The crude unit fractionates the ARL into Light Straight Run Gasoline
(VBALLSR), Naphtha (VBALNAP), Diesel (VBALDSL), and High Sulfur Fuel Oil (VBALHSF)
while consuming atmospheric tower capacity (CCAPAT1), fuel (UBALFUL) and steam
(UBALSTM). The LSR is then blended to Unleaded Regular Gasoline (VBALURG) through the
BLSRURG vector. URG has blend specifications of maximum Reid Vapor Pressure (XRVPURG)
and minimum (R+M)/2 octane (NDONURG) and is sold at $30.00/BBL through the sell vector
SELLURG.
Although this model is very similar to a PIMS model it is not complete and not completely accurate
in the model structure. There must obviously be other blend components for URG in order to blend
the LSR octane up and the LSR RVP down in order to meet specifications. It is only a very simple
example of how a refinery model might look. An actual PIMS model can be very, very complex and
much more detailed.
The types of rows found in a process model are material balances, blending specifications, ratios,
unit capacities, utility balances, stream property balances, distributive recursion rows, and other
process unit limitations.
The only thing unknown about a column is its “activity,” or value, in the optimum solution. As far as
the optimizer is concerned all other properties about the variable are known. However, this may not
be true for the user of the LP. For instance, in a petroleum refinery model the yield and properties of
each fractionated stream coming from each crude oil, component blending properties, process unit
yields, process unit limits, etc. must all be determined ahead of time and made available to the
optimizer.
Columns generally represent flow in a process model. This flow can be in terms of mass, such as
pounds or tons, or volume, such as barrels or cubic feet.
In some cases it may take several columns to adequately model the stream in a process model. An
example of this is a gasoline catalytic reformer where several different severity options are available
to the problem.
Each column usually will have entries in more than one equation or row. One problem the user has is
to adequately relate LP vector properties to actual process properties. Examples of these problems
are: yield decline as a result of catalyst aging, process unit yield as a function of feed quality,
physical properties of pools whose composition is determined by the optimizer and is therefore
unknown to the user when the case is submitted for solution.
The types of columns found in a PIMS model are purchases, sales, specification blending vectors,
formula blending vectors, process submodel vectors, distributive recursion property error vectors,
and user specified control vectors.
The activity of a row is the algebraic sum of each column activity multiplied by its coefficient in the
row.
The units of the RHS constraint must be consistent with the units of its corresponding row.
In a PIMS model the RHS of most rows is zero; with the exception of capacity rows, whose RHS will
be greater than zero.
Ranges
A range represents an upper or lower limit on a row activity. For instance, if a process unit has a
maximum capacity of 20 M#/D and a minimum capacity of 12 M#/D the range is –8 M#/D. The
capacity can range from 20 M#/D down to 12 M#/D.
Bounds
The bounds section of an LP is used to set upper and lower limits on the activity of a column in the
optimum solution. When the upper and lower limits are equal the activity of the column is fixed at
that level of activity.
All columns, by definition, will have an upper bound of plus infinity and a lower bound of zero
unless the user changes them.
Matrix Coefficients
Matrix coefficients are the row entries of a column that define all relevant properties of the column
including price, cost,, yield, disposition, physical properties, utility consumption, and capacity
consumption.
As an example, a crude unit charge vector will have coefficients relating how a specific crude oil
will be fractionated in a specific crude unit. A gasoline reformer severity vector will have
coefficients showing a specific yield pattern for that severity along with specific utility and capacity
consumption as they relate to that severity.
The coefficients are also the column entries of a row that relate to a particular constraint for various
columns.
As an example, a normal butane material balance row will have coefficients showing the yield of
normal butane from various process units in a refinery model and make the total amount of normal
butane available to other processing or sales. A fuel gas utility balance row will sum the entire fuel
The activity of a vector multiplied by the coefficient in a row equals the contribution of that column
to that row’s activity.
The units of a column multiplied by the units of a coefficient equal the units of the row.
As an example, if a column activity represents MBbls/Day of flow and that column has an entry in a
utility balance row where the coefficients represent steam consumption in MLbs/Bbl the units of the
row will be:
MBbls/Day x MLbs/Bbl = MMLbs/Day
It should be pointed out the LP optimizer deals with numbers only. The optimizer does not care
about units. It is up to the user to keep track of units and make sure the implied units on all columns
and coefficients are consistent.
Problems With LP
There are several problems using linear relationships to model non-linear process operations. In a
petroleum refinery some of these problems can be illustrated as follows:
Synergism or Antagonism
In the real world when two or more streams are blended together, the resulting blend may not exhibit
the properties of the same blend when the properties are ratioed mathematically in the same
proportion as the blend. When the actual blend properties are less than the calculated properties, this
is known as antagonism. When the actual blend properties are greater than the calculated properties,
this is known as synergism. This is a problem for the LP because the optimizer can only recognize
one set of blending values per solution.
Column Arithmetic
In building an LP model it becomes readily apparent we can neither multiply nor divide one column
by another, nor can we raise a column activity to an exponential power. However, by utilizing a
technique known as distributive recursion these limitations can be overcome. With the
implementation of distributive recursion we are using a non-linear approach to solve linear
equations.
In spite of these problems, methods have been devised which give good approximations to the real
world. One of these methods has been fully implemented in PIMS and has very effectively solved
most of the problems mentioned above. The method known as “distributive recursion” allows the LP
matrix coefficients to be updated automatically based on the column activities from a prior solution.
This is an iterative process and continues until the updated changes are so small as to be within
specified tolerances. When all changes are within the specified tolerances, the solution is said to
have converged and further changes cannot improve the solution.
LP Accuracy
Accuracy of data is a problem, which all users must be concerned with. This problem must also be of
concern to tech service and operations people who must help in the collection of good data. An effort
must be made to collect and analyze representative samples, as well as provide accurate utility and
capacity consumption data. Efforts must be made to separate the effects of one variable from the
effects of other variables. The matrix coefficients must accurately reflect real operating data.
As an example, in the operation of a fluid catalytic cracker (FCC) the yield of each gaseous and
liquid product is a function of many variables. For instance, the amount of Cat gasoline yielded can
be altered by changes in feed quality, riser temperature, cat-to-oil ratio, heat balance, etc. Therefore,
when gathering FCC yield data it is important to only allow one variable to change at a time in order
to separate out the yield effects of changes in the other variables.
The LP matrix structure must also accurately reflect the process options available. While it is not
necessary to model every pipe and valve in a plant, care must be taken that necessary variables and
constraints are modeled. If an option is not represented in the matrix it cannot be evaluated by the
optimizer as a viable solution.
An example of this is seen in the operation of a FCC main column fractionator. Normally the heat
balance of the tower can control the distillation 90% point of the Cat gasoline. This allows the FCC
operator to maximize gasoline or maximize diesel fuel as a function of market pricing. However, if
this flexibility is not modeled in a refinery LP, the optimizer does not know this economic option
exists and cannot evaluate it.
The Pi value actually represents the rate of change in the objective function as the RHS of a row is
increased. Another way of looking at Pi values is that they are the partial derivative of the objective
function with respect to a specific row:
OBJFN
______________________________________
ROWNAME
All basis columns will have a DJ equal to zero. This reflects the fact that the cost of producing the
next increment and the product value of the next increment exactly balance each other and the slope
is zero.
A basis column is a column that is not up against a limit in the solution. There are as many basis
columns as there are limiting rows in the solution.
If a column has an entry in the objective function row, the DJ will be the difference between this
entry and the incremental value of the column in a solution.
Specification Blending
BVBLxxx
BWBLxxx
Bcmpxxx
Formula Blending
FBLNxxx
Process Submodels
Suntxxx
Distributive Recursion
Rprpxxx
Control
uuuuuuu
Where:
xxx = any three character stream name
prp = any physical property name
cmp = any blend component name
ccc = any capacity constraint name
unt = any process submodel unit name
zzz = any alpha-numerics to complete the row name
rrr = any descriptive three characters
nn = any alpha-numerics making this row name unique to a specific submodel
uuuuuu = any user defined descriptive row name
uuuuuuu= any user defined descriptive column name
bld = blender tag
Note: Column activities are normally generated so that activity will be 0 to infinity, except
for any PIMS created column beginning with Rprpxxx or specially defined submodel
columns Suntxxx that will have activity -infinity to +infinity. (See BOUNDS.)
Overview
When PIMS is installed on a personal computer (PC), it will normally reside on the C: drive. If the
hard disk has been partitioned, PIMS may reside on a drive other than the C: drive. For this
discussion, the assumption is made that PIMS will be on the C: drive of the PC.
The installation for PIMS Version 10.0 and later has changed from previous versions. The default
location of the PIMS executable files is C:\Program Files\AspenTech PIMS10.0, the PIMS.CTL file
now resides in C:\Program Files\Common Files\AspenTech Shared, and the PIMS sample models are
located in C:\AspenTech Models\PIMS 10.0. As the PIMS version number increases from year to
year the directory names will change to reflect the current PIMS version number. If the computer
hard disk is partitioned into more than one drive the user may install PIMS on any of the available
drives assuming there is enough space available.
After PIMS is installed model sub-directories can be created and models copied onto the hard disk.
There are several models provided by Aspen Technology, Inc. to all PIMS clients. These models
include:
SAMPLE – A weight based complex refinery model
SAMP_WB – A weight based complex refinery model in workbook format
VOLSAMP – A volume based complex refinery model
VOLRFG – A volume based complex refinery model with Reformulated Gasoline production
MIPSAMP – A complex refinery model utilizing mixed integer programming (MIP)
PETROLIB – A library of refinery process sub-models
PCHEMLIB – A library of petrochemical process sub-models
PSAMPLE – A weight based multi-period refinery model (PPIMS)
PVOLSAMP – A volume based multi-period refinery model (PPIMS)
GLOBAL – The global multi-refinery example model (MPIMS)
MODELA – Local model “A” used by MPIMS example model
MODELB – Local model “B” used by MPIMS example model
MODELC – Local model “C” used by MPIMS example model
XGLOBAL – The global multi-period/multi-refinery example model (XPIMS)
XMODELA – Local model “A” used by XPIMS example model
XMODELB – Local model “B” used by XPIMS example model
Within the each model sub-directory will be all the spreadsheet and/or workbook files needed to
represent the process being modeled. In addition, if PIMS options have been executed other files
will be created by the PIMS system and placed into the current model directory. These files include:
Settings files: PimsModX.pim and PimsModX.Bak
Report files: FullSolution(###).lst, IterationLog.lst,
SummarySolution(Summary###).lst, Validation.lst,
PrimalDual(Primal###).lst, MatrixListing.lst, MatrixBCDListing.lst,
Warn.lst, Optwarn.lst, Small.lst, Model DocumentorReort.lst,
Mpsprob.mps, mpsbcd.mps
Work files: Basis.dat, Blnspec.dat, Modify.dat, PimsNeg.dat, Solution.fil, Tables.fil,
Recurse.fst, Recurse.rpt, Lpcommon.sav, Lpcommon.sav, Tables.fil,
Tables.map, Errmsg.xls (wk1)
DataBase file: Results.mdb
! Output files: !Pguess(###).xls(wk1), !Pdist(###).xls(wk1), !!Pdist(###).xls(wk1), !
Rows(###).xls(wk1)
Spreadsheet Report files: Primal(Prima###).xls(wk1), Solution(Solut###).xls(wk1),
Sdsum(###).xls(wk1), Utmap(###).xls(wk1), Prmap(###).xls(wk1,
Blmap(###).xls(wk1, Sdmap(###).xls(wk1, Sprice(###).xls(wk1,
Prows(###).xls(wk1,
Flowsheet files: Model.flo, Result(Resul###).flo
Basis files: Basis.nnn, Basis.dat
The ### represents a specific case number for a case defined by the case stacking option using table
Case.xls (wk1). The nnn represents a user assigned number for an output basis file for a PIMS run.
Many different models can exist on the same computer. The number of models is only limited by the
size of the hard disk.
Required Tables
BUY Defines materials that will be purchased into the plant model
SELL Material that will be sold from the plant model
Blending Tables
BLENDS Defines materials that are specification or formula blends
BLNMIX Defines formula blend composition and maps components to spec blends
BLNSPEC Defines specifications for spec blends
BLNxxxxx Provides properties of materials used in LP
INTERACT Provides DuPont Interaction coefficients for spec blending
INDEX Provides relationship between properties and their linear indices
PBONUS Provides blending bonuses for spec blending
SCALE Provides matrix scaling factors for selected properties
WSPECS Defines which specification blend properties are blended gravimetrically
ADDITIVE Defines additive susceptibilities for spec blending
BLNTARG Defines a target recipe for spec blends
BLNCAP Defines blender capacity constraints
PIMS Process Industry Modeling System PIMS Data Tables and Reports 29
BLNNAPH Properties of naphtha and lighter materials used in LP
BLNREST Properties of kerosene and heavier materials used in LP
Submodel Tables
SUBMODS: List of submodel tables to include in LP and Validation Report
CAPS Capacity limits of process units
Sxxx Process unit submodel for process xxx
Sxxx submodel tables used in the training model listed in same order as Table SUBMODS
SCR1 Logical Crude Unit 1 (not a spreadsheet but appears in Validation.lst)
SCR2 Logical Crude Unit 2 (not a spreadsheet but appears in Validation.lst)
SVAC Vacuum Unit capacity for weight based models
SISO Butane Isomerization
SNHT Naphtha Hydrotreater
SREF Catalytic Reformer
SRFP Reformer Feed Pool
SKHT Kerosene Hydrotreater
SDHT Distillate Hydrotreater
SCCU Catalytic Cracking Unit
SALK Alkylation Unit
SDHC Distillate Hydrocracker
SHMP Hydrogen Manufacturing Plant
SDCK Delayed Coker Unit
SSGP Sat Gas Plant
SUGP Unsat Gas Plant
SPFS Plant Fuel System
SSRU Sulfur Recovery Unit
SUTL Plant Utility Generator
SMPT Multiple Path Terminator
Recursion Tables
PGUESS Initial guess at recursed properties of recursed streams
PDIST Initial guess at error distribution
PCALC Transfers properties from one stream to another
PCALCB Provides Pcalc intercept for mx+b property transfer relationships
NONLIN Defines matrix coefficients that utilize generalized nonlinear recursion
CURVE Defines nonlinear relationship of coefficients specified in Table Nonlin
Miscellaneous Tables
CASE Defines cases that modify existing matrix
ROWS Changes sense of rows and adds additional structure to LP
BOUNDS Controls activity of non-purchase and non-sales vectors
PRNTABS List of miscellaneous tables included in Validation.lst
REPORT Provides fixed costs, report suppression, and report spreadsheet creation
VPOOL Defines Virtual Pools for automatic generation of compositional recursion pool structure
PIMS Process Industry Modeling System PIMS Data Tables and Reports 31
Spreadsheet file extension and formats will conform to users requirements
Where ### = case number as defines by Table Case, i.e., 001, 002, 003, ... ### ... 997, 998, 999
PIMS Process Industry Modeling System PIMS Data Tables and Reports 33
Notes:
Recursion
Before we address the issue of Distributive Recursion, or DR as it is referred to, let us first address
the issue of Recursion.
What is Recursion?
In the early days of linear programming, when a model was built to represent a process such as a
refinery, there was, of necessity, data in the model that had to be estimated. These data were usually
physical property data of materials used in the refinery to produce refined products. For example,
gasoline is blended in a refinery to meet certain specifications for octane, vapor pressure, sulfur
content, distillation, etc. Therefore, when blending data was provided for each of the blend
components to be used by the optimizer to blend gasoline, the user estimated most of these data.
Unfortunately, much of these data were dependent on other factors such as feedstock qualities and
operating conditions. In other words, they were dependent on the composition of the crude slate
feeding the refinery or the way the refinery process units were operated. The cut point for each
material coming from the crude unit was a factor, as well as the severity at which the reformer was
run and the ratio of C3 olefin to C4 olefin in the feed to the alky unit.
Because much of these data were estimated or guessed at by the user, the data in the model was
inaccurate or wrong. To compensate for this, a technique was developed to try to improve the data as
the model was being solved. This technique, which came to be known as Recursion, was very
ingenious. The optimizer first solved the model with the estimated data in it. After solving the
model, an external computer program written in a computer language such as, Fortran, PL/1, or
Assembly Language, calculated the physical property data being used in the model from the
optimum solution. In other words, the external program examined the optimum solution just
produced by the optimizer and calculated the physical property data of the crude fractions by using
the composition of the crude slate in the solution. This data was then inserted into the model (LP
matrix) thereby updating the estimated data with more accurate data. The model was resubmitted to
the optimizer and solved again. The same external program then examined this second solution, the
same data recalculated, the recalculated data inserted into the matrix and the model solved again.
This process was repeated until the changes taking place in the calculated data were small enough to
be within certain tolerances specified in the external program.
Let us first look at why DR is needed in an LP model and then describe what it is.
After the recursion technique described above had been in use for a while it became apparent that LP
models were still not giving the correct answers.
The shortcomings of this recursion technique were serious. The major problem was that the
comparison of the last calculated values and the last guessed values in the matrix were always one
solution cycle behind. The difference between the guess and calculated value were not represented in
the current matrix for consideration in the current solution.
Another problem was one of visibility. The downstream user of a material with certain physical
properties could not “look back” to where that material was being produced and examine
opportunities that may have existed if the physical properties where different. By the same token,
physical properties of a material produced upstream were not influenced by the physical property
requirements of where the material was used downstream.
Distributive Recursion is the next logical extension of the simple recursion described above. In
simple recursion, the difference between the user’s guess and the optimum solved value is calculated
in an external computer program, updated, and re-optimized. Distributive Recursion model structure
moves that error calculation from outside the LP solution to inside the LP matrix itself. The whole
idea is to provide “visibility.” In other words, to allow the upstream producer of a material to see the
requirements of the downstream user, and to allow the downstream user of a material to see the
production constraints of the upstream producer in the current LP matrix being solved. This allows
the optimizer to economically balance the cost of producing certain material physical properties
against the value of those properties at the downstream location. With this arrangement, the optimum
solution that is reached has physical property data for all of the recursed streams that exactly match
the composition of the pools used to create those properties.
Distributive recursion matrix structure provides visibility from the source of a recursed pool to its
disposition and from the disposition of a recursed pool to its source. This structure is generated
automatically by PIMS in the crude units if the PIMS crude unit architecture is used. However, the
user must explicitly provide all other DR structure. We will come back to this later. Let’s look at a
very simple DR model. If we have a cat cracker unit (SCCU) in our model and we want to
dynamically adjust the cat yields based on feed quality using a delta based model structure (see
section on Delta Based Modeling), we need to pool the feeds to the cat and recurse on whatever feed
qualities we want to use to drive the delta based model. The flow diagram would look like this:
This structure creates a pool CFP from LV1, HV1, and DCG. The material balance row VBALCFP
collects the pool barrels and makes them available for processing downstream (i.e. the cat cracker
unit SCCU). The RBALCFP row is a recursion balance row which sums the pool barrels into the
pool collector column SCFPCFP. The activity of column SCFPCFP in the solution will be equal to
the total amount of CFP yielded into the VBALCFP material balance row. It is very important that
in all distributive recursion structure the negative entries in a recursion balance row exactly
match the negative entries in the pool material balance row (VBAL or WBAL) if one exists.
In this example, we have a cat cracker feed quality AFC (aromaticity factor), which we are using to
adjust the yields in the cat cracker using delta-based modeling structure. The coefficients in this row
represent the property AFC for each of the feeds in the pool. In other words, LV1 has an AFC of 24,
HV1 has an AFC of 20, and DCG has an AFC of 31. We have guessed the AFC of the CFP pool to
be 26. This guess must be added to table Pguess. In a PIMS model, material balance rows are
normally inequalities. However, recursion balance rows and recursion property rows are equalities
and must equal to zero. Therefore, the activity of column SCFPCFP must equal the sum of the
activities of columns SCFPLV1, SCFPHV1, and SCFPDCG. Let’s look more closely at the
RAFCCFP property recursion row. If we guess wrong on the AFC of recursed pool CFP, there will
be a difference in the pool AFC property of 26 and the actual pool AFC. The actual pool AFC is
The entire structure shown above is part of a process submodel called SCFP.xls in a PIMS model,
except for the column RAFCCFP, which is the error distribution vector. PIMS automatically
generates error distribution vectors and puts the appropriate error distribution coefficients in the
proper rows for the user.
Now that we have summed the error created by guessing at the property, what do we do with it? In a
PIMS model, we take this error and distribute it wherever the property is being used. In our example,
we are using the AFC property of CFP in the cat cracker. It so happens this is the only place where
the AFC of CFP is used. The matrix structure would look like this:
SCCUBAS SCCUAFC SCCUCFP RAFCCFP RHS
VBALCFP 1 0
EBALCCU 1 -1 =0
EAFCCCU 15 5 -26 -1 =0
For an understanding of the above delta based modeling structure see the PIMS Training Manual
section on Delta Based Modeling.
This structure guarantees the activity of SCCUBAS to be equal to the activity of column SCCUCFP,
the cat cracker feed pool. Since the base cat yields were developed when the cat feed had an AFC of
15, there will be an adjustment made to the yields by the SCCUAFC shift vector if the CFP has an
AFC different from 15. Notice that the same guess of 26 which was made when we formed the CFP
pool in Table SCFP is the same guess we are using in the cat cracker at the intersection of column
SCCUCFP and row EAFCCCU. The only difference is that the sign is negative rather than positive.
This is by design. Also notice the column RAFCCFP has an entry of –1 in row EAFCCCU. This
coefficient represents the location of where the error in the AFC guess will be distributed. Let’s
combine these two structures and walk through some matrix arithmetic to get a better idea of what is
happening in the matrix.
SCFPLV1 SCFPHV1 SCFPDCG SCFPCFP RAFCCFP RHS
Activity = 10 10 10 30 ?
VBALLV1 1 0
VBALHV1 1 0
VBALDCG 1 0
VBALCFP –1 –1 –1 0
RBALCFP –1 –1 –1 1 =0
RAFCCFP –24 –20 –31 +26 +1 =0
activity x coefficient
Since the calculated AFC is higher than the base AFC, the SCCUAFC shift vector comes into the
solution to adjust the cat cracker yields which reflects a cat feed pool quality different than the base
quality. That is why the SCCUAFC vector had an activity of +60 in the solution. A positive activity
on the SCCUAFC shift vector produces less cat gasoline (CCG = 30(-0.66) + 60(0.05) = -16.8
MBbls/Day) and more cycle oils (CCD= 30(-0.17) + 60(-0.03) = -6.9 MBbls/Day, CCS = 30(-0.06) +
60(-0.02) = -3.0 MBbls/Day). This is indicative of cat yields as aromaticity increases.
As important and dynamic and creative as it is to see how the cat cracker yields are adjusted based
on some quality of the feed this is NOT the significance of this discussion. The real significance, as
related to distributive recursion, is the fact that our cat cracker model responded to the feed pool just
as though we had guessed the correct value for the AFC of the feed pool CFP. Although we guessed
the AFC of the feed to be 26, the cat cracker actually “saw” an optimum cat feed AFC of 25 because
of the error distributed to the EAFCCCU row by the error distribution vector RAFCCFP.
Let’s look at this example again except this time let’s assume we have no idea what an AFC is and
our initial guess at the AFC of CFP is 1,000.0 rather than 26.
SCFPLV1 SCFPHV1 SCFPDCG SCFPCFP RAFCCFP RHS
Activity = 10 10 10 30 ?
VBALLV1 1 0
VBALHV1 1 0
VBALDCG 1 0
VBALCFP –1 –1 –1 0
RBALCFP –1 –1 –1 1 =0
RAFCCFP –24 –20 –31 +1,000 +1 =0
activity x coefficient
The CFP pool AFC is still 25.0 and the cat cracker still responded to 750.0 AFC-MBbls/Day just like
when we guessed the AFC to be 25.0. If the user thinks about this example a little the conclusion
must be drawn that we only have to solve the model one time to obtain the correct answer. The
reason for this is that the error distribution coefficient is 1.0. The problem arises when the error
distribution coefficients are not 1.0.
This example is one of the more simple DR applications we can construct but it illustrates very
graphically the power and practicality of the DR structure. We will explore that situation in our next
example.
Here we have three different naphtha’s coming from three different crude oils. Each naphtha has
different properties as noted by the Road Octane (DON) shown below. These naphtha’s are
combined into a pool called LN1 and blended into three grades of gasoline, Unleaded Regular
(URG), Unleaded Premium (UPR), and Leaded Regular (LRG). We estimate 50% of the LN1 will
go to URG, 30% to UPR, and 20% to LRG. Since we do not know the crude slate composition we
do not know the composition of pool LN1. The LP structure to model this situation might look
something like this if we make an initial guess at the DON of LN1 to be 75:
A small part of the blending structure for LN1 would look like this:
BVBLURG BREFURG BALKURG BLN1URG
NDONURG +87 -92 -93 -75 -0.5 0
There are also additional vectors in the NDONLRG row to reflect lead susceptibility but we will
ignore these for our discussion. There may also be additional component blend vectors. We will
also assume that LN1 is the only recursed pool in any of these blends so that we can concentrate on
LN1 only.
After we solve the model, we examine the solution and find the following vector activities:
Column Name Activity
SCR1LNA 10.0000
SCR1LNB 10.0000
SCR1LNC 10.0000
SCR1LN1 30.0000
BLN1URG 24.0000
BLN1UPR 1.5000
BLN1LRG 4.5000
activity x coefficient
With the composition of the LN1 pool at 10 LNA, 10 LNB, and 10 LNC the calculated DON of the
pool is 80.0 (10x70 + 10x80 + 10x90) = 2400, 2400/30 = 80.0). Since our initial guess was 75 we
created 150 DON octane-MBbls/Day of error. We will refer to this as simply octane-bbls. This error
is distributed to the three DON specification rows using our initial guess of how we think the LN1
will distribute to the three grades of gasoline. This distribution is 50% to URG, 30% to UPR, and
20% to LRG and is located in table Pdist.
Upon examination of the solution, we discover that although 80% of the LN1 went to URG
(BLN1URG/SCR1LN1 = 24/30 = 0.80) only 50% of the octane-bbl error was distributed to the
NDONURG spec row. By the same token, 5% of the LN1 went to UPR (BLN1UPR/SCR1LN1 =
1.5/30 = 0.05) while 30% of the error went to NDONUPR. In the LRG, 15% of LN1 was blended
(BLN1LRG/SCR1LN1 = 4.5/30 = .15) while 20% of the error was distributed there. This solution is
obviously wrong. Why? Because the DON spec rows for these blends did not have the proper
number of octane-bbls in them, and since the spec rows are nothing more than an octane-bbl balance
this constitutes a critical problem. The NDONURG row is short 45 octane-bbls, NDONUPR has
37.5 too many octane-bbls and NDONLRG has 7.5 octane-bbls too much. The LP will compensate
for this by changing the solution to accommodate this imbalance of octane-bbls. It will certainly
change the blend compositions by adding more high octane blend stocks to URG than would be
required if we had proper octane-bbl distribution. In addition, it may change the operation of the
refinery by increasing reformer severity or buying more of the crude that produces LNC with a DON
= 90. This is a problem that must be addressed and is addressed by the PIMS recursion program.
The PIMS recursion program examines the current solution and does two tolerance calculations. The
Absolute Tolerance, ATol = the current property calculated from the current solution minus the
previous property from the matrix when it was solved for the current solution. In Equation form this
would be ATol = PC – PP. The Relative Tolerance, RTol = the current property calculated from the
current solution minus the previous property from the matrix when it was solved for the current
solution divided by the previous property. This equation looks like this: RTol = (P C – PP)/ PP. The
tolerance calculation requires a criterion upon which to base convergence decisions. These criterions
Since neither the ATol nor the RTol is converged the recursion program will update all the non-
converged recursed properties in the matrix and the model will be solved again. It only takes one of
the tolerance calculations to be within tolerance in order for the property to be deemed converged.
In addition, the recursion program will also update the error distribution coefficients in the matrix at
the same time it updates the recursed properties. The error distribution coefficients for column
RDONLN1 in rows NDONURG, NDONUPR, and NDONLRG are, respectively, 0.80, 0.05, and
0.15, just as we calculated earlier. The updated matrix would look like the following where the
updated coefficients are highlighted by BOLD print:
SCR1LNA SCR1LNB SCR1LNC SCR1LN1 RDONLN1 RHS
VBALLNA 1 0
VBALLNB 1 0
VBALLNC 1 0
VBALLN1 –1 –1 –1 0
RBALLN1 –1 –1 –1 1 =0
RDONLN1 –70 –80 –90 +80 +1 =0
The current DON property of LN1 is calculated from the second solution as 7x70 + 10x80 + 13x90 =
2460, 2460/30 = 82.0 and the activity of the error distribution column RDONLN1 is
activity x coefficient
The property is still not converged, therefore, the matrix is updated again and the model is solved a
third time. In the third solution the column activities we have been looking at do not change from
the second solution. The tolerance calculation is now:
RTol = (PC – PP)/ PP = (82 – 82)/82 = 0/82 = 0.000 is this 0.001 Yes
The solution has now converged on the DON property of LN1. Notice that in a converged solution
the error distribution vector has an activity of zero as can be seen below.
activity x coefficient
The functionality of this table is preserved if the “Always Import Tables” box is checked under
Tools|General System Settings|Spreadsheet tab.
The next step is to draw flow diagrams of the recursed pools we wish to create. The following three
flow diagrams represent recursed pools for cat cracker feed, distillate hydrotreater feed, and
reformate.
2. Distillate Desulfurization
3. Reformate
Once we have defined the pool feedstocks, the properties we need to recurse, and the recursed pool
name we can begin adding recursion structure to the submodel tables.
This table shows a straightforward, simple recursion structure to determine the specific gravity,
sulfur content, and aromaticity factor of the cat feed pool (CFP).
The feeds into the pool have negative coefficients in the recursion balance row and property balance
rows. The pool collector column (CFP) has positive coefficients in the same rows. This sign
convention is very important and must be followed unless very special circumstances exist.
The properties of CFP are used directly in Table SCCU in the driver rows EAFCCCU and
ESULCCU in order to adjust the cat cracker yields based on feed quality. This is shown in the table
below.
*TABLE SCCU CAT CRACKER UNIT
*
TEXT BAS AFC SUL CFP
1
*
VBALCFP CAT FEED POOL -1
VBALCCF CAT FEED 1
VBALH2S H2S, FOEB -0.0033
VBALFGS FUEL GAS & COKE, -0.06
VBALC3M C3 MIXTURE -0.07
VBALC4M C4 MIXTURE -0.12 0.0005
VBALCCG C5-400 CCU GASOLINE -0.66 -0.05 0.0021
VBALCCD CAT CYCLE OIL -0.17 -0.03 0.0005
VBALCCS CAT SLURRY -0.06 -0.02 0.0002
* BALANCE CHECK -0.14 0.00 0.0000 0
*
ECHGCCU FEED CHARGE 1 -1
EAFCCCU FEED AROMATICITY 15 5 -999
ESULCCU FEED SULFUR 1 1 -999
This table shows another straightforward, simple recursion structure to determine the blending
properties of untreated distillate which are passed on to the treated distillate.
Again, the feeds into the pool have negative coefficients in the recursion balance row and property
balance rows. The pool collector (DTF) has positive coefficients in the same rows. This sign
convention is very important and must be followed unless very special circumstances exist.
The properties of DTF are then passed to the blendstock DES through Table PCALC.
Again, the feeds into the pool have negative coefficients in the recursion balance row and property
rows. The pool collector column (RFT) has positive coefficients in the same rows. This sign
convention is very important and must be followed unless very special circumstances exist.
Since the activity of the severity columns will be in terms of naphtha barrels, the recursion rows must
multiply the recursion balance and property balance coefficients by the reformate yield. This will
cause the pool collector column activity (RFT) to be in terms of reformate barrels, which is what we
actually need.
We must now provide the initial estimate or guess for each recursed property in Table PGUESS.
*TABLE PGUESS ESTIMATED RECURSION PROPERTIES
*
SPG SUL RON DON D11 CBI PPI VBI AFC
*
CFP 0.89 2 18
RFT 100 94.5 97.3
DTF 0.84 1.1 51 1.1 0.5
For every property balance row set up in a sub-model table, an entry must be made in Table
PGUESS. The row names must exactly match the pool collector column names in the sub-model
tables, and the column names must exactly match the property names in the recursion property rows
in the sub-model tables.
These entries are initial guesses at what the properties should be, and will be inserted into the matrix
when it is generated.
PIMS will create a PDIST.WKX and PGUESS.WKX file from the last solution. These WKX files
should be retrieved by the user and saved as PDIST.WK1 and PGUESS.WK1. This will give the user
a better estimate of the error distribution coefficients for subsequent solutions.
Table PCALC can now be expanded to include the linkages needed to define properties of streams
that are related to the recursed pool properties through some mathematical formula.
*TABLE PCALC PROPERTY CALCULATIONS
*
TEXT SUL SPG PPI VBI CBI
*
DESDTF DES IN TERMS OF DTF 0.1 1 1 1 1
This table is used to specify a 90% sulfur removal in the stream DTF to produce DES. The SPG, PPI,
VBI, and CBI of the DES are the same as DTF since the multiplier is 1.0.
Now it is time to generate a Validation Report by executing PIMS Main Menu Option 3. Direct this
report to the hard disk and use it to debug the model.
Generate and solve the matrix after all error and warning messages have been dealt with.
This indicates the LP has chosen to send different quantities of LN1 to each of the three products. A
second example of a valid distribution is shown below:
LN1 TO URG 1.000 .3333
LN1 TO UPR .0000 .3333
LN1 TO LRG .0000 .3333
If PIMS does not change initial guesses of properties and/or distributions be suspicious of incorrect
structure. Another example of a possibly incorrect distribution report follows:
LN1 TO URG .5000 .3333
LN1 TO UPR .5000 .3333
LN1 TO LRG .0000 .3333
Since this is only a warning message, PIMS will generate a matrix. However, the recursion structure
in the matrix is mathematically incorrect and may cause problems with recursion convergence or
possibly local optima.
We have a straight run kerosene (KR1) produced on a crude unit. KR1 is a recursed pool and can be
blended directly to Diesel Fuel (DSL). The recursed properties of KR1 include sulfur content (SUL).
KR1 can also be hydrotreated in sub-model SKHT where hydrotreated kerosene KT1 is produced
from KR1. KT1 can also be blended to DSL. The properties of KT1 are related to the properties of
KR1 through Table PCALC. The flow diagram would look like:
DSL has a maximum sulfur specification of 0.5 weight percent. KR1 has an initial sulfur content
estimate in Table PGUESS of 0.6 weight percent. In Table PCALC we specified the sulfur content of
KT1 is equal to the sulfur content of KR1 multiplied by 0.1. Therefore, KT1 has an initial sulfur
content of 0.06 weight percent. The SUL specification row of DSL in the matrix would look like:
BWBLDSL BKR1DSL BKT1DSL
XSULDSL 0.5 –0.6(CONV) –0.06(CONV)
The multiple path problem arises from the fact that the SUL of KT1 is equal to the SUL of KR1
times 0.1. Since we created error when we guessed at the sulfur content of KR1 we also created error
in KT1 as well. Since KT1 is really KR1 multiplied by a constant, we created error for KR1 twice.
The problem then becomes, “How do you distribute error from recursed pool KR1 twice to the same
row?” Because KR1 is a recursed pool with SUL as a recursed property PIMS will automatically
generate a column into the matrix to distribute KR1 error to DSL. The matrix will look like:
BWBLDSL BKR1DSL BKT1DSL RSULKR1
XSULDSL 0.5 –0.6 –0.06 –1
PIMS cannot generate a matrix with an extra RSULKR1 column because this is not allowed by the
optimizer, i.e., two columns with the same name cannot be in the same matrix.
BWBLDSL BKR1DSL BKT1DSL RSULKR1 RSULKR1
XSULDSL 0.5 –0.6 –0.06 –1 –1
Also, PIMS cannot generate a column RSULKT1 with an entry in the RSULKR1 row because there
is no linkage of KT1 to KR1 for material balance and recursion balance rows. In other words, this
structure would permit error to be distributed through the RSULKT1 vector, which may be totally
out of proportion to the amount of KT1 material that is produced. Therefore, the distributive
recursion matrix structure below is incorrect.
BWBLDSL BKR1DSL BKT1DSL RSULKR1 RSULKT1
RSULKR1 +1 +1
XSULDSL 0.5 –0.6 –0.06 –1 –1
The new pool is KX1 and is produced by recursing the material KR1 into KX1 through sub-model
SMPT – MULTIPLE PATH TERMINATOR. Table SMPT would look like:
* TABLE SMPT MULTIPLE PATH TERMINATOR
*
TEXT KR1 KX1
*
VBALKR1 +1
VBALKX1 –1
*
RBALKX1 –1 +1
RSULKX1 –999 999
KX1 now replaces KR1 as the feed to sub-model SKHT (we must physically change SKHT.WK1)
and the properties of KT1 are linked to KX1 rather than KR1 like so:
* TABLE PCALC
*
SUL
*
KT1KX1 0.1
The matrix from this PIMS model would now look like:
BWBLDSL BKR1DSL BKT1DSL RSULKR1 RSULKX1
RSULKR1 +1
RSULKX1 –0.5 +1
XSULDSL 0.5 –0.6 –0.06 –0.5 –1
The only difference in the PIMS model would be Tables SKHT and PCALC would remain as they
were originally and Table BLNMIX would have KX1 as a blendstock to DSL rather than KR1. The
matrix would then appear as:
BWBLDSL BKR1DSL BKT1DSL RSULKR1 RSULKT1
RSULKR1 +1
RSULKX1 –0.5 +1
XSULDSL 0.5 –0.6 –0.06 –0.5 –1
Overview
Delta Based Modeling (DBM) is a linear programming technique used to predict yields and/or
properties of process units and their products in situations where these yields and properties are a
function of feed quality. For example, in a catalytic reformer the reformate product (gasoline) yield
will be high if the naphthenes plus aromatics (N+A or NPA) content of the naphtha feed is high. On
the other hand, if the NPA content of the naphtha feed is low the corresponding reformate yield will
be low.
In most LP applications, the feed is a pool of streams whose composition is unknown and must be
determined by the optimization process. In other words, the properties of the feed to a unit are
unknown because we do not know the composition of the feed pool. DBM is especially useful in
these situations when combined with the very powerful Distributive Recursion (DR) technique
implemented in the PIMS system (see section on Distributive Recursion). Using DR we can estimate
the feed pool properties needed, and when the solution has converged, we will have the correct
properties to accurately predict the product yields and/or properties.
To implement DBM, a feed quality parameter is defined which is easily measured and accurately
predicts product yields and/or properties. An example of such a relationship is shown below in
Figure 1. We will discuss a little later how DBM data is developed from these nonlinear
relationships.
The activity of the column SCCUCFP is the total feed to the cat cracker unit SCCU. The Cat Feed
Pool CFP is formed in another submodel and has only this one disposition. If the activity of column
SCCUCFP is 40.0 MB/D, the equation (E-row) ECHGCCU requires that the activity of column
SCCUBAS must also be 40.0MB/D. In other words, the activity of column SCCUBAS is driven by
the row ECHGCCU to equal the activity of column SCCUCFP, or 40.0 MB/D. This is easily seen
when we do the arithmetic:
SCCUBAS SCCUCFP
activity = 40 40
activity x coefficient =
ECHGCCU +1 x 40= +40 -1 x 40 = -40 =0
activity x coefficient =
ECHGCCU +40 -40 =0
Delta Based Modeling (DBM) uses this concept to make adjustments to process submodel yields
and/or stream properties based on some predetermined property or properties of feedstocks. If we
expand our example and add an adjustment to the cat cracker yields based on some property of the
feed, we can illustrate this quite nicely.
The property we are using is Aromaticity Factor or AFC. This property is calculated from a formula
and is an indicator of how well a cat cracker feedstock will crack. The measure of how well a
feedstock cracks is how much cat gasoline is produced. In our example, the higher the AFC the less
gasoline produced and the more cycle oils are produced. We will get to that later.
The activity of column SCCUBAS is driven to be equal to the activity of column SCCUCFP by the
row ECHGCCU. With this in mind, it can easily be seen that the new row EAFCCCU will drive the
activity of the new column SCCUAFC to take on an activity in the solution that will allow the
activity of row EAFCCCU to equal zero. Let’s do the arithmetic again using 40.0 MB/D to be the
activity of column SCCUCFP. We have already determined the activity of column SCCUBAS to be
40.0 MB/D as well.
activity x coefficient =
EAFCCC +15 x 40 +5 x ? -18 x 40 =0
+600 +5 x ? -720 =0
+5 x ? -120 =0
+5 x ? =120
? =120/5
? =24
Therefore, the activity of column SCCUAFC is driven by row EAFCCCU to be equal to 24 in order
for EAFCCCU to equal zero.
What we have done is develop a structure that forces the activity of a column in the matrix to be
responsive to a physical property of the feed to the process unit. This is very useful! Let’s expand our
example further.
In the matrix structure below, we have added volume material balance rows. Material balance rows
are like pipes in a refinery. The row VBALCFP is the pipe that brings feed into the reactor and the
other material balance rows, VBALH2S, et.al., are pipes that take the cracked products out of the
reactor to other parts of the refinery for further processing or sales.
The positive signs in the material balance rows represent material that is taken out of the row and
negative signs represent material that is yielded or put into the row.
The base yield AFC is 15 but the model wants to run a feed whose AFC is 18.
SCCUBAS SCCUAFC SCCUCFP
activity = 40 24 40
VBALCFP +1
VBALH2S -.001
.
.
.
VBALCCG -.621 +.024
VBALCCD -.170 -.018
VBALCCS -.063 -.006
.
.
.
ECHGCCU +1 -1 =0
EAFCCCU +15 +5 -18 =0
We have already done the arithmetic in the E-rows, so let’s now look to see the effect it had on the
yields. When we multiply the activity of columns SCCUBAS and SCCUAFC times the coefficients
in the material balance rows we see the gasoline yield has “shifted” to a lower production rate than
would otherwise be produced by the base yield vector and the cycle oil yields have increased.
activity x coefficient =
VBALCCD -.170 x 40 -.018 x 24
-6.800 -.432
cat distillate produced = -6.800 -.432 =-7.232 or 7.232 MB/D
activity x coefficient =
VBALCCS -.063 x 40 -.006 x 24
-2.520 -.144
cat slurry oil produced = -2.520 -.144 =-2.664 or 2.664 MB/D
The principle illustrated by this example is relatively simple and can be expanded to cover several
different processes. The PIMS Library has DBM’s to model catalytic reforming, catalytic cracking,
hydrocracking, delayed coking, fluid coking, resid desulfurization, and atmospheric resid treating.
Note: If the feed quality is less than the base quality, the activity of SCCUAFC will have to be
negative to satisfy the row EAFCCCU. Therefore, DBM shift vectors must be set “free” in Table
BOUNDS.
In our example, we show a base set of yields in our cat cracker. Examination of the row EAFCCCU
reveals the base conditions at which this base set of yields were derived was for a feed having an
AFC equal to 15. The intersection of the column SCCUBAS and the row EAFCCCU has a
coefficient of 15 which defines the base conditions for AFC.
Upon further examination of row EAFCCCU we find a coefficient at the intersection with column
SCCUAFC of +5. Remember that SCCUAFC is the shift vector which makes adjustments to the
yields if the feed comes in with an AFC different from the base. Therefore, the coefficient must be
reflecting a change in the yields for every 5 number increase in the AFC property.
The data points modeled by column SCCUAFC really represent the slope of the lines between the
points on the graph. When we take the difference between the yields and the difference between the
AFC we get a decrease in CCG of 0.024 vol. fraction for every 5 number increase in AFC. Likewise,
we get an increase in CCD and CCS yield of 0.018 and 0.006 volume fraction, respectively, for the
same increase of 5 numbers in AFC. These differences are the same numbers we see in our cat
A word of caution is in order at this point. The data used in a DBM is of necessity linear. In other
words, the slopes of the curves used above reflect a linear relationship between yield and AFC. This
may or may not be accurate. The user must be satisfied that this relationship adequately models the
real world for each specific DBM application.
In a DBM the shift vectors must be set free in Table BOUNDS. In our example, if the cat feed comes
in with an AFC less than 15, the SCCUAFC shift vector will need to have a negative activity for row
EAFCCCU to equal zero. If this happens, the assumption is made by the model that the linear
relationship of yield versus AFC holds even at AFC values less than 15. In other words, without
additional limitations the model can extrapolate the curves into the region below an AFC of 15. By
the same token, the model can extrapolate the curves above an AFC of 20. The user needs to be
aware of these conditions and recognize these as limitations of the DBM technique.
The user must be cognizant of the range of AFC values for which this curve is valid. If the solution
has extrapolated beyond the range over which the data is linear, the user should update the base yield
data and the shift vector data to reflect a different part of the curve from which the data is derived.
In this structure the sulfur in the feed is higher than the base of 0.8 weight percent, therefore, shift
vector SCCUSUL will take an activity that balances row ESULCCU to zero. After doing the
arithmetic we discover the activity of SCCUSUL to be 20. As the sulfur increases more H2S is
produced at the expense of the liquids yield. (This is a simplification for illustrative purposes only.)
When using a DBM with multiple shift vectors it is important to develop the shift vector data for
each parameter separately if possible. In other words, when developing the data for AFC hold feed
sulfur constant and when developing the data for SUL hold feed AFC constant.
Note: By allowing the shift vector to be free, it may take on negative activity in the solution if it is
needed to satisfy the driver E-rows. Failure to do this may, at times, cause infeasibilities or severely
restrict the solution.
Overview
P-PIMS is a PIMS option that requires TPIMS and that allows the user to create models with multiple
time periods. P-PIMS models may contain up to 13 periods of user definable varying lengths. These
models retain the full functional capabilities of PIMS in each time period. All operating variables such
as purchases, sales, process submodel operations and product blending can vary from period to period.
In addition a P-PIMS model can include the implications of opening, minimum, target and maximum
inventory levels for all or selected materials. Inventory holding costs and present value factors are also
provided to allow the user to optimize present value objective functions if desired. Inventory transfers
from one time period to the next provides the linkage between time periods in a P-PIMS model.
P-PIMS is truly an extension of PIMS in the sense that its data input requirements are substantially
identical to PIMS. Time varying and inventory implications are merely overlaid on top of the existing
PIMS model. Only two new input tables are required. All other time varying constraints are included
by extending existing PIMS tables. Consequently, a P-PIMS model is very easy to set up from an
existing PIMS model and PIMS users can readily extend their planning activities to include multi-
period models.
P-PIMS offers powerful and flexible reporting options that permit the user to select from a wide variety
of reports and report formats. These enable the user to create both very simple and very detailed
reports. Reports may be presented with one time period to a page (as is the case with PIMS), or in
tabular format with time periods shown across the page. Facilities for totaling and averaging across
periods are also provided.
1. P-PIMS models require two new tables, PERIODS and PINV. Although both these tables must be
present, table PINV could be empty or have could be empty or have no rows if desired. The contents
of these tables is described below.
2. The time varying requirements of the P-PIMS model are supplied in the Tables BUY, SELL,
UTILBUY, UTILSEL, CAPS, BLNSPEC, BOUNDS, ROWS, PDIST and PGUESS. Time varying
quantities are identified by appending an additional character to the end of existing column and/or row
names to identify the time period. This easy to implement technique is also described below.
3. Table SETUP may contain the additional options (rows) ALTVOL and ALTWGT.
4. Table RECURSE may contain the additional rows XPENALTY and P2P.
BLNSPEC
All four character row names except the maximum TEL specification for leaded gasoline blends. Note
that the use of period suffices in table BLNSPEC has a different convention from that used in all other
time varying tables. The period suffix in table BLNSPEC indicates that the data item applies from the
indicated period onwards, and not only in the indicated period. This facilitates the data entry of
seasonal product specifications where changes occur at selected time periods. The example shows that
the maximum RVP in the gasoline blends is reduced in period 2 and subsequent periods.
BOUNDS
BOUNDS: Columns MIN, MAX, FIX.
See Table BOUNDS in PIMS for further information.
However, the column names MIN, MAX, FIX and FREE, which are used to override the default row
type of matrix rows, must not include appended period identifiers.
PDIST All rownames.
An example of table CAPS is shown below.
*TABLE CAPS PROCESS CAPACITIES
* NOTE 3 WEEK SHUTDOWN OF FCC AND ALKY IN
FEBRUARY
TEXT MIN MAX MAX2
*
CAT1 CRUDE UNIT 1 MBPD 94
CAT2 CRYDE YBUT 2 MBPD 12
CVT1 VAC UNIT 1 MBPD 46
CVT2 VAC UNIT 2 MBPD 0
CNSP NAPH SPLITTER MBPD 27
CNHT NAPH HYDROTRT MBPD 23
CLPR LOW-P REFORMER MBPD 33
CKHT KERO HYDROTRT MBPD 8
CDHT DIST HYDROTRT MBPD 15
CCCU CAT CRACKER MBPD 17 35 5
CCRB CARBON BURNT MTPD 0.300
CIS4 C4 ISOM MBPD 5
CSFA SULF ACID ALKY MBPD 12 0
*
CHCD HYDROCK-DIST MBPD 5 21
CHYD H2 PLANT BSCFD 0.030
CDLC DELAYED COKER MBPD 9 15
CAMN AMINE UNIT MLT/D 0.150
CSRU SULFUR PLT MLT/D 0.150
CTGT TAIL GAS TRT MLT/D 0.010
CH20 COOLING TOWER GPM
CSTM STEAM GEN LB/HR
CKWH POWER DISTRIB KVA
Table CAPS
PERIODS
A P-PIMS model may span up to 13 time periods of user definable varying length. The period lengths
are specified in multiples of the standard unit of time defined by the user in row TIME of table SETUP.
The standard unit of time will typically be a day (with text like DAY, SD or CD). Note that tables
containing rate data such as BUY, SELL and CAPS, have these rates specified in terms of the unit of
time, for example in MBBLS/DAY or MTONS/DAY.
An example of table PERIODS is shown in Fig. J.3 below. The row names of the table are one
character in length and this character is used to identify each period. It is recommended that
alphanumeric characters only (A-Z, 0-9) be used. Note that if numeric characters are used, these must
be entered in the table as LOTUS text fields (by preceding the character with an apostrophe). The
table can contain up to 13 such rows (periods). The periods are assumed to be sequential in time in
row order.
Column TEXT contains an 8 character description for each period. This text is used only at report time
to clearly identify the periods on the solution reports.
Column LEN is used to define the length of each period in multiples of the standard period length as
defined in row TIME of table SETUP. In the example shown the three periods are defined as having
lengths of 31, 28 and 31 days respectively. Note that it is permissible to use fractional period lengths
(such as 1.5 weeks etc.) if desired. If column LEN is absent all periods are assumed to have a length of
1.
The optional column PVF may be used to provide present value factors for each period. All entries in
the LP objective function row, that is, all revenue and cost items, will be multiplied by the entries in
this column so that the LP objective becomes a net present value function. Values of 1.0 are assumed
and the objective function is not discounted if column PVF is absent.
The optional column RECURSE may be used to define for which periods the system should recurse
properties and distributions. An entry of 1 in this column indicates that recursion should take place, and
an empty or zero entry indicates that the initial estimates of properties and distributions in the
referenced period should remain unchanged during the recursion. If column RECURSE is absent, ALL
periods are recursed.
The optional column MIP may be used in MIP models to define for which periods MIP variables
should be forced to their integer values. Absence of this column causes the MIP feature to be active in
all periods.
*TABLE PERIODS TIME PERIOD DEFINITIONS
*
TEXT LEN PVF * INTEREST = 15.00%
*
1 JANUARY 31 1.00 PV FACTOR DEFINED BY
2 FEBRUARY 28 0.99
3 MARCH 31 0.98 PVF(k) = PVF(k-1)/(1+i/12)
*
* (k) = CURRENT PERIOD
* (k-1) = PREVIOUS PERIOD
* i = INTEREST RATE
Table PERIODS
PINV
Table PINV is used to provide inventory information about all materials for which the model is to carry
inventory from one period to the next. Any stream in the model, be it a feed stock, intermediate or
finished product maybe inventoried. Any stream not identified in table PINV is assumed to close each
period with the same quantity of inventory as existed at the beginning of the period, that is, no
inventory changes occur in each period.
An example of table PINV is shown. The three character row names of the table are the stream tags of
the materials that are to be inventoried.
Table PINV illustrates the technique used in P-PIMS to define time varying data items. The same
technique is used in each of the time varying data tables identified above. In this technique an
additional character, the period identifier character as defined in table PERIODS, is appended to an
existing column or row name to indicate that the data item applies only for the specified period. If the
period identifier is omitted the data value is interpreted as a default value that applies for all periods
unless otherwise defined. In terms of this convention, table PINV shown above implies that the
minimum inventory of CCG is 10,000 BBLS in all periods except period 3 where the minimum is
20,000 BBLS. The minimum inventory of HCL, on the other hand, is 5,000 BBLS in all periods.
Column VOL may be used in weight basis models to indicate that the inventory levels and costs for a
material are in volume rather than weight units. This has a similar implication to the use of column
VOL in tables BUY and SELL. Column VOL will be ignored in volume basis models. In a weight
basis model, an entry of 1.0 in column VOL indicates that the inventory data for the material is in
volume units. Absence of column VOL, or an empty or zero entry in the column implies that the
inventory data for the material is in weight units.
Note that it is also possible to establish minimum and maximum inventory constraints for groups of
materials by defining the group in table GROUPS and using the group tag as a row name of table
PINV. If a group constraint is imposed, all stream members of the group must also appear in PINV.
Also, if a group inventory minimum (or maximum) is required, a value must appear in the column MIN
(or MAX), not withstanding the presence of period specific entries in columns MINp (or MAXp).
While the constraint will limit the solution of the matrix it will not appear in the PPIMS across the
page or down the page solution reports.
* TABLE PINV PERIOD INVENTORIES MBBLS
*
TEXT OPEN MIN MIN3 TARG TARG3 MAX MAX3 HCOST PCOST PCOST3 VOL
*
HCL HYDROC LGT NAPHTHA 13 5 15 50 0.011 1.00 26.00 1
LCI LGT CAT NAPH (INVTY) 50 10 20 30 50 100 0.011 1.00 26.00 1
RFT REFORMATE 11 5 15 50 0.011 1.00 27.00 1
ALK ALKYLATE 4.4 2 5 6 10 20 0.011 1.00 27.00 1
LD1 LGT DIST 6.6 3 9 30 0.010 1.00 24.00 1
HD1 HVY DIST 34 5 15 50 0.009 1.00 22.00 1
LV1 LIGHT VGO 650-950 22 10 30 20 100 0.011 1.00 26.00 1
HV1 HEAVY VGO 950-1050 66 30 90 90 300 0.009 1.00 22.00 1
VGO COMB VACUUM GAS OILS 40 99 400 500
VR1 VACUUM RESID 1050+ 13.2 6 18 60 0.006 1.00 14.00 1
*
* TARG = 30% OF MAX
* MIN = 10% OF MAX
Table PINV
PSPAN
The optional table PSPAN may be used to cause specification blend recipes to be held constant across
groups of time periods. The resultant recipes are still optimized but PPIMS finds the best recipe that
spans the indicated periods.
The row names of the table are 7 characters in length. The first three characters are the tag of a blend
component. The next three characters are the tag of a specification blended product. The final character
(which may be a blank character if desired) is a designator for a span of periods. This character may
not match any of the period identifier characters. Entries of 1 in the row define a contiguous set of
periods in the span. If the row is empty the span is assumed to include ALL periods of the model.
A row constructed in this manner implies that the percentage of the indicated component in the
indicated product should be the same for all periods in the span. For example in Fig. J.5 the row
LSRLRGA implies that the percentage of component LSR in product LRG should be the same for all
the periods of span A, namely periods 1 and 2. The row LSRLRGB implies that the percentage of LSR
in LRG should be the same in periods 3 and 4.
If the first three characters of the row name use ..., this is interpreted as a “wild card” signifying ALL
components permitted in the product. For example the row ...MID implies that the percentage of each
component in product MID should be the same across all periods (i.e. the entire recipe should be the
same across all periods).
In some situations the entries in table SPAN might create an infeasible condition. In this case P-PIMS
will cause the requirement of a constant recipe to be relaxed, using a “penalty vector” approach. The
magnitude of this penalty may be set in row XPENALTY of table RECURSE and defaults, if not set to
a value of 100.00 monetary units/unit volume/period. (typically $100.00/Day).
*TABLE PSPAN SPAN RECIPES ACROSS PERIODS
*
1 2 3 4
*
LSRLRGA 1 1
LSRLRGB 1 1
*
...MID *KEEP ALL RATIOS CONSTANT ACROSS ALL PERIODS
*
*
* NOTE: PENALTY ON VIOLATION IN ROW XPENALTY OF
TABLE
RECURSE IF OMITTED SET AT $100/BBL/DAY
RECURSE
In P-PIMS table RECURSE permits two additional row names. The row XPENALTY is described in
PSPAN Section J.6. The row P2P may be used to define, in column VAL, the quantity to be used as an
initial estimate of period to period error distribution. If this value is not provided, period to period error
distributions are estimated as 1.0 minus the sum of distributions within the period (as defined by table
PDIST).
RFORMAT
The P-PIMS Solution Reporting Menu offers the user the choice of four reports:
1. A summary report
2. A down-the-page report
3. An across-the-page report
4. A primal/dual report.
The summary report is similar to the PIMS summary report, but represents the different time periods as
columns across the page for easy period to period comparisons. The primal/dual report is identical in
format to the PIMS primal/dual report. Examination of this report reveals how P-PIMS appends the
period identifier character to all LP row and column names.
The Down The Page reports are essentially identical to the PIMS solution report, with one period to a
page. The appropriate period is clearly identified at the top of each page, and successive periods are
shown on successive pages. P-PIMS offers the user the choice of reporting a single specified period, or
all periods.
The Across The Page reporting mode offers the opportunity to select form a wide variety of report
options. These options are pre-selected through the creation of a P-PIMS report format table. The P-
PIMS report menu requests the user to enter the name of the report format table to be used (this name
defaults to RFORMAT if no name is entered).
An example of a report format table is shown below. This table has pre-defined row names for
identifying individual reports, and pre-defined column names for identifying report types and options.
The row names which are recognized by P-PIMS and the reports to which they refer are as follows:
PAS: Purchases and Sales Reports
UTL: Utility Purchases and Sales Reports
ECO: Economic Summary Analysis Reports
CAP: Capacity Utilization Summary Reports
REC: Recursion Log and Recursed Property Reports
INV: Inventory Reports
SPC: Specification Blend Reports
FRM: Formula Blend Reports
SUB: Process Submodel Reports
MBR: Material Balance Reports
The column names which are recognized by P-PIMS include both report types and options within a
report. The report types are:
RATE: A rate report shows the rate of activity in units of weight or volume per unit time for each period.
The units for a rate report are typically BBLS/DAY or MTONS/DAY.
PERIOD: A period report shows the total activity for each period in units of weight or volume. The units for
a period report are typically BBLS or MTONS. Note that the total activity in a period report, is
calculated as the rate, as reported on a rate report, multiplied by the period length.
MRATE: A monetary rate report is similar to a rate report except that the values shown are in monetary
units per unit of time, typically $/DAY. Note that the monetary scaling option MSCALE, as set in
table SETUP, is used in this report.
MPERIOD: A monetary period report is similar to a period report except that the values shown are in
monetary units, typically $. Note that the monetary scaling option MSCALE, as set in table
SETUP, is used in this report.
EXPAND: An expanded report is a rate report that includes additional information. The upper and lower
bounds, costs and marginal values associated with each rate item are also shown in the report.
These items are shown down the page as the periods vary across the page.
PRICING: The pricing reports are merely a reflection of input data and show material and utility costs and
prices in each period. These reports serve as useful companions to the Purchase and Sales and
Utility Purchases and Sales reports. P-PIMS will also recognize two additional rows in table
SETUP. Rows ALTVOL and ALTWGT may be used to provide alternative units of weight and
volume for the pricing reports. The alternative unit text is defined in column TEXT and scale
factors are provided in column OPTIONS to convert from the default units of weight and volume
to alternative units. A typical use of ALTVOL would be to define GAL as an alternative volume
unit to BBL with a factor of 42 so that pricing reports can show product prices in both $/BBL and
$/GAL.
Note that any entry of 1 in the table selects the appropriate report or report option. A zero, empty or
missing intersection switches off the appropriate report or option. The default for all intersections is
zero, that is all reports and options are switched off, so that no report will be printed unless selected
with a 1. Note also that not all report presentation types are available for all reports. For example the
expanded report is only available for the Purchases and Sales, Utility and Capacity Utilization reports.
All the permitted combinations are identified in Figure J.8 by 1’s. It is recommended that the user
adjust report format tables by substituting 0’s for 1’s and vice versa, so that all usable intersections of
the table are always identified.
If the user requests that the Down The Page or Across The Page report be directed to a disk file, P-
PIMS then requests the user to enter the name of the disk file to be created. The default names Down
and Across may be selected by hitting the ENTER key, however other names may be readily selected.
P-PIMS automatically appends the extension LST to the name selected. This feature of the P-PIMS
Report Menu facilitates the creation of multiple reports from a single P-PIMS run by allowing the user
to conveniently name each report. It is perfectly acceptable, and in fact recommended, that the user set
up a number of Report Format files that request different volumes of print for different purposes.
Because of the potentially large number of pages that may be created in a P-PIMS report, both the
Down The Page and Across The Page reports include a Table of Contents as the last report printed.
This Table of Contents may be used to easily locate specific parts of the report.
The width of a P-PIMS Across The Page report is calculated from the formula:
WIDTH = 46 + n * 12,
where
n = Number of Periods
For a model with 7 or fewer periods the report width is less than 132 columns and these reports can be
printed at 10 characters per inch on a standard printer. Reports for models with 8 to 13 periods will
require that the printer be set up in condensed print mode.
* TABLE RFORMAT
*
TEXT RATE AVERAGE PERIOD TOTAL EXPAND MRATE MPERIOD PRICING
*
PAS PURCHASES AND SALES 1 1 1 1 1 1 1 1
UTL UTILITIES 1 1 1 1 1 1 1 1
ECO ECONOMIC SUMMARY 1 1 1 1
CAP CAPACITIES 1 1 1 1
REC RECURSED PROPERTIES 1
INV INVENTORY REPORT 1
SPC SPECIFICATION BLENDS 1 1 1 1
FRM FORMULA BLENDS 1 1 1 1
SUB SUBMODELS 1 1 1 1
Table RFORMAT
ROWS
All rows and all columns except MIN, MAX, FIX and FREE. If row or column names contain a blank
in character position 8, the appropriate row or column structure will be replicated across all periods.
Thus an entry at the intersection of a seven character rowname with a seven character column name,
will generate a diagonal structure. However, the column names MIN, MAX, FIX and FREE, which are
used to override the default row type of matrix rows, must not include appended period identifiers. See
Table ROWS in PIMS.
*TABLE ROWS USER DEFINED ROWS
*
TEXT FIX FREE MAX
*
VBALLOS 1
VBALRFL 1
VBALTGT 1
Table ROWS
Where a recursed pool is also an inventoried material, that is, a row of table PINV, the recursion
structure is set up a little differently by P-PIMS. In this case the opening inventory of the period is
treated as if it were an additional feed to the pool and the closing inventory of the period is treated as
an additional distribution. Consequently the model correctly distributes property errors both to
dispositions of the pool and to the subsequent period. This arrangement is illustrated below.
Executing PPIMS
PPIMS X or PPIMS XX will be invoked automatically if the current model opened is
a periodic model. PIMSWIN will detect a periodic model by the presence of tables
PERIODS and PINV in the model directory and the system size executed will depend
on the selected size from the Run menu box.
The P-PIMS Main Menu is essentially identical to PIMS. All facilities provided in the
Model Management remain the same as for PIMS. The P-PIMS Model Validation
report is nearly identical to the corresponding PIMS report, but also prints the
contents of tables PERIODS and PINV.
The P-PIMS Matrix Generation process generates a single multi-period LP matrix for
the model. A highly efficient generation technique is used which results in the
generation of P-PIMS models taking only slightly longer than a single period model
rather than a multiple thereof. The row size of a P-PIMS LP matrix will be
essentially that of a single period model multiplied by the number of periods. The
number of LP columns will exceed this multiple of a single period model by virtue of
the introduction of inventory variables to define closing inventories for each period.
Consequently some care should be exercised in setting up P-PIMS models to ensure
that unreasonably large LP problems are not created.
The P-PIMS LP Optimization and Recursion steps are also very similar to their single
period PIMS counterparts. During the recursion process the recursion report is
generated for each period, so that the convergence of stream qualities may be
monitored for each period.
It is possible to solve a multi-period model as a standard model (non-periodic) by
clicking on the Run menu item and selecting Standard Model Execution. Otherwise,
the model will solve as a multi-period model. The PIMS Validation Summary can
only be run as a multi-period model from any model that contains tables PINV and
PERIODS. These tables must be disabled in order to run the PIMS Validation
Summary as a standard model.
Report Writing
The P-PIMS Solution Reporting Menu offers the user the choice of four reports:
1. A summary report
2. A full report down-the-page
3. A full report across-the-page
4. A primal/dual report.
The summary report is similar to the PIMS summary report, but represents the
different time periods as columns across the page for easy period to period
comparisons. The primal/dual report is identical in format to the PIMS primal/dual
report. Examination of this report reveals how P-PIMS appends the period identifier
character to all LP row and column names.
The Down The Page reports are essentially identical to the PIMS solution report,
with one period to a page. The appropriate period is clearly identified at the top of
each page, and successive periods are shown on successive pages. P-PIMS offers the
user the choice of reporting a single specified period, or all periods.
The Across The Page reporting mode offers the opportunity to select form a wide
variety of report options. These options are pre-selected through the creation of a P-
PIMS report format table. The P-PIMS report menu requests the user to enter the
name of the report format table to be used (this name defaults to RFORMAT if no
name is entered).
An example of a report format table is shown below. This table has predefined row
names for identifying individual reports, and predefined column names for
identifying report types and options.
The row names which are recognized by P-PIMS and the reports to which they refer
are as follows:
PAS: Purchases and Sales Reports
UTL: Utility Purchases and Sales Reports
ECO: Economic Summary Analysis Reports
CAP: Capacity Utilization Summary Reports
REC: Recursion Log and Recursed Property Reports
INV: Inventory Reports
SPC: Specification Blend Reports
FRM Formula Blend Reports
SUB: Process Submodel Reports
MBR Material Balance Reports
PEN Penalties
The column names which are recognized by P-PIMS include both report types and
options within a report. The report types are:
RATE: A rate report shows the rate of activity in units of weight or volume per
unit time for each period. The units for a rate report are typically BBLS/DAY or
MTONS/DAY.
PERIOD: A period report shows the total activity for each period in units
of weight or volume. The units for a period report are typically BBls or MTONS.
Note that the total activity in a period report, is calculated as the rate, as reported
on a rate report, multiplied by the period length.
MRATE: A monetary rate report is similar to a rate report except that the
values shown are in monetary units per unit of time, typically K$/DAY. Note
that the monetary scaling option MSCALE, as set in table SETUP, is used in
this report.
MPERIOD: A monetary period report is similar to a period report except
that the values shown are in monetary units, typically K$. Note that the
monetary scaling option MSCALE, as set in table SETUP, is used in this report.
EXPAND: An expanded report is a rate report that includes additional
information. The upper and lower bounds, costs and marginal values associated
with each rate item are also shown in the report. These items are shown down
the page as the periods vary across the page.
PRICING: The pricing reports are merely a reflection of input data and
show material and utility costs and prices in each period. These reports serve as
useful companions to the Purchase and Sales and Utility Purchases and Sales
reports.
Note that any entry of 1 in the table selects the appropriate report or report option. A
zero, empty or missing intersection switches off the appropriate report or option. The
default for all intersections is zero, that is all reports and options are switched off, so
that no report will be printed unless selected with a 1. Note also that not all report
presentation types are available for all reports. For example the expanded report is
only available for the Purchases, Sales, Utility and Capacity Utilization reports. All
the permitted combinations are identified by 1's. It is recommended that the user
adjust report format tables by substituting 0's for 1's and vice versa, so that all usable
intersections of the table are always identified.
If the user requests that the Down The Page or Across The Page report be directed to
a disk file, P-PIMS will then request a disk file name. The default names Down and
Across may be selected by hitting the ENTER key , however, other names may be
readily selected. P-PIMS automatically appends the extension LST to the name
selected. This feature of the P-PIMS Report Menu facilitates the creation of multiple
reports from a single P-PIMS run by allowing the user to conveniently name each
report. It is perfectly acceptable, and in fact recommended, that the user set up a
number of Report Format files that request different volumes of print for different
purposes.
Because of the potentially large number of pages that may be created in a P-PIMS
report, both the Down The Page and Across The Page reports include a Table of
Contents as the last page printed. This Table of Contents may be used to easily locate
specific parts of the report.
The width of a P-PIMS Across The Page report is calculated from the formula:
WIDTH = 46 + n * 12,
where
n = Number of Periods
For a model with 7 or fewer periods the report width is less than 132 columns and these reports can be
printed at 10 characters per inch on a standard printers. Reports for models with 8 to 13 periods will
require that the printer be set up in condensed print mode.
The CASE worksheet constructed for this purpose is identical in format and content to its PIMS
equivalent, except that period identifiers may be appended to row and column names that support this
feature. An example of such a worksheet is shown below.
CASE 1 BASE CASE
***********************************************
*
CASE 2 INCREASE FCC CAP (PD 2) TO 12.5 MBPD
TABLE CAPS
TEXT MAX2
CCCU CAT CRACKER 12.5
***********************************************
*
CASE 3 REDUCE MAX RVP (PD 3) TO 10 psi
TABLE BLNSPEC
TEXT URG LRG UPR
XRV13 RVP INDEX 17.78 17.78 17.78
P-PIMS CASE Worksheet
P-PIMS Row and Column Naming Conventions
A P-PIMS LP matrix includes all the structure of a PIMS matrix duplicated for each period. All PIMS
column names and row names other than OBJFN and XTRA have the P-PIMS period identifier
character appended as the eighth character of the LP row/column name.
Additional structure appended to the matrix is used solely for the purpose of modeling inventory. For
an inventoried material, the closing inventory at the end of period j is defined by
Sj = TARGj + IEXCj - IDEFj (1)
Substituting (1) in (2) and rearranging terms yields the material balance equation.
-PRODj + CONSj-1/LENj * ( IDEFj - IDEFj-1 - IEXCj + IEXCj-1 )
It should be noted that P-PIMS material balances are consequently defined as equalities for all
inventoried materials. Material balances for non-inventoried materials remain as less-or-equal-to
inequalities as in PIMS.
A consequence of the material balance equation (3) is that P-PIMS models have terms in the LP RHS
column, where PIMS has zeros.
The inventory excess and deficit variables are included in the P-PIMS matrix with the following
names:
Note also that in P-PIMS entries in the LP objective function row OBJFN are multiplied by the period
length LENj and by the present value factor PVFj.
Notes:
Notes:
PIMS Training Class Problems
The following class problems and their solutions have been provided on diskettes for you to take
home with you. The README.TXT file on the diskettes will tell you how to install them on
your computer at your home or office. If you are using the VOLUME based model they will
create directories C:\PIMS\TV (Training - Volume) if they do not already exist or directories C:\
PIMS\TW (Training - Weight) if you are using the WEIGHT based model.
The directory TV (TW) has two compressed files: TV.EXE (TW.EXE) and CV.EXE
(CW.EXE). TV.EXE (TW.EXE) contains the spreadsheet files that comprise the original
training model before any changes are made to it. CV.EXE (CW.EXE) contains the solutions to
the class problems. CV.EXE (CW.EXE) is also a compressed file. These two files provide
everything needed to correctly solve all of the Essential PIMS Class Problems and all of the
Intermediate PIMS Class Problems.
CV.EXE (CW.EXE) contains batch files with a BAT extension and self-unarchiving files with
an EXE extension. The batch file names begin with the class problem number that they pertain
to, for instance, CP2.BAT pertains to Class Problem 2, CP3.BAT to Class Problem 3, etc. In
order to see the solution to a class problem type CP and the number of the class problem solution
you wish to see. As an example, if you want to see the solution to Class Problem 8 type in CP8.
This will cleanup the directory by deleting all reports and other files created by PIMS, restore
the model tables to their original condition by expanding TV.EXE (TW.EXE), and then
unarchive only those spreadsheet files that are changed in order to solve the problem. If you
open these files using your spreadsheet program you will notice there are areas highlighted in
yellow which mark those changes which must be performed in order to solve the problem. The
changed files will have a time stamp of 11:00 AM whereas the original files are time stamped
10:00 AM. There will also be a file that begins with an “!” for each solution. In our example !
CP8.WK1 shows the answer you should get when you solve Class Problem 8.
There is also a file TR.BAT which when executed will cleanup and restore the model back to its
original condition so that you will have a clean model from which to work.
List of PIMS Class Problems
Problem 1 – Matrix Arithmetic
Problem 2 – Evaluating a New Crude
Problem 3 – Evaluating a Gasoline Blendstock
Problem 4 – Evaluating a New Product
Problem 5 – More Matrix Arithmetic
Problem 6 – Evaluating a Cat Cracker Feedstock
Problem 7 – Evaluating an Alky Feedstock
Problem 8 – Evaluating a New Process Unit(C5/C6 Isom)
Problem 9 – Creating a Cat Feed Pool
Problem 10 – Adding a New Process Unit (Cat Feed Hydrotreater)
Problem 11 – Adding a New Crude and Vacuum Unit
Problem 12 – Using Matrix Control Rows & Bounds
Problem 13 – Using Submodel Parameter Rows (P-ROWS)
Problem 14 – Adding Swing Cut Capability
Problem 15 – Gas Plant Recoveries
Problem 16 – Error and Warning Message Resolution
Problem 17 – Obtaining Information from PIMS Reports
Problem 18 – Implementing Crude Unit Limits
Problem 19 – Same Crude Mix to Multiple Crude Units
Problem 20 – Using Deferred Crude Cuts (Naphtha Splitter)
Problem 21 – Reporting Hydrogen and Sulfur Balances
Problem 22 – Multiple Path Resolution
Problem 23 – Compositional Recursion
Problem 24 – Using Tables CURVE and NONLIN
Add a new crude called NCR (New Crude) to the Training Class Model with the following assay
yields:
Volume Yield Weight Yield
NC1 .0000 .0000
NC2 .0000 .0000
NC3 .0008 .0005
IC4 .0011 .0007
NC4 .0087 .0058
LN1 .0571 .0441
MN1 .1426 .1225
HN1 .0481 .0434
LD1 .1442 .1344
HD1 .0998 .0972
LV1 .2162 .2263
HV1 .0521 .0564
VR1 .2293 .2687
Assume that NCR crude is processed on both crude units in the model. The whole crude
properties of NCR are: API = 30.2 and SUL = 2.01 wt%. The properties of the cuts may be
assumed to be the same as ARL (Arab Light). This crude is available for $19.50/BBL and we
may purchase up to 20,000 B/D. Using Table Case set up a case stacking run to evaluate
increments of 0 to 10,000 Bbls/Day and 10,000 to 20,000 Bbls/Day.
What is the break-even value of an average barrel in the first 10,000 Bbl/Day increment? What
does “break-even value” mean?
What is the break-even value of an average barrel in the last 10,000 Bbl/Day increment?
Why are the break-even values of an average barrel in the first and last 10,000 Bbl/Day
increments different?
What is the break-even value of an average barrel in the full 20,000 Bbl/Day increment?
MTBE is available for gasoline blending in all grades of gasoline. We would pay transportation
costs of $.84/BBL. Current law allows us to blend up to 2.7 WT% Oxygen (OXY). Be sure this
limit is in the model.
If we buy MTBE for gasoline blending what price should we pay for it?
DO NOT put a lower WT% oxygen spec in the model. (Gasoline blends can go down to 0 WT%
oxygen.
Extra Credit:
Run a third case that limits MTBE to 10 volume percent maximum in any blend.
Problem 4 – Evaluating a New Product
Be sure you run TR.BAT in the class problem model before starting if you want to start from a
clean model or CP3.BAT to start from the end of Class Problem 3. If you set up Class Problem
3 correctly do not run any batch files, just proceed with Class Problem 4.
Our company management is considering going into the Mid-Grade Unleaded gasoline market.
This would be an 89 (R+M)/2 octane unleaded gasoline (U89). All blend specs would be the
same as Unleaded Regular except the octane. Keep Unleaded Premium and Leaded Regular
volumes constant at 30,000 B/D and 5,000 B/D respectively. Add U89 (Mid-Grade Unleaded) to
the model and do an economic evaluation on a demand of 5,000 B/D.
How does this compare to a demand of 5,000 B/D of a High Octane Premium gasoline (another
potential new product) with an octane of 93 (R+M)/2 Road Octane (U93)?
Assume MTBE is available for blending up to 2.7 wt% oxygen of any blend and the cost is
$30.24 including transportation.
Which product should we make, if any? What is the annual profit from each product?
Problem 4 may need MTBE for blending these higher octane grades of gasoline. MTBE
blending data is supplied in Class Problem 3 except that we now have a price for MTBE of
$30.24/Bbl.
Extra Credit:
Assume we have modified Tables BUY and CAPS in the SAMPLE model to reflect the
following:
TABLE BUY MIN MAX
ARL 1.0 1.0
ANS 0.0 0.0
BAC 0.0 0.0
How much LV1 and HV1 are produced? What are their respective SUL and AFC properties?
Feed both LV1 and HV1 to the Cat Cracker, SCCU. Assume no DCG is fed to SCCU. How
much AR2 will be fed to the SCCU?
Use severity based on 975 °F and DO NOT IGNORE YIELD ADJUSTORS FOR SUL, AFC,
and BNT. How much LCN and HCN will be produced from SCCU and what is its weight
percent sulfur for each? What is the total Cat Gasoline produced LCN and HCN? Sulfur is
related to charge via PCALC table that has not been discussed yet.
What would the total Cat Gasoline production be if there were no yield adjusters?
Hint: Setup the spreadsheet as shown below -- SUL and BNT are WT based
properties.
Our marketing department has discovered a gas oil stream that is available. We pay
transportation costs of $.84/BBL and we can buy up to 6,500 B/D. Use tag PGO for the
Purchased Gas Oil Cat Cracker feedstock. The properties of PGO are:
API SPG SUL AFC
27 .8927 2.2 32
For weight based models remember to add SPV (Specific Volume) which is 1 divided by the
Specific Gravity (1/SPG).
Assuming we have excess Cat and Alky capacity, Marketing wants to know what the value of
this material is to our refinery in $/Bbl?
Extra Credit:
There is another process unit which is limiting the FCC throughput. What is it? Remove the
limit and re-evaluate the purchased Cat feedstock.
The refinery down the street has had a fire in their Alkylation Unit and it will be shut down for
several weeks. While talking to our marketing department they have asked if we would be
interested in buying 500 Bbl/Day of a butane stream for processing in our Alkylation Unit.
Transportation costs would be $.84/BBL. Use PC4 for the Purchased C4 stream tag. The
composition of PC4 is:
Component Composition
Propylene (C3=) 3%
Butylene (C4=) 44%
Propane(NC3) 5%
Isobutane (IC4) 22%
Normal Butane (NC4) 26%
Since we have excess Alky capacity (increase maximum in Table CAPS to 100 MB/D),
Marketing wants to know what we should pay or offer them for this feedstock?
Extra Credit:
There is another process unit which is affecting the value of this material because it is at its
upper limit. What is the process unit? Remove the limit and re-evaluate the purchased alky
feedstock.
Problem 8 – Evaluating a New Process Unit (C5/C6 Isom)
Be sure you run TR.BAT in the class problem model before starting.
Add a C5/C6 Isomerization unit to the class model and blend the isomerate product to gasoline.
Gasoline blending properties of Isomerate are:
RON MON DON R11 M11 D11 SPG SUL RVP
wt% psi
83 81 82 96 94 95 .684 .0 12
Distillation Data
PERCENT OFF AT: 160 210 230 330 DEGF
100 100 100 100 VOL%
Using Table SISO (C4 Isom) as a pattern, convert it to Table SC56. (Note: Table SISO is still
part of the model.). Assume product yields as well as consumption of hydrogen and utilities are
the same as in Table SISO. Feed to the C5/C6 Isom is LN1 (LT ST Run Gasoline). The Isom
product tag is C56 (C5/C6 Isomerate).
Create a submodel SC56 and create blendstock C56 and don't forget capacity limits (and SPV
for weight based models).
Note: Retrieve file SISO.WK1 and save it immediately as SC56.WK1 before
attempting any changes.
Extra Credit:
Assuming a 20 year project life, $820/feed throughput, and $2,000,000 offsite investment
calculate the Internal Rate of Return, the Payout in years, the Number of Times Investment
Returned and Total Cash Generated over the life of the project.
Retrieve Table SCCU and immediately save it as Table SCFP. Using Table SCFP remove all
columns except LV1, HV1, DCG, AR2, and PGO (Purchased Gas Oil, if it exists in your model).
Also remove all rows except VBALLV1, VBALHV1, VBALDCG, VBALAR2, and VBALPGO
(Purchased Gas Oil, if it exists in your model). Create a recursed pool called CFP (VBALCFP
and RBALCFP) and recurse on the properties AFC, SUL, and SPG.
Revise Table SCCU so that CFP is the only feedstock to the unit. This is done by: first,
renaming column LV1 to CFP and removing columns HV1, DCG, AR2, and PGO (if it exists in
your model) and second, renaming row VBALLV1 to VBALCFP and removing rows
VBALHV1, VBALDCG, VBALAR2, and VBALPGO (if it exists in your model).
Don't forget to relocate the control row LAR2CCU from SCCU to SCFP. Do not remove the
recursion pool CCF from Table SCCU.
Determine the value of the intermediate stock “CFP” in increments of 10,000 Bbl/Day, 20,000
Bbl/Day, 30,000 Bbl/Day and no Cat Cracker capacity available (all “CFP” will go to sales).
This value can be determined by selling “CFP” at the levels mentioned above.
Extra Credit:
Add P-Rows to Table SCFP to report the percent AR2 in the total feed and the percent ratio of
AR2 to the gas oil feeds.
Problem 10 – Adding a New Process Unit (Cat Feed
Hydrotreater)
The starting point for this problem is the end of Class Problem 9. Therefore, execute the batch
file CP9.BAT or work Class Problem 9 before starting.
Add a Cat Feed Hydrotreater to the class model. The feed to the hydrotreater is CFP, Cat Feed
Pool, created in Class Problem 9. Untreated gas oil cannot by-pass the hydrotreater. There will
be 90% sulfur removal from the feed.
Using Table SDHT as a pattern, convert it to Table SFHT (Cat Feed Hydrotreater). (NOTE:
Table SDHT is still part of the model.) Assume consumption of hydrogen and utilities and the
yield of all products are the same as Table SDHT. Run a case to be sure this structure works
properly. Use tag HCF as the Hydrotreated Cat Feed.
Sulfur properties of CCG, CCD, and CCS will continue to be PCALC'd from CCF.
Don’t forget to add column SFHTSUL to Table BOUNDS as a free vector. This is the delta-
based sulfur shift vector which adjusts yields based on the sulfur content of the feed pool.
Extra Credit: Modify the model so that the Cat feed material can go through the SFHT unit as
well as bypass it to get to the Cat Cracker and set a maximum limit of 1 wt% sulfur in the feed
to the Cat Cracker.
A new crude/vacuum (SCR3) unit has been approved and is under construction. This new unit
will be starting up next month. We need to add it to our current refinery model. This new
crude/vacuum unit will replace our two existing crude units and our existing vacuum unit. Do
not remove SCR1 or SCR2 from the model in case management wants to start one or both of
them up at some later date. The capacity of Crude Unit 3 (SCR3) is 130,000 Bbls/Day and the
capacity of the new vacuum unit is 70,000 Bbls/Day. Their utility consumption is:
Atmos Tower Fuel, MMBTU/Bbl 0.0209
Atmos Tower Electricity, KWH/Bbl 0.3966
Atmos Tower Steam, MLBS/Bbl 0.0032
With this new crude unit we will be able to run a more economical crude slate. There are eight
additional crudes in Table ASSAYS beginning in column “H”. Delete columns “F” and “G”
from Table ASSAYS and these additional crudes will become available to the model. Pricing
for these crudes is as follows:
API COST
ARH SAUDI ARABIAN HEAVY 28.1 $17.85
TJL TIA JUANA LIGHT 31.7 $18.55
KUW KUWAIT EXPORT 36.4 $18.15
IRL IRANIAN LIGHT 34.1 $18.50
IQK IRAQI KIRKUK 36.8 $18.30
MIN MINAS 35.3 $19.00
FOR FORCADOS 37.2 $18.90
NIG NIGERIAN LIGHT 35.0 $18.95
Map all crudes to SCR3 and determine the best crude slate for our new refinery configuration.
Compare this new crude slate to our current crude slate economically. (Run two cases. Case 1 is
current operation without SCR3. Case 2 is new operation with SCR3 but no SCR1 or SCR2.)
Atmos Tower Bottoms from SCR3 cannot go to the Cat Cracker (SCCU) or to ATB sales. In
Table CRDCUTS segregate HN3, AR3, LV3, HV3, and VR3. Everything except HN3 can go
to blending in Table BLNMIX, the LV3 and HV3 can go to the Cat Cracker (SCCU) and the
VR3 can go to the Delayed Coker (SDCK).
Intermediate PIMS Training Class Problems
The following problems are not additive. When putting a constraint in to solve a problem,
remove it to solve the next one. Remove any purchase or sales constraints that may inhibit the
solution and solve the model to be sure the added constraints work correctly.
1. Add structure to the class model that will ratio the unleaded premium gasoline sales to
unleaded regular gasoline sales. The ratio should be 25% UPR and 75% URG.
2. Add structure to the class model that will ratio total gasoline sales to 60% unleaded regular
sales (URG), 25% unleaded premium sales (UPR), and 15% leaded regular sales (LRG).
3. Add structure to the class model that will limit total gasoline sales to 60,000 B/D.
4. Add structure to the class model that will limit the total crude charge to 90,000 B/D.
5. Add structure to the class model that will limit the heavy distillate (HD1) draw on crude unit
1 (CR1) only to 9,000 B/D.
6. Add structure to the class model that will limit reformer severity to 99.5 RONC.
7. Add structure to the class model that will limit crude unit atmospheric resid (AR2) to a
maximum of 2% of the total feed to the Cat Cracker (SCCU).
1. Add P-ROW structure to calculate and report the average sulfur content of the crude charge
to each crude unit in the class model. Also report the average specific gravity of the crude
charge to each crude unit.
2. Add P-ROW structure to the Alky Unit submodel (SALK) to report the composition of the
feed stream. Do not include the extra isobutane brought in to react with the olefins.
3. Add P-ROW structure to the Cat Cracker submodel (SCCU) to report the percent AR2 in the
feed stream. Also report the percent AR2 ratio to the other gas oil feed stocks.
4. Add P-ROW structure to the Reformer submodel (SREF) to report hydrogen production in
MSCF/Bbl (volume based models) or M3/MeT (weight based models) of naphtha feed.
Hydrogen has 20.092 MSCF/FOEB (414.9095 SCF/MeT or 11.76 M3/MeT).
5. Add P-ROW structure to the Diesel Hydrocracker submodel (SDHC) to report hydrogen
consumption in MMSCF/Bbl (volume based models) or M3/MeT (weight based models) of
feed. Hydrogen has 20.092 MSCF/FOEB (414.9095 SCF/MeT or 11.76 M3/MeT).
6. Add P-ROW structure to Table BLNSPEC that will report the Research Octane (RON) and
the Motor Octane (MON) of all gasoline blends.
7. Add P-ROW structure to Table BLNSPEC that will report the specific gravity (SPG) of all
blends that do not have a specific gravity specification.
Problem 14 – Adding Swing Cut Capability
Be sure you run TR.BAT in the class problem model before starting.
Add swing cut capability to the Cat Cracker (SCCU) that will allow the back end of the current
Cat Gasoline cut (CCG) (C5-430°F) to swing down into the Light Cycle Oil cut (CCD). The
Light Cat Gasoline (LCN) will be a C5–350°F cut and the swing cut Heavy Cat Gasoline (HCN)
will be a 350–430°F cut. Assume yield of the current CCG is split 90% to LCN and 10% to
HCN, PCALC the sulfur of CCF to LCN and HCN using .08 and .16, respectively..
Note: CCG and CCD are still the final product streams from the cat cracker (SCCU)!
Create streams LCN, HCN, and LCO that will yield into and recurse into CCG and CCD. LCN
will be 90% of the current VBALCCG yield, HCN is a swing cut that is 10% of the current
VBALCCG yield, and LCO is the current yield of VBALCCD.
Allow the Light Cycle Oil (CCD) that is produced to be a blend stock to diesel fuel (DSL) as
well as a feed stock to the Hydrocracker. Resolve any multiple path problems created
The distillate properties of the Light Cycle Oil cut 430+°F (CCD) are:
SPG API POUR PT VISCOSITY CBI KFC
.8702 31.1 7 DEGF 20 cSt @ 122F 38 11.91
Add the P-ROW structure that will report the cut point temperature and Cat Cracker conversion.
Cat Cracker conversion is calculated as 100 minus Light Cycle Oil yield (CCD) in percent minus
Cat Slurry Oil yield (CCS) in percent.
Run a case to force a 350F cat gasoline end point and another case to force a 430F cat gasoline
end point.
After obtaining gas chromatography information from the plant lab, we discovered the saturate
(SSGP) and unsaturate (SUGP) gas plant streams are not 100% pure.
The SAT gas plant streams have the following percent compositions:
Gas Plant Product Stream (LP Hydrocarbon Type
Stream)
===================== ==========================
FGS NC3 IC4 NC4 TOTAL
FUEL GAS (NC1 and NC2) 97 3 100
PROPANE (NC3) 97 3 100
ISOBUTANE (IC4) 4 90 6 100
NORMAL BUTANE (NC4) 5 95 100
The UNSAT gas plant streams have the following percent compositions:
Gas Plant Product Stream (LP Stream) Hydrocarbon Type
============================= =========================
FGS NC3 C3= IC4 NC4 C4= TOTAL
FUEL GAS (UC1, UC2, and U2=) 97 3 100
UNSAT C3 MIX (C3M ) 25 69 6 100
UNSAT C4 MIX (C4M) 1 4 31 15 49 100
Using the above information, model these recoveries in the SAT (SSGP) and UNSAT (SUGP)
gas plant models. Run the model to be sure it still works.
Special Note: Do not build a completely rigorous structure. Simply use the above compositions
to shift material from one material balance row to another.
Problem 16 – Error and Warning Message Resolution
There is a directory on your computer called INTER. This directory has several compressed
models that have various error and warning messages which appear when a PIMS validation
summary report is produced or when the matrix is generated. The model names are INT0, INT1,
INT2, INT3, INT4, INT5, INT6, INT7, INT8, INT9 and INT10. They will uncompress
themselves if you type their name at the DOS prompt or execute their batch file through the
Windows File Manager. For example at the DOS prompt
C:\PIMS\INTER>
type INT0 and the INT0 model will uncompress itself. Or, using the Windows File Manager
double click on the INT0.BAT file and the INT0 model will uncompress itself. Likewise for the
other models.
Using these models, eliminate the error and warning messages, or understand what is causing
them, and decide whether or not they are acceptable.
If you want to take a copy of these models home with you copy the INT?.BAT and INT?.EXE
files to a diskette. They will require two diskettes.
C:\PIMS\INTER>
type INTA and the INTA model will uncompress itself. Or, using the Windows File Manager
double click on the INTA.BAT file and the INTA model will uncompress itself. Likewise for
the other models.
1. In the model named INTA there is blending data missing. Find out what it is.
4. In model INTD, there is a material out of balance. Find out what it is and where the out of
balance appears in the various PIMS reports.
5. When model INTE is solved, it aborts after the first solution complaining about an
"Unbounded Solution". What is an "Unbounded Solution" and what is causing it in model
INTE?
If you want to take a copy of these models home with you copy the INT?.BAT and INT?.EXE
files to a diskette.
Advanced PIMS Training Class Problems
After a corrosion survey on Crude Unit 1 (SCR1), it was found that the unit was dissolving itself.
Funds are not available for a shutdown and stainless steel cladding of the unit. Operations
dictates that the sulfur content of the crude charge to the unit will not exceed 1.10 WT% at any
time.
Build the matrix structure into the class model that will limit the crude sulfur to no more than
1.10 WT% on SCR1 only. Note that sulfur blends by weight and you do not have direct access to
Table SCR1.
Provide a cost curve for sulfur content limits using 1.10, 1.20, 1.30, and 1.40 WT% and plot
against M$/day net revenue.
To get to the proper starting point execute file CP11.BAT in the directory TV if you are using
the volume based model or the directory TW if you are using the weight based model.
Set all capacities except crude and vacuum units to be non limiting. Open sales of LPG, URG,
JET, DSL, HSF, CKE, and SUL to non limiting as well. Set the sale of UPR to 60,000
Bbls/Day, LRG to 5,000 Bbls/Day, LSF to 0 Bbls/Day, and ATB to 0 Bbls/ Day.
Extra Credit:
Resolve the warning message that appears in the iteration log (ITLOG.LST).
Problem 20 – Using Deferred Crude Cuts (Naphtha Splitter)
Be sure you run TR.BAT in the class problem model before starting.
Because of flooding in the naphtha fractionation section of the crude units and the distillation
overlap between Light and Heavy Straight Run Naphthas Management has approved the
construction of a new naphtha splitter.
Construction on the naphtha splitter is complete and start up is scheduled for next month. The
new splitter is located at the Naphtha Hydrotreater Unit which is outside the crude unit battery
limits. Therefore, we have to change our refinery LP to reflect a Full Range Naphtha draw from
the crude units. This Full Range Naphtha, which includes the Light and Heavy Straight Run
Naphthas, goes to the new naphtha splitter where it is fractionated into LSR and HSR.
Combine the LN1 (LSR) and MN1 (HSR) naphtha crude cuts in Table ASSAYS into a full range
naphtha cut (FN1) and add structure to the model that will simulate the new naphtha splitter
(Table SNSP) downstream of the crude unit. Maintain the swing cut capability of the heavy
naphtha cut (HN1) and produce LN1 and MN1 at the naphtha splitter. Run the model to be sure
the structure works correctly. Ignore utilities for the splitter SNSP but include a capacity
constraint.
Our model needs to keep track of where hydrogen and sulfur are being produced and consumed
in the refinery. Therefore:
1. Put a hydrogen balance in the model that reports the hydrogen production and consumption in
MSCF/D. The balance should be reported in Table SHMP (Hydrogen Manufacturing Plant).
The tags for hydrogen in our model are HYL for low purity hydrogen and HYH for high purity
hydrogen.
2. Put a sulfur balance in the model that reports the sulfur produced from each of the process
units that produces H2S (Hydrogen Sulfide). This should total to the sulfur recovered at the
Sulfur Recovery Unit (Table SSRU). This balance should be reported in long tons (LTONS) for
volume based models and metric tons (MeT) for weight based models. Place the balance in
Table SSRU.
Extra credit:
3. Include in the sulfur balance the sulfur that went out with the blended products in the
appropriate LTONS or MeT units.
4. Compare the accounted for sulfur in number 3 above to the total sulfur coming into the
refinery in the crude oil. In other words, capture the tons of sulfur in the crude oil and include it
in the sulfur balance.
Problem 22 – Multiple Path Resolution
Be sure you run TR.BAT in the class problem model before starting.
We would never think of doing this to our real refinery model but just for practice add Delayed
Coker Naphtha (DCN) as a feedstock to the Reformer Feed Pool (Table SRFP).
Resolve the multiple path warning message created by this change and explain what caused it.
After a careful review of our refinery model we have discovered an error in the way we have
modeled the Unsat Gas Plant. Currently, we allow the PP Mix (C3M) and BB Mix (C4M) to go
to the Plant Fuel System (SPFS) as separate streams. In fact, if the C3’s and/or C4’s go to the
plant fuel system the entire cat cracker main fractionator (MF) overhead stream plus the Delayed
Coker unsaturated gases must go as one stream. Change the model so that the Unsaturated
Gases have the option of going to fuel (SPFS) or the Unsat Gas Plant (SUGP). This will require
that you recurse on the composition of the Unsaturated Gas Stream (UGS). The current and
actual flow diagrams appear below.
Further test runs on our Cat Cracker Unit have resulted in a more definitive relationship between
the amount of Atmos Resid we can process on the Cat and the amount of gas oil feed to the unit.
Currently, we have a control row in Table SCCU to limit the Atmos Resid to less than 5% of the
total gas oil feed to the unit. This limit prevents too much carbon from entering the Cat
regenerator from the vacuum resid portion of the Atmos Resid. High levels of carbon would
cause excessive heat which the regenerator is not designed to handle.
The data obtained from the plant reveals the following relationship:
100.0
AR % of Gas Oil
80.0
60.0
40.0
20.0
0.0
0 20 40 60
Gas Oil Feed, MB/D
Add this relationship to the training class model. Include PROWS to report the Atmos Resid to
Gas Oil ratio in percent. Run the model to be sure it works properly.
Extra Credit:
Put structure into the model that will allow AR1 (SCR1 Atmos Resid ) to be processed on the
Cat Cracker Unit (SCCU) as well as AR2 (SCR2 Atmos Resid ). Include AR1 in the above
relationship. AR1 has an Aromaticity Factor (AFC) of 25.4.
The 90 Day Forecast covers three months: May, June, and July.
Pricing, $/Bbl:
MAY JUNE JULY
SAUDI ARABIAN LIGHT 18.00 18.50 18.50
ALASKAN NORTH 18.25 18.25 18.50
SLOPE
BACHAQUERO 17.00 17.00 17.00
NORMAL BUTANE 18.90 19.32 19.32
We have to run a minimum of 40,000 B/D SAUDI ARABIAN LIGHT, 20,000 b/d ALASKAN
NORTH SLOPE, and 1,000 B/D BACHAQUERO.
Management wants to maintain 7 days crude supply in inventory (including tank bottoms) for
our 100,000 B/D refinery. Therefore, we need to target for 700,000 barrels of total crude
inventory. Since our crude levels are low at the moment, how should we build crude inventory
over the next 3 months?
The Hydrotreaters and Reformer turnarounds are fixed and cannot be moved. However, our
Maintenance Manager indicates the FCCU/ALKY and the Hydrocracker turnarounds can be
reversed. In fact, although one of the turnarounds must start on March 18 the other turnaround
can start May 1st or June 1st. Which turnaround should we take first and when should the second
turnaround start?
All components are available to blend into all products. Blend all remaining components into
FIN in the final period to ensure good blending components are left in inventory.
Inventories
OPEN MIN MAX HCOST PCOST
UPR 60 0 90 0 0
MID 20 0 300 0 0
URG 50 0 150 0 0
NC4 0 0 30 0 0
RFT 90 0 180 0 0
LCG 85 0 90 0 0
HCG 45 0 90 0 0
ALK 40 0 60 0 0
LNP 10 0 40 0 0
ISO 15 0 40 0 0
MTB 50 0 60 0 0
HCL 50 0 90 0 0
During optimization, this model should go infeasible. Can you determine why the model is
infeasible?
Problem 107 – Using Unfeasibility Breakers
Add unfeasibility breakers to model BLEND. Run the model and view the results. Have the
unfeasibility breakers been used? If so, identify why this model is still infeasible and correct the
situation.
Compare the blender activities for all three cases, REPORT, REPORT1 and REPORT2.