FC Coding is
One step from 1st Principles to Solution!


Oil Refinery Production Model Code
to simulate a refinery's Distillation units
in one run.

Goal for this page: simulate a refinery's entire number of Distillation units in one run.

On this page, we'll show the few code changes necessary to simulate an entire refinery in one run.

1. To start, set iRefinery = 'i'th refinery unit and make a test run ... are results lookin' good? If so, continue to another 'i'th refinery; if not, fix model or whatever needs fixing to get agreement with present production results. Next, change 'iRefinery' refinery setting to another refinery and step through all it's Distillation units until all are working properly and results agree with what is presently being produced.

iRefinery = 2

2. The 'iRefinery' statement must be entered before a call to the 'processing' statement is executed as shown below.

model departments iRefinery = 2 ! must change for each refinery Key point call processing ! distillation model for 'i'th Refinery call inventory ! present supply of various products ooo End

3. Build the Processing model that states how the crude oil is broken down into the sellable oil units; e.g., 10, 20, 30, 90 grades. Think distribution! Where are the different grades to be sold? Heavy grades in the cold parts and light grades in the hot parts of the country. So, in order to help minimize cost, produce the oil products in their appropriate regions.
Processing model is the only one necessary to get things rolling.

model Processing ! All distillation units @ 'i'th refinery i = iRefinery Key point ! assume distillation requires solving a PDE or two. ! below is the bases for solving a PDE. t = 0: tPrt = tPrint do j = 1, nDistillUnits(i) Key point Initiate ISIS for PDEquations ooo do while (t .lt. tFinal) Integrate PDEquations by ISIS if( t .ge. tPrt) print 79, t, (U(ii),ii = 1,ip) tPrt = tPrt + tPrint end do end do crudeErr = crudeErr+(totCrudeIn(i, j)– crudeUsed)**2 79 format( 1x,f8.4,20(g14.5, 1x)) end model PDEquations if( j .eq. 1) then pde_1 = pde equations with parameters ! assume # 3, 7, & 8 products are created qtyProd(3) = qtyProd(3) + ??? qtyProd(7) = qtyProd(7) + ??? qtyProd(8) = qtyProd(8) + ??? elseif( j .eq. 2) then pde_2 = pde equations with parameters ! assume # 2 & 8 products are created qtyProd(2) = qtyProd(2) + ??? qtyProd(8) = qtyProd(8) + ??? ooo end if crudeUsed = crudeUsed + ??? pollution = pollution + ??? cost = cost + mfgCost + distCost + ??? profit = profit + ??? - cost end

The next article will show ALL refineries being executed in one run.

< < Back

Next > >

Problem-Solving Applications include:

CurvFit: a curve fitting program with Lorentzian, Sine, Exponential and Power series are available models to match your data.

Match-n-Freq: a Matched Filter program used to filter signals and slim pulses.

Industry Problem-Solving Descriptions include:

Business Strategies & War Gaming: Buy, Sell, Hold options may be tested for an entire company, individual plant(s), or whole product lines. Imagine an increase in control settings from a 1 or 2 digits (i.e., a guess value) to an 8+ digit accuracy resulting from a Calculus programming calculation!

Pulse Slimming to minimize InterSymbol Interference: via Arbitrary Equalization with Simple LC Structures to reduce errors.

Voice Coil Motor: basically an electromagnetic transducer in which a coil placed in a magnetic pole gap experiences a force proportional to the current passing through the coil.

Electrical Filter Design: find the transfer function's poles & zeros; H(s) = Yout(s) / Yin(s).

Digitized Signal from Magnetic Recording: Magnetic recording of transitions written onto a computer disc drive may produce an isolated pulse as shown.

AC Motor Design: a simulation program for A.C. motor design that was reapplied as a constrained optimization problem with 12 unknown parameters and 7 constraints.

PharmacoKinetics: an open-two- compartment model with first order absorption into elimination from central compartment is presented here.