Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Instrumentation

Forty-one measurements come out of the plant, and they are not all the same kind of thing. XMEAS(1..22) are continuous instruments, read every step, computed at teprob.f:679-701 and given additive noise at teprob.f:711-735. XMEAS(23..41) are composition analysers, read on a schedule and reporting the composition from their previous sample (teprob.f:736-761).

Nothing in the continuous block is physics. Every one of the twenty-two lines takes a quantity the model has already computed and converts it into the unit an operator's instrument would read. Getting a conversion wrong changes no state and no derivative; it changes only what the controller sees, which is worse, because the plant then runs correctly and is controlled wrongly.

The conversion factors

FactorWhereMeaning
0.359679, 682-684, 688standard cubic feet per lbmol
35.3145the same lines, and 692, 695, 704-710cubic feet per cubic metre
0.454680, 681, 697kilograms per pound
760685, 691, 694mmHg per atmosphere
101.325the same threekPa per atmosphere

So FTM * 0.359 / 35.3145 is lbmol/h to standard cubic metres per hour, and (P - 760)/760 * 101.325 is mmHg absolute to kPa gauge. Levels are reported as a percentage of a span, and the three vessels do not do it the same way: the reactor and the separator carry hard-coded ranges (teprob.f:686, 690) while the stripper's span is the vessel volume VTC itself (teprob.f:693).

XMEAS(20) is assigned twice

      XMEAS(20)=CPDH*0.0003927D6
      XMEAS(20)=CPDH*0.29307D3

at teprob.f:698-699. The first is dead, and the two factors are not equal: 392.7 against 293.07, a third apart. So this is not a harmless duplicate but a superseded conversion, and a port that took the first line would report compressor work 34% high. That is delta D-006.

The shutdown detector

Eight limits, checked at teprob.f:702-710:

ConditionLimitLine
reactor pressure highabove 3000 kPa gauge703
reactor level highabove 24 cubic metres704
reactor level lowbelow 2 cubic metres705
reactor temperature highabove 175 C706
separator level highabove 12 cubic metres707
separator level lowbelow 1 cubic metre708
stripper level highabove 8 cubic metres709
stripper level lowbelow 1 cubic metre710

The original records only that something tripped, in a single integer ISD. This port reports which, because "the plant tripped" without a reason is nearly useless to a caller and the information is free.

All eight comparisons are strict, so a state exactly on a limit does not trip. That matters for how the adversarial sampling pool is built: states placed on the limits exercise the not-tripped side, and the tripping side needs states past them. Both were built.

Two of the eight are phrased in terms of XMEAS rather than the underlying quantity. teprob.f:703 tests the converted reactor pressure against 3000 kPa gauge, and teprob.f:706 tests XMEAS(9), which is TCR unconverted. Testing PTR against an equivalent mmHg threshold instead would be arithmetically different in the last bits.

What a trip does is described in The right-hand side: it freezes all fifty derivatives (teprob.f:807-811), which is delta D-007.

Noise and dead time

Noise is drawn by TESUB6 (teprob.f:1538-1546), twelve uniform draws summed and scaled, and is skipped entirely at TIME = 0 and on a tripped plant (teprob.f:711). Only the continuous noise is skipped, though. The analyser blocks at teprob.f:744-761 have no such guard, so a tripped plant still draws: 258 draws in a tripped evaluation against 522 in a healthy one, measured in B-0027. A port that silenced everything on a trip would leave the generator 264 steps behind and desynchronise every later draw.

The dead time is a latch, and the order of two lines makes it:

      XMEAS(I)=XDEL(I)
      CALL TESUB6(XNS(I),XMNS)
      XMEAS(I)=XMEAS(I)+XMNS
      XDEL(I)=XCMP(I)

The reported value is taken from the store before the store is updated. Swapping those two lines gives an analyser with no dead time at all, which produces entirely plausible numbers and a plant that is much easier to control than the real one.

Three further details are about when rather than about what. The schedules advance from their own previous value rather than from the current time (TGAS = TGAS + 0.1 at teprob.f:751), so a step arriving late does not shift the schedule. Both 0.1 literals, at teprob.f:741 and 751, are single precision, so the gas interval is 0.10000000149011612 and a step landing on exactly 0.1 does not sample; 0.25 is exactly representable, so the product analyser is unaffected, which is precisely the kind of inconsistency that has to be read off the line rather than inferred from its neighbour. And at TIME = 0 the analysers are primed rather than sampled (teprob.f:736-743): the store and the reported value are both set to the current composition, with no noise and no draw.

The 53 channels

Measurements and manipulated variables together are the 53 columns every downstream consumer sees, in this order. The measurement names follow Downs and Vogel's Table 4 and the manipulated ones their Table 3.

#XMEAS#XMEAS
1A feed22condenser cooling water outlet
2D feed23reactor feed, A
3E feed24reactor feed, B
4total feed25reactor feed, C
5recycle flow26reactor feed, D
6reactor feed rate27reactor feed, E
7reactor pressure28reactor feed, F
8reactor level29purge, A
9reactor temperature30purge, B
10purge rate31purge, C
11separator temperature32purge, D
12separator level33purge, E
13separator pressure34purge, F
14separator underflow35purge, G
15stripper level36purge, H
16stripper pressure37product, D
17stripper underflow38product, E
18stripper temperature39product, F
19stripper steam flow40product, G
20compressor work41product, H
21reactor cooling water outlet

XMEAS(23..28) and XMEAS(29..36) are the two gas analysers, on a 0.1 hour schedule; XMEAS(37..41) is the product analyser, on 0.25 hours.

#XMV#XMV
1D feed flow7separator underflow
2E feed flow8stripper underflow
3A feed flow9stripper steam
4total feed flow10reactor cooling water flow
5compressor recycle11condenser cooling water flow
6purge valve12agitator speed

XMV(12), the agitator, is never written by any controller the driver calls, so in a closed-loop run it has zero variance. That is a fact about the control scheme rather than about the plant, and it is the reason the Tier 5 harness had to learn to report a degenerate ensemble as NaN rather than as a number.