0% found this document useful (0 votes)
67 views134 pages

PPIMS Training Manual Part1

The document is a training manual for the Process Industry Modeling System (PIMS), detailing course outlines for essential, intermediate, and advanced training levels. It covers various topics including linear programming concepts, refinery economics, planning, and capital investment appraisal, along with specific training class problems. Additionally, it provides insights into PIMS data tables, reports, and modeling techniques relevant to the process industry.

Uploaded by

nidhi.bawa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views134 pages

PPIMS Training Manual Part1

The document is a training manual for the Process Industry Modeling System (PIMS), detailing course outlines for essential, intermediate, and advanced training levels. It covers various topics including linear programming concepts, refinery economics, planning, and capital investment appraisal, along with specific training class problems. Additionally, it provides insights into PIMS data tables, reports, and modeling techniques relevant to the process industry.

Uploaded by

nidhi.bawa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 134

Process Industry Modeling System

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

Linear Programming Concepts 11


General.............................................................................................................................. 11
Definition............................................................................................................. 11
An LP is a set of simultaneous linear equations:...................................................11
An example of a very simple refinery LP model:..................................................12
Constraints (Rows, Equations)............................................................................................ 13
Variables (Columns, Vectors).............................................................................................13
Right Hand Sides (RHS).................................................................................................... 14
Ranges............................................................................................................................... 14
Bounds............................................................................................................................... 14
Matrix Coefficients............................................................................................................ 14
Problems With LP.............................................................................................................. 15
Additive Concentration vs. Response....................................................................15
Synergism or Antagonism.....................................................................................15
Yield Loss Over Time..........................................................................................16
Column Arithmetic...............................................................................................16
Stream Properties vs. Operating Conditions..........................................................16
Pooling of Streams...............................................................................................17
LP Accuracy......................................................................................................... 17
Shadow Pricing.................................................................................................................. 18
Pi Values (i) Apply to Rows............................................................................................. 18
DJ’s (j) Apply to Columns................................................................................................ 18

PIMS Row/Column Types 21


PIMS Model Row Types.................................................................................................... 21
PIMS Model Column Types...............................................................................................22

PIMS Computer Configuration 25


Overview........................................................................................................................... 25

PIMS Data Tables and Reports 29

PIMS Process Industry Modeling System Contents  i


Required Tables................................................................................................................. 29
Other Supply/Demand Tables............................................................................................. 29
Crude Distillation Tables................................................................................................... 29
Blending Tables................................................................................................................. 29
Submodel Tables................................................................................................................ 30
Recursion Tables................................................................................................................ 30
Miscellaneous Tables......................................................................................................... 30
System Created Spreadsheets............................................................................................. 30
Internal Tables (Will appear in Validation.LST if listed in Table PRNTABS)....................31
Matrices and Reports.......................................................................................................... 31

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

Delta Based Modeling 61


Overview........................................................................................................................... 61
The Delta Based Driver Mechanism.....................................................................62
Delta Based Data.................................................................................................. 65
Multiple Shift Vectors In The Same DBM............................................................66

P-PIMS PIMS Multi-Period Option 69


Overview........................................................................................................................... 69
P-PIMS Data Input............................................................................................... 69
BLNSPEC............................................................................................................ 70
BOUNDS............................................................................................................. 70
Other P-PIMS Tables............................................................................................ 70
PERIODS............................................................................................................. 71
PINV.................................................................................................................... 72
PSPAN................................................................................................................. 74
RECURSE............................................................................................................ 75
RFORMAT.......................................................................................................... 75
ROWS.................................................................................................................. 78
Distributive Recursion in P-PIMS......................................................................................78
Executing PPIMS............................................................................................................... 79
Report Writing................................................................................................................... 80
P-PIMS Case Stacking..........................................................................................82
P-PIMS Row and Column Naming Conventions...................................................83

PIMS Training Class Problems 86


List of PIMS Class Problems..................................................................................2
PIMS Training Class Problems...............................................................................3
PIMS and PPIMS Training Class Problems Flow Diagram.....................................4
Essential PIMS Training Class Problems..............................................................................5
Problem 1 - Matrix Arithmetic...............................................................................5
Problem 2 – Evaluating a New Crude.....................................................................6
Problem 3 – Evaluating a Gasoline Blendstock.......................................................7
Problem 4 – Evaluating a New Product...................................................................8
Problem 5 – More Matrix Arithmetic......................................................................9
Problem 6 – Evaluating a Cat Cracker Feedstock..................................................10

ii  Contents PIMS Process Industry Modeling System


Problem 7 – Evaluating an Alky Feedstock...........................................................11
Problem 8 – Evaluating a New Process Unit (C5/C6 Isom)...................................12
Problem 9 – Creating a Cat Feed Pool..................................................................13
Problem 10 – Adding a New Process Unit (Cat Feed Hydrotreater).......................14
Problem 11 – Adding a New Crude and Vacuum Unit..........................................15
Intermediate PIMS Training Class Problems......................................................................16
Problem 12 – Using Matrix Control Rows & Bounds............................................16
Problem 13 – Using Submodel Parameter Rows (P-ROWS)..................................17
Problem 14 – Adding Swing Cut Capability.........................................................18
Problem 15 – Gas Plant Recoveries......................................................................19
Problem 16 – Error and Warning Message Resolution..........................................20
Problem 17 – Obtaining Information from PIMS Reports.....................................21
Advanced PIMS Training Class Problems..........................................................................22
Problem 18 – Implementing Crude Unit Limits....................................................22
Problem 19 – Same Crude Mix to Multiple Crude Units.......................................23
Problem 20 – Using Deferred Crude Cuts (Naphtha Splitter)................................24
Problem 21 – Reporting Hydrogen and Sulfur Balances........................................25
Problem 22 – Multiple Path Resolution.................................................................26
Problem 23 – Compositional Recursion................................................................27
Problem 24 – Using Tables CURVE and NONLIN...............................................28
Multi-Period PIMS (PPIMS) Training Class Problems........................................................29
List of Multi-Period PIMS (PPIMS) Class Problems.............................................29
Problem 101 – Short Range Planning....................................................................30
Problem 102 – Short Range Planning....................................................................32
Problem 103 – Short Range Planning....................................................................33
Problem 104 – Long Range Planning....................................................................34
Problem 105 – Long Range Planning....................................................................35
Problem 106 – Multi-Period Gasoline Blending....................................................36
Problem 107 – Using Unfeasibility Breakers.........................................................38
Problem 108 – Analyzing Blend Results...............................................................39
Problem 109 – Analyzing Blend Results II...........................................................40
Problem 110 – Using Blend Target Recipes..........................................................41

PIMS Process Industry Modeling System Contents  iii


PIMS Course Outlines

Essential PIMS Training


I. Linear Programming Concepts
II. PIMS – Process Industry Modeling System
A. PIMS Menu Options
B. PIMS Reports
1. Validation Summary (PIMSVS.LST)
2. Iteration and Recursion Log (ITLOG.LST)
3. Summary Report (SOLUTION.LST)
4. Full Report (REPORT.LST)
5. MPSPROB
6. Matrix Listing Report (MATRIX.LST)
7. Model Documentor Report (MODEL.LST)
C. PIMSHELP
D. PIMS Model Building
1. Overview of PIMS Training Class Problem
2. Crude Distillation
3. Product Blending
4. Submodel Process Units
5. Distributive Recursion
6. Delta Based Modeling
III. Class Problems

PIMS Process Industry Modeling System PIMS Course Outlines  1


Intermediate PIMS Training
Objective: Understand and learn how to build PIMS LP
structure.
I. Tools
A. Tools for debugging what you build
1. PIMS Validation Summary - PIMSVS.LST
2. WARN.LST
3. CPLXWARN.LST
4. MPSPROB and MPSPROB.BCD
5. MATRIX.LST and MATBCD.LST
6. Pre-Solve without a basis
7. Unbounded Solution
B. Tools for analyzing what you build
1. Iteration log - ITLOG.LST
2. Primal/Dual Solution Report - PRIMAL.LST
3. Solution Summary Report - SOLUTION.LST
4. Full Report - REPORT.LST
5. SMALL.LST
6. CASERW

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

IV. Class Problems

V. Needs
A. Client Modeling Problems
B. Specific Client PIMS Problems

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 2


Advanced PIMS Training
I. Class Discussion and Problems
A. Distributive Recursion (DR)
1. Goal
2. Topics
B. More Distributive Recursion
1. Goal
2. Topics
C. Multiple Paths
1. Goal
2. Topics
D. Deferred Cuts
1. Goal
2. Topics
E. Infeasibilities
1. Goal
2. Topics
F. Blending
1. Goal
2. Topics
G. Capital Investment Modeling
1. Goal
2. Return on Investment
3. Cost of Capital
4. Net Present Values
5. Discount Factors
6. Internal Rate of Return
7. Capital Cost Curves
8. Capital Costs Inside LP Model
H. Post Optimal Analysis
1. Goal
2. Topics

PIMS Process Industry Modeling System PIMS Course Outlines  3


Multi-Period PIMS
I. PPIMS Tables
A. Table PERIODS
B. Table PINV
C. Table RFORMAT, ET.AL.

II. PIMS Tables With Time Varying Considerations


A. Table BUY
B. Table SELL
C. Table UTILBUY
D. Table UTILSEL
E. Table CAPS
F. Table BLNSPEC
G. Table BOUNDS
H. Table ROWS
I. Table PDIST
J. Table PGUESS

III. Distributive Recursion In PPIMS

IV. The PPIMS Matrix

V. PPIMS Reports
A. Across the Page
B. Down the Page
C. Solution Summary Report
1. Spreadsheet
2. ASCII File

VI. Refinery Planning Applications


A. Long Range (4 months and more)
1. Budgets
2. Capital Investments
3. Turnaround Planning
B. Short Range (3 months and less)
1. 90-day Forecast
2. Turnaround Planning
C. Class Problems

VII. Blending Applications


A. Gasoline
B. Distillates
C. Fuel Oils
D. Class Problems

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 4


Fundamentals of Refinery Economics and Analysis
I. The Cost Concept
A. Fixed Costs
B. Variable Costs
C. Average Costs
II. Methods and Procedures
A. Back of Envelope
B. Lotus Worksheets
C. LP-Based Economics
III. PI Values and DJ’s
IV. Crude Oil Valuation
A. Crude Assay Data
B. Ideal Crude Slate
C. Optimum Crude Mix
D. Substitution Analysis
E. Incremental Costing
V. Break-even Analysis
A. Intermediate Feedstock
B. Component Blendstock
VI. Product Costing
A. Incremental Analysis
B. Quality Giveaways
VII. Capital Budgeting Decisions
A. Return on Investment
B. Cost of Capital
C. Net Present Values
D. Discounted Cash Flows
E. Capital Costs Inside LP Model
VIII. Class Problems

PIMS Process Industry Modeling System PIMS Course Outlines  5


Planning and Economics of Refinery Operations
I. Refinery Processes
A. Overview Of Major Refinery Process Units
B. Feed And Product Streams
C. Constraints And Cost Of Operations
D. Refinery Upgrading Options
II. Refining Economics
A. Concepts Of Product Value/ Gross Product Worth
B. Calculation Of Crude Value
C. Spreadsheet Case Study
III. Crude Oil Scheduling
A. Manual
B. Spreadsheets
IV. Unit Programming
A. Programming Flows Of Process Streams
B. Presenting And Analyzing Detailed Programs
C. Reacting To Unplanned Events
V. Product Blending/LP Applications
VI. Product Scheduling
A. Critical Parameters
B. Introduction To PC Based Software (PSS)
VII. Organization and Control
A. Overview Of Production Planning Process
B. Performance Monitoring And Control
C. Preferred Organizational Structures

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 6


Capital Investment Appraisal
I. Reasons For Investment
A. Enhance Profitability
B. Meet Operating Constraints
II. Study Basis
A. Required Parameters
B. Data Gathering
III. Types Of Investment
A. Grass Roots
B. New Process Units
C. Debottlenecking
IV. Modeling Techniques
A. Stock Balance Implications
B. Changes In Operating Costs
V. Cost Estimation
A. Basis For Cost Estimation
B. Data Requirements
C. Types Of Estimates
VI. Financial Evaluation
A. Outside LP Model
B. Inside LP Model

PIMS Process Industry Modeling System PIMS Course Outlines  7


Gasoline Blending Seminar
I. Gasoline Markets
A. USA
B. Europe
C. Pacific Rim

II. Gasoline Blendstocks


A. Product Specifications
B. Laboratory Testing Procedures
C. Impact Of Reformulated Gasoline
D. Auto/Oil Task Force
E. Clean Air Act

III. Blending Theory Fundamentals


A. Nomenclatures
B. Blending Anomalies
C. Predictive Equations
D. Blending Values

IV. Use Of Oxygenates


A. Types
B. Advantages/Disadvantages

V. Octane Prediction Equations


A. Ethyl
B. DuPont
C. Mobil

VI. Development Of Octane Prediction Equations


A. Octane Study
B. Historical Data
C. Regression Analysis

VII. Blending LP Using PPIMS

VIII. Determine Blend Recipes Via Blending LP

IX. Use Of Blending Optimization And Scheduling


A. Planning Process
B. Use Of Blending LP
C. Alternate Formulations
D. Scheduling Parameters

X. Blending Facilities
A. Types Of Facilities
B. Refinery Operations
C. Alternatives To Knock Engines
D. State-of-the-art Blending Facility

XI. Workshop Problems

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 8


Product Blending Seminar
I. Overview Of Blending Fundamentals
A. Critical Specifications
B. Test Methods
C. Blending Indices
II. PIMS Modeling Structures
III. Gasoline Blending (Conventional)
A. Blending To Critical Specifications
B. Neat Vs. Blending Values
C. Interaction Coefficients
IV. Gasoline Blending (Reformulated)
A. Review Of The EPA Equations
B. PIMS Modeling Structures
V. Distillate And Fuel Oil Blending
A. Blending To Critical Specifications
B. Cold Properties
C. Blending Indices
VI. Blending LP’s
A. Optimum Recipe/s
B. Period Blending LP
C. Inventory Management
VII. Scheduling Considerations
A. Interface Between LP and Scheduling Software
B. PSS Operation
VIII. Workshop Problems

PIMS Process Industry Modeling System PIMS Course Outlines  9


Notes:

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 10


Linear Programming Concepts

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.

An LP is a set of simultaneous linear equations:


+ aX1 – bX2 + cX3 + dX5 = K

– eX1 – fX2 + gX4 – hX5  L

+ iX1 – jX3 + kX4  0

The same problem in matrix form:


X1 X2 X3 X4 X5 RHS
Eq1 +a –b +c +d = K
Eq2 –e –f +g –h  L
Eq3 +i –j +k  0
OBJFN + yy – zz

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.

PIMS Process Industry Modeling System Linear Programming Concepts  11


An example of a very simple refinery LP model:
If we look at an LP matrix typical of many refinery models, it might look something like this:
PURCARL SCR1ARL BLSRURG SELLURG RHS
OBJFN – 20.00 + 30.00  0.0
VBALARL –1 +1  0.0
VBALLSR – .15 +1  0.0
VBALNAP – .25  0.0
VBALDSL – .20  0.0
VBALHSF – .40  0.0
VBALURG –1 +1  0.0
CCAPAT1 +1  94.0
UBALFUL .04  0.0
UBALSTM .16  0.0
XRVPURG – 12 +9  0.0
NDONURG – 71 + 87  0.0

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.

The variables at the top of the matrix represent:


PURCARL = The purchase of Arab Lt. Crude Oil (ARL) at $20.00/BBL.

SCR1ARL = The feed of ARL to crude unit 1 (SCR1).

BLSRURG = The blending of Lt. St. Run Gasoline (LSR) to Unleaded Regular Gasoline
(URG).

SELLURG = The sale of URG at $30.00/BBL.

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.

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 12


Constraints (Rows, Equations)
The constraints of a process can be inequalities as well as equalities. These represent the limits of
operation and are only needed for the optimization step if the constraint will actually be limiting at
some point.

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.

Variables (Columns, Vectors)


These represent the unknowns in the matrix. In an LP there are more unknowns than constraining
rows.

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.

PIMS Process Industry Modeling System Linear Programming Concepts  13


Right Hand Sides (RHS)
The RHS of an equality row will force the activity of the row to be equal to the RHS. The RHS of a
less than or equal to row will set the upper limit of the activity of the row. The RHS of a greater than
or equal to row will set the lower limit of the activity of the row.

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

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 14


gas demand for a refinery through the coefficients in the row and allow the model to produce or
purchase the fuel gas needed to meet that demand.

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:

Additive Concentration vs. Response


This is typically seen when blending TEL into gasoline to improve octane. The response curve lends
itself to a good approximation by utilizing tangents to the response curve, the slopes of which
approximates the response of the blend to the additive.

Additive Concentration vs. Response

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.

PIMS Process Industry Modeling System Linear Programming Concepts  15


Synergism or Antagonism

Yield Loss Over Time


Many process units are reactions which take place over a catalyst. As the catalyst is spent, the yield
from the process unit deteriorates. The LP can only look at one set of yields at a time. If the yield
changes with time, the user must relate that to the LP by updating appropriate yield coefficients. An
example of this behavior is reformer yield loss with catalyst aging.

Yield Loss Over Time

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.

Stream Properties vs. Operating Conditions


Again, in the real world, stream properties are usually dependent on the operating conditions of a
process unit. For instance, in a fractionation operation when the end point of a stream is increased or
decreased, its associated properties change because material from the cut above or below comes into
the stream, bringing with it the properties inherent to that fraction of material.

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 16


Pooling of Streams
In a process LP, many streams are combined to form intermediate streams (pools) which are then
fed to a process unit. The user must supply data for the pooled stream in order for the optimizer to
reach a solution. The user, however, has a problem because he does not know the composition of the
pooled stream until after the optimum solution is reached. Another example from petroleum refining
is the production of alkylate from both C3 and C4 olefins. C3 alkylate has an octane about six
numbers below C4 alkylate, therefore, the problem becomes, “What octane do you put on the
combined alkylate since you don’t know the composition of the olefin feed stream?”

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.

PIMS Process Industry Modeling System Linear Programming Concepts  17


Shadow Pricing

Pi Values (i) Apply to Rows


As a result of the algorithm used to solve a matrix, a number is readily calculated for each row which
is called a Pi value, or shadow price or incremental value. For a material balance row, the Pi value is
the value of the next increment of this material. The size of the increment is indefinite and can range
from an infinitesimal size to a very large increment. The sign on the Pi value is determined by the
sign convention used in the associated row and the sign convention of the objective function. Care
must be taken in analyzing these numbers.

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

DJ’s (j) Apply to Columns


Another number associated with an LP solution and calculated for each column is the DJ, which
represents the change in the objective function value for an incremental change in column activity.

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.

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 18


Notes:

PIMS Process Industry Modeling System Linear Programming Concepts  19


Notes:

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 20


PIMS Row/Column Types

PIMS Model Row Types


Material Balance Type Process Submodel Reporting
(Rows beginning with a "P" are not generated into the matrix.)
WBALxxx  0 PrrrRnn (REMARK)
VBALxxx  0 PprpTnn (or) PrrrTnn (TOTAL)
DBALxxx (Table ASSAYS only) PprpAnn (or) PrrrTnn (AVERAGE)
Specification Blending PprpNnn (or) PrrrNnn (NUMERATOR)
Xprpxxx  0 PprpDnn (or) PrrrDnn (DENOMINATOR)
Nprpxxx  0 Objective Function
Capacity Utilization OBJFN = ª Products Sold*Price - ª Purchases*Cost - ª Utilities*Cost
CCAPccc  RHS Assay Property Inspection Information
(Only found in Table Assays - not generated as a matrix row.)

Utility Balance Iprpxxx


UBALxxx  0
Distributive Recursion
RBALxxx = 0
Rprpxxx = 0
Control
Eprpzzz (or) Euuuuuu = 0
Lprpzzz (or) Luuuuuu  0
Gprpzzz (or) Guuuuuu  0
Note: Default row types may be overridden by the user in Table ROWS or all
VBAL/WBAL rows can be set to equalities by using the FIXBAL option in Table SETUP.

PIMS Process Industry Modeling System PIMS Row/Column Types  21


PIMS Model Column Types
Purchase and Sales
PURCxxx
SELLxxx

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.)

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 22


Notes:

PIMS Process Industry Modeling System PIMS Row/Column Types  23


Notes:

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 24


PIMS Computer Configuration

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

PIMS Process Industry Modeling System PIMS Computer Configuration  25


The VOLRFG model is installed only if the Excel spreadsheet option is chosen. AspenTech PIMS
does not have a Lotus version of this 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.

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 26


Notes:

PIMS Process Industry Modeling System PIMS Computer Configuration  27


Notes:

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 28


PIMS Data Tables and Reports

Required Tables
BUY Defines materials that will be purchased into the plant model
SELL Material that will be sold from the plant model

Other Supply/Demand Tables


UTILBUY Defines utilities that will be purchased or produced by the plant model
UTILSELL Defines utilities that will be produced and sold from the plant model
GROUPS Aggregates materials for purchases, sales, blending, and reporting
ALTTAGS Allows tiered pricing for purchases and sales

Crude Distillation Tables


CRDDISTL Defines estimated crude slates and crude/vacuum capacities and utilities
CRDCUTS Defines crude/vacuum unit cut segregation and type
ASSAYS Defines cut yields and properties for each crude available to the model
UNITS Provides crude oil gravity’s and changes units of measure for other materials
ASSAYLIB Defines multiple Table ASSAYS and maps them to Logical Crude Units
SWING Defines different cutting schemes for multiple crude/vacuum units

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

BLNxxxxx data tables used in the training model

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

System Created Spreadsheets


!Pguess Recursed properties calculated from last solution
!Pguess### !Pguess spreadsheet for each case defined in Table Case

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 30


!Pdist Error distribution coefficients calculated from last solution
!Pdist### !Pdist spreadsheet for each case defined in Table Case
!!Pdist Error distribution coefficients calculated by inverting !Pdist
!!Pdist### !!Pdist spreadsheet for each case defined in Table Case
!Rows Generalized nonlinear recursed coefficients calculated from last solution
!Rows### !Rows spreadsheet for each case defined in Table Case
Primal PIMS Primal/Dual Solution Report in spreadsheet form
Prima### Primal spreadsheet for each case defined in Table Case
Solution PIMS Solution Summary Report in spreadsheet form
Solut### Solution spreadsheet for each case defined in Table Case
Errmsg List of all warning and error messages generated by PIMS for the current model
Blmap Blend Map from Full Report
Blmap### Blmap spreadsheet for each case defined in Table Case
Sdsum Stream Disposition Summary from Full Report
Sdsum### Sdsum spreadsheet for each case defined in Table Case
Sdmap Stream Disposition Detailed Map from Full Report
Sdmap### Sdmap spreadsheet for each case defined in Table Case
Utmap Utility Disposition Map from Full Report
Utmap### Utmap spreadsheet for each case defined in Table Case
Prmap Stream Property Map from Full Report
Prmap### Prmap spreadsheet for each case defined in Table Case
Prows Parameter Row Values from Full Report
Prows### Prows spreadsheet for each case defined in Table Case

Spreadsheet file extension and formats will conform to users requirements.


Where ### = case number as defined by Table Case, i.e., 001, 002, 003, ... ### ... 997, 998, 999.

Internal Tables (Will appear in Validation.LST if listed in


Table PRNTABS)
Blnxxx Combined data table for all blend data tables listed in BLNPROP branch of model tree
Qpool Crude cut properties calculated from Tables Crddistl, Crdcuts and Assays

Matrices and Reports


Pims.Log Log of all LP runs made on the current computer
Mpsprob.mps LP Matrix as generated by PIMS
MpsBCD.mps The last solved LP matrix as updated by PIMS Recursion Program
Validation.lst PIMS Validation Summary Report
ModelDocumentorReport.lst PIMS Model Documentor Report
MatrixListing.lst Mpsprob.mps listing by rows
MatrixBCDListing.lst MpsBCD.mps listing by rows
IterationLog.lst PIMS Iteration and Recursion log of last run submission
PrimalDual.lst PIMS Primal/Dual Solution Report
Primal###.lst PrimalDual.lst for each case defined in Table Case
SummarySolution.lst PIMS Solution Summary Report
Solution###.lst SummarySolution.lst for each case defined in Table Case
FullReport.lst PIMS Full Solution Report
FullReport###.lst FullReport.lst for each case defined in Table Case
Warn.lst PIMS warning messages suppressed by user in Table Report
Small.lst List of matrix coefficients not allowed in matrix by PIMS Matrix Generator
Optwarn.lst CPLEX Optimizer warning messages

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

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 32


Notes:

PIMS Process Industry Modeling System PIMS Data Tables and Reports  33
Notes:

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 34


Distributive Recursion

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.

PIMS Process Industry Modeling System Distributive Recursion  35


Recursion, therefore, is the process of solving a model, examining the optimum solution using an
external program, calculating physical property data, updating the model using the calculated data,
and solving the model again. This process is repeated until the changes in the calculated data are
within specified tolerances.

What is Distributive Recursion?


One user’s definition of Distributive Recursion (DR) is as follows. The users stand around taking
turns cursing at the model. After everyone has had a chance to curse the model, they start over and
everyone then recurses the model. Since everyone gets a chance to curse and recurse the model, the
recursing is therefore distributed. As true as this may be at times, it is not a good definition of DR.

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.

What Is the Actual DR Mechanism?


After the current matrix is solved using initial physical property estimates or guesses, new values are
computed from the solution and inserted into the matrix for another LP solution. The major
distinction between DR and simple recursion is the handling of the difference between the guess and
the calculated physical property data from the solution. This difference is referred to as the “error.”
When the user guesses at the physical properties of recursed pools in an LP model, error is created
because the user always guesses incorrectly.

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 36


The distributive part of Distributive Recursion is from the fact that this error is distributed to where
the quality is being used. The downstream locations where the recursed pool physical properties are
being used, therefore, have visibility back to the pool source and is able to evaluate, through this
error handling model structure, the benefits and/or penalties of the alternate quality operations.
Alternatively, the upstream producer of these pool properties is able to evaluate the benefits and/or
penalties of the alternate quality operations on the downstream use of the pools. For example, if the
gasoline blending section of the LP model is using a guess of 96 research octane for reformate, the
blending section is able to look upstream and evaluate the economic benefits or penalties of changing
the reformer operation to produce a different octane reformate. At the same time, the reformer is able
to look downstream to evaluate the economic benefits or penalties associated with blending if a
change is made in the reformer operation to produce a different octane reformate.

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:

And the recursion structure would look like this:


SCFPLV1 SCFPHV1 SCFPDCG SCFPCFP RAFCCFP RHS
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

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

PIMS Process Industry Modeling System Distributive Recursion  37


calculated by multiplying the LV1, HV1, and DCG column activities by their respective AFC
properties in row RAFCCFP and dividing by the sum of their activities. This difference is the “error”
created by guessing at the property and guessing the wrong value. The error is summed into the
activity of the “error distribution vector (column)” RAFCCFP and has units of property-units of
volume/unit of time or property-units of weight/unit of time. In our example, the units are AFC-
Barrels/Day

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

RAFCCFP –24(10) –20(10) –31(10) +26(30) +1(-30) =0


RAFCCFP –240 –200 –310 +780 -30 =0
The activity of RAFCCFP = -30. Initial guess of property AFC of stream CFP = 26.0

SCCUBAS SCCUAFC SCCUCFP RAFCCFP RHS

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 38


Activity = 30 ? 30 -30
VBALCFP 1 0

VBALCCG -0.66 0.05 0
VBALCCD -0.17 -0.03 0
VBALCCS -0.06 -0.02 0
EBALCCU –1 1 =0
EAFCCCU 15 5 –26 –1 =0
activity x coefficient

EAFCCCU +15(30) +5(?) –26(30) – 1x(-30) =0


EAFCCCU +450 +300 –780 +30 =0
Activity of SCCUAFC = 300/5 = 60.0. Column SCCUAFC is set free from minus infinity to plus infinity.
With the composition of the pool at 10 LV1, 10 HV1, and 10 DCG the calculated AFC of the pool is
25.0 (10x24 + 10x20 + 10x31 = 750; 750/30 = 25.0). This AFC is higher than the base AFC at the
cat cracker of 15 and different than our estimate or guess of 26.

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

SCFPLV1 SCFPHV1 SCFPDCG SCFPCFP RAFCCFP RHS


Activity = 10 10 10 30 ?

PIMS Process Industry Modeling System Distributive Recursion  39


RAFCCFP –24(10) –20(10) –31(10) +1,000(30) +1(-29,250) =0
RAFCCFP –240 –200 –310 +30,000 -29,250 =0
The activity of RAFCCFP = -29,250. Initial guess of property AFC of stream CFP = 1000.0

SCCUBAS SCCUAFC SCCUCFP RAFCCFP RHS


Activity = 30 ? 30 -29,250
VBALCFP 1 0

VBALCCG -0.66 0.05 0
VBALCCD -0.17 -0.03 0
VBALCCS -0.06 -0.02 0
EBALCCU –1 1 =0
EAFCCCU 15 5 –1,000 –1 =0
activity x coefficient

EAFCCCU +15(30) +5(?) –1,000(30) -1(-29,250) =0


EAFCCCU +450 +300 –30,000 +29,250 =0

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:

SCR1LNA SCR1LNB SCR1LNC SCR1LN1 RDONLN1 RHS


VBALLNA 1 0

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 40


VBALLNB 1 0
VBALLNC 1 0
VBALLN1 –1 –1 –1 0
RBALLN1 –1 –1 –1 1 =0
RDONLN1 –70 –80 –90 +75 +1 =0

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

BVBLUPR BREFUPR BALKUPR BLN1URG


NDONUPR +91 -92 -93 -75 -0.3 0

BVBLLRG BREFLRG BALKLRG BLN1LRG


NDONLRG +88 -92 -93 -75 -0.2 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

Using this information we can do our matrix arithmetic calculations as before.


SCR1LNA SCR1LNB SCR1LNC SCR1LN1 RDONLN1 RHS
Activity = 10 10 10 30
VBALLNA 1 0
VBALLNB 1 0
VBALLNC 1 0
VBALLN1 –1 –1 –1 0
RBALLN1 –1 –1 –1 1 =0
RDONLN1 –70 –80 –90 +75 +1 =0

activity x coefficient

PIMS Process Industry Modeling System Distributive Recursion  41


SCR1LNA SCR1LNB SCR1LNC SCR1LN1 RDONLN1 RHS
Activity = 10 10 10 30 ?
RDONLN1 –70(10) –80(10) –90(10) +75(30) +1(150) =0
RDONLN1 –700 –800 –900 +2250 +150 =0
The activity of RDONLN1 = +150.
Initial guess of property DON of stream LN1 = 75.0

BVBLURG BREFURG BALKURG BLN1URG


Activity = 24 +150
NDONURG +87 -92 -93 -75(24) -0.5(150) 0
NDONURG +87 -92 -93 -1800.0 -75 0

BVBLUPR BREFUPR BALKUPR BLN1URG


Activity = 1.5 +150
NDONUPR +91 -92 -93 -75(1.5) -0.3(150) 0
NDONUPR +91 -92 -93 -112.5 -45 0

BVBLLRG BREFLRG BALKLRG BLN1LRG


Activity = 4.5 +150
NDONLRG +88 -92 -93 -75(4.5) -0.2(150) 0
NDONLRG +88 -92 -93 -337.5 -30 0

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

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 42


are defined in the Recursion Setting of the model as ATOL and RTOL. The values normally
recommended for each is 0.001. (See the discussion relating to Recursion Settings.) Working
through the arithmetic of the tolerance calculations for this example reveals:

ATol = PC – PP = 80 – 75 = 5 is this  0.001  No

RTol = (PC – PP)/ PP = (80 – 75)/75 = 5/75 = 0.067 is this  0.001  No

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

BVBLURG BREFURG BALKURG BLN1URG


NDONURG +87 -92 -93 -80 -0. 80 0

BVBLUPR BREFUPR BALKUPR BLN1URG


NDONUPR +91 -92 -93 -80 -0. 05 0

BVBLLRG BREFLRG BALKLRG BLN1LRG


NDONLRG +88 -92 -93 -80 -0. 15 0

PIMS Process Industry Modeling System Distributive Recursion  43


An examination of the second solution reveals the following column activities:
Column Name Activity
SCR1LNA 7.0000
SCR1LNB 10.0000
SCR1LNC 13.0000
SCR1LN1 30.0000
BLN1URG 24.0000
BLN1UPR 1.5000
BLN1LRG 4.5000

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

SCR1LNA SCR1LNB SCR1LNC SCR1LN1 RDONLN1 RHS


Activity = 7 10 13 30 ?
RDONLN1 –70(7) –80(10) –90(13) +80(30) +1(60) =0
RDONLN1 –490 –800 –1170 +2400 +60 =0
The activity of RDONLN1 = +60. Current property DON of stream LN1 = 80.0
Using this solution the tolerance calculations in the recursion program now look like this:

ATol = PC – PP = 82 – 80 = 2 is this  0.001  No

RTol = (PC – PP)/ PP = (82 – 80)/80 = 2/80 = 0.025 is this  0.001  No

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:

ATol = PC – PP = 82 – 82 = 0 is this  0.001  Yes

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

SCR1LNA SCR1LNB SCR1LNC SCR1LN1 RDONLN1 RHS


Activity = 7 10 13 30 ?
RDONLN1 –70(7) –80(10) –90(13) +82(30) +1(0) =0
RDONLN1 –490 –800 –1170 +2460 0 =0
The activity of RDONLN1 = 0. Current property DON of stream LN1 = 82.0
Distributive Recursion structure can be much more complicated than what we have seen thus far.
When there is more than one disposition for the recursed properties or when the coefficients in the
RBAL row are not –1 or when Table PCALC is involved, etc. the user must be very careful to set up
the structure correctly and must have a very good understanding of the modeling structure required.
However, the principle is the same. The model is able to show the optimizer what is going on in
other parts of the matrix and adjust the solution to arrive at the true optimum reflected by the
calculated pool properties.

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 44


Now that we have examined the principles and techniques of Distributive Recursion let us think
about how to set up a Distributive Recursion model. The first step is to review the Recursion
Settings in the model. The Recursion Settings are accessed from the model tree structure in PIMS
under Model|Settingds|Recursion.

Recursion Settings accessed from model tree structure

PIMS Process Industry Modeling System Distributive Recursion  45


General Recursion Settings

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 46


Recursion Tolerances

Advanced Recursion Settings

PIMS Process Industry Modeling System Distributive Recursion  47


All the entries contained in the tabbed boxes shown above are available for changing. An
explanation of each option follows. This same information is available in the PIMS On-Line Help
System under Help|Help Topics|Index|Recurse.
Entry Default Options
RECURSE 0 1= Recurse.
0= Switch off recursion.
MODE 1 1= Converge on property values.
2= Converge on objective function value.
MANUAL 1 1= Permit client to terminate recursion after each pass. Display only out of
tolerance items on the recursion report.
0= Recurse until converged or maximum number of passes achieved.
Display all items on recursion report.
-1 = Recurse until converged or maximum number of passes is achieved.
Display only out of tolerance items on the recursion report.
Note: During the execution of the PIMS recursion program, the client can
toggle the value of MANUAL by pressing the ALT and I keys
simultaneously (ALT/I). If the value was 0 or -1, it is changed to 1 and if
the value was 1, it is changed to 0.
MAXPASS 10 Maximum number of recursion passes to be made before exit.
MAXPASS1 MAXPASS n Maximum number of recursion passes to be made before the MIP
algorithm is invoked.
MAXIPASS 0 Maximum number of infeasible recursion passes that will be tolerated
before the system exits.
ATOL 0.001 Absolute error tolerance.
RTOL 0.001 Relative error tolerance. A recursed property is assumed to be converged
if EITHER its absolute error is less than ATOL, OR its relative error is less
than RTOL.
DTOL 0.001 Specifies the tolerance for distribution coefficients to be converged. This
value should default to 0.01 times ATOL if omitted.
VIEW 0 1= Display purchase and sale values after each recursion pass.
0= No display of purchases and sales.
DAMP 1.0 Property update damping factor. A recursed property will not be allowed to
change from one recursion pass to the next by an amount that exceeds
the damping factor multiplied by the maximum range of property values
found in the input data tables. The model Validation Report shows the
minimum, maximum and data range for all recursed properties. These
values are derived by examining the Tables BLNXXX, PGUESS, Sxxx,
and SCALE. If the data range is determined to have a value of 0.0, PIMS
will generate an error message.
HOLDUPD 0 1= On first recursion pass only update distribution only, and hold properly
values at their initial estimates. This strategy may be used where it is
known that the initial estimates of stream distributions are poor.
0= Update properties and distribution on first recursion pass.
MAXSTEP 0 Maximum recursion error vector bound.
The presence of a non-zero value for MAXSTEP causes PIMS to invoke a
step bounding procedure that facilitates convergence on models that tend
to oscillate. If the value of MAXSTEP is set to a non-zero quantity Q, the
recursed property error vectors are generated in the matrix with lower and
upper bounds of -Q and +Q, rather than being declared free vectors. At
the end of the first recursion pass, the value of the error vector is reduced,
for each error vector to 0.01 * Q or the absolute value of the error vector
activity, whichever is greater.

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 48


On subsequent recursion passes the value of the bound is reduced if the
error vector has changed sign from the previous pass, signifying that the
recursed quality is potentially oscillating. If a recursion pass is infeasible,
the value of the bound is increased if an error vector is at or beyond its
bound. Note that if MAXSTEP is set very large, the step bounding
procedure will not be limited by the bound. If MAXSTEP is set too small,
convergence will be very slow since property changes from pass to pass
will be limited. A good value for MAXSTEP is 10 times the estimated
quality (weight or volume) of the largest pool.
If the value of MAXSTEP is set to 1.0, this is regarded as a flag indicating
that PIMS should automatically construct a value for Q. In this case, Q is
set to a large non constraining value for the first pass and reduced to the
activity of the largest error vector value on the second pass.
MAXSTEP should be invoked when using the EPA reformulated gasoline
complex and simple equations.
CHKCYCL 0 1= On Check for cycling during recursion and exit if cycling is suspected. A
model is regarded as cycling if on 5 successive recursion passes, every
recursed item that has not converged, is cycling between 2 alternate
values. The check for cycling is not invoked until the model has completed
10 recursion passes.
PDSMALL During construction of the PDIST table, any distributions that were not
defined by the client will be set to this value if supplied. This may be useful
in models with sensitive compositional recursion, to ensure that initial
estimates of the distributions are set to a small value.
FORCEUPD 0 n= Update all properties and distributions in the matrix regardless of whether
these values are within convergence tolerance or not. Do this for n
recursion passes.
0= Update only values not within convergence tolerance.
FORCEONE 0 1= Used to force a 1.0 initial distribution coefficient for recursed pools with a
single destination. Also causes distribution coefficients not to be updated
when the activity of the pool collector column falls below FSMALL.
ALPHA 1.0 Factor used to limit recursed quality move to the fractional quantity of what
the calculated move should be. Differs from DAMP in that DAMP limits
move to fraction of the range.
NALPHA 5000 Recursion reduces alpha to 0.5 * original value after NALPHA recursion
passes.
P1 0.01 Reduction of step bounds on the first pass of recursion if MAXSTEP was
set to an actual value rather than 1.0.
P2 0.5 Reduction of step bounds when error vector activity magnitudes are
similar to step bound values.
P3 0.5 Step bound reduction factor when the error vector magnitude is much less
than the bound. It allows the bound to shrink to the region of the error
vector activity. Values as small as 0.1 seem to work OK.
INCREASE 0 0= Setting INCREASE to 1.0 permits the step bounding algorithm to increase
step bounds by 1/P2 if the error vector hits the bound on three successive
passes or if the DJ on the bound exceeds the value of 1,000.
1= Allow step bounds to be increased if the error vector is up against its
bound for three consecutive recursion passes.
CASEREC 0 1= During case stacking, the system will use final recursed property and
distribution values of the previous case for Case 2 onward, as starting
estimates for the current case. This will significantly reduce the time in
recursion pass No. 1. This option has not been implemented for M-PIMS
and P-PIMS models.
0= Use original MPSPROB coefficients for initial recursion estimates.
VPENALTY 100 Value used for penalizing pool violations in the use of Table VPOOL.
XPENALTY 100 Value used in Table PSPAN penalties for pool violations.

The functionality of this table is preserved if the “Always Import Tables” box is checked under
Tools|General System Settings|Spreadsheet tab.

PIMS Process Industry Modeling System Distributive Recursion  49


PIMS recursion, property estimates, and non-linear structure calculations are controlled in tables
ADDITIVE, ADDLEVS, CURVE, NONLIN, PDIST, and PGUESS. Tables PDIST and PGUESS are
created during report writing under the names !PDIST and !PGUESS.

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.

1. Cat Cracker Feed Pool

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.

*TABLE SCFP CAT FEED POOL

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 50


*
TEXT LV1 HV1 DCG CFP
*
VBALLV1 VAC GAS OIL 1
VBALHV1 VAC GAS OIL 1
VBALDCG COKER GAS OIL 1
VBALCFP CAT FEED POOL -1 -1 -1
*
RBALCFP DR BALANCE FOR CFP -1 -1 -1 1
RSPGCFP DR SPG FOR CFP -999 -999 -999 999
RSULCFP DR SVL FOR CFP -999 -999 -999 999
RAFCCFP DR AFC FOR CFP -999 -999 -999 999

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

PIMS Process Industry Modeling System Distributive Recursion  51


*TABLE SDHT DISTILLATE HYDROTREATER
*
TEXT BAS SUL HD1 DCD DTF
*
VBALHD1 ST RUN HY DISTILLATE 1
VBALDCD COKER DISTILLATE 1
VBALHYL HYDROGEN, FOEB -0.0025 0.0003
VBALH2S H2S, FOEB -0.0106 -0.0053
VBALNC1 FUEL GAS, FOEB -0.0020
VBALNC5 PENTANE -0.0003
VBALDES HYDROTREATED DIST -0.9896 0.0050
* BALANCE CHECK 0.0000 0.0000 1 1
*
ECHGDHT FEED CHARGE 1 -1 -1
ESULDHT FEED SULFUR DRIVER 1 0.5 -999 -999
*
CCAPDHT DIST H2TRTR CAPACITY 1
*
UBALFUL FUEL, MMBTU 0.0580
UBALKWH POWER, KWH 1.2950
UBALSTM STEAM, MLBS 0.0493
UBALH20 COOLING WATER, MGAL 0.0088
UBALCCC CAT+CHEM, $ 0.3000
*
RBALDTF DTF RECURSN BALANCE -1 -1 1
RSULDTF DTF RECRS'D PROP SUL -999 -999 999
RSPGDTF DTF RECRS'D PROP SPG -999 -999 999
RCBIDTF DTF RECRS'D PROP, CBI -999 -999 999
RPPIDTF DTF RECRS'D PROP PPI -999 -999 999
RVBIDTF DTF RECRS'D PROP VBI -999 -999 999
*
PSULAVG AVG FEED SULFUR 999 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.

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 52


*table sref reformer (150 psig)
*
TEXT S90 S94 S98 S02 NPA RFD RFT
*
VBALRFD REFORMER FEED 1
VBALHYL HYDROGEN, FOEB -0.0393 -0.0441 -0.0486 -0.0523 -0.0034
VBALNC1 FUEL GAS, FOEB -0.0193 -0.0242 -0.0306 -0.0390 0.0078
VBALNC3 PROPANE -0.0288 -0.0362 -0.0457 -0.0581 0.0120
VBALIC4 ISO BUTANE -0.0118 -0.0148 -0.0186 -0.0237 0.0047
VBALNC4 NORMAL BUTANE -0.0168 -0.0213 -0.0269 -0.0343 0.0072
VBALRFT REFORMATE -0.8899 -0.8611 -0.8283 -0.7901 -0.0226
* BALANCE CHECK -0.0060 -0.0017 0.0013 0.0024 0.0058
*
ECHGREF FEED CHARGE 1 1 1 1 -1
ENPAREF FEED NPA DRIVER 30 30 30 30 7 -999
*
CCAPREF REFORMER CAPACITY 1
*
UBALFUL FUEL, MMBTU 0.98 0.99 1.00 1.01
UBALKWH POWER, KWH 4.64 4.74 4.84 4.94
UBALCCC CAT & CHEM, $ 0.80 0.90 1.00 1.10
*
* REFORMATE RON 90 94 98 102
* REFORMATE DON 84.5 88.5 92.5 96.5
* REFORMATE D11 87.5 91.5 95.5 99.5
*
RBALRFT RFT RECURSN BALANCE -0.8899 -0.8611 -0.8283 -0.7901 -0.0226 1
RRONRFT RFT RECRS'D PROP RON -80.094 -80.947 -81.175 -80.594 -2.213 999
RDONRFT RFT RECRS'D PROP DON -75.199 -76.210 -76.619 -76.248 -2.088 999
RD11RFT RFT RECRS'D PROP D11 -77.869 -78.794 -79.104 -78.618 -2.156 999
*
PREMRO1 FEED PROPERTIES: 999
PNPAAVG1 NPA
PREMRO2 PRODUCT PROPERTIES:
PYLDNUM1 C5+ YIELD, VOL% 88.99 86.11 82.83 79.01 2.26
PYLLDEN 1 1 1 1
PRONAVL3 SEVERITY, RONC 999
PDONAVG1 (R+M)/2 CLEAR 999
PD11AVG1 (R+M)/2 1.1 GM TEL 999

PIMS Process Industry Modeling System Distributive Recursion  53


This table shows a more complicated recursion structure to determine blending properties of
reformate. Since the user does not know the severity at which the reformer should run, the model
reflects a choice between 90 RONC and 102 RONC and allows the optimizer to determine the
severity.

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.

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 54


After this model is built and debugged, a run should be made to solve the model. It is important to
observe the recursion report at the end of the first recursion pass. If it has been directed to disk, this
report is located in the file ITLOG.LST and is accessed through PIMS Model Management Option 7
– View Model Reports. This report will often provide an indication if the distributive recursion is not
properly structured. We would normally expect the following type of report:
CURRENT PREVIOUS
LN1 TO URG .0700 .3333
LN1 TO UPR .2800 .3333
LN1 TO LRG .6500 .3333

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

This indicates all of the LN1 is being directed to URG.

Distribution reports that indicate a problem are shown below:


LN1 TO URG .3333 .3333
LN1 TO UPR .3333 .3333
LN1 TO LRG .3333 .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

PIMS Process Industry Modeling System Distributive Recursion  55


Multiple Path Problems
When setting up recursion structure in a sub-model it is possible to create a situation where PIMS
detects what is referred to as a multiple path. This situation will generate a warning message similar
to:

*** WARNING. MULTIPLE PATHS FOR DISTRIBUTION XXX TO YYY

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.

Let’s examine a situation to illustrate a multiple path problem.

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:

Table PCALC would have an entry thus:


* TABLE PCALC
*
SUL
*
KT1KR1 0.1

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)

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 56


The CONV is a conversion factor equal to the specific gravity times the volume to weight conversion
factor for unit gravity. When CONV is multiplied times the column activity, the product is the
weight equivalent of the column activity in volume units. In our example, the column activities of
the blendstocks BKR1DSL and BKT1DSL are in barrels while the column activity of the product
blend column BWBLDSL is in tons, thus, the need for CONV. To illustrate the multiple path
problem we will ignore the CONV factor. Our matrix would then look like:
BWBLDSL BKR1DSL BKT1DSL
XSULDSL 0.5 –0.6 –0.06
(SUL)SPEC (SUL)KR1 (SUL)KR1(PCALC)

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

PIMS Process Industry Modeling System Distributive Recursion  57


In order to solve the multiple path problem a new recursion pool must be introduced into the matrix.
In our current example, this new pool can be inserted in one of two places. If the new pool is added
upstream of the hydrotreater the flow diagram would look like:

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

An initial guess for KX1 properties is also included in Table PGUESS:


* TABLE PGUESS
*
SUL
*
KX1 0.6

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

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 58


This allows error from KR1 to be distributed to the KX1 SUL property recursion row RSULKX1
and the maximum SUL spec row for DSL XSULDSL. The column RSULKX1 also distributes error
from KX1 pool to XSULDSL when KT1 is blended to DSL.

An alternative approach would be to put KX1 as the blendstock like so:

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

PIMS Process Industry Modeling System Distributive Recursion  59


Notes:

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 60


Delta Based Modeling

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.

PIMS Process Industry Modeling System Delta Based Modeling  61


Reformate Yield Versus Naphtha Feed N+A

The Delta Based Driver Mechanism


To understand the concept of Delta Based Modeling, the user must thoroughly understand matrix
arithmetic. In a delta based model the activity of several columns in the solution are driven by one or
more “E-rows” in which they are entered. An E-row is a row in the matrix which starts with the letter
“E” and has a row activity which must equal the right hand side, which in a PIMS model is zero.
Consider the following structure:
SCCUBAS SCCUCFP
ECHGCCU +1 -1 =0

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.

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 62


Lets look at the above matrix with this adjustment structure added:
SCCUBAS SCCUAFC SCCUCFP
ECHGCCU +1 -1 =0
EAFCCCU +15 +5 -18 =0

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.

Looking now at row EAFCCCU we have:


SCCUBAS SCCUAFC SCCUCFP
activity = 40 ? 40

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 material balance row definitions are:


VBALCFP = cat feed pool
VBALH2S = hydrogen sulfide
VBALCCG = cat gasoline
VBALCCD = cat light cycle oil
VBALCCS = cat slurry oil

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.

PIMS Process Industry Modeling System Delta Based Modeling  63


Using the same activities we developed earlier let’s see what the row EAFCCCU is doing to the
yields in our cat cracker model when the feed to the cat cracker actually has an AFC that is 3
numbers higher than the AFC of the feed used to develop the base yields.

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.

Here is how it would work.


SCCUBAS SCCUAFC SCCUCFP
activity = 40 24 40

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 64


activity x coefficient =
VBALCCG -.621 x 40 +.024 x 24
-24.840 +.576
cat gasoline produced = -24.840 +.576 =-24.264 or 24.264 MB/D

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.

Delta Based Data


The data used in a DBM must be developed by the user to reflect the parameters and operation that
best models their processes. In the example used above, in a cat cracker unit we chose to use
Aromaticity Factor (AFC) as the parameter with which to characterize cat cracker feed quality.
There are, in fact, a whole host of properties we could have chosen. For instance, some people might
use Watson “K Factor,” refractive index, hydrogen content, Volumetric Average Boiling Point
(VABP), or one of several other possible parameters. In fact, it is possible to use more than one
parameter in the same DBM. The guiding principle is availability of data that accurately reflects
yield shifts due to changes in the parameter(s) used.

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

PIMS Process Industry Modeling System Delta Based Modeling  65


cracker DBM with the proper sign convention applied. There is nothing preventing us from dividing
each of these numbers by 5, the AFC increment, if we so desired. The DBM would then reflect a
shift in yields for a unit change in AFC. The LP solutions would be exactly the same except the
activity of column SCCUAFC would be 5 times larger.

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.

Cat Cracker Yield Versus Aromaticity Factor

Multiple Shift Vectors In The Same DBM


If it is useful to model more than one parameter in a DBM the structure needed to accomplish this
would look similar to the following. In this example we have added a shift vector SCCUSUL to
reflect adjustments to yields based on the sulfur content of the cat feed pool.
SCCUBAS SCCUAFC SCCUSUL SCCUCFP
activity = 40 24 ? 40

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 66


VBALCFP +1
VBALH2S -.001 -.003
.
.
VBALCCG -.621 +.024 +.001
VBALCCD -.170 -.018 +.001
VBALCCS -.063 -.006 +.001
.
.
ECHGCCU +1 -1 =0
EAFCCCU +15 +5 -18 =0
ESULCCU +0.8 +1.0 -1.3 =0

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.

PIMS Process Industry Modeling System Delta Based Modeling  67


Notes:

P-PIMS PIMS Multi-Period Option PIMS Process Industry Modeling System 68


PIMS Process Industry Modeling System Delta Based Modeling  69
P-PIMS PIMS Multi-Period Option

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.

P-PIMS Data Input


Data input for a P-PIMS model differs from a PIMS model in five respects:

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.

5. A new optional table PSPAN may be present

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.

Other P-PIMS Tables


Time varying data may also be provided for tables BUY, SELL, UTILBUY, UTILSEL, CAPS,
BOUNDS, ROWS, BLNSPEC and PDIST. Period suffixes may be appended to the following row and
column names of these tables:
BUY: Columns MIN, MAX, FIX, COST. (e.g. MIN2, FIX2)
SELL: Columns MIN, MAX, FIX, PRICE.
UTILBUY Columns MIN, MAX, FIX, COST.
:
UTILSEL: Columns MIN, MAX, FIX, PRICE.
CAPS: Columns MIN, MAX, FIX.
BOUNDS: Columns MIN, MAX, FIX.
ROWS: All rows and columns except MIN, MAX, FIX and FREE. If row or column names contain a blank
in character position 8, the appropriate 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.
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.

The column names of PINV recognized by P-PIMS are as follows:


OPEN defines the opening inventory of the material (in thousands of volume or weight units) at the
beginning of the first period of the model.
MIN(p) defines the minimum acceptable closing inventory for each period p. This may be construed as a
tank heel quantity or other operating requirement. Note this quantity may vary from period to
period. A common technique in multi-period modeling is to define the minimum inventory for the
last period to be equal to the opening inventory of the first period, although this is clearly not a P-
PIMS requirement. If not defined in any period, the minimum inventory will be assumed to be zero.
TARG(p) defines a target minimum closing inventory for each period. This is a “soft” constraint which the
model will endeavor to achieve, but the inventory could drop below this value (down to the
minimum value as defined in column MIN(p)). Target inventories are often defined heuristically by
scheduling and planning personnel and are designed to provide operating flexibility for unpredicted
situations. If the target is not defined in any period, it defaults to the minimum inventory for the
period.
MAX(p) defines the maximum closing inventory at the end of each period. This may be construed as a tank
limit or defined from other operating considerations. In general a multi-period model will drive
inventories to their lower limits so that maximum inventory constraints are unlikely to be active. If
the maximum inventory value is not defined for any period it is assumed to be infinite (no
maximum).
HCOST(p) defines the inventory holding cost for each material in each period. This cost is defined in monetary
units per unit of inventory (weight or volume) per time period, typically in $/BBL/day. The cost of
holding inventory is usually calculated from the cost of the working capital tied up in the inventory.
For example, for a material with a value of $24 per BBL, assuming a cost of capital of 20% per
annum, the holding cost would-be 24*0.20/365 or 0.0132 $/BBL/day. If the holding cost is not
defined for any period, it is assumed to be zero. The LP objective function row entry for each period
is calculated as the inventory holding cost multiplied by the average of the opening and closing
inventories for the period, multiplied by the period length.
PCOST(p) defines the penalty cost to be incurred if the target inventory is not achieved in a period. This cost is
defined in monetary units per unit of weight or volume, typically in $/BBL. Note that this cost is
not a true accounting cost, but is merely a penalty in the LP to cause the model to achieve the target
inventories. If the penalty cost for the last period is defined as a quantity which is less than the cost
of manufacture of the material, the LP will clearly draw the inventory below target and down to the
minimum inventory level, rather than incur the manufacturing cost needed to put the material into
inventory. By suitable definitions of MIN, TARG, HCOST and PCOST the user has considerable
flexibility in the inventory policy that will result from the model. If the penalty cost is not defined
for any period, it is assumed to be zero.

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

Table PSPAN Example


*TABLE PSPAN SPAN RECIPES ACROSS PERIODS
*
1 2 3
*
LN1URGA 1 1
RFTURGA 1 1
*
...UPR *KEEP ALL RATIOS CONSTANT ACROSS ALL PERIODS
*
*
* NOTE: PENALTY ON VIOLATION IN ROW XPENALTY OF TABLE
RECURSE IF OMITTED SET AT $100/BBL/DAY
Table PSPAN from PVOLSAMP

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.

The column names which define report options are:


AVERAGE: The AVERAGE option causes an additional column to be appended on the right hand side of
RATE reports. This column shows the time averaged values for each entry in the report.
TOTAL: The TOTAL option causes an additional column to be appended on the right hand side of
PERIOD reports. This column shows the total activity across all periods.

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

Distributive Recursion in P-PIMS


The PIMS Distributive Recursion technique is implemented with only minor variations in P-PIMS.
Since recursed pools may be blended differently from period to period, the resulting pool qualities and
pool distributions will also vary from period to period. The initial estimates as defined in tables
PGUESS and PDIST are used as initial estimates for all periods, unless time varying entries are
supplied in these tables by the appending of period identifiers to the table row names.

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.

Pooling of Inventoried Materials


Note that it is not necessary for the user to identify the opening inventory as an additional feed, nor the
closing inventory as an additional distribution. The necessary structure in the matrix will be
automatically constructed by P-PIMS. The 3 character row name entries in table PGUESS also assume
an additional meaning in the case of inventoried pools. The PGUESS entries for a pool define the
initial estimates of pool qualities for all periods, and also define the qualities of the opening inventory
at the beginning of the first period, that is, the material referred to in column OPEN of table PINV.

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.

The column names which define report options are:


AVERAGE: The AVERAGE option causes an additional column to be appended on the right hand
side of RATE reports. This column shows the time averaged values for each entry in
the report.
TOTAL: The TOTAL option causes an additional column to be appended on the right hand side
of PERIOD reports. This column shows the total activity across all periods.

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.

P-PIMS Case Stacking


The P-PIMS Multiple Case Solution Option (Main Menu Option 8) allows the user to submit a number
of cases, stacked one behind the other, in the same manner as for PIMS.

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)

where TARGj = user defined target inventory for period j

IEXCj = inventory in excess of the target

and IDEFj = inventory deficit below the target

The material balance for an inventoried material in period j is defined by


Sj = Sj-1 + LENj * ( PRODj - CONSj (2)

where LENj = period length for period j

PRODj = production in period j (various terms)

CONSj = consumption in period j (various terms)

Substituting (1) in (2) and rearranging terms yields the material balance equation.
-PRODj + CONSj-1/LENj * ( IDEFj - IDEFj-1 - IEXCj + IEXCj-1 )

=1/LENj * ( TARGj-1 - TARGj ) (3)

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:

IEXCtagp Inventory excess for stream tag period p

IDEFtagp Inventory deficit for stream tag period p

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

2  PIMS Training Class Problems PIMS Process Industry Modeling System


PIMS Training Class Problems
The PIMS and PPIMS Training Class Problems are based on the configuration of a typical U.S.
refinery which includes the following process units.

Crude Oil Distillation (Atmospheric)


Crude Oil Distillation (Vacuum)
Butane Isomerization
Alkylation
Naphtha Hydrotreating
Catalytic Reforming
Kerosene Hydrotreating
Distillate Hydrotreating
Fliuidized Catalytic Cracking
Delayed Coking
Hydrocracking for Diesel Fuel Production
Hydrogen Manufacture by Methane Reforming
Saturate Gas Plant
Unsaturate Gas Plant
Sulfur Recovery
Utility Generation
PIMS and PPIMS Training Class Problems Flow Diagram

4  PIMS Training Class Problems PIMS Process Industry Modeling System


Essential PIMS Training Class Problems

Problem 1 - Matrix Arithmetic


The following partial matrix is generated by a PIMS model:
SCCUBAS SCCUAFC SCCULV1 SCCUHV1 SCCUDCG SCCUCCF RSULCCF
ECHGCCU 1 -1 -1 -1
EAFCCCU 20 5 -22 -26 -24
RBALCCF -1 -1 -1 1
RSULCCF -1.2 -1.6 -1.4 2.0 1

All rows are equalities and must equal to zero.

After solving this model the activity of the columns are:


SCCUBAS = 26
SCCUAFC = ?
SCCULV1 = 10
SCCUHV1 = ?
SCCUDCG = 4

What is the activity of Column SCCUHV1?

What is the activity of Column SCCUAFC?

What is the activity of Column SCCUCCF?

What is the activity of Column RSULCCF?


Problem 2 – Evaluating a New Crude
Be sure you run TR.BAT in the class problem model before starting.

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 marginal value (shadow price) of the 1st barrel?

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 marginal value (shadow price) of the 10,001st barrel?

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?

What is the marginal value (shadow price) of the 20,001st barrel?

Should we buy this crude?

6  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 3 – Evaluating a Gasoline Blendstock
Be sure you run TR.BAT in the class problem model before starting.

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.

Blending data for MTBE is as follows:


RON MON DON R11 M11 D11 SPG SUL RVP OXY
118 98 108 119 99 109 .744 0 8.5 18.2
WT% PSI WT%
Distillation Data
Percent Off at:
160 210 230 330 DEGF
100 100 100 100 VOL%

If we buy MTBE for gasoline blending what price should we pay for it?

Use the three character tag “MTB “ for MTBE.

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.

We can get $28.14/Bbl for U89 and $31.08/Bbl for U93.

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.

Evaluate the U89 and the U93 separately.


Note: MTBE IS NOT USED HERE TO SUPPLY OXYGENATES. It is here to allow
the problem to buy a high octane blendstock if needed for the U89 or U93
pools. There should be no minimum oxygen spec for the blends. MTBE may
go to all blends.

Extra Credit:

What is the break-even-value of each new grade of gasoline?

8  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 5 – More Matrix Arithmetic
Do not run the LP to find a solution to this problem. Instead, do the problem by hand using a
calculator or spreadsheet.

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

TABLE CAPS MIN MAX


CAT1 0.0 5.0
CAT2 0.0 0.0
CCCU 0.0 39.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.

LV1 HV1 AR2


VOL%
SUL WT%
AFC
SPG
BNT

From SCCU submodel:


975 AFC BNT SUL CF1
VBALLC1
VBALHC1
ECHGCCF
EAFCCCF
EBNTCCF
ESULCCF
Problem 6 – Evaluating a Cat Cracker Feedstock
Be sure you run TR.BAT in the class problem model before starting.

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.

10  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 7 – Evaluating an Alky Feedstock
Be sure you run TR.BAT in the class problem model before starting.

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%

Specific Gravity (SPG) .5814

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.

12  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 9 – Creating a Cat Feed Pool
Be sure you run TR.BAT in the class problem model before starting.

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.

What is the purpose of the LAR2CCU control row?

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.

14  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 11 – Adding a New Crude and Vacuum Unit
Be sure you run TR.BAT in the class problem model before starting.

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

Vac Tower Fuel, MMBTU/Bbl 0.0018


Vac Tower Electricity, KWH/Bbl 0.3184
Vac Tower Steam, MLBS/Bbl 0.0109

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

Problem 12 – Using Matrix Control Rows & Bounds


Be sure you run TR.BAT in the class problem model before starting.

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).

16  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 13 – Using Submodel Parameter Rows (P-ROWS)
Be sure you run TR.BAT in the class problem model before starting.

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 gasoline properties of the Light Cat Gasoline (LCN) are:


SPG RON MON DON R11 M11 D11 RVP OLF
.7368 92 82 87 96 86 92 8.2 35
Distillation Temp., °F 160 210 230 330
Volume % off 10 70 95 100

The gasoline properties of the Heavy Cat Gasoline (HCN) are:


SPG RON MON DON R11 M11 D11 RVP OLF
.7931 86 76 81 90 78 84 2.0 25
Distillation Temp., °F 160 210 230 330
Volume % off 0 0 10 80

The distillate properties of the Heavy Cat Gasoline (HCN) are:


SPG API POUR PT VISCOSITY CBI KFC
.7931 46.9 -10 DEGF 14 cSt @ 122F 42 12.01

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.

18  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 15 – Gas Plant Recoveries
Be sure you run TR.BAT in the class problem model before starting.

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.

20  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 17 – Obtaining Information from PIMS Reports
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 INTA,
INTB, INTC, INTD, and INTE. 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 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.

2. What is causing the potential infeasible blend in model INTB?

3. Fix the incomplete disposition in model INTC.

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

Problem 18 – Implementing Crude Unit Limits


Be sure you run TR.BAT in the class problem model before starting.

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.

As an economics analyst, you must:

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.

Evaluate the cost of implementing the dictated sulfur level.

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.

22  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 19 – Same Crude Mix to Multiple Crude Units
Starting with the results from Class Problem 11 - Adding a New Crude and Vacuum Unit add
structure to the model that will force the same crude mix to SCR1 and SCR3 (SCR2 is
shutdown; maximum capacity = 0).

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.

Remove all crudes from the model except the following:


ARL (Saudi Arabian Light) Max of 50,000 Bbls/Day
ANS (Alaskan North Slope) Max of 44,000 Bbls/Day
ARH (Saudi Arabian Heavy) Max of 100,000 Bbls/Day
TJL (Tia Juana Light) Max of 30,000 Bbla/Day

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.

24  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 21 – Reporting Hydrogen and Sulfur Balances
Be sure you run TR.BAT in the class problem model before starting.

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.

Extra, extra credit:

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.

Use NPA = 50 for DCN.

26  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 23 – Compositional Recursion
Be sure you run TR.BAT in the class problem model before starting

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.

Current flow scheme:

Delayed C1's & C2's to SPFS


C Coker
A
Unsat S
T U PP Mix to SALK & SPFS
Gases
G
M P
F BB Mix to SALK & SPFS

Actual flow scheme:

Unsaturated Gases to SPFS

Delayed C1's & C2's to SPFS


C Coker
A
Unsat S
T
Gases U PP Mix to SALK
G
M P
F BB Mix to SALK
Problem 24 – Using Tables CURVE and NONLIN
Be sure you run TR.BAT in the class problem model before starting

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:

(For the volume based training class model)


Gas Oil, MB/D 10 15 20 25 30 35 40 45 50
AR2,% of Gas Oil 100 64 32 16 8 4 2 1 0

(For the weight based training class model)


Gas Oil, MMeT/D 2 3 4 5 6 7 8 9 10
AR2,% of Gas Oil 100 64 32 16 8 4 2 1 0

Atmos Resid to Gas Oil 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.

28  PIMS Training Class Problems PIMS Process Industry Modeling System


Multi-Period PIMS (PPIMS) Training Class Problems

List of Multi-Period PIMS (PPIMS) Class


Problems
Problem 101 – Short Range Planning
Problem 102 – Short Range Planning
Problem 103 – Short Range Planning
Problem 104 – Long Range Planning
Problem 105 – Long Range Planning
Problem 106 – Multi-Period Gasoline Blending
Problem 107 – Using Unfeasibility Breakers
Problem 108 – Analyzing Blend Results
Problem 109 – Analyzing Blend Results II
Problem 110 – Using Blend Target Recipes
Problem 101 – Short Range Planning
Our company uses a rolling plan every month called a 90 DAY FORECAST. Since we are in the
Planning Group, it is our responsibility to produce this plan. Make a copy of the single period
class model (SAMPLE or VOLSAMP) and call it 90DAY. Convert the model 90DAY to a
PPIMS model with three time periods and prepare a 90 DAY FORECAST using the following
assumptions (ignore the fact that there are more than 90 days in the time period):

The 90 Day Forecast covers three months: May, June, and July.

Gasoline RVP spec is 9 psi for all three months.

Inventory is unchanged for all materials in all three months.

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

LPG 12.60 11.76 10.50


UNLEADED REGULAR 25.20 25.62 26.46
UNLEADED PREMIUM 26.04 26.46 27.30
LEADED REGULAR 23.94 24.36 25.20
KERO/JET 25.20 24.78 24.36
DIESEL 23.10 22.68 22.26
EXPORT DIESEL 23.31 23.31 23.31
LOW SULFUR FUEL OIL 11.00 10.50 10.00
HIGH SULFUR FUEL OIL 9.00 8.50 8.00
ARAB LT ATMOS BTMS 15.00 15.00 15.00
COKE, $/TON 23.00 23.00 23.00
SULFUR, $/TON 100.00 100.00 100.00

Feedstock Availability, MBbls/Day:


MAY JUNE JULY
SAUDI ARABIAN LIGHT 70 80 80
ALASKAN NORTH SLOPE 80 90 60
BACHAQUERO 10 10 10
NORMAL BUTANE ****** AS REQUIRED ******

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.

30  PIMS Training Class Problems PIMS Process Industry Modeling System


Product Demand, MBbls/Day:
MAY JUNE JULY
UNLEADED PREMIUM, MAX 30 32 31
UNLEADED PREMIUM, MIN 30 32 31
LEADED REGULAR, MAX 7 7 7
LEADED REGULAR, MIN 5 5 5
KERO/JET, MAX 11 15 11
EXPORT DIESEL, MAX 3 3 3
LOW SULFUR FUEL OIL, 2 2 2
MAX
ARAB LT ATMOS BTMS, 5 5 5
MAX

All other products to be optimized by pricing without demand constraints.


Problem 102 – Short Range Planning
Rerun Class Problem 102 with the following inventory considerations:
OPEN MIN MAX TARGET
SAUDI ARABIAN LIGHT 136 80 1,000 ?
ALASKAN NORTH SLOPE 182 80 1,000 ?
BACHAQUERO 167 30 400 ?

UNLEADED REGULAR 85 12 200 80


UNLEADED PREMIUM 38 6 80 40
LEADED REGULAR 20 3 50 25
KERO/JET 54 9 100 40
DIESEL 92 15 200 80
LOW SULFUR FUEL OIL 34 10 40 15
HIGH SULFUR FUEL OIL 32 15 80 30
ARAB LT ATMOS BTMS 37 15 80 40

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?

32  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 103 – Short Range Planning
Rerun Class Problem 103 with the following intermediate stock inventory considerations:
OPEN MIN MAX TARGET
LT ST RUN GASOLINE 28 3 40 20
LIGHT HYDROCRACKATE 11 2 20 10
CAT GASOLINE 36 6 80 40
ALKYLATE 12 2 30 15
REFORMATE 34 4 55 30

NAPHTHA H2TRTR FEED 35 6 80 40


KERO H2TRTR FEED 25 3 50 25
DIST H2TRTR FEED 39 5 80 40
CAT CRACKER FEED 62 8 100 50
DELAYED COKER FEED 21 9 60 30
Problem 104 – Long Range Planning
Using the model provided called PPTA devise a process unit turnaround plan for the upcoming
year that will maximize profitability.

The plan currently calls for the following:


NO.
DAYS T/A
DOWN BEGINS
FCCU 14 March 18
ALKY UNIT 14 March 18
HYDROCRACKER 21 May 1
KERO 7 June 24
HYDROTREATER
DIST HYDROTREATER 7 June 24
NAPH 7 October 1
HYDROTREATER
REFORMER 7 October 1

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?

34  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 105 – Long Range Planning
Using the model provided called PPBUD, develop a twelve-month budget for the upcoming
calendar year.
Problem 106 – Multi-Period Gasoline Blending
On your computer is a model called BLEND. The model consists of tables SETUP, RECURSE,
RFORMAT, BLNNAPH and BLNSPEC. The last two tables describe all the blendstock
properties and final product specifications. Using these tables and the information shown below,
build a six-period (six one-day periods) gasoline blending model.

Component rundown rates and Values ($/BBL)


MBBLS/DAY $/BBL MBBLS/DAY $/BBL
NC4 14.00 ISO 3.0 19.00
RFT 15.0 33.00 MTB 1.5 36.0
LCG 13.0 22.00 HCL 5.0 23.00
HCG 2.2 21.00
ALK 7.5 24.00
LNP 5.5 23.00

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

Set the blender capacity to a MIN = 0 and a MAX = 100.

36  PIMS Training Class Problems PIMS Process Industry Modeling System


The lifting schedule is as follows (MBBLS/DAY):
URG MID UPR FIN
DAY 1 40.0 10.0 30.0 0
DAY 2 60.0 25.0 20.0 0
DAY 3 75.0 30.0 15.0 0
DAY 4 60.0 20.0 10.0 0
DAY 5 60.0 20.0 10.0 0
DAY 6 60.0 20.0 10.0 Unlimited

PRICE,$/BBL 25.00 26.00 27.00 25.50

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.

38  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 108 – Analyzing Blend Results
To correct Problem 107, increase the opening inventory of MTBE from 50.0 to 55.0. Because
the blending is considerably constrained by RVP, relax the spec from a maximum of 9 to 10.
Run the model again and produce an across-the-page report.

Analyze the results by checking the following:

 Are unfeasibility breakers in use?

 Are there utility costs?

 Check blend batch sizes—too small or too large.

 Check blend batch recipes. Are they similar or dissimilar for a


given product?

 Check blended product qualities. Is there giveaway?

 Check component inventories. Is the LP altering recipes because


inventories are too high or too low?

 Check product inventories.


Problem 109 – Analyzing Blend Results II
Run Problem 108 again with two scenarios. First, put a $1.00 holding cost on all products and
leave component holding costs at $0.00. Second, reverse the scenario by placing a $1.00 holding
cost on components and $0.00 on products. Save the first run as REPORT1 and the second run
as REPORT2.

Compare the blender activities for all three cases, REPORT, REPORT1 and REPORT2.

40  PIMS Training Class Problems PIMS Process Industry Modeling System


Problem 110 – Using Blend Target Recipes
REPORT2.LST from Problem 109 shows that the recipes vary significantly from period to
period for each blend. Use the average recipe shown in the report as a target. Implement this
target in your model without using BLNTARG. Assume that any deviation from the target will
cost the objective function $0.20 per target BBL. Use the same utility row as you use for the
deviation in octane for FIN. Save the solution as REPORT10.LST and compare to
REPORT2.LST.
Notes:

42  PIMS Training Class Problems PIMS Process Industry Modeling System


Notes:
Notes:

44  PIMS Training Class Problems PIMS Process Industry Modeling System

You might also like