nbsir 84-

Demand Limiting Algorithms for

Energy Management and Control

Systems

U S. DEPARTMENT OF COMMERCE

National Bureau of Standards

Center for Building Technology

Building Equipment Division

Washington, DC 20234

February 1984

Sponsored by:

Office of Building and Community Systems

U.S. Department of Energy

U.S. Navy Civil Engineering Laboratory

-(X U.S. Department of Defense

34-2326

1934

NBSIR 84-2826

DEMAND LIMITING ALGORITHMS FOR

ENERGY MANAGEMENT AND CONTROL

SYSTEMS

Cheol Park

U.S. DEPARTMENT OF COMMERCE

National Bureau of Standards

Center for Building Technology

Building Equipment Division

Washington, DC 20234

February 1 984

Sponsored by:

Office of Building and Community Systems

U.S. Department of Energy

U.S. Navy Civil Engineering Laboratory

U.S. Department of Defense

U.S. DEPARTMENT OF COMMERCE, Malcolm Baldrige, Secretary

NATIONAL BUREAU OF STANDARDS, Ernest Ambler, Director
.
ABSTRACT

Demand limiting control is one of popular control strategies for electrical

energy management in Energy Management and Control Systems (EMCS) in

commercial/office buildings. The purpose of demand limiting is to maintain

the peak demand level below a predetermined limit by shedding nonessential

loads in a building during the peak demand period. In this present report,

description of fixed interval metering and sliding window metering for

electrical demands are included. Demand limiting calculation procedures

discussed are the ideal rate, the predictive, and the instantaneous rate

methods. Demand limiting algorithms, which were developed based on available

information, are presented. Computer program listings of demand limiting

control algorithms in Fortran 77 and an open-loop computer simulation result

are included in the appendices.

Key words: electrical demand; electrical energy management; electric

power; energy management and control systems; fixed interval

metering; ideal rate method; instantaneous rate method; load

control; predictive method; sliding window metering.

iii
TABLE OF CONTENTS

Page

ABSTRACT iii

LIST OF FIGURES vi

1. INTRODUCTION 1

2. ELECTRICAL DEMAND METERINGS 4

2.1 DEMAND METERS 4

2.2 FIXED INTERVAL METERING 8

2.3 SLIDING WINDOW METERING 10

3. DEMAND LIMITING CALCULATION METHODS 15

3.1 IDEAL RATE METHOD 15

3.2 PREDICTIVE METHOD 19

3.3 INSTANTANEOUS RATE METHOD 20

4. DEMAND LIMITING ALGORITHMS 22

4.1 IDEAL RATE METHOD WITH FIXED INTERVAL 23

4.2 PREDICTIVE METHOD WITH FIXED INTERVAL 24

4.3 PREDICTIVE METHOD WITH SLIDING WINDOW 26

4.4 INSTANTANEOUS RATE METHOD 31

4.5 PREDICTIVE METHOD WITH FLEXIBILITY IN METERING 31

5. LOAD CONTROL ALGORITHM 3 5

6. CONCLUSION 41

REFERENCES 42

APPENDIX A. Computer Program Listing of the Ideal Rate Method

with Fixed Interval-DLRF A-l

APPENDIX B. Computer Program Listing of the Predictive Method

with Fixed Interval - DLPF B-l
Page

APPENDIX C. Computer Program Listing of the Predictive Method

with Sliding Window - DLPS C-l

APPENDIX D. Computer Program Listing of the Instantaneous

Rate Method - DLIS D-l

APPENDIX E. Computer Program Listing of the Predictive Method

with Flexibility in Metering - DLPFS E-l

APPENDIX F. Computer Program Listing of the Load Control

Algorithm - LDONOF F-l

APPENDIX G. Open-loop Computer Simulation G-l

v
LIST OF FIGURES

Page

Figure 1. A sketch of a small demand meter 6

Figure 2. Demand metering set-up for high power users 7

Figure 3. Fixed interval metering 11

Figure 4. Sliding window metering 14

Figure 3. Ideal rate method with offset 16

Figure 6. Upper and lower limits for the ideal rate method 18

Figure 7. Logic flow diagram of the subroutine DLRF for the

ideal rate method 25

Figure 8. Logic flow diagram of the subroutine DLPFA for the

predictive method with fixed interval metering 27

Figure 9. An illustration of sliding window billing method 29

Figure 10. Logic flow diagram of the subroutine DLPSA for the

predictive method with sliding window metering 32

Figure 11. Logic flow diagram of the subroutine DLP for linking .... 34

Figure 12. Logic flow diagram of the subroutine LDONOF for load

control 39
1 . INTRODUCTION

Electrical energy management has an important role in energy management and

control systems (EMCS) in buildings. The purpose of electrical energy

management is to lower the charges imposed by electric utilities. Although

popular strategies for electrical energy management include demand limiting,

duty cycling, time-of-day control, scheduled start/ stop control, and optimum

start/stop control, only demand limiting is discussed in this report.

Electric utility charges are typically based on some combination of electric

energy consumption, fuel adjustment, electric demand, ratchet adjustment, and

power factor [1,2]. Electric energy consumption is defined as the electric

energy usage read by a watt-hour meter in kWh, while the fuel adjustment

charge is based on the kind and cost of fuel used by the utility. The

electric demand charge is the portion of the service charge which is based

upon a customer's demand, and will be explained later. A ratchet adjustment

is made on the basis of energy use or demand. Finally, the power factor is

the relationship between the phase of the current and the phase of the voltage

in alternating current distribution systems. (A low power factor can overload

generating and distribution networks.) Currently, residential customers are

not charged for electric demand and power factor, while industrial and

commercial customers may be billed for all or some charges discussed.

Electric demand is defined as the load integrated over a specified time

interval [3]. In other words, electric demand is the energy consumption over

a specific time interval of 15, 30, or 60 minutes. The time interval is

determined by a utility and is called demand interval. The maximum demand is

the maximum value of demand measures during a billing period in kW. Charges
based on maximum demand allow a utility to recover its capital investment in

generating and distributing equipment U6ed to meet the maximum demand for

electrical power. When the maximum demand of many customers occurs

simultaneously, the peak load of the power system will be high, therefore the

utility's capital investment will be large. During the off-peak period, a

part of the equipment capacity is idle. Because demand charges are high (as

much as 30 percent of some customers' bills [4]) and because a demand charge

is usually based upon the highest demand that has occurred during a billing

period, controlling demand is very important. A high peak demand for just a

few minutes can raise the demand charge for the entire billing period.

An electrical demand limiting strategy is outlined by Shih [5], The purpose

of demand limiting is to maintain the peak demand level below a predetermined

limit by shedding (disconnecting) nonessential loads in a building during the

peak demand period. In conjunction with demand meter pulse signals, Shih

presented two demand limiting methods. These are the predictive method

(forecasting method), and the ideal rate method. The ideal rate method was

used with analog demand limiting meters many decades ago. The concept of

demand control was also explored with comprehensive analyses by Militello [6],

On-peak or off-peak metering, automatic load control, and demand billing

control are extensively discussed in his paper in addition to the concepts of

demand and demand control. The instantaneous rate principle is mentioned as a

load shedding technique by Pannkoke [7]. In this technique, the rate of

electric energy use is measured at short time intervals and compared with a

limiting value. Good examples of the demand computation can be found in

Pannkoke' 8 article. Currently, there exist, as discussed above, three

calculation methods; i.e., ideal rate, predictive (forecasting) and

2
instantaneous methods. These methods are related to the metering technique

employed

.

Two metering techniques, associated with impulse signals from the demand

meter, are known. They are the fixed interval metering and the sliding window

metering. The most widely used one is the fixed interval metering in which

shedding of loads is generally performed sequentially or rotationally. The

loads that have been shed are restored when the demand is lower than a

predetermined level. Novak [8] considered on and off times of loads during

shedding and restoring activities, keeping the number of on and off actions to

a minimum. A new concept for load shedding, called "comfort fairness,"

was briefly introduced in an article by Spethmann [9]. The comfort fairness

concept is not currently involved in the demand limiting algorithm of this

report. The use of this concept can be found in the report of time-of-day

control and duty cycling algorithms by May [ 1 7 ]

.

Although many publications relating to demand limiting are available in the

public domain, no detailed information that is suitable for implementation

utilizing computers has been found. Software on the market, for practical

purposes, is proprietary so that general public has limited access to detailed

information. The present report is intended to describe the concept of demand

limiting, and the possible implementation of the algorithms to digital control

hardware. Metering techniques, calculation principles, and load control

algorithms are discussed, and computer programs written in Fortran 77 are

provided. With presumed data, the open-loop computer simulations were carried

out, and the results are appended for illustration purposes. It should be

noted that demand limit control is a closed loop control in practice.

3
2 . ELECTRIC DEMAND METERINGS

Electrical energy consumption and maximum demand are measured by meters and

serve as the basis of billing for industrial and commercial customers. A

utility and a customer make a contract for the electric charge. Discussion of

the contents of such contracts is beyond the scope of this report. Some ideas

about the rate structure for these charges may be obtained from papers by Teed

[10] and Carpenter [11]. In this chapter, demand meters, fixed interval

metering, and sliding window metering will be described.

2.1 DEMAND METERS

Ordinarily a utility must provide electric power to any customer in any

quantity required. Since alternating-current (AC) power cannot be stored

practically, the utility must increase its generating and distributing

capacities to meet an increased maximum load condition. This results in

larger generators, larger transformers, heavier switches, heavier wires, and

so on. Consequently, fixed investment must be increased to meet increased

customers' requirements. Such a situation was being investigated as far back

as 1892, and as a result, a dual rate of metering was developed [12], In this

scheme, energy use measured by a watt-hour meter and electric power demand

measured by a demand meter determine the charge for billing period.

The demand meter is a device to register the integrated energy used for a

specific time interval, namely electric power. There are two different sizes

of meters available. One is a small demand meter which is housed in the same

4
case of a watt-hour meter. An internal timer with fixed time interval resets

the demand reading at the end of each demand measurement interval. The

maximum value of the demand reading is indicated by a sweephand maximum demand

pointer during the demand period. The pointer can go upward but not downward

until reset is made manually when the meter is read. Thus the maximum demand

during a billing period is determined. Internal mechanical connections are

made between the demand meter and the watt-hour meter. Figure 1 shows a

sketch of a small meter.

Another type of meter is a large demand meter which is a type of recording

instrument separate from the integrating watt-hour meter. Recording can be

done on a chart or a magnetic tape. Chart recording demand meters have become

obsolete and they are being replaced by newer magnetic tape recording device.

For large commercial and industrial users who require more than 500 kW peak

load, large demand meters are installed [13]. The demand meters are linked to

the watt-hour meters electrically. Pulses generated by a signal pickup device

in the watt-hour meter are fed into the demand meter in which the pulses are

totalized for a short time period, and the totalized value is recorded at each

sampling instance for recording. A description of the totalization technique

can be found in a report by Hurley, Kelly, and Kopetka [14]. More detailed

information on demand meters is described elsewhere [12].

For demand control, sampled data from the pulse counter (totalizer) are

required for digital processing by a microprocessor or a computer. The

sampling rate, T g> may depend upon the system of interest. By installing an

optical or mechanical device, electric pulses can be generated in small demand

meters like those discussed earlier. Figure 2 shows a possible arrangement

5
Figure 1. A sketch of a small demand meter

6
COu

0)

CO33

013o

(X x.

60 •H

rC30

34

0<31 4-1 0)

CO603

•H3

0)

4-1 36

T333e3Q

CM333

60 •H

3j 7
for demand metering for a customer using large amounts of electric power.

This illustration provides a general view of demand metering. Besides the

pulses from the watt-hour meter, it is sometimes possible to obtain (from the

utility) a second pulse signal which indicates the end of one demand period

and the start of the next period; a demand interval signal.

2.2 FIXED INTERVAL METERING

Fixed interval metering is the most widely used method in the measurement of

electric demand. For a fixed time interval (15, 30, or 60 minutes set by the

utility), the average power use is computed to be the demand for that period.

At the end of each billing period, the peak demand is then taken by the power

company, and billing is made based on the peak demand in conjunction with the

rate schedule. Since billing methods differ depending on the contract between

the utility and its customers, no attempt is made here to discuss a customer's

payment to a utility in terms of dollars.

A requirement of the fixed interval metering technique is that a reset signal

must be available at the end of every demand interval so that the demand meter

can again accumulate the energy use from zero. The reset signal can be

originated from an internal clock of the demand meter, or from an external

clock. The reset signal may also come directly from the utility to the demand

meters. Should the reset signal fail once, measured demand will be doubled if

the required electric power remains the same for two consecutive demand

periods. Thus, special attention must be paid to detecting the reset signal

when fixed interval metering is used to control demand, especially if the

reset signal is not continuously synchronized with the power company.

8
When the demand interval is D, and the sampling period is T

g

, the number of

samples in the demand interval, n, will be D/T

g

. If the total number of

pulses during the i-th sampling period is given by N^, the average power, P,

which is the demand during the whole demand interval, is expressed by:

n

P - n

i = i

(i)

where C is the conversion factor in kWh per pulse. Since C and T

g are usually

constant, equation (1) yields:

n

P L Ni

i = 1

( 2 )

The instantaneous power at the i-th sampling instant may be given by:

CNi

P

i = T (3)

s

It should be noted that, since the unit of C is kWh per pulse, both D and T

g must be in hours. The term "instantaneous power" means the average power

during a sample period when the pulse counting technique with a watt-hour

meter is used for power measurement. However, if continuous direct power

measurement is available, for example, by means of using analog devices

(voltmeter and ammeter), the sampled data at an instant can be considered the

instantaneous value of power at that instant.

As an example, if D is 30 min, T

g is 60 6ec, is 10 pulses for i-th period,

and C is 0.7 2 kWh per pulse, the instantaneous power at the i-th period can be

9
computed from equation (3), resulting in:

= -< -* Z-2)(10) . 432 kw

60

3600

If the measured number of pulses for all sampling intervals is the same, the

average power in the demand interval is from equation (2):

30

0.72 v- (10) = (1.44)000) = 432 kW

60 (30)

^

This result coincides with the previous result as expected.

Furthermore, suppose pulse counts of 100 and 200 pulses during the first and

second sampling periods, respectively, were obtained during the demand

period, then the integrated demand becomes

P = (1.44) (100 + 200) = 432 kW.

We arrive at the same answer as before. This indicates that high peak power

for a short time period does not really increase the demand because the demand

is an integrated quantity over the demand interval. Figure 3 illustrates

fixed interval metering.

2.3 SLIDING WINDOW METERING

A reset signal, preferably synchronized with the utility's metering system, is

a requirement for using the fixed interval method. When reset signal is not

available or is missing due to equipment failure, fixed interval metering is

10
INSTANTANEOUS

POWER

Reset Reset Reset

TIME

J

Figure 3. Fixed interval metering

11
not desirable. Sliding window metering is the method that is usually used

when there is no synchronized reset pulse. In this technique, the demand

interval is still fixed. If the current sampling instant is moved to the next

sampling period and it becomes the upper limit of the integration, then the

lower limit moves ahead by one sampling period. In this way, the total number

of observations remains unchanged as time progresses so the demand during a

demand period is calculated at the end of each sampling period and one of

those measurements will be the peak demand. Unlike the fixed interval

method, this method requires knowledge of the past history of instantaneous

power measurements between the lower and the upper time limits. This means

that dynamic data storage is needed.

Because dynamic data memory capability is required with sliding window

metering, a computer must be incorporated with the demand meter.

If the energy consumption rate (power), P(t), is sampled with a sampling

period, T and if a zero-order hold filter [15] is employed to reconstruct

the sampled data, the integrated energy consumed, E(t), starting at time t

g and ending the current time, t, can be given by:

tf

n-1

E(t ) = / P(t)dt « £ P(kT ) T

s (4)

J k=0

fc s

where n is the total number of sampled data in the demand period, D. The

demand in that period, P(t), is computed by dividing E(t) by D, namely

12
( 5 ) P(t) E(t)

D

n-1

1 £ P<kT

s

) n k-0

At the next time step, t + T

g

, retaining the same index k for time t,

the demand yields:

n P(t+T ) = E(t'*' T

s

) = 1 £ P(kT_)

D

n k=l

( 6 )

At t + 2 T

g

, the computed demand becomes (see figure 4):

P(t+2Tg

) = E(t* 2T

s

) D

n+2

i £ P(kTg) (7)

Clearly, one can see that the sliding window method is a moving integration

method. Instead of a zero-order hold filter, use of the linear point

connector [15] can be considered to minimize errors when the sampling rate is

low.

The integration method employed in this report is the simple trapezoidal

method. It would not be surprising if the customer's computation of total

energy usage during a billing period disagrees with the utility's meter

reading because different integration methods may be used. It is obvious that

the accuracy of integration will be increased as the sampling rate increases.

13
INSTANTANEOUS

POWER

TIME

Figure 4. Sliding window metering

14
3 DEMAND LIMITING CALCULATION METHODS

The highest demand during a billing period is often used as a basis for

determining the demand charge for a future billing period. The main purpose

of demand limiting is therefore to avoid establishing new higher peaks by

maintaining the maximum demand within a preset limit. Non-essential or lower

priority loads are usually turned off when load shedding becomes necessary by

a demand limiting decision-making process. The load shedding decision is made

by a calculation method that is selected as the most appropriate method for a

given situation. There exist three well-known calculation methods at the

present time [2,5,7,8,9,16]. They are the ideal rate, the predictive (or

forecasting), and the instantaneous rate methods.

3 .1 IDEAL RATE METHOD

The ideal rate method was first used with analog type demand controllers. In

this method, the quantity of energy consumed is measured and accumulated by

the demand controller. The integrated value is then compared with a maximum

allowable value which varies with respect to time in a predetermined rate.

The principle of the ideal rate uses linear prediction to determine the

allowable energy at the next sampling instant, and incorporates fixed interval

metering. This principle may also be applied on large metering devices that

may include computers.

Figure 5 illustrates the ideal rate method. As seen on the figure, an

adjustable offset, E

Q

, is provided to delay required shedding action to a

later stage of time in the demand interval instead of having it in the earlier

15
Offset,

Figure 5. Ideal rate method with offset

16
time. This offset permits restoring of the shed loads during the previous

demand period. If all loads which have been shed are restored at the

beginning of the next demand interval, the offset value should be set at a

relatively high value.

If the maximum allowable demand power during a demand interval is selected as

Pm ax>t*ie integrated energy in that interval will be D times Pmax» The ideal

rate line without the offset, E^(t), as seen in figure 5 , has the slope of

P_ Q „. When the offset value is other than zero, the integrated energy

expression with respect to time, E2(t), can be given by:

where E

Q

is the offset.

Since E

Q and D are positive constants, the rate of change of E^(t) is always

greater than that of E2(t). The ideal rate of change is thus (Pmax “ E

q

/D)

instead of Pmax. Remember that the ideal rate method is used only with fixed

interval metering.

E2(t) may be used as an upper limit for the demand limit control, (see figure

Whenever the measured, integrated energy usage, E(t), exceeds the limit value,

Em ax(t), load shedding takes place. It is also desirable to restore the loads

which were shed if the rate of energy use is much lower than the ideal rate.

( 8 )

6 ).

Emax<t) - E

2 (t) ( 9 )

17
Figure 6. Upper and lower Units for the ideal rate method

18
A minimum limit value can be assigned so that load restoring may be performed

if the energy usage is less than the limit value that is expressed by:

where E

0

' is the intersection that is less than E

Q in the amount of AE. In

terms of the differential, AE, equations (9) and (10) give a relationship as:

Depending upon the value of E at a particular time, the load control actions

may be selected. No control action is needed if the E(t) stays in the range

3 .2 PREDICTIVE METHOD

At each measurement instant in a demand interval, the instantaneous rate of

energy consumption is measured and a forecast of the energy consumption at the

end of the demand interval is made. This calculation procedure is called the

predictive or forecasting method. Either fixed interval or sliding window

metering may be used with the predictive method. The predictive principle

needs more computational effort than the ideal rate principle. As a result,

unlike the ideal rate principle, the predictive method can be employed only

with a computer. For simplicity, the predictive method with fixed interval

metering will be described in this section.

( 10 )

W‘> - W£ > - ( 11 )

as

Emin(t)<E(t)<Emax(t) ( 12 )

19
Assume the desired peak demand is P max* When the peak demand occurs, the

accumulated energy use will be P D, in which the demand interval is a

constant. Knowing that E(t) is the integrated energy consumption from the

beginning of the demand interval to a specific time, t, the total energy

consumption at the end of the demand interval can be predicted. A simple

linear prediction may be made based on the energy use at the current time and

at the previous sampling period. The predicted energy consumption without

correction (shedding loads) at the end of the demand interval, Ep(t), is given

by:

E

p

(t)

• ('•)

E(t) - E(t-T s

) + E(t) (13)

The value of E

p

(t) is compared with Emax( = PmaxD) at a certain time. Loads

are then shed when Ep exceeds the preset value E

mflX. Loads may be restored

when Ep is less than a limit given by

Emin “ PminD ««

where P • is the preset value of power selected as the lower limit.

3 .3 INSTANTANEOUS RATE METHOD

With the instantaneous rate method, the rate of energy consumption is measured

at short time intervals and each measurement is compared with a predetermined

limiting value. Whenever this instantaneous rate exceeds the upper limit,

Pmax»

l° a<* shedding takes place. When the instantaneous rate of energy use is

20
below the limit that is preestablished as the lower limiting value, P

m £ n, loads

are restored. The control band, which is the difference between the upper and

the lower limits, is needed to minimize rapid cycling of the load control

action. As long as the measured power at time t, P(t), stays in the range as

given by Pm £n

<P(t) <?max > loads are neither shed nor restored. The advantage

of using this instantaneous rate principle is that synchronization with the

utility's demand interval is not necessary. This principle, however, does not

involve the demand interval.

21
4. DEMAND LIMITING ALGORITHMS

In previous sections, the general principles of demand limiting have been

reviewed. In this section, the algorithms developed for use with computers

will be discussed. The ideal rate and the predictive methods incorporate

fixed interval metering. The predictive method may also use sliding window

metering, while the instantaneous method does not need specific metering. The

load control algorithm is not given with the main algorithms, but is presented

in Section 5.

The demand limit algorithms use the trapezoidal integration method in which

the average value of the power measured at the current sampling instant and

the power measured at the past sampling instant is computed. The average

power value is then multiplied by the sampling period to give the

instantaneous value of energy consumption at the current time. This approach

provides less computational error than the approach using a zero-order holder.

Although the accuracy of integration can be improved with a high sampling

rate, the system under consideration usually limits the sampling rate.

The algorithms presented here need supporting hardware and software to perform

the actual load shedding. With the aid of the supporting software and

hardware, the pulse countings can be entered and resulting control action

signal can be transmitted to the device of interest. Computer programs are

written in FORTRAN 77 and given in the appendices.

22
4.1 IDEAL RATE METHOD WITH FIXED INTERVAL

The computer algorithm of the ideal rate method is quite simple. Because of

using fixed interval metering with this method, a demand interval reset signal

must be provided. The important input data is the instantaneous power, P(t),

determined by measuring the number of pulses from a watt-hour meter for a

sampling period. An expression of the instantaneous power at a sampling

instant is given by equation (3). The calculation procedure of power using

equation (3) is not included in the algorithm given in this report, because

the power can also be determined from direct measurements of the electric

current and the voltage at an instant.

For a given demand period, D, and sampling interval, T

g

, the average energy

consumption rate is calculated, and then is compared with the preset ideal

rate as described in the section 3.1. The ideal rate is a function of the

maximum allowable power, Pmax» the offset, E

Q

, and the demand interval.

The actual energy usage, E(t), is compared with the maximum energy use

up to the point of time from the beginning of the interval. Load shedding

occurs if E(t) >E

max(t) and loads are restored if E(t)<Em £n

(t), in which

Emax(t) and Em £n

(t) are the upper and lower limiting quantities at time t.

The amount of load to be shed or restored is calculated by:

& = < pmax " VD) - P(t) (15)

where P(t) = (P(t) + P(t - T c ))/2 O (16)

23
For simplicity, Pmax is a constant, but if the rate schedule contains

different rates for different times-of-day, Pmax needs to be varied according

to a predetermined schedule.

A flow chart of the ideal rate method in conjunction with fixed interval

metering is depicted in figure 7. No load shedding or restoring is performed

if the reset signal at the end of the demand interval is missed. Load control

is resumed when the next reset signal is received.

A computer program (DLRF) for this algorithm appears in Appendix A.

4.2 PREDICTIVE METHOD WITH FIXED INTERVAL

The predictive method using fixed interval metering has been described in

Section 3.2. The algorithm for this metering will be explained briefly here.

With this algorithm, the ultimate value of energy consumption at the end of

the demand period is forecasted. At every sampling time, the forecasting is

made and load shedding is performed if the predicted value exceeds the preset

value

To avoid exceeding the preset limit, the amount of power subject to shedding,

AP, is determined from equation (13) and the demand limit value of Pmax*

By differentiating equation (17) with respect to time, using the assumption

-

PmaxD - (17)

D - t

that the predicted energy usage at each time during the remaining time in the

24
I

Figure 7. Logic flow diagram of the subroutine DLRF for the ideal

rate method

25
demand period remains unchanged, i.e. Ep(t) = Ep, the following result is

obtained

- - ( w> - y/<D-t>

2

(is

As time approaches D, the denominator becomes smaller, resulting in an

increment of the rate of change in AP, provided Ep > Pm ayD. This means that

for the same forecasted value of Ep, load shedding is less likely to be needed

at the beginning of the demand interval but the need progressively increases

as time passes until the end of the interval. Because of this effect, demand

limiting control using the predictive method with fixed interval metering

allows an electricity customer to use high power at first, then gradually cut

down as the end of the demand interval approaches to prevent setting a new

peak demand. As a result, utility load curves show a roller-coaster effect

with an overload state at the beginning and an underload condition near the

end of each demand period [16].

Figure 8 shows a logic flow chart of the predictive method using fixed

interval metering. Given Pmax , Pm £n

an<^ D, this method predicts the load

shedding required. If the reset pulse is missed, no load control action takes

place until the reset pulse is restored. The computer program DLPF is based

on this algorithm and is provided in Appendix B.

4.3 PREDICTIVE METHOD WITH SLIDING WINDOW

As mentioned in the previous section, the roller-coaster effect can be

observed in the utility's load curves when customers employ demand limit

26
Figure 8. Logic flow diagram of the subroutine DLPFA for the

predictive method with fixed interval metering

27
controls based on fixed interval metering. Peaks and valleys appear in the

load distribution, resulting in short-time overloading and underloading.

Although short-time high power places a burden on the utility, the charge for

the short-period demand cannot be imposed on the consumers because the

integrated energy use for the demand interval is still below the preset value.

Various billing methods are devised by some utilities. For instance, one

utility company charges its industrial and commercial customers for a maximum

demand that is calculated by the addition of any two adjacent 15-minute energy

consumptions, while another utility computes the demand charge by adding six

adjacent 5-minute energy usages. These cases of sliding window billing

methods are illustrated in figure 9.

The predictive method using the sliding window metering is needed for the

following cases:

(1) When the reset signal at the end of each demand period is not

provided by the utilities.

(2) When the reset pulse misses temporarily.

(3) When the sliding window billing method is used.

For the third case, the sampling period for the instantaneous energy use rate

must be less than the period of the sliding billing.

In the algorithm under consideration, the demand at the next sampling instant

is predicted on the basis of the demands computed at the current time and at

the previous sampling period. The demand period, D, the maximum allowable

demand, Pmax , the minimum demand for restoring loads, Pm £n

> a^d the

sampling period, T , are required input data.

28
TIME (min)

Figure 9. An illustration of sliding window billing method

29
With this algorithm, the demand at the next time step is unknown and thus must

be forecasted from known values. Since the present and past energy

consumptions are known, the energy consumption for a given demand period at

time t + T can be expressed using a linear extrapolation as:

5

E(t + T

s

) = 2 E(t) - E(t - T

g

) (19)

where E(t) and E(t+T ) may be obtained from equations (4) and (6) after

O substituting P(t) as defined in equation (16) for P(t). The value of

E(t - T) can be calculated using the equation:

s

n-2

E(t - T ) = — 2 P(kT ) (20) n

k = -1

where n = D/T c

. s

By letting E(t + T

g

) be Ep(t), a predicted energy consumption one sampling

period ahead, and by letting Emax be the the maximum allowable demand times

the demand interval ( =P max D), the amount of electrical power to be shed when

E_(t) exceeds E_„ v yields:

p in ci a

AP =

Emax

' Ep^

( 21 )

When Ep(t) is lower than Em £ n , which is the product of Pm ^ n and D, loads can

be restored by:

30
AP

E . _min - Vt)

T

s

( 22 )

Figure 10 shows the logic flow of the predictive method with the sliding

window metering. The computer program, DIPS is given in Appendix C.

4.4 INSTANTANEOUS RATE METHOD

The instantaneous rate method uses a very simple algorithm. The required

input data are P(t), Pmaxand The instantaneous energy consumption rate

is the average value of the measured power at the present and the past. Load

shedding occurs if ?(t) > Pmax » and load restoring takes place if P(t) <P

m £n

.

The demand interval is not needed and the sampling period is not specifically

involved. The sampling period is needed in equation (3) if the measurement of

pulses is made in order to determine the power at an instant. Since the

algorithm is so simple, the logic diagram is not provided here. However,

Appendix D provides the computer program listing, DLIS.

4.5 PREDICTIVE METHOD WITH FLEXIBILITY IN METERING

The algorithm introduced here is a combined version of the predictive methods

with the fixed interval metering which appeared in Section 4.2 and the

sliding window metering which was discussed in Section 43. With this

algorithm, one of two metering schemes can be selected depending upon the

user's choice. When the fixed interval method is chosen and the demand

interval reset signal is missed unexpectedly, the metering method is

automatically switched to the sliding window metering. This automatic

31
Figure 10. Logic flow diagram of the subroutine DLPSA for the

predictive method with sliding window metering

32
changeover helps to prevent the accidental creation of a new peak demand when

an unexpected thing happens such as a broken communication link between the

reset signal source and the computer. Fixed interval metering is restored as

as soon as the reset pulse is detected again. Variable peak demand

distributions based on the time-of-day rate schedule may also be incorporated.

The computer program for this algorithm is lengthier than others in this

report, because it allows for flexibility in metering. The logic flow of the

linking program is shown in figure 11. Because the flow charts of predictive

methods used in this algorithm are similar to the ones which appeared in

figures 8 and 10, they are not presented here. The computer program listing,

DLFFS, can be found in Appendix E.

33
Begin

Figure 11. Logic flow diagram of the subroutine DLP for linking

34
5. LOAD CONTROL ALGORITHM

Controlling loads is part of the job required by demand limiting control.

For clarity, the load control algorithm is separately discussed here.

Excellent discussions of load control are given in papers by Zilko

[2], Spethmann [9], Novak [8], and Shih [5], Based upon these previous works,

the present load control algorithm was developed. This algorithm sheds

or restores loads sequentially or rotationally. Provisions for inhibiting

short cycling of equipment are made. However, a "comfort fairness" concept

[10] is not included but the application of such a concept can be found

elsewhere [17].

As pointed out by Pannkoke [7], resistance and motor loads can be shed.

Shedable resistance loads include lighting, electric space heaters, boilers,

electric furnaces, electric ovens, electric water heaters, battery chargers,

de-icers, etc. Motor loads would be fans, pumps, air compressors,

refrigeration compressors, etc. Selective loads to be controlled may be

anything that can be turned off without harming equipment, significantly

impairing comfort, endangering the safety of personnel, or affecting

production capability. Elevators, emergency equipment, essential lighting,

and computers must be excluded from a list of candidates for shedding. If

such loads are included in the list, they must be assigned the highest

priority (i.e., not to be shed).

Sequential load shedding is carried out depending upon priority levels of

loads. The lowest priority load is shed first and restored last, while the

load with the highest priority is cut off last and turned on first. However,

35
when a number of loads are classified with the same priority, the order for

shedding is determined on a rotational base (round-robin). With the

rotational load shedding, a load shed first will be restored first. Each load

has a rating and loads are selected and shed until the accumulated loads being

shed satisfy the shedding requirement.

It is possible that loads with low priority might experience rapid cycling

which might shorten the life of the equipment. To prevent short cycle

operations, time parameters are set for minimum off-time and minimum on-times.

The minimum off-time ensures that once a load is shed, it will not be turned

back on before a predetermined safe period has elapsed. This is particularly

needed for the refrigeration system compressors. On the other hand, the

minimum on-time is needed so that once a load is turned on, it will remain on

for a reasonable time and is essential to prevent motors from being shut off

before reaching full rotational speed.

In addition to these two time parameters, Novak [8] described the maximum offtimes of loads. A noticeable change in temperature, humidity, air quality,

etc. does not permit a certain type of load to be turned off for more than a

specific period. Careful analysis of limiting conditions can determine the

length of the maximum off-period of each load. Also, particularly during an

initial cycle of load control, delay times for starting loads are necessary to

prevent sudden surges of power. Delay times for each load can be set in order

to make a smooth start-up during an initial start period of equipment rather

than turning on a large number of loads all at once.

The algorithm for controlling loads presented here as the subroutine LDONOF

36
incorporates all the elements mentioned above. To use this algorithm, a table

must be prepared prior to the start of program. Load identification number,

priority, average required power, delay time, minimum off-time, minimum ontime, and maximum off-time are tabulated and stored as one of the input files

for the demand limiting program. The priority listed in the table is referred

to as global priority. In contrast to the global priority, local priority

levels are generated internally by the algorithm for loads with the same level

of global priority.

There are two subroutines, PUSH and POP, that support the main load control

routine (LDONOF). One assigns the highest local priority to the load that is

most recently shed (PUSH) and the other assigns the lowest local priority to

the load most recently restored (POP). Using local priority, the rotational

order is created for loads with the same global priority. It is important to

point out that even if a load is in the lowest level of priority, it is not

shedable if the minimum on-time requirement ha6 not been met. On the other

hand, if the minimum off-time for a load has not elapsed, the load cannot be

restored. Implementation of these requirements in the algorithm has

increased its complexity.

The load controller algorithm is as follows:

(1) Set up local priority levels for each global priority level. Two

local priority levels are assigned in a sequential order, one for

turn-off and another for turn-on.

(2) Turn on loads during the initial cycle after delay times have

passed

.

(3) If a power decrease is demanded by a decision-making algorithm as

37
given in Chapter 4, and only if minimum on-times have passed, start

to shed loads with the lowest priority. Then assign the highest

local priority to the load which has just shut off.

(4) Restore loads, if a power increase is allowed, and if minimum offtimes have passed. A load with the highest priority is restored

first. Once a load is back on, assign the lowest local priority to

the load.

(5) If the maximum off-time of a load has elapsed, restore the load

regardless of its priority.

(6) Increase on and off times by one sample period for the use in next

time step.

(7) Go to step (3)

The output values of the load control algorithm are logical values (true or

false). If the logical value of a load is true, it is expected that the load

is turned on, otherwise the load is turned off. A logical value itself cannot

be used to directly to control any device. A command given by a high level

language must be transformed into signals that are associated with

switching devices. Generally machine language subprograms are involved to

speed up the process. Therefore, appropriate software and hardware are

needed with the load control algorithm.

Figure 12 shows the logic flow diagram for the subroutine LDONOF, and its

computer program appears in Appendix F with the PUSH and POP subroutines. To

aid hardware implementation, computer simulations using the open- loop

assumption are described in Appendix G.

38
<

39

Figure

12.

Logic

flow

diagram

of

the

subrotuine

LDONOF

for

load

control
Duty cycle, time-of-day, scheduled start/stop, or optimum start/stop control

may be active at the same time that the demand limiting control is in

operation. Such a case could cause a conflict between control algorithms.

This kind of problem can be resolved by reassigning the level of priority of

each control algorithm depending on the conditions to be met. For instance,

for shedding, a demand limiting controller should have higher priority than a

duty cycling controller. But for restoring activity, the duty cycling

controller can ignore a request to turn on by the demand limiting control. As

a result, a high level supervisory controller is required to control all

control algorithms involved. Since coordination among strategies is discussed

by Spethmann [9] and May [17], further discussion will not be made in this

report

40
6 . CONCLUSION

Demand limiting control is an important strategy for energy management and

control systems (EMCS). The use of demand limiting control can not only avoid

establishment of a new peak demand during a billing period, but it can also

reduce energy consumption. Selection of the appropriate demand limit

algorithm depends upon the billing method of the utility and the availability

of a demand period reset signal. Thus, a demand limiting algorithm should be

tailored according to a given situation. In the load control algorithm used

with a demand limiting control, the input value determination is the

customer's responsibility. The customer must provide sufficient load

flexibility to permit adequate shedding capability. Appropriate coordination

of the hardware, the computer programs provided in this report, and supporting

software are essential for successful controls. When other control strategies

are involved simultaneously with demand limiting, a supervisory program must

govern the controlling activities to resolve conflicts that may arise between

strategies.

It is believed that after necessary modification the algorithms presented

here can be implemented on actual hardware.

41
REFERENCES

[1] Air Conditioning, Heating and Refrigeration News, June 21, 1982.

[2] Zilko, P.S., "Apply Demand Controls for Energy Conservation," Specifying

Engr., Feb. 1981, pp. 74-77 .

[3] IEEE, Standard Dictionary of Electrical and Electronics Terms . 2nd ed.,

edited by Frank Jay, IEEE, New York, 1977.

[4] Potomac Electric Power Co., "Understanding KW Demand," Energy Management

Series, PEPCO, May 20, 1977.

[5] Shih, J.Y., '‘Energy Conservation and Building Automation," ASHRAE Trans.,

Vol. 81, Part 1, Jan. 1975, pp. 419-435.

[6] Militello, P.G., "Concepts in Demand Control," Public Utilities

Fortnightly, Aug. 1975, pp. 29-34.

[7] Pannkoke, T., '*rhe Ups and Downs of Demand Limiting," Heating/Piping/Air

Conditioning, Dec. 1976, pp. 25-30.

[8] Novak, W.J., "Saving Energy through Load Scheduling, Cycling and

Shedding," Electrical Construction and Maintenance, Vol. 77, No. 4, April

1978, pp. 57-62.

[9] Spethmann, D.H., "Electrical Energy Management," ASHRAE Journal, July

1981, pp. 31-35.

[10] Teed, R.H., "A Practioner Looks at Peak-Load Pricing," Public Utilities

Fortnightly, Jan. 29, 1956 , pp. 26-29.

[11] Carpenter, W.W., "The Energy Ratchet Rate Form," Public Utilities

Fortnightly, Jan. 3, 1974, pp. 28-31.

[12] General Electric, "Manual of Demand Meters," General Electric,

Publication GET-23 27 C.

42
[13] Potomac Electric Power Co., "Demand Measurement Instrumentation," Energy

Management Service, June 24, 1977.

[14] Hurley, C.W., Kelly, G.E., and Kopetka, P.A., "Using Microcomputers to

Monitor the Field Performance of Residential Heat Pumps," Natl. Bur. of

Standards, NBSIR 81-2285, June 1981.

[15] Tretter, S.A., Introduction to Discrete-time Signal Processing. John

Wiley, N.Y., 1976.

[16] Quinn, G.C. and Knisley, J.R., "Controlling Electrical Demand,"

Electrical Construction and Maintenance, June 1976, pp. 43-52.

[17] May, W.B., 'Time of Day Control and Duty Cycling Algorithms for Building

Management and Control Systems," Natl. Bur. of Standards, NBSIR 83-2713,

1983.

43

APPENDIX A. Computer Program Listing of the Ideal Rate Method with

Fixed Interval-DLRF

QSQSQ$*DL< 1 ) . DLRF (0

)

1 C ****» »** **»**«*«*****»*****•********»*****»*..**««**«.*»«<,.*...*

2 C

3 C DLRFMAIN « Demand limiting main program for the Ideal rate method

4 C with fixed Interval metering

5 C

6 C January 12, 1984 C.P.

7 C

8 C

-

9 C 10 c DELAY Delay time to start (min)

1

1

c DELP The amount of power to be shed or restored (kV)

12 c DIFF Difference between maximum and minimum energy levels

13 c ( kVh

)

14 c DMDP Demand period (min)

15 c ID Identification number of a load

16 c INITST True for Initial start

17 c False when no Initial start Is needed

18 c IRESET 1 for on-status of the reset signal of demand metering

19 c 0 for off-status of the reset signal

20 c ITIME Number of samples taken from the beginning of sampling

21 c LDNAME Load name

22 c LOADON True If the load Is turned on

23 c False If the load Is turned off

24 • c MAXOFF Maximum off-time of a load (min)

25 c MINOFF Minimum off-time of a load (min)

26 c MINON Minimum on-time of a load (min)

27 c NL Maximum number of loads (»50>

28 c NLD Total number of loads

29 c OFFSET Offset at the beginning of each demand period ( kVh

)

30 c PDATA Measured power data (kV)

31 c PLOAD Nominal power of a load (k V)

32 c PMAX Maximum power allowed In a demand limit period

33 c (kV)

34 c PRILOV Lowest global priority

35 c PRIOR Global priority of a load

36 c The highest priority Is 1 and the lowest priority Is 37 c PRILOV.

38 c PRT True If printing of detailed Information of load statu:

39 c Is desired.

40 c False If short print-out Is desired.

41 c RESET True when a reset signal Is on.

42 c False when the reset signal Is off.

43 c TSAMPL Samp 1 1 ng per 1 od (min)

44 c 45 c

* 46 c 47 LOGICAL RESET, LOADON, INITST, PRT

48 REAL MAXOFF .MINOFF .MINON

49 INTEGER PRIOR .PRILOV

50 CHARACTER LDNAME* 1

5

51 PARAMETER (NL-50)

52 COMMON /BK1 / DMDP .TSAMPL , PMAX, DIFF, OFFSET, PDATA

53 & /BK2/ RESET, IRESET, ENCAL

54 & /BK3/ MAXOFF (NL ) .MINOFF (NL ) .MINON ( NL ) .PRIOR (NL )

,

55 & LDNAME ( NL ) .PLOAD (NL ) .DELAY ( NL > , INITST

56 & /BK4/ NLD, I D(NL) .LOADON (NL ) , PR I LOV , LPR I OF ( NL , NL ) , 57 & LPRLOV(NL),LPRION(NL,NL),PRT

A-l
58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

1 10

1 1 1 112

113

114

115

NAMELIST /INPUT/ DMDP , TSAMPL , PMAX , D I FF , OFFSET , PR I LOW , PRT , I N I TST

& /OUTPUT/ IT IME .PDATA , IRESET.DELP

C

C Read Input data files and print them.

C

OPEN!7,FILE-’INPUTRF’

)

OPEN(8,FILE"*LOADTABL*

)

OPEN!9,FILE-’INPUTPWR’

REWIND 7 REWIND 8 REWIND 9 C

READ(7, INPUT)

PRINT INPUT

PRINT 4000

1-1

10 READI8, 1000, END-20) I D < I ) , L DNAME ( I

)

READ (8,*) ID( I ) .PRIORI I ) ,PLOAD( I ) , DELAY! I ) .MINOFF ( I )

,

& M I NON < I ) .MAXOFF ( I

)

PRINT 2000, I D { I ) , LDNAME! I ) .PRIORI I > .PLOAD! I ) .DELAY! I ) .MINOFF ( I ), & M I NON ( I ) .MAXOFF! I

I-IM

GOTO 10

20 NLD-I-1

C

C Read power and reset signals from a meter In real control

C

ITIME-0

30 READI9,*, END-999) PDATA, IRESET

IF ( ITIME.EQ.0.AND. IRESET.NE. 1 ) GOTO 30

I F C ITIME.EQ. 1441 ) ITIME-1

PRINT 3000

C

C Ideal rate method using fixed Interval metering

C

CALL DLRF(DELP)

C

C Control loads based on priorities, minimum on/off-tlmes

C and maximum on-times of loads.

C

CALL LDONOF ( DELP

)

PRINT OUTPUT

I F ( .NOT. PRT) THEN

PRINT 5000, ( ID( I > , 1-1 ,NLD>

PRINT 6000, ( LOADON1 I > , I"1 ,NLD ) END I

F

ITIME-ITIME+1

DELP-0.0

GOTO 30

C

1000 FORMAT! 13, IX, A15)

2000 FORMAT! 15, 1X.A15, I3.5F10.2)

3000 FORMAT! 80! ’ - ' ) / ) 4000 FORMAT! //T4, • ID ’ ,T9 ,’ ITEM’ ,T21 , ’PRIORITY* ,T30. ’PLOAD*

,

& T40, ’DELAY* ,T50, ’MINOFF * ,T60, ’MINON * ,T70, ’MAXOFF*/)

5000 FORMAT! 201 4)

6000 FORMAT! 20L4)

C

A2
116

117

118

119

1 20

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

noon

oooooooooooononnoooooooooooonooooon

999 STOP

END

DLRF t Demand limiting using Ideal rate method with

fixed Interval metering

January 12, 1984 C.P.

DELP

DIFF

DMDP

EEMAX

EMIN

ENCAL

IRESET

NNINT

OFFSET

PDATA

PMAX

PWR

RESET

TSAMPL

The amount of power to be shed or restored (kW)

Difference between maximum and minimum energy levels

(kWh ) Demand period (min)

The amount of energy used from the beginning of

a demand limit period to the current time (kWh)

Maximum energy level allowed at sampling Instant

(kWh)

Minimum energy level allowed at sampling Instant

(kWh)

Energy used from the beginning of demand period to the

sampling 1 nstant ( 1 . e . , the latest value of E) (kWh)

1 for on-status of the reset signal of demand metering

0 for off-status of the reset signal

Number of samples In a demand limit period

Maximum number of samples In a demand limit per1od(<=60)

Offset at the beginning of demand period (kWh)

Measured power data (kW)

Maximum power allowed In a demand limit period

(kW)

Average value of power at current and past sampling

Instants (kW)

True when a reset signal Is on. False when the reset signal Is off.

Sampling period (min)

SUBROUTINE DLRF ( DELP

)

LOGICAL RESET

PARAMETER (NINT-60)

DIMENSION P(0sNINT) ,E(0«NINT)

COMMON /BK 1 / DMDP, TSAMPL, PMAX, DIFF, OFFSET, PDATA

& /BK2/ RESET, IRESET, ENCAL

NAMELIST /OUTRF I / I , PWR , ENCAL , EMAX , EMI

DATA I CYCLE , I FLAG /0 , l/,E(0)/0.0/

Bypass when the reset signal Is missed and resume the normal

operation when the reset signal appears

I F ( I FLAG . EQ . 2 ) THEN

I F ( IRESET. EQ. 1 ) THEN

I F LAG®

ICYCLE-0

ELSE

PRINT 3000

RETURN

END I

ENDIF

A174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

C

C Reset the counting of samples

C

1 F ( I RESET . EQ . 1 .AND. I FLAG . EQ . 1 > THEN

N-DMDP /TSAMPL+0 .01

RESET-. TRUE.

NN-0

END I

F

C

C Set all energy stock values zero at the end of demand period

C except the Initial cycle

C

I F ( RESET ) THEN

1 F ( I CYCLE . EQ .0 ) THEN

P < 0 ) -P DATA

ENCAL-0.0

ICYCLE-1

ELSE

P ( I ) -PDATA

ENCAL-ENCAL* 1 P(I)+P(I-1 > > /2 . *TSAMPL /60

.

P (0 ) -P { I

)

END I

F

1-0

DO 10 K-0 ,

N

10 E ( K ) -0.0

RESET-. FALSE.

C

C Calculate average power and determine the power to be shed

C or restored.

C

ELSE

P ( I ) -PDATA

El I >-<P< I > + P( 1-1 ) )/2.*TSAMPL/60.+E( 1-1

)

ENCAL-El I

)

EMAX- (PMAX-60.0*OFFSET/DMDP )*( I*TSAMPL/60. ) OFFSET

EMIN-EMAX-DIFF

IF(l.LT.N) THEN

PI I

) -60 . * ( E ( I )-E( 1-1 ) l/TSAMPL

PWR-Pl 1

)

IF1E1 I ) .GT.EHAX) THEN

DELP-PMAX-60 . *OFFSET/DMDP-P ( I

)

PRINT 1000, -DELP

ELSEIF (El I ) .LT.EMIN) THEN

DELP-PMAX-60. *OFFSET/DMDP-P< I

)

PRINT 2000, DELP

END 1

F

END I

F

ENDIF

C

PRINT OUTRFI

I - 1 1 NN-NN+

1

C

C Set a flag to bypass the calculation when the reset signal misses

C

1F1NN.GT.N) THEN

NN-NN-1

IFLAG-2

A4
232

233

234

C

1000

ENDIF

FORMAT ( /5X ,

' POWER TO BE SHED* ,F10.2, * —

235 2000 FORMAT (/5X,

*

POWER TO BE RESTORED’ ,F10.2

236 3000 FORMAT <*1111111 MISSING RESET SIGNAL !!!!!'/)

237

238

239

C

RETURN

END

A

’

)

, ’*

)

APPENDIX B. Computer Program Listing of the Predictive Method with

Fixed Interval - DLPF

QSQ$Q$*DL( 1 ) . DLPF (0

)

1 c *•*••••****«*********•«*••«•«*««*•**•*********• «** **•****•*•

2 C

3 C DLPFMAINt Demand limiting main program for predictive method

4 C using fixed Interval metering

5 C

6 C January 12, 1984 C.P.

7 C

8 C

-

9 C

i£r C DELAY Delay time to start (min)

li C DELP The amount of power to be shed or restored (kW)

12 c DMDP Demand period (min)

13 c ID Identification number of a load

14 c INITST True for Initial start

15 c False when no Initial start Is needed

16 c IRESET 1 for on-status of the reset signal of demand metering

17 c 0 for off-status of the reset signal

18 c ITIME Number of samples taken from the beginning of sampling

19 c LDNAME Load name

20 • c LOADON True If the load Is turned on

21 c False If the load Is turned off

22 c MAXOFF Maximum off-time of a load (min)

23 c MINOFF Minimum off-time of a load (min)

24 c MI NON Minimum on-time of a load (min)

25 c NL Maximum number of loads (“50>

26 c NLD Total number of loads

27 c PDATA Measured power data (kW)

28 c PLOAD Nominal power of a load (kW)

29 c PMAX Maximum power allowed In a demand limit period

30 c (kW)

31 c PMIN Minimum power allowed In a demand limit period

32 c (kW)

33 c PRILOW Lowest global priority

34 c PRIOR Global priority of a load

35 c The highest priority Is 1 and the lowest priority’ Is 36 c PRILOW.

37 c PRT True If printing of detailed Information of load statu

38 c Is desired.

39 c False If short print-out Is desired.

40 c RESET True when a reset signal Is on.

41 c False when the reset signal Is off.

42 c 43 c

* 44 c 45 LOGICAL RESET, LOADON, INITST, PRT

46 REAL MAXOFF .MINOFF .MINON

47 INTEGER PRIOR .PRILOW

48 CHARACTER LDNAME* 1

5

49 PARAMETER <NL=50>

50 COMMON /BK1/ DMDP .TSAMP L , PMAX , PM IN, PDATA

51 & /BK2/ RESET, IRESET, PPRED.ENCAL

52 & /BK3/ MAXOFF ( NL ) .MINOFF (NL ) , M I NON ( NL ) .PRIOR (NL ) , 53 & LDNAME ( NL >

, PLOAD (NL ) .DELAY (NL ) .INITST

54 & /BK4/ NLD, ID(NL) , LOADON (NL > , PR I LOW. LPR I OF ( NL , NL )

,

55 & LPRLOW( NL ) ,LPRION( NL ,NL ) ,PRT

56 NAMELIST /INPUT/ DMDP , TSAMP L , PMAX , PM I N , PR I LOW , PRT , I N I TST

57 & /OUTPUT/ ITIME, PDATA, IRESET, DELP

B-l
58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

1 10

111

112

113

114

115

C

Cc

c

10

20

C

CC

30

C

C

c

cc

c

c

c1000

2000

3000

4000

5000

6000

C999

Read Input data files and print them.

0PEN(7,F I LE- * INPUTPF * ) 0PEN!8,FILE-’L0ADTABL’ ) 0PEN(9,FILE-’ INPUTPWR'

REWIND 7 REWIND 8 REWIND 9 READ ( 7 .INPUT)

PRINT INPUT

PRINT 4000

1-1

READ( 8, 1000, END-20) I D < 1 ) , L DNAME ( I

READ (8,*) I D < I ) .PRIORI I ), PLOAD ( I.DELAY! I.HINOFF ( I )

& M I NON ( I > .MAXOFF ( I

PRINT 2000, I D ( I > , LDNAME ( I ) .PRIORI 1 > .PLOAD ( I ) .DELAY! I ) .HINOFF ( I )

& MI NON ( I > .MAXOFF! I

1 - 1*1

GOTO 10

NLD-I-1

Read power and reset signals from a meter In real control

ITIME-0

READI9,*, END-999) PDATA , I RESET

I F < ITIME.EQ.0.AND.IRESET.NE.1) GOTO 30

I F ( ITIME.EQ. 1441 ) ITIME-1

PRINT 3000

Predictive method using fixed Interval metering

CALL DLPFAI DELP

Control loads based on priorities, minimum on/off-tlmes

and maximum on-times of loads.

CALL LDONOF I DELP ) PRINT OUTPUT

IF ( . NOT . PRT > THEN

PRINT 5000, ( ID! I ) , 1-1 ,NLD)

PRINT 6000, (LOADONI I ) , 1-1 ,NLD)

END I

ITIME-ITIME+1

DELP-0.0

GOTO 30

FORMAT! 13, 1X.A15)

FORMAT! 15, IX, A1 5,13, 5F 10. 2)

FORMAT ! 80! )/)

FORMAT! //T4, ’ ID* ,T9, • ITEM* ,T21 , ’PRIORITY' ,T30, ’PLOAD*

& T 40 , ’DELAY’ ,T50, ’MINOFF ’ , T60 ,’ MI NON ’ , T70, ’MAXOFF’/)

FORMAT ! 201 4

F ORMAT ! 20L4

STOP

END

B-2
116

117

118

119

120

121

122

c

C

C

C

C

CC

DLPFA i 1

January

Demand limiting using predictive method with

fixed Interval metering

12, 1984 C.P.

1 6 0 V 124 C DELP The amount of power to be shed or restored (kW)

125 C DMDP Demand per 1 od (min)

126 c E The amount of energy used from the beginning of

127 c a demand limit period to the current time (kWh)

128 c EMAX Maximum energy level allowed In a demand limit per 1 od

129 c (kWh)

130 c EMIN Minimum energy level allowed In a demand limit per 1 od

131 c (kWh)

132 c ENCAL Energy used during a sampling period (kWh)

133 c EPRED Predicted value of energy use during a demand period

134 c (kWh)

135 c IRESET 1 for on-status of the reset signal of demand metering

136 c 0 for off-status of the reset signal

137 c N Number of samples In a demand limit period

138 c N 1 NT Maximum number of samples In a demand limit per 1od( =60)

139 c P Power at a sampling Instant (kW)

140 ,c PDATA Measured power data ( kW > 141 c PLOAD Nominal power of a load (kW)

142 c PMAX Maximum power allowed In a demand limit period

143 c (kW)

144 c PMIN Minimum power allowed In a demand limit period

145 c (kW)

146 c PPRED Predicted value of average power for a demand 1 1ml t 147 c per lod (kW)

148 c RESET True when a reset signal Is on.

149 c False when the reset signal Is off.

150 c TSAMPL Samp 1 1 ng per 1 od (min)

151 c

* 152 c 153 SUBROUTINE DLPFA(DELP)

154 LOGICAL RESET

155 PARAMETER (NINT-60)

156 DIMENSION P(0sNINT) ,E(0tNINT)

157 COMMON /BK1 / DMDP .TSAMPL , PMAX, PMIN, PDATA

158 & /BK2/ RESET, IRESET, PPRED , ENCAL

159 NAMELIST /OUTPF I / I , PPRED , EPRED , EMAX , EMI N , ENCAL

160 DATA ICYCLE, IFLAG/0, 1/

161 c 162 c Bypass when the reset signal Is missing and resume the norma 1 163 c operation when the reset signal appears.

164 c 165 I F < I FLAG . EQ . 2 ) THEN

166 IF( IRESET. EQ.l ) THEN

167 ICYCLE-0

168 IFLAG-1

169 ELSE

170 PRINT 3000

171 RETURN

172 ENDIF

173 ENDIF

B-3
174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

CC Reset the counting of samples

C

IF ( IRESET.EO. 1 .AND. IFLAG.EQ.Il THEN

N-DMDP/TSAMPL+0.01

RESET-. TRUE.

NN-0

END I

C

C Set all energy stock values zero at the end of demand period

C except the Initial cycle.

C

I F (RESET ) THEN

I F ( I CYCLE . EQ .0 ) THEN

P (01-PDATA

ENCAL-0.0

ICYCLE-1

ELSE

P( I l-PDATA

ENCAL-ENCAL-MP1 I >+P< 1-1 ) >/2 . *TSAMPL/60.

P < 0 ) «P ( I ) END I

1-0

DO 10 K-0,N

10 E ( K ) -0.0

RESET-. FALSE.

CC Predict energy use at the end of demand period and

C determine the power to be shed or restored.

C

ELSE

P ( I l-PDATA

E( I )-(P( I > + P( 1-1 ) 1/2 . *TSAMPL/60. +E ( 1-1

ENCAL-E ( I

EMAX-PMAX*DMDP/60.

EMIN=PMIN*DMDP/60.

IF(I.LT.N) THEN

EPRED- ( N- 1 ) * < E ( I )-E< 1-1 ) )+E( I

PPRED-60.*EPRED/DMDP

IF(EPRED.GT.EMAX) THEN

DELP-60 . * ( EMAX- EPRED ) / < DMDP- 1 *TSAMPL

PRINT 1000, -DELP

ELSEIFIEPRED.LT. EMIN) THEN

DELP-60.* <EMIN-EPRED)/<DMDP-I*TSAMPL)

PRINT 2000, DELP

ENDIF

END I

ENDIF

PRINT OUTPFI

I-I + l NN-NN+1

C

C Set a flag to bypass the prediction when the reset signal misses.

C IF(NN.GT.N) THEN

NN-NN-l

IFLAG-2

PRINT 3000

B-4
232 PRINT 3000

233 END IF 234 C 235 1000 FORMAT! /6X , * POWER TO BE SHED • , F 10 . 2

, *

236 2000 FORMAT! /5X,

’

POWER TO BE RESTORED F 10 .

2

237 3000 FORMAT! * I I I 1 ! I I MISSING RESET SIGNAL mil’/

238 C

239 RETURN

240 END

—* )

, **••

)

)

i B-5
*
APPENDIX C. Computer Program Listing of the Predictive Method

with Sliding Window - DLPS

Q$Q$Q$*DL ( 1 ) .DLPS(0>

12

3

45

6

7

C

* C

C

C

C

C

C

DLPSMAI N t Demand limiting main program for predictive method

using sliding window metering

January 12, 1984 C.P.

o L

9 c 10 c DELAY Delay time to start (min > 11 c DELP The amount of power to be shed or restored (kW)

12 c DMDP Demand period (min)

13 c ID Identification number of a load

14 c INITST True for Initial start

15 c False when no Initial start Is needed

16 c ITIME Number of samples taken from the beginning of sampling

17 c LDNAME Load name

18 c LOADON True If the load Is turned on

19 c False if the load Is turned off

20 c MAXOFF Maximum off-time of a load (min)

21 c MINOFF Minimum off-time of a load (min)

22 c MI NON Minimum on-time of a load (min)

23 c NL Maximum number of loads (“50)

24 c NLD Total number of loads

25 c PDATA Measured power data (kW)

26 c PLOAD Nominal power of a load (kW)

27 c PMAX Maximum power allowed In a demand limit period

28 c (kW)

29 c PMIN Minimum power allowed In a demand limit period

30 c (kW)

31 c PRILOV Lowest global priority

32 c PRIOR Global priority of a load

33 c The highest priority Is 1 and the lowest priority’ 1 s 34 c PRILOW.

35 c PRT True If printing of detailed Information of load status

36 c Is desired.

37 c False If short print-out Is desired.

38 c TSAMPL Samp 1 1 ng per lod (min)

39 c 40 c

* 41 c 42 LOGICAL LOADON, INITST, PRT

43 REAL MAXOFF , MINOFF .MINON

44 INTEGER PRIOR, PRILOW

45 CHARACTER LDNAME* 1

5

46 PARAMETER (NL=50>

47 COMMON /BK

1

/ DMDP .TSAMPL , PMAX, PMIN, PDATA

48 & /BK2/ PPRED , ENCAL

49 & /BK3/ MAXOFF (NL ) .MINOFF (NL ) , MI NON ( NL ) , PR I OR ( NL > , 50 & LDNAME(NL) .PLOAD (NL ) , DELAY ( NL ) .INITST

51 & /BK4/ NLD, ID(NL) , LOADON ( NL > , PR I LOW, LPR IOF ( NL , NL ) , 52 & LPRLOW(NL) ,LPRION(NL,NL ) ,PRT

53 NAMELIST /INPUT/ DMDP , TSAMPL , PMAX , PMI N , PR I LOW , PRT , I N ITST

54 & /OUTPUT/ ITIME, PDATA, DELP

55 c 56 c Read Input data files and print them.

57 c

C-l
1

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

0PEN!7,FILE-’INPUTPS’ ) OPEN18.FILE-* LOADTABL *

OPEN!9,FILE-’ INPUTPWR’ > REWIND 7 REWIND 8 REWIND 9 C

READ(7, INPUT)

PRINT INPUT

PRINT 4000

1-1

10 READ(8, 1000. END-20) I D ( I ) , LDNAME ( I

READ (8,*) I D ( I > .PRIORI I ) ,PLOAD( I ) .DELAY! I ) .MINOFFU )

& MI NON ( I ) .MAXOFF ( I

PRINT 2000, ID! I > .LDNAME! 1 ) .PRIOR! I > .PLOAD! I ) .DELAY! I > .MINOFF! I >, & MINON! 1 ) .MAXOFF! I

1-1*1

GOTO 10

20 NLD-I-1

CC Read power signal from a meter In real control

C

1TIME-0

30 READ(9,*, END-999) PDATA

IF! 1TIME.EQ.144I) ITIME-1

PRINT 3000

C

C Predictive method using sliding window metering

C CALL DLPSA! DELP

C

C Control loads based on priorities, minimum on/off-tlmes

C and maximum on-times of loads.

C

CALL LDONOF < DELP > PRINT OUTPUT

IF!. NOT . PRT ) THEN

PRINT 5000 ,!ID!I),1-1,NLD)

PRINT 6000, ! LOADON ! I ) , I - 1 , NLD

END I

ITIME-ITIME+1

DELP-0.0

GOTO 30

C

1000 FORMAT! 13, IX, A15)

2000 FORMAT! 1 5 , 1 X , A1 5 , 1 3 , 5F 10. 2

3000 FORMAT! 80! ’-’ >/)

4000 FORMAT! //T4, ’ ID ’ ,T9 ,

’ ITEM’ ,T21 , ’PRIORITY* , T30, • PLOAD ’

& T40, ’DELAY’ ,T50, ’MINOFF ’ ,T60, ’MINON* ,T70, ’MAXOFF’/)

5000 FORMAT! 201 4)

6000 FORMAT! 20L4)

C

999 STOP

END

c ••*••*••••••••*«*•••*«***•*••»•**•****•*•*••***••*»*•*•***•*••*****•*

C

C DLPSA t Demand limiting using predictive method with

C sliding window metering

C-2
January 12, 1984 C.P

116 C 117 C 118 C 119 C 120 C DELP The amount of power to be shed or restored (kW)

121 C DMDP Demand per 1 od (min)

122 C E The amount of energy used from the beginning of

123 C a demand limit period to the current time (kWh)

124 C EMAX Maximum energy level allowed In a demand limit per 1 od

125 C (kWh)

126 C EMIN Minimum energy level allowed In a demand limit per 1 od

127 c (kWh)

128 c ENCAL Energy used during a sampling period (kWh)

129 c EPRED Predicted value of energy use during a demand period

130 c (kWh)

131 c N Number of samples In a demand limit period

132 c NINT Maximum number of samples In a demand limit per 1od( =60)

133 c PDATA Measured power data ( kW > 134 c PLAG Time- lagged power (kW)

135 c PMAX Maximum power allowed In a demand limit period

136 c (kW)

137 c PMIN Minimum power allowed In a demand limit period

138 c (kW)

139 c PPRED Predicted value of average power for a demand 1 1 m 1

1

140 c per lod (kW)

141 c START True at the beginning of program run

142 c False otherwise

143 c TSAMPL Sampl Ing per lod (min)

144 C 145 c 146 SUBROUTINE DLPSA(DELP)

147 LOGICAL START

148 PARAMETER (NINT-60)

149 DIMENSION PLAG (0 : N I NT ) , E (0 : 2

)

150 COMMON /BK1 / DMDP .TSAMPL , PMAX, PMIN, PDATA

151 & /BK2/ PPRED, ENCAL

152 NAMELIST /OUTPSW/ I , PPRED , EPRED , EMAX , EMI N , ENCAL

153 DATA START/. TRUE./

154 c 155 c Determine the number of samples per sample period.

156 c 157 N= DMDP /TSAMPL +0.01

158 c 159 c Initialize the regressor vector of power.

3 60 c 161 1 F ( START ) THEN

162 ICYCLE=0

163 1=0

164 DO 10 K=0 , N 165 10 PLAG ( K ) =0 .

0

166 START-.FALSE.

167 c 168 c Determine the regressor vector of power In the learningi period.

169 c 170 ELSEIFt ICYCLE.EQ.0) THEN

171 PLAG(0)-PDATA

172 DO 20 K=N-1 ,0,-1

173 20 PLAG( K+l >-PLAG(K)

C-3
174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

IF(I.EQ.N-l) ICYCLE-1

I - 1 1 C

C Predict energy use at the next sampling Instance

C and determine the power to be shed or restored.

C

ELSE

PLAG101-PDATA

SUM-0.0

00 30 K-l.N-l

30 SUM- SUM* TSAMPL/ 60 . * ( PLAG ( K l+PLAC (KM ) >/2.

E ( 0 ) -SUM

E< 1 )-TSAMPL /60. * ( PLAG (0 ) PLAG( 1))/2.*E(0)

ENCAL-E ( 1

)

E ( 2 > -2*E 1 1 )-E(0)

EPR ED-E ( 2 ) PPRED-60.*EPRED/DMDP

EMAX-PMAX*DMDP /60

.

EMIN-PMIN*DMDP/60.

IF(EPRED.GT.EMAX) THEN

OELP-60. • ( EMAX-EPRED ) /TSAMPL

PRINT 1000, -DELP

ELSEIFIEPRED.LT. EMIN) THEN

DELP-60.M EMI N-EPRED) /TSAMPL

PRINT 2000, DELP

ENDIF

C

PRINT OUTPSV

CC Shift back the regressor vector by one sample period

C DO 40 K-N- 1 ,0,-1

40 PLAG1K+1 )«PLAG(K)

ENDIF

C

1000 FORMAT! /5X , * POWER TO BE SHED • , F 10. 2 , * »> 2000 F0RMAT1/5X,

*

POWER TO BE RESTORED F 10 . 2 ,••

)

C RETURN

END

C-4
APPENDIX D. Computer Program Listing of the Instantaneous Rate

Method - DLIS

Q$QSQ$*DL ( 1 > .DLIS(0>

1 C ******

2 C

3

4

5

6

7

CC

c

c

c

DLISMAIN t Demand limiting main program for Instantaneous

rate method

January 12, 1984 C.P.

o

9 c 10 c DELAY Delay time to start (min)

n c DELP The amount of power to be shed or restored (kW)

12 c ID Identification number of a load

13 c INITST True for Initial start

14 c False when no Initial start Is needed

15 c 1TIME Number of samples taken from the beginning of sampling

16 c LDNAME Load name

17 c LOADON True If the load Is turned on

18 c False If the load Is turned off

19 c MAXOFF Maximum off-tlme of a load (min)

20 c MINOFF Minimum off-tlme of a load (min)

21 c MI NON Minimum on-time of a load (min)

22 c NL Maximum number of loads {*50)

23 c NLD Total number of loads

24 c PDATA Measured power data (kW)

25 c PLOAD Nominal power of a load (kW)

26 c PMAX Maximum power allowed In a demand limit period

27 c (kW)

28 c PMIN Minimum power allowed In a demand limit period

29 c (kW)

30 c PRILOW Lowest global priority

31 c PRIOR Global priority of a load

32 c The highest priority Is 1 and the lowest priority Is 33 c PRILOW.

34 c PRT True If printing of detailed Information of load status

35 c Is desired.

36 c False If short print-out Is desired.

37 c 38 c

* 39 c 40 LOGICAL LOADON, INITST, PRT

41 REAL MAXOFF, MINOFF, MINON

42 INTEGER PRIOR, PRILOW

43 CHARACTER LDNAME* 1

5

44 PARAMETER (NL-50)

45 COMMON /BK1 / PMAX, PM IN, PDATA

46 & /BK3/ MAXOFF (NL ) , MI NOFF ( NL ) , MI NON ( NL ) , PR I OR ( NL )

,

47 & LDNAME (NL ) .PLOAD (NL ) , DELAY ( NL ) .INITST

48 & /BK4/ NLD, ID(NL ) .LOADON (NL )

, PR I LOW, LPR IOF ( NL , NL )

,

49 & LPRLOW( NL > , LPR I ON ( NL , NL ) ,PRT

50 NAMELIST /INPUT/ PMAX , PMI N , PR I LOW, PRT , I N ITST

51 & /OUTPUT/ ITIME, PDATA, DELP

52 c 53 c Read Input data files and print them.

54 c 55 OPEN (

7

.FILE-’ INPUTIS’ ) 56 OPEN (

8

.FILE-’ LOADTABL *

)

57 OPEN(

9

.FILE-’ INPUTPWR’

)

D-l
58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

REWIND 7 REWIND 8 REWIND 9 C

READ(7, INPUT)

PRINT INPUT

PRINT 4000

I- 1 10 READ(8, 1000, END-20) I D ( I ) , LDNAME ( I

)

READ (8,*) ID< I > .PRIORI 1 ), PLOAD ( I ) , DELAY! I ) .MINOFF ( I )

,

& MI NON ( 1 ) ,MAXOFF ( I

)

PRINT 2000, I D ( I ) , LDNAME ( I ) .PRIORI I ) .PLOAD ( I ) , DELAY! I ) .MINOFF ( I )

,

& M I NON ( I > .MAXOFF! I ) I-I + l GOTO 10

20 NLD-I-1

C

C Read power from a meter In real control

C

ITIME-0

30 READ<9,*, END-999) PDATA

IF( ITIME.EQ. 1441 ) ITIME-1

PRINT 3000

C

C Instantaneous rate method

C

CALL DLIS(DELP)

CC Control loads based on priorities, minimum on/off-tlmes

C and maximum on-times of loads.

C

CALL LDONOF ( DELP > PRINT OUTPUT

I F ( . NOT . PRT ) THEN

PRINT 5000, ( ID( I ) , 1-1 ,NLD)

PRINT 6000, !LOADON! I ) , 1-1 ,NLD>

END I

ITIME-ITIME+l

DELP-0.0

GOTO 30

C

1000 F0RMAT(I3,1X,A15>

2000 F OR MAT (I5,1X,A15,I3,5F10.2)

3000 F OR MAT ( 80 ( * - ’ > /

)

4000 FORMAT! //T4, ’ ID* ,T9, * ITEM* , T2 1

, ’PRIORITY* , T30 , ‘PLOAD’

,

& T 40 , ’DELAY’ ,T50, ’MINOFF ’ ,T60, ’MINON ’ ,T70, ’MAXOFF’/)

5000 FORMAT! 201 4)

6000 FORMAT! 20L 4)

C

999 STOP

END

c •«•***•»•**•••*•••••*•*•*••«••••••**••••*«•*•**«**•****••*•****«••••«

C

C DL1S > Demand limiting using Instantaneous rate method

C

C January 12, 1984 C.P.

C

C

D-2
116 C DELP The amount of power to be shed or restored (kW>

117 C PAVG Average value of current and past powers

118 C PDATA Measured power data (kW)

119 C PLAG Time- lagged power (kW)

120 C PMAX Maximum power allowed In a demand limit period

121 C ( kW > 122 C PMIN Minimum power allowed In a demand limit period

123 C (kW)

124 C RESET True when a reset signal Is on. 125 C False when the reset signal Is off.

126 c **« 127 C

128 SUBROUTINE DLIS(DELP)

129 LOGICAL RESET

130 DIMENSION PLAG (0i 1

131 COMMON /BK1 / PMAX, PMIN, PDATA

132 NAMELIST /OUTISV/ PAVG , PMAX , PMI

133 DATA RESET/. TRUE./

134 C

135 IF (RESET) THEN

136 PLAG(0>-0.0

137 PLAG ( 1 >-0.0

138 RESET-. FALSE.

139 C

140 ELSE

141 PLAG(0)-PDATA

142 PAVG- ( PLAG (0)+PLAG( 1 ) )/2.

143 I F ( PAVG . GT . PMAX ) THEN

144 DELP-PMAX-PAVG

145 PRINT 1000, -DELP

146 ELSE I F ( PAVG . LT . PMI N > THEN

147 DELP -PM IN- PAVG

148 PRINT 2000, DELP

149 END I

150 C

151 PRINT OUTISV

152 C

153 PLAG( 1

) -PLAG (0

)

154 ENDIF

155 C 156 1000 FORMAT ( /5X , * POWER TO BE SHED • ,F 10 .

,

’ ’ > 157 2000 F OR MAT (/5X, *+ + + POWER TO BE RESTORED F 10 . 2 ,•’

)

158 C

159 RETURN

160 END

D-3

APPENDIX E. Computer Program Listing of the Predictive Method

with Flexibility in Metering - DLPFS

Q$Q$Q$*DL ( 1 ) .DLPFS(0>

12 C

* C

3

A C DLPFSMAI N * Demand limiting main program for predictive method

4

5

6

L

c

c January 12, 1984 C.P.

/B

9

L

c

c DELAY Delay time to start (min)

10 c DELP The amount of power to be shed or restored (kW)

11 c DHDP Demand period (min)

12 c FIXINT True If fixed Interval metering is used

13 c False If sliding window metering Is used

14 c ID Identification number of a load

15 c INITST True for Initial start

16 c False when no Initial start Is needed

17 c IRESET 1 for on-status of the reset signal of demand metering

18 c 0 for off-status of the reset signal

19 c ITIME Number of samples taken from the beginning of sampling

20 c LDNAME Load name

21 c LOADON True If the load Is turned on

22 c False If the load Is turned off

23 c MAXOFF Maximum off-time of a load (min)

24 c MINOFF Minimum off-time of a load (min)

25 c M I NON Minimum on-time of a load (min)

26 c MODE 1 for fixed Interval metering

27 c 2 for sliding window metering

28 c NL Maximum number of loads (*50)

29 c NLD Total number of loads

30 c PDATA Measured power data (kW)

31 c PLOAD Nominal power of a load (kW)

32 c PMAX Maximum power allowed In a demand limit period

33 c (kW)

34 c PM1N Minimum power allowed In a demand limit period

35 c (kW)

36 c PRILOW Lowest global priority

37 c PRIOR Global priority of a load

38 c The highest priority Is 1 and the lowest priority Is 39 c PRILOW.

40 c PRT True If printing of detailed Information of load status

41 c Is desired.

42 c False If short print-out Is desired.

43 c TSAMPL Sampl Ing per lod (min)

44 c 45 c

* 46 c 47 LOGICAL RESET, FIX I NT, LOADON, INITST, PRT

48 REAL MAXOFF , MINOFF ,MINON

49 INTEGER PRIOR .PRILOW

50 CHARACTER LDNAMEM5

51 PARAMETER (NL-50)

52 COMMON /BK1/ DMDP, TSAMPL , PMAX, PMIN, PDATA

53 & /BK2/ FIX I NT, RESET, IRESET , PPRED , ENCAL

54 & /BK3/ MAXOFF (NL ) , MI NOFF ( NL ) , MI NON ( NL )

, PR I OR ( NL )

,

55 & LDNAME ( NL ) .PLOAD (NL ) , DELAY ( NL ) .INITST

56 & /BK4/ NLD, ID(NL ) , LOADON ( NL ) , PR I LOW, LPR IOF ( NL , NL )

,

57 & LPRLOW( NL ) ,LPRION(NL,NL>,PRT

E-l
58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

NAMELIST /INPUT/ DMDP , TSAMPL , PMAX , PMI N ,PR I LOW, PRT .MODE , I N ITST

& /OUTPUT/ I T IME , PDATA , IRESET,DELP,F1XINT

DATA F1X1NT/. FALSE./

C

C Read Input data files and print them.

C

OPEN(7,FILE-*I NPUTPFS *

OPEN(8,FILE* * LOADTABL * OPENtS.FILE-’lNPUTPWR* > REWIND 7 REWIND 8 REWIND 9 C

READ17, INPUT)

PRINT INPUT

PRINT 4000

1-1

10 READ(8, 1000, END-20) I D < I > , LDNAMEt I

READ (8,*) I D < I >

, P R I OR < I > ,PLOAD( I ) , DELAY! I ) , MINOFF ill*

& M I NON ( I ) , MAXOF F ( 1

PRINT 2000, I D ( I ) .LDNAMEU )

, PR IOR ( I 1 , PLOAD ( I ) , DELAY! I ) .MINOFF (I)

& MINON( I ) , MAXOF F < I

I - 1 1 GOTO 10

20 NLD-I-1

CC Read power and reset signals from a meter In real control

C when fixed Interval metering Is used(MODE-l )

C Read power data only from a meter when sliding window

C meter tng Is usedl MODE-2 )

C

ITIME-0

30 READ(9,«, END-999) PDATA, IRESET

I F ( MODE .EQ. 1 .AND. ITIME.EQ.0.AND. IRESET.NE.l ) GOTO 30

IF( ITIME.EQ. 1441 ) ITIME-1

PRINT 3000

C

C Predictive method Is called using sliding window or fixed

C Interval metering

C

CALL DLP(MODE.DELP)

CC Control loads based on priorities, minimum on/off-tlmes

C and maximum on-times of loads.

C

CALL LDONOF ( DELP > PRINT OUTPUT

I F ( .NOT. PRT) THEN

PRINT 5000, (ID(I),I-1,NLD)

PRINT 6000, (LOADON1 I ) , 1-1 ,NLD)

END I

ITIME-ITIME+1

DELP-0.0

GOTO 30

C

1000 FORMAT! 13, IX, A15)

2000 FORMAT ( 15, 1X.A15, 1 3 , 5F 10. 2

3000 FORMAT ( 80( * - ' )/

E-2
116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

4000 F0RMAT(//T4, ’ ID’ ,T9, ’ ITEM’ , T2 1

,

* PR IOR I TY * , T30 , ’PLOAD'

& T40, ’DELAY’ ,T50, ’ Ml NOFF ’ ,T60, ’M1NON ’ ,T70, ’MAXOFF ’/

)

FORMAT (2014)

FORMAT ( 20L4

)

5000

6000

C999 STOP

END

DLP i Demand limiting link program for predictive method

January 12, 1984 C.P.

SUBROUTINE DLP ( MODE , DELP

)

LOGICAL RESET, FIXINT

COMMON /BK1 / DMDP , TSAMPL , PMAX , PMI N , PDATA

& /BK2/ FIXINT, RESET, IRESET , PPRED , ENCAL

Sliding window metering

IF ( MODE . EQ . 2 ) THEN

CALL DLPSB(DELP)

Fixed Interval metering

If the reset signal Is missing at the next sampling

Instance, sliding window metering Is activated. When

the reset signal Is restored, fixed Interval metering

Is also restored.

ELSE IF (MODE . EQ. 1 ) THEN

I F < IRESET. EQ. 1 ) THEN

FIXINT-. TRUE.

ENDIF

IF (F IXINT) THEN

CALL DLPFB(DELP)

ELSE

CALL DLPSB(DELP)

ENDIF

ENDIF

RETURN

END

DLPFBt Demand limiting using predictive method with

fixed Interval metering

January 12, 1984 C.P.

168 C DELP

169 C DMDP

170 C E 171 C 172 C EMAX

173 C

The amount of power to be shed or restored

Demand period

The amount of energy used from the beginning of

a demand limit period to the current time

Maximum energy level allowed In a demand

(kW)

(min)

(kWh)

limit per lod

(kWh)

E-3
174

175

176

177

178

179

1 80

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

oooo

non

o

oo

o

oo

o

o

n

o

oo

n

oo

n

o

o

o

oo

o

oo

EMIN

ENCAL

EPREO

EPS

F 1 X I NT

IRESET

NNINT

PPDATA

PMAX

PMIN

PPRED

RESET

TSAMPL

Minimum energy level allowed In a demand limit period

(kWh)

Energy used during a sampling period <kWh)

Predicted value of energy use during a demand period

(kWh)

A small positive number (-0.01)

True If fixed Interval metering Is used

False If sliding window metering Is used

1 for on-status of the reset signal of demand metering

0 for off-status of the reset signal

Number of samples In a demand limit period

Maximum number of samples In a demand limit per

Power at a sampling Instant

Measured power data

Maximum power allowed In a demand limit period

Minimum power allowed In a demand limit period

Predicted value of average power for a demand 1 per 1 od

True when a reset signal Is on. False when the reset signal Is off.

Samp 1 1 ng per 1 od

1 od ( *60

(kW)

(kW)

( kU > (kW)

Imlt

(kW)

(min)

SUBROUTINE DLPFB(DELP)

LOGICAL RESET, FIXINT

PARAMETER (NINT=60)

DIMENSION P(0:NINT) ,E(0«NINT)

COMMON /BK1 / DMDP, TSAMPL, PMAX, PMIN.PDATA

& /BK2/ FIXINT, RESET, IRESET, PPRED, ENCAL

NAMELIST /OUTPF I / I , PPRED , EPRED , EMAX , EMI N , ENCAL

DATA ICYCLE/0/

Reset the counting of samples

I F ( IRESET. EQ. 1 ) THEN

N=DMDP/TSAMPL+0.01

RESET- . TRUE

NN-0

END I

Set all energy stock values zero at the end of demand period

except the Initial cycle

I F ( RESET ) THEN

IF ( ICYCLE . EO.0) THEN

P ( 0 ) -PDATA

ENCAL-0.0

ICYCLE-1

ELSE

P( I ) =PDATA

ENCAL ENCAL'*- ( P ( I )*P( 1-1 ) >/2 . *TSAMPL/60.

P (0)*P ( I

END I

1-0

DO 10 K-0.N

10 E ( K ) -0.0

E-4
232 RESET-. FALSE.

233 C 234 C Predict energy use at the end of demand period and

235 C determine the power to be shed or restored.

236 C 237 ELSE

238 P < I l-PDATA

239 E( I >-(P< I >*P( 1-1 ) >/2.*TSAMPL/60.+E( 1-1

)

240 ENCAL-E ( I

)

241 EMAX-PMAX*DMDP/60.

242 EMI N-P MIN* DMDP / 60.

243 IF(I.LT.N) THEN

244 EPRED- ( N- 1 ) * ( E ( I ) -E ( I - 1 ) >+E( I

)

245 PPRED-60.*EPRED/DMDP

246 IF(EPRED.GT.EMAX) THEN

247 DEL P -60. * ( EMAX-EPRED )/( DMDP-I*TSAMPL

)

248 PRINT 1000, -DELP

249 ELSEIFIEPRED.LT. EMIN) THEN

250 DELP-60.*(EMIN-EPRED)/( DMDP- 1 *TSAMPL

251 PRINT 2000, DELP

252 ENDIF

253 ENDIF

254 ENDIF

255 PRINT OUTPFI

256 I-I + l 257 NN-NN+1

258 C

259 C Switch over to sliding window metering when

260 C the reset signal Is not detected.

261 c 262 IF (NN.GT.N) THEN

263 ICYCLE-0

264 FIXINT-. FALSE.

265 RESET-. TRUE.

266 PRINT 3000

267 ENDIF

268 c 269 1000 FORMAT ( /5X ,

* POWER TO BE SHED • , F 10 . 2 , • *)

270 2000 FORMAT (/5X,

'

POWER TO BE RESTORED F 10. 2 ,'*

)

271 3000 FORMAT! ’!!!!!!! SWITCHED TO SLIDING WINDOW mi!*/)

272 C

273 RETURN

274 END

275 c *** 276 c 277 c DLPSB « Demand limiting using predictive method with

278 c sliding window metering

279 c 280 c January 12, 1984 C.P.

281 c

L —

283 c DELP The amount of power to be shed or restored (kW)

284 c DMDP Demand period (min)

285 c E The amount of energy used from the beginning of

286 c a demand limit period to the current time (kWh)

287 c EMAX Maximum energy level allowed In a demand limit per 1 od

288 c (kWh)

289 c EMIN Minimum energy level allowed In a demand limit per lod

E-5
290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

C

Cc

c

c

c

ccc

cc

cc

c

c

c

c

c

c

cc

c

c

cc

10

c

cc

20

c

cc

c

30

(kWh)

ENCAL Energy used during a sampling period (kWh)

EPRED Predicted value of energy use during a demand period

(kWh ) N Number of samples In a demand limit period

NINT Maximum number of samples In a demand limit per 1 od ( -60

PDATA Measured power data (kW)

PLAG Time-lagged power (kW)

PMAX Maximum power allowed In a demand limit period

(kW)

PM I N Minimum power allowed In a demand limit period

(kW)

PPRED Predicted value of average power for a demand 1 1 m 1

per 1 od (kW)

RESET True when a reset signal Is on. False when the reset signal Is off.

TSAMPL Samp 1 1 ng per 1 od (min)

SUBROUTINE DLPSB(DELP)

LOGICAL RESET

PARAMETER (NINT-60)

DIMENSION PLAG<0:NINT) , E ( 0 : 2

COMMON /BK 1 / DMDP , TSAMPL , PMAX , PMI N , PDATA

& /BK2/ FIXINT, RESET, IR ESET , PPRED , ENCAL

NAMELIST /OUTPSW/ I , PPRED , EPRED , EMAX , EMI N , ENCAL

Determine the number of samples per demand period

N“ DMDP /TSAMPL *0.01

Initialize the regressor vector of power.

I F ( RESET ) THEN

ICYCLE-0

1=0

DO 10 K=0 ,

PLAG( K ) =0.0

RESET-. FALSE.

Determine the regressor vector of power In the learning period.

ELSEIF1 ICYCLE.EQ.0) THEN

P LAG ( 0 ) =P DATA

DO 20 K-N-l ,0,-1

P LAG ( K+- 1 ) -PLAG ( K ) IF(I.EQ.N-l) I CYCLE

I-I + l Predict energy use at the next sampling Instance

and determine the power to be shed or restored.

ELSE

PLAG(0)-PDATA

SUM=0 .0

DO 30 K* 1 N

SUM=SUM+TSAMPL/60. * ( PLAG ( K ) +PLAG ( K + 1 ) )/2.

E ( 0 ) -SUM

E-6
348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

non

E ( 1 )»TSAMPL/60 . * ( PLAG10) +PLAG (l))/2,+E(0)

ENCAL-E( 1

E(2)-2*E( 1 )-E<0>

EPRED“E ( 2

)

PPRED-60.*EPRED/DMDP

EMAX-PMAX*DMDP/60.

EMIN«PMIN*DMDP/60.

IF ( EPRED .GT.EMAX ) THEN

DELP" 60. *( EMAX-EPRED l/TSAMPL

PRINT 1000, -DELP

ELSEIF(EPRED.LT.EMIN) THEN

DELP"60.*(EMIN-EPRED ) /TSAMPL

PRINT 2000, DELP

ENDIF

C

PRINT OUTPSV

Shift back the regressor vector by one sample period

DO 40 K-N-1,0,-1

40 PLAG ( K+ 1 )"PLAG( K

)

ENDIF

C

1000 FORMAT ( /5X , ’ POWER TO BE SHED * , F 10. 2 , • * > 2000 FORMATi /5X, ’+ POWER TO BE RESTORED F 10. 2 ,*»

)

C

RETURN

END

E-7

APPENDIX F. Computer Program Listing of the Load Control

Algorithm - LDONOF

Q$Q$Q$*DL ( 1 ) .LDONOF(0)

1 C

*’ 2 C

3 c LDONOF t Turn on or off loads

4 c

5 c April 29, 1983 C.P.

6 C

7 C

8 C

9 C DELAY Delay time to start (min ) 10 C DELP The amount of power to be shed or restored (kW>

1c EPS Small positive number for tolerance! >0.01

12 c INITST True for Initial start

13 c False when no Initial start Is needed

14 c ISTAT Number of loads which are turned on at ari Initial stage

15 c I SUM Number of loads turned on during Initial cycle

16 c LOADON True If the load Is turned on

17 c False If the load Is turned off

18 c LPR Local priority of a load

19 c LPRIOF Local priority of a load for shedding

20 c L PR I ON Local priority of a load for restoring

21 c LPRLOW Lowest local priority level

22 c MAXOFF Maximum off-time of a load (min)

23 c MINOFF Minimum off-time of a load (min)

24 c MI NON Minimum on-time of a load (min)

25 c NL Maximum number of loads (*50)

26 c NLD Total number of loads

27 c PLOAD Nominal power of a load (kW)

28 c PRI Global priority of a load

29 c PRILOW Lowest global priority

30 c PRIOR Global priority of a load

31 c The highest priority Is 1 and the lowest pr lor 1 ty 1 s 32 c PRILOW.

33 c PRT True If printing of detailed Information of load status

34 c Is desired.

35 c False If short print-out Is desired.

36 c SUMPINT Summed nominal power turned on during Initial cycle

37 c SUMP Summed nominal power actually shed or restored at an Instant

38 c (kW)

39 c TOFF Off-time of a load (min)

40 c TON On-time of a load (min)

41 c TSAMPL Samp 1 1 ng per 1 od (min)

42 c 43 c

* 44 c 45 SUBROUTINE LDONOF ( DELP > 46 c 47 REAL MAXOFF , MINOFF .MINON

48 INTEGER PRIOR , PRI , PRILOW

49 LOGICAL LOADON, INITST.PRT

50 CHARACTER LDNAMEM5

51 PARAMETER (NL=50>

52 DIMENSION TONI NL ) , TOFF ( NL ) , ISTAT ( NL

53 COMMON /BK1 / DMDP .TSAMPL ,PMAX , PM IN, P DATA

54 COMMON /BK3/ MAXOFF <NL ) .MINOFF (NL )

,

I NON ( NL ) .PRIOR (NL ) , 55 & LDNAME ( NL ) .PLOAD (NL ), DELAY! NL > .INITST

56 & /BK4/ NLD, ID(NL ) .LOADON (NL ) , PR I LOW, LPR IOF ( NL , NL ) , 57 & LPRLOW( NL ) , LPR I ON ( NL , NL ) ,PRT

F-l
58

59

6 0

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

NAMELIST /NAM1 / SUMINT, ISUM, IN1TST

& /NAM2/ SUMP

DATA EPS/0.01/, 1FLAG/0/

C

C Initial Izatlon

C

I F ( I FLAG . EQ .0 ) THEN

DO 10 I-l.NLD

TON ( I >-0.0

TOFF ( I >-0.0

LOADON1 I >-. FALSE.

I STAT ( I >-0

10 CONTINUE

CC Set up local priority levels for each global priority

C level, P R I OR Cl). Two local priority levels are assigned

C In a sequential order, one for turn-off and another for

C turn-on.

C

DO 40 PRI-1.PRIL0W

K-0

DO 20 I-I.NLD*

IF(PRIOR< I > .EQ.PRI > THEN

K-KM

LPR IOF ( PR I , I )-K

END I

20 CONTINUE

LPRL0W1 PR I ) -K

KK-LPRLOWt PR I ) + l DO 30 I-l.NLD

IF(PRIOR(I>. EQ.PRI) THEN

KKb KK~

LPRION(PRI,I)-KK

END I

30 CONTINUE

40 CONTINUE

IFLAG-1

ENDIF

C

C Turn on loads during the Initial cycle after delay tines

C are over,

cC

IF ( INITST) THEN

ISUM-0

SUMINT-0.0

DO 50 I-l.NLD

IF1T0FFU >.GE.DELAY(I >) THEN

L0AD0N1 I >- . TRUE

SUMINT-SUMINT+PL0AD1 I

ISTAT < I >-i

ENDIF

ISUM-ISUM*ISTAT< I

I F ( ISUM.EQ.NLD> INITST- .FALSE

50 CONTINUE

PRINT NAM1

ENDIF

C

F-2
116

117

lie

119

1 20

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

C Shed loads If power decrease Is demanded by the

C amount of DELP, and If minimum on-times are passed.

C Start to shed loads with low priority first.

C Asstgn the highest local priority to the load most

C recently shed.

C

IF ( DELP . LT. -EPS ) THEN

SUMP-0.0

DO 90 PR I -PR 1 LOW, 1,-1

60 DO 80 LPR-LPRLOW( PR I ) , 1

, -

DO 70 I - 1 , NLD

IF (PRIORI I ) .GE.PRI . AND. TON ( I) .GE.MINONU ) . AND . MAXOFF ( 1 ) .GT.

& 0.0 .AND . LOADON ( I ) . AND . LPR I OF (PRI , I ) .EQ.LPR ) THEN

LOADON ( I )-. FALSE.

TOFF ( I >-0.0

KEY-LPR I OF ( PR I , I

CALL PUSH ( KEY , PR I

)

SUMP -SUMP -»P LOAD ( I > PRINT 1000,1

GOTO 60

ENDIF

I F ( SUMP . GE . -DELP > GOTO 100

70 CONTINUE

80 CONTINUE

90 CONTINUE

100 PRINT NAM2

ENDIF

C

C Restore loads If power Increase Is allowed by the

C amount of DELP, and If minimum off-times are passed.

C Start to restore loads with high priority first.

C Assign the lowest local priority to the load most

C recently restored.

C

IF ( DELP .GT . EPS ) THEN

SUMP-0.0

DO 140 PRI-1 , PRILOV

110 DO 130 LPR-1 ,LPRLOW(PRI

)

DO 120 I - 1 , NLD

IF(PRIOR( I > .EQ.PRI .AND. TOFF < I > .GE .MINOFF ( I ) .AND.

& < .NOT.LOADON< I > > . AND . LPR ION ( PR I , I > .EQ.LPR) THEN

LOADON! I

) - . TRUE

TON ( I >-0.0

ISTAT ( I >-l

KEY-LPRIONIPRI , I

CALL POP ( KEY , PRI)

SUMP-SUMP+PLOADI I

PRINT 2000,1

GOTO 110

ENDIF

I F ( SUMP . GE . DELP > GOTO 150

120 CONTINUE

130 CONTINUE

140 CONTINUE

150 PRINT NAM2

ENDIF

C

C Restore loads regardless of priority level. If maximum

F-3
174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

CC

160

C

CC

170

C

C

C

C

180

C1000

2000

3000

4000

5000

C

C

c

cc

c

c

c

c

c

c

off-times are passed.

1 F ( .NOT. INITST) THEN

DO 160 PR I * 1 .PRILOV

DO 160 I-l.NLD

IF (PRIORI I ) .EQ.PRI .AND.TOFF( I ) .GE . MAXOFF ( 1 ) & .AND. ( .NOT.LOADON( 1 > ) ) THEN

LOADON ( 1

) * . TRUE

TON ( I >-0.0

KEY-LPR I ON ( PR I , I ) CALL POP ( KEY , PR I

PRINT 5000,1

END I

CONTINUE

ENDIF

Print details

1F(PRT> THEN

PRINT 3000

DO 170 I-l.NLD

PRINT 4000, I ,PLOAD( I ) ,TOFF< 1 ) ,MINOFF ( I > ,TON( I > ,MINON< I >

& LOADON ( I > , PRIORI I > , LPR 10F ( PR 10R ( I > ,1 > , LPR ION ( PR IOR ( I > ,1

ENDIF

Increase on- and off-times by one sample period for

the use In the next time step

DO 180 I-l.NLD

I F ( LOADON ( I ) ) THEN

TON ( I

) -TON ( I ) +TSAMPL

I F ( TON ( I ) .GE . 2*MINON( I > 24*60) TON( I >-2*HINON( I

ELSE

TOFF ( I )-TOFF ( I )+TSAMPL

IF ( TOFF ( I ) . GE . 2*MAXOF F ( I >+24*60) TOFF ( I

> -2*MAXOFF ( I

ENDIF

CONTINUE

FORMAT ( 5X ,

’ LOAD # ’

, 1 5 , 2X ,

• SHED ’> FOR MAT ( 5X, ’+ LOAD ’ , 1 5 , 2X , ’RESTORED + + + + + + •

F ORMAT ( /T5 , * I • ,T10, ’PLOAD’ ,T21 , ’TOFF’ ,T29, ’MINOFF *

4T50, ’MINON ’ , T56 ,

* STATUS ’ , T63 , ’PR I ’ ,T67, ’LPR I OF’ ,T74

FORMAT ( I5,5(F9.2, IX) ,3X,L1 ,2X, I4,2(3X, 13, IX)

FORMAT(5X,

'+ + LOAD #’, 1 5 , 2X ,’ RESTORED SINCE

& ’THE MAXIMUM OFF-TIME IS PASSED’)

T41 , ’TON’

, ’LPRION’/)

RETURN

END

PUSH « Determine local priority levels for each given

global priority . Assign the highest local priority to the load

which Is most recently shed.

April 27, 1983 C.P.

F-4
232 C ** 233 C 234 SUBROUTINE PUSH { KEY , PR I

)

235 LOGICAL LOADON , PRT

236 INTEGER PRI.PRILOW

237 PARAMETER <NL=50)

238 COMMON /BK4/ NL D , I D ( NL ) , LOADON ( NL ) , PR I LOW , LPR I OF ( NL , NL )

,

239 & LPRLOW( NL > .LPRIONI NL ,NL ) ,PRT

2 40 DIMENSION I TEMP ( NL , NL > 241 c 242 DO 10 I * 1 , NL D 243 1F(LPRI0F(PRI,1).LT.KEY> THEN

244 I TEMP ( PR I , I >-LPRIOF(PRI , I > 1 245 ELSEIF (LPRIOF (PRI , I ) .GT.KEY) THEN

246 I TEMP ( PR I , I

) -LPRIOF (PRI , I

)

247 ELSE

248 I TEMP (PRI, I )-l

249 END I

F

25# 10 CONTINUE

251 c 252 DO 20 1=1, NLD

253 20 LPRIOF ( PRI , I

) - 1 TEMP ( PRI , I

)

254 C 255 RETURN

256 END

257 c ** 258 C 259 C POP : Determine local priority levels for each given

260 C global priority . 261 c 262 c Assign the lowest local priority to the load

263 c which Is most recently restored.

264 c 265 c 266 c April 27, 1983 C.P.

267 c 268 c

•* 269 c 270 SUBROUTINE POP(KEY.PRI)

271 LOGICAL LOADON, PRT

272 INTEGER PRI.PRILOW

273 PARAMETER (NL=50)

274 COMMON /BK4/ NLD , I

D

( NL ) , LOADON ( NL ) , PR I LOW, LPR IOF ( NL , NL ) , 275 & LPRLOW(NL),LPRION(NL,NL),PRT

276 DIMENSION I TEMP ( NL , NL ) 277 c 278 DO 10 I-l.NLD

279 IF (LPRION( PRI ,

I

) .GT.KEY) THEN

280 I TEMP (PRI, I )=LPRION(PRI , I )-l

281 ELSEIF (LPRION1PRI , I ) . LT . KEY ) THEN

282 I TEMP (PRI, I ) -LPR I ON (PRI ,

I

) 283 ELSE

284 I TEMP (PRI , I )-LPRLOW( PRI)

285 END I

F

286 10 CONTINUE

287 c 288 DO 20 1 = 1 , NLD

289 20 LPR I ON (PRI , I )-ITEMP (PRI,

I

> 290 c 291 RETURN

292 END

F-5

APPENDIX G. Open-Loop Computer Simulation

For illustration purposes, a computer simulation was performed under an openloop condition and is presented in this appendix. The open-loop assumption

cannot be applied in actual load control condition, employing demand limiting

control algorithms. Without feedback, the effects of load shedding or

restoring are not realized in the control action. The selected algorithm for

the simulation was the predictive method with flexibility in metering (either

fixed interval or sliding window metering) as described in section 4.5.

Accordingly, the computer programs given in Appendix E and Appendix F were

used. Most numerical values of input data were arbitrarily selected but some

of the values for average power requirement were extracted from the work by

May.* Some extremely large and small numerical values were specified as input

data in order to check the capability of the computer program.

The main program, DLPFSMAIN, in Appendix E calls three input files as follows:

Logical Unit File Name

7 INPUTPFS

8 LOADTABL

9 INPUTPWR

The format used by the file, INPUTPFS, i6 an input format for the NAMELIST

statement of Fortran 77 in a Sperry 1100/82 computer. Since this format is

machine-dependent, a Fortran user's manual should be consulted if other

*W. B. May, "Analysis of Data from the Energy Monitoring and Control System at

the Norris Cotton Federal Office Building," Natl. Bur. of Standards, NBSIR

81-2358, 1981 .

G-l
computers are employed. If desired, the main program, DLPFSMAIN, may be

modified to read the information in the INPUTPFS file interactively. The

INPUTPFS file contains the following:

DMDP = 5.0 min •• demand period

TSAMPL = 1.0 min * sampling period

PMAX = 75.0 kW •

• maximum power allowed in a demand period

above which shedding loads takes place

PMIN = 70.0 kW • minimum power allowed in a demand period

below which restoring loads takes place

PRILOW = 3

•

• integer variable, lowest global priority.

The highest priority is 1 and the lowest

priority is PRILOW

PRT = F

• logical variable, set true (=T) if printing

of detailed information of load status is

desired, set false (“F) otherwise.

MODE = 1

•

• integer variable, choice of metering.

When fixed interval used, MODE = 1 and

when sliding window is used, MODE = 2.

INITST = T

•

• logical variable, true (=T) if initial

start; otherwise set false (=F).

The file, LOADTABL, is needed for the load control routine, LDONOF, that is

listed in Appendix F. The file comprises the following items for each load:

ID = 001 : integer variable, load identification number

LDNAME = NORMAL LIGHT #1 : description of a load, up to 15 characters

G-2
PRIOR = 2

PLOAD = 5.974 kW

DELAY = 0.0 min

MINOFF = 0.0 min

MINON = 0.0 min

MAXOFF = 1440.0 min

integer variable indicating the global

priority of a load. The lower the number

the higher the priority, and vice versa,

nominal average power of a load

delay time for starting at the initial

period

minimum off-time of a load. Only after this

off-time, the load may be restored,

minimum on-time of a load. Only after the

on-time passes the minimum on-time, the load

may be shed.

maximum off-time of a load. If the load is

maintained off more than the time period

specified by MAXOFF, restoring the load

occurs automatically. Assignment of

highest number (=1440) prevents automatic

restoring.

The values given above are the values for the first load in the file,

LOADTABL, in this appendix. For each load, two lines of data are needed such

as shown below:

1st line: ID, LDNAME (13, IX, A15)

2nd line: ID, PRIOR, PLOAD, DELAY, MINOFF, MINON, MAXOFF (free format)

The instantaneous power, PDATA, is actually measured at each sampling instant

in a real control environment. In this open-loop simulation, the

instantaneous power is not measured, but specified arbitrarily. The file,

G-3
INPUTPWR, contains the instantaneous power, PDATA, and a reset signal,

IRESET. PDATA has a unit of kW, and IRESET is an integer, either 0 or 1.

Presence of the reset signal from the utility's meter is indicated by

IRESET = 1. PDATA and IRESET have a free format in the INPUTPWR file.

Important simulation output data are:

DELP: the amount of power to be shed or restored

LOADON: logical variable. True (=T) if the load is turned on and false

(=F) if off. Using a supporting program, this logical value

may be translated into a binary code and used as input to

actual hardware controls.

Printout of I/O operation for the simulation is included in the following

pages

G-4
INPUT DATA FOR SIMULATION

Q$Q$Q$*INPUTPFS( 1

)

1 SINPUT DMDP«5.0,TSAMPL«1 .0 , PMAX-75 .0 , PHI N-70.0 , PR I LOW-3 , PRT-F , 2 MODE-1 , INITST-T.SEND

QSQ$Q$*LOADTABL ( 1 ) 1 001 NORMAL LIGHT#1

2 001 2 5.974 0.0 0.0 0.0 1440.0

3 002 NORMAL L IGHT#2

4 002 3 3.625 2.0 0.0 0.0 1440.0

5 003 ESSENTIAL LIGHT

6 003 1 8.516 0.0 0.0 0.0 0.0

7 004 HEAT PUMP #1

B 004 3 13.753 3.0 5.0 90.0 20.0

9 005 HEAT PUMP #2

10 005 3 5.597 4.0 3.0 3.0 15.0

11 006 FAN COIL

12 006 2 0.546 3.0 2.0 2.0 10.0

13 007 FAN

14 007 3 9.554 4.0 3.0 3.0 10.0

15 008 COOLER

16 008 3 0.037 5.0 5.0 5.0 20.0

17 009 PUMP

18 009 2 0.748 4.0 3.0 3.0 20.0

19 010 ELEVATOR

20 010 1 8.876 0.0 0.0 0.0 0.0

21 011 EMERG. SYSTEM

22 01

1

1 8.395 0.0 0.0 0.0 0.0

23 012 OTHER

24 012 3 2.091 2.0 0.0 90.0 1440.0

Q$Q$Q$* I NPUTPWR { 1 > 1 31.76 0

2 31.76 0

3 31.76 0

4 31.76 0

5 31.76 0

6 31.76 1 7 31.76 0

8 37.48 0

9 51.78 0

10 67.68 0

11 67.72 1 12 67.72 0

13 67.72 0

14 67.75 0

15 67.00 0

16 75.00 1 17 60.00 0

18 70.00 0

19 75.00 0

20 60.00 0

21 70.00 1 22 75.00 0

23 80.00 0

24 85.00 0

25 60.00 0

26 50.00 1 27 80.00 0

28 40.00 0

29 50.00 0

30 67.00 0

31 80.00 1 32 40.00 0

G-5
•XQT 01 . NAMES

sirput

0**:» • Sllfffff'fftJSAMH • . 19999999-991 .PMAX • .7Sf«ffl«*lf2,N!a • . 79999999*992

,

PR 1 LOW • J.MT

MODE • I.IHtTST • T SEND

ID ITEM PRIORITY PLOAO OELAV MIHOFF Ml RON MAXOFF

1 RORMAL L1C*T#i 2 5.97 .99 .99 .99 1449.99

2 »3«MA W LICMT#2 3 3.63 2.99 .99 .99 1449.99

3 ESSERTIAL L I 6*7 1 8.52 .99 .99 .99 .99

4 MEAT PUMP #1 3 13.75 3.99 5.99 99.99 29.99

5 neat PU"P #2 3 5 69 4 .99 3 99 3.99 15.99

6 PAR COIL 2 .55 3.99 2.99 2.99 19.99

- FAR 3 9.55 4 .99 3 99 3.99 19.99

8 COOLER 3 .94 5.99 5.99 5.99 29.99

9 Pump 2 .75 4.99 3.99 3.99 29 99

19 E.E.ATOR 1 8 .66 .99 .99 .99 .99

1 1 EMERC. SYSTEM 1 8 . 39 99 .99 .99 .99

12 OTHER 3 2.99 2.99 .99 99.99 1449.99

soutpfi

1 • 9.PPRED • .99999999 .ERRED - .BBBBBBBB .EMAX • .BBBBBBBB .EMIR • .BBBBBBBB .C«CAL • SEND

SRAMl SUMIRT - .31761999-192. ISUM • 4.1R1TST • T SEND SCUTPUT

ITIME • 9.PDATA • .31769999-992 . IRESET • l.DELP - .99999999 .F1XIRT • T SEROTFTFFFFFFTTF 1 2 3 4 5 6 7 B 9 19 11 12

•••* POWER TO BE RESTORED 47. S9*****

S0UTPF1

1 • l.PPREO • . 31759999*992. EPRED • . 264 66666*991 . EKAX • . 62599999*99 1 . EM! R • . 51333333*991 . ERCAl - SERO

SRAM 1 SUMIRT - .31761999*992. 1SUM - 4.1RITST • T SEND

LOAD # 12 RESTOREO******

LOAD 2 RESTORED

SRAM2

SUMP - .57169999*991

SERO SOUTPUT

ITIme - l.PDATA - . 3 1 7 69999*992 . 1 RESET - 9 . DEL P - . 47 199999-992 . F 1 X I RT - T SEROTTTFFFFFFTTT 1 2 3 4 5 6 7 8 9 19 11 12

POWER TO BE RESTORED 59. 92*****

S0UTPF1

I - 2.PPRED • . 34947999*992 .EPRED • . 21373333*991 . EKAX - .62599999*991 .EMIR - . 51333333*991 . ERCAL • SERO SRAM 1 SUMIRT • .31761999-992 . ISUM - 6.IR1TST • T SERD LOAD # 6 RESTORED******

SRAM2 SUMP • .54699999*999

SERD SOUTPUT

ITIME . 2 . P DATA - .37489999*992. IRESET • 9.DELP • . 5 9 9 2999 1 *992 . F I X I RT • T SERDTTTFFTFFFTTT 1 2 3 4 5 6 7 8 9 19 11 12

POWER TO BE RESTORED 74. 17*****

soutpt i

] > 3.PPRED * . 49953999*992 .EPRED • . 33378333*991 . EMAX - . 62599999*991 .EMIR • . 58333333*991 . ERCAL

SERD SRAM 1

.52933333 *999

.11963333*991

.18591666*991

G-6
SUM1NT - . 45514000*002 . ISUM • l.miTST • T SEND ***LOAD # 9 RESTORED

LOAD • 7 RESTORED

LOAD # S RESTORED

SHAM2

SUMP • .15899 000*002 SEND

3 . P DATA • .51780000*00 2. IRESET • f.DELR - . 74865001 *002 . F 10 I NT • T

4TTTTFTTTT 5 8 7 8 9 10 11 12

SOUTPUT

IT1ME • SEND

1 2 3 T T T

ROVER TO BE RESTORED 119.53 SOUTPF

1

1 . 4.PPRE0 • .46093999*002. ERRED • . 384 1 1 666*001 .EMAX • . 62500000*00 1 . EMI N - .58333333*001 .ENCAL • SEND

S NAM 1 SUM 1 NT - . 4551 4000*002 . ISUM • 11.1N1TST • T SEND

SNAM2

SUMP • .00000000

SEND SOUTPUT

I T 1 ME 4 . P DATA - .67680000*002 . IRESET • 0.DEIP . 1 1 953000*003 . F 1 X I NT • T SENOTTTTTTTFTTTT 1 2 3 4 5 6 7 8 9 10 1 1 12

SOUTPF

1

1 - 0.PPREO - . 46093999*002 .ERRED • . 384 1 1 666*00 1 , ENAX - . 62500000*00 1 . EMJ N • . 58333333*001 .ENCAL • SEND

SNAMl SUMINT - .45551000*002. ISUM - 12.1NITST • F SENO SOUTPUT

ITIME 5 , P DATA • .67720000*002. IRESET • l.DELP • .00000000 .FIXINT - T SENDTTTTTTTTTTTT 1 2 3 4 5 6 7 8 9 10 1 1 12

ROVER TO BE RESTORED 2.85 SOUTPF

I

I • 1 . P PR EC • .67719999*002 .EPREO - . 56433333*001 .EMAX . 62500000*00 1 . EM I N • . 58333333*001 . ENCAL SEND SNAM2

SUMP - .00000000 SEND

SOUTPUT

ITIME - 6 . P DATA - .67720000*002 . IRESET • 0 . DEL P • . 2 8 500000*00 1 . F I X I NT - T SEND

1 2 3 4 5 6 7 8 9 10 1 1 12

TTTTTTTTTTTT

•• ROVER TO BE RESTORED 3.80

SOUTPFI

1 • 2.PPRED • .67719999*002. ERRED • . 56433333*00 1 . EKAX • . 62500000*00 1 . EMI N - . 58333333*001 . ENCAL SEND SNAM2

SUMP • .00000000

SEND SOUTPUT

ITIME SEND

• 7.PDATA - .67720000* 002 ., IRESET - 0 . DEL P - .38000000*001 .FIXINT - T

1 2 3 4 5 6 7 8 9 10 11 12

T T T T T T T T T T T T

ROVER TO BE RESTORED 5.68 SOUTPFI

1 • 3.PPRED • .67728998*002 .ERRED • . 564 40833*00 1 . EMAX • . 62500000*001 . EMI N - .58333333*001 . ENCAL

SENO SNAM2

SUMP • .00000000

SEND SOUTPUT

ITIME • 8 .PDATA • .67750000*002,.IRESET - 0 . DEL P • .56775016*001 .FIXINT • T SEND

1 2 3 4 5 6 7 8 9 10 11 12 T T T T T T T T T T T T

SOUTPFI

I • SEND SNAM2

SUMP .] SEND SOUTPUT

ITIME • SEND

1 2 T T

ROVER TO BE RESTORED 12. 08*****

4.PPRED .67584998*002. ERRED • . 56320832*001 . EMAX •

'000000

9.PDATA - . 67000000 « 002 .IRESET • 0.DELP

3TTTTTTTTTT 4 5 6 7 8 9 10 1 1 12

.62500000*001 .EMIN • .58333333*001 .ENCAL

.12075005*002, FIXINT • T

SOUTPFI

I • 0.PPRED • .67584998*002. ERRED • . 56320832*001 . EMAX - . 62500000*001 . EMI N • . 58333333*00 1 . ENCAL SENO SOUTPUT

ITIME • 10 . P DATA • . 75000000*002 . I RESET - 1.0ELP - .00000000 .FIXINT • T SENDTTTTTTTTTTTT 1 2 3 4 5 6 7 8 9 10 11 12

.28456666*001

.39740000*001

. 1 1286667*00:

.22573333*001

.338625 00*001

.45091666*001

• .56924999*001

G-7
POWER TO BE RESTOREO 3.12*****

SOUTPF

I

| . l.PPREO • .67508 800 *002. EPRED • .56250000*001 .EMAX • . 62500000*001 . EM! N • . 5 6 3 3 3 3 3 3 00 1 . E NC Al • SEND SNAH2

SUMP • 00000000

SEND SOUTPUT

1 T I ME • 11.P0ATA • . 60000000*002 . IRESET • 0.DELP • . 3 1 24 9997 *00 1

, F I X 1 NT • T SENDTTTTTTTTTTTT 1 2 3 4 5 6 7 6 9101112

* POWER TO BE RESTORED 7.50*****

SOUTPF 1

1 • 2.PPRED • .65499998* 00 2. EPRED • . 54503333*00 1 . EMAK • . 62500000*00 1 , EMI N • . 58333333*001 .ENCAl • SEND SNAM2

SUMP • .00000000

SEND SOUTPUT

I T I ME l 2 . P OAT A • . 70000000*002 . IRESET - 0.DELP - .750000 12*001 . F I X I NT • T SENDTTTTTTTTTTTT 1 2 3 4 5 6 7 8 9 10 1 1 12

SOUTPF

I

1 - SENO SOUTPUT

I T I ME • SEND

1 2 T T

POWER TO BE RESTORED . 00 •*

3.PPRED • .69999998*002. EPRED - .58333333*001

1 3 . P DATA - . 75000000*002 . IRESET -

3TTTTTTTTTT 4 5 6 7 8 9 10 11)2

.EMAX •

0.DELP

.62500000*001 .EMIN - .51333333*001 .ENCAL -

• .17881393-005. FIXINT • T

POWER TO BE RESTORED 10. 00*****

SOUTPF I

I - 4.PPRED - . 67999999*002. EPRED • . 56666666*001 . EMAX • . 62500000*00 1 . EM I N • . 58333333*001 . ENCAL • SEND

SNAM2

SUMP - .00000000

SEND SOUTPUT

1TIME - 14 , P DATA • .60000000*002 . IRESET - 0.DELP • . 1 000000 1 *002 . F I X I NT • T SENDTTTTTTTTTTTT I 2 3 4 5 6 7 8 9 10 1 1 12

SOUTPF

1

I - 0.PPRED - .67999999*002. EPRED - . 56666666*001 . EMAX • .62500000*001 .EMI N - .58333333*001 .ENCAL SEND SOUTPUT

I T 1 ME - 1 5 . P DATA - . 70000000*002 . I RESET - l.DELP - .00000000 .FIXINT • T SENDTTTTTTTTTTTT 1 2 3 4 5 6 7 8 9 10 1 1 12

SOUTPF

I

SEND SOUTPUT

I TIME • SEND

1 2 3

T T T

, PPRED - .72499999*002. EPRED - . 604 1 6666*00 1 . EMAX - . 62500000*00 1 . EMI N - . 58333333*00) . ENCAL

1 6 , P DATA • .75000000*002, IRESET - 0.DELP • .00000000 .FIXINT - T TTTTTTTTT 4 5 6 7 8 9 10 11 12

POWER TO BE SHED 2 . 50 SOUTPF I

I - 2. PPRED • .76499999*002. EPRED - . 63749999*001 . EMAX - .62500000*001 .EMIN • . 58333333*001 . ENCAL SEND

LOAD 8 SHED

LOAD # 7 SHED

SNAM2

SUMP - .95910000*001

SEND SOUTPUT

ITIME - 1 7 , P DATA - . 80000000*002 . I R ESET - 0 , DEL P •-.24999988*001 .FIXINT • T SENDTTTTTTFFTTTT 1 2 3 4 5 6 7 8 9 10 1 1 12

POWER TO BE SHED 1 1 .25 SOUTPF

I

I - 3. PPRED - . 79499999*002. EPRED • . 66249999*001 . EMAX - . 62500000*00 1 . EMI N - . 58333333*001 .ENCAL SEND

LOAD # 5 SHEO

LOAD # 2 SHED

LOAD # 9 SHED

LOAD • 6 SHED

LOAD # 1 SHED

SNAM2

SUMP - .16490000*002 SEND

SOUTPUT

ITIME • 18.PDATA • . 85000000*002 . IRESET • 0.DELP 1 1 249998*002 . F I X I NT • T SENDFFTTFFFFFTTT 1 2 3 4 5 6 7 8 9 10 11 12

POWER TO BE SHED 2 . 50-

. 11250000*001

.22083333*001

.34166666*001

.45416666*001

.56249999*001

.12083333*001

.25000000*001

• .30750000*001

G-8
I . 4.PPRED - . 75499998*002 , EPRED . 629 1 6666*00 1 , EMAX • .62500000+001 ,EMIN • . 58333333+00 1 , ENCAl • SEND SNAM2

SUMP - .00000000

SEND

1 9 . P DATA . 60000000 + 002 , 1RESET - 0 , DEL P 24999940 + 001 , F IX I NT • T

4 5 6 7 0 9 10 11 12

T F F F F F T T T

SOUTPUT

I T I ME • SEND

1 2 3

F F T

SOUTPF

I

I • SEND SOUTPUT

1 T I ME • SEND

1 2

F F

0.PPRED • . 75499990 + 002 . EPRED • . 629 1 6666 + 00 1 , EMAX - . 62500000+00 1 . EM I N • . 56333333 + 00 1 . ENCAL -

20 . P DATA - .50000000 + 002, IRESET - l.DELP - .00000000 .FIXINT - T TTFFFFFTTT 3 4 5 6 7 8 9 10 1 1 12

POWER TO BE RESTORED 6.25+++++

SOUTPF 1

1 - l.PPRED • .64999999+002, EPRED • . 54 1 66666 +00 1 , EMAX - . 62500000+001 , EMI N - . 58333333+001 , ENCAL • SENO

LOAD # 1 RESTORED++++++

LOAD # 6 RESTORED + + + + + + SNAM2

SUMP • .65199999+001 SEND SOUTPUT

1 T 1 ME - SEND

21 .PDATA • .80000000+002..IRESET - 0.DELP - .62500003+00

1 2 3 4 5 6 7 0 9 10 11 12

T F T T F T F F F T T T

POWER TO BE RESTORED 15.00+++++

SOUTPF

I

I - 2.PPRED - .60999999+002 .EPRED . 50833333+00 1 , EMAX • SEND

+ + 4 4 4 4 LOAD # 444444 LOAD # +LOAD # LOAD

LOAD #

9 RESTORED++++++

8 RESTORED++++++

2 RESTORED++++++

7 RESTOREO++++++

5 RESTORED++++++

SNAM2

SUMP - .19561000+002

SEND SOUTPUT

1 T I ME - 22 .PDATA - .4 0000000+002,. IRESET

SEND

1 2 3 4 5 6 7 8 9 10 1 1 12

T T T T T T T T T T T T

0.DELP

.62500000+001 .EMIN - . 58333333+001 . ENCAL •

- . 15000000+002.FIXINT • T

POWER TO BE RESTORED 4S.00+++++

SOUTPF

I

I - 3.PPRED • .51999999+002 .EPRED » . 43333333+00 1 . EMAX - . 62500000+001 . EMI N - . 58333333+00 1 . ENCAL

SEND SNAM2

SUMP - .00000000

SEND SOUTPUT

I T I ME • 23.PDATA • . 50000000 + 002 . 1 RESET - 0.DELP - . 4 5000000+002 . F I X I NT - T SENDTTTTTTTTTTTT 1 2 3 4 5 6 7 8 9 10 1 1 12

POWER TO BE RESTORED 63 .00+++++ SOUTPF

I

1 • 4.PPRED • .57399999+002 .EPRED - . 47833333+001 . EMAX - . 62500000+001 , EMI N - . 58333333+001 . ENCAL SEND SNAM2

SUMP - .00000000 SEND SOUTPUT

I T I ME • 24.PDATA - . 67000000+ 002 . I RESET - 0.DELP • . 63000000+002 . F I X I NT - T SENDTTTTTTTTTTTT 1 2 3 4 5 6 7 8 9 10 1 1 12

SOUTPF

I

I - 0.PPRED - .57399999+002 .EPRED - . 47833333+00 1 . EMAX . 62500000+001 .EMIN - . 58333333+001 . ENCAL SEND SOUTPUT

1 T I ME - 25.PDATA - . 80000000 + 002 . IRESET - l.DELP - .00000000 .FIXINT - T SENDTTTTTTTTTTTT 1 2 3 4 5 6 7 8 9 10 1 1 12

POWER TO BE RESTORED 12.50+++++

SOUTPF I

I - l.PPRED - . 60000000+002. EPREO - . 50000000+001 , EMAX - . 62500000+001 . EMI N - . 58333333+001 . ENCAL SEND SNAM2

SUMP - .00000000

SEND SOUTPUT

1 T I ME SEND 26.P0ATA - .40000000+002, IRESET • 4.DELP • .12500000 .00 2, FIXINT • T

1 2 3 4 5 6 7 8 9 10 11 12

T T T T T T T T T T T T

.50833333+001

.59999999+001

. 10033333+001

.20833333+001

.28333333+001

.38083333+001

- .50333333+001

- . 10000000+001

G-9
NBS-114A (REV. 2-80

U.S. DEPT. OF COMM.

BIBLIOGRAPHIC DATA

SHEET (See/nstructions)

1. PUBLICATION OR

REPORT NO.

NBSIR 84-2826

2. Performing Organ. Report NoJ 3. Publ cation Date February 1984

4. TITLE AND SUBTITLE

DEMAND LIMITING ALGORITHMS FOR ENERGY MANAGEMENT AND CONTROL SYSTEMS

5. AUTHOR(S)

Cheol Park

6. PERFORMING ORGANIZATION (If joint or other than NBS. see instructions) 7 . Contract/Grant No. NATIONAL BUREAU OF STANDARDS

DEPARTMENT OF COMMERCE S. Type of Report & Period Covered

WASHINGTON, D.C. 20234

9. SPONSORING ORGANIZATION NAME AND COMPLETE ADDRESS (Street. City. Stote, ZIP)

Office of Buildings and Community Systems U.S. Navy Civil Engineering Laboratory

U.S. Department of Energy U.S. Department of Defense

1000 Independence Avenue, SW Port Hueneme, CA 93043

Washington. DC 20585

10. SUPPLEMENTARY NOTES

] Document describes a computer program; SF-185, FIPS Software Summary, is attached.

11.

ABSTRACT (A 200-word or less factual summary of most significant information. If document includes a significant

bi bl iography or literature survey, mention it here

Demand limiting control is one of popular control strategies for electrical

energy management in Energy Management and Control Systems (EMCS) in

commercial/office buildings. The purpose of demand limiting is to maintain

the peak demand level below a predetermined limit by shedding nonessential

loads in a building during the peak demand period. In this present report,

description of fixed interval metering and sliding window metering for

electrical demands are included. Demand limiting calculation procedures

discussed are the ideal rate, the predictive, and the instantaneous rate

methods. Demand limiting algorithms, which were developed based on available

information, are presented. Computer program listings of demand limiting

control algorithms in Fortran 77 and an open-loop computer simulation result

are included in the appendices.

12.

KEY WORDS (Six to twelve entries; alphabetical order; capitalize only proper names; and separate key words by semicolon s) electrical demand; electrical energy management; electric power; energy management

and control systems; fixed interval metering; ideal rate method; instantaneous rate

method; load control; predictive method; sliding window metering.

13.

AVAILABILITY

f~y] Unlimited

(331 For Official Distribution. Do Not Release to NTIS

[~] Order From Superintendent of Documents, U.S. Government Printing Office, Washington, D.C.

20402.

[jQ Order From National Technical Information Service (NTIS), Springfield, VA. 22161

14. NO. OF

PRINTED PAGES

88

15. Price

$11.50

USCOMM-DC 6043-P80