184
Eindhoven University of Technology MASTER State estimation in power networks van Overbeek, A.J.M. Award date: 1974 Link to publication Disclaimer This document contains a student thesis (bachelor's or master's), as authored by a student at Eindhoven University of Technology. Student theses are made available in the TU/e repository upon obtaining the required degree. The grade received is not published on the document as presented in the repository. The required complexity or quality of research of student theses may vary by program, and the required minimum study period may vary in duration. General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain

Eindhoven University of Technology research portal · STATE ESTIMATION IN POWER NETWORKS III I. Progr·am de·scril;.tion A.J.M. van Overbeek ABSTRACT. , . J This report gives a description

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

  • Eindhoven University of Technology

    MASTER

    State estimation in power networks

    van Overbeek, A.J.M.

    Award date:1974

    Link to publication

    DisclaimerThis document contains a student thesis (bachelor's or master's), as authored by a student at Eindhoven University of Technology. Studenttheses are made available in the TU/e repository upon obtaining the required degree. The grade received is not published on the documentas presented in the repository. The required complexity or quality of research of student theses may vary by program, and the requiredminimum study period may vary in duration.

    General rightsCopyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright ownersand it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights.

    • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain

    https://research.tue.nl/en/studentthesis/state-estimation-in-power-networks(89770b7b-d0e9-40ad-b712-14ce34127407).html

  • STATE ESTIMATION IN POWER NETWORKS IIII.

    Progr·am de·scril;?·tion

    A.J.M. van Overbeek

    ABSTRACT. , . J

    This report gives a description of the p~9rams developed to

    conpare the three state estimation methods. It is intended

    for future users of these programs.

    EERATA A.J.M. van Overbeek: State Estimation in Power

    Networks III, Program description.

    page line read

    21 2- GXI GXT

    26 8+ GXT GXE

    46 does not exist58 page number should be 59

    59 page number should be 5[3

    This work has been done as partial fullfillment of the reqUire-ments for the Masters Degree in Electrical Engineering at theEindhoven University of Technology, Eindhoven, The Netherlands.

  • -2-

    Contents

    1. Introducti.on

    2. Simulation, general3. The common blocks

    4. The subroutines and mainprograms

    5. The programlistings6. Re ferences

    Page

    3

    4

    8

    15

    52

    183

  • -3-

    1. Introduction

    In order to compare the three methods mentioned in /1/-)41 sub-routines and four mainprograms were written... The purpose of thisreport is to give a description of these programs for future users.

    First a general description is given of the simulation program andthe way the data exehartge between the different subroutines isorganized in common blocks. After a detailed description of thesecommon blocks all subroUtines are presented in chapter 4. Thelast chapter consists of the prbgra~ listings and two tablesshowing the re1ationshlps between the variou$ subroutines andprograms.

    The 41 routines and four programs consist'of:S630 source-:cards.All programming is done in Fortran on the Univac 1108 of thecomputing center of Lund University.

    ~ .

    See chapter 6: References

  • -4-

    2. ~imulation, general

    The purpose of· the simulationprograms is to compare and test the

    three different methods on the followtng:

    1. errors in the network model used by the estimator

    2. the influence of measurement accuracy and bias

    3. the influence of the choice of measurement system

    How is this implemented in the simulation proqram?

    Fig. 2.1 gives a simplified flow diagram of the main program. The

    power demand is chosen as the control variable for the true state,

    since this is closest to reality. In the data read part (part 1 in

    fig. 2.1) the load pattern is read. The true state is calculated

    from the power demand by means of a conventional Newton-Raphson

    load-flow. The load flow program needs as input net bus injections.

    Therefore there is first done an economic load dispatch to divide

    the active demand over the generators. The dispatch program needs

    generator data, these are supplied in the common block /GEN/.

    The j:eaetive de~nd is divided over the generators in the same

    ratio as the active demand. This means that all generators are

    operated at the same cos ~. From the true state the other true

    variables are calculated. These consist of the types in the follow-

    ing table.; The_type ..... ate •• u -.l.1 ".-tines and programs- ." ..-,,,. '-'" ,-." - ",' .. '''''.' ~"",~,_.,' . ~~-., '. ,. '

    type variable

    1 bus voltage

    2 line current at A-end of line

    3 line current at B-end of line4 line flow at A-end of line

    5 line flow at a-end of line

    6 bus injection

    Table 2_1 variable types

  • -5-

    Flow diagram:START

    read data 1

    2: carpute the paNer demand1

    I: J

    4

    3

    6

    ,

    COt1pute the t:rlE state Ivector and all other Itr\2 variables j

    II

    ,.carpute all possible Ineasurenents j

    .11>

    Icall the estiIra.tor I

    .'carpute am store the iIerror auantities

    I

    no;""'---~----,"'---------~ last tine point? I

    I

    Iprint results 7

    Figure 2.1 Mainprogram for simulation

  • -6-

    The true variables are stored in the common block ITRUE/. In all

    these calculations the true network parameters and structure areused. These are stored in ITNET/. With the true variables given,the measurements are computed (4 in fig. 2.1). All possiblemeasurements are always computed. These are stored in the commonblock /MSM/. Which measurements are used by the est.:j.mator is deter-mined by a mask vector. This has the advantage that for two diffeEentmeasurement systems the same values are generated for thoseme~surements used by both systems. The mask vector and the infor~mation on the order of the measurements (necessary for method B)are stored in IMSI/. The n>easurements are computed by adding biasand noise to the true values. The noise is generated by a randomnumber .generator. The noise amplitude: ~orf .ad1_a$uremen~..1s given

    ..,. - "

  • -7-

    - estimator meter data

    - estimator parameters.

    The next chapter describes all corr~on blocks while chapter 4

    presents all subroutines as they occur in the simulation pro-

    gram and the three simulation programs (one for each method)and the program to plot the results.

    The last chapter consists of the program listings.

  • -8-

    3.. The common blocks

    The following dimension parameters are used in the common blocks:

    MG maximum number of generators~

    MB maximum number of buses"•.ML maximum number of lines.

    MMB 2MB

    MML 2.ML

    "i~:;~~~~~~~7'?~;;:;E;~t;~~·7~-~~:~~;}T;~·~~~7;~~.ZABT (Ml ) ,vaaT (ML)NBT number of buses

    NLT number of linesLTAT(I) A-end of line I is connected to bus LTAT(I)LTBT(I) B-end of line I is connected to bus LTBT(I)

    YAAT(I) shunt admittance at ~~end of line IZABT{I) series impedance of line IYBBT shunt admittance at B-end of line I

    Ib~_~gmmgD_2!Qg~LIBQ~Ll_~h~_S~Y!_Y~[!!E!§~~ .COMMON !TRUE/ XT(MB),YT2(ML),YT3(ML),YT4{ML),YT5{Ml),YT6(MB)

    XT(I) busvoltage I (state)

    YT2{I) line current at A-end of line I

    YT3(I) line current at B-end of line IYT4(I) Iineflow at A-end of line I

    YT5(I) lineflow at ~-end of line IYT6{I) businjection at bus I

    all variables are complex.

    l'b~_~QmmQn_£lQg~L9~~L':'_~b~_9!!!!.~ator-J2Y~~~r.~~.

    COMMON {GEN! NB,NG8(MG),A1(MG),A2(MG),PMIN(US),PMAX(MG)

    NG number of generators

    NGB(I) generator I is connected to bus ;[Al (I) coefficients of the generatpt

  • .A2 (I)

    PtUN( I)

    PMAX(I)

    -9-

    cost function: c = a + a2p21 genmin generated active power for generator Imax generated active power for generator I

    ~be_~Q[®Qn_Q1Q£~LMg!!Ll_!~Y~_~~~r_!n!Qr~~!QD~

    COMMON fUETT/ 8IAS1(MB),8IAS2(ML),BIAS3(ML),BIAS4(MML),x BIAS5(MML),BIAS6(MMB},WN1(M8),WN2{ML),WN3(ML),x WN4(MML),WN5(MML).WN6(MMB),ALFT1(MB),ALFT2(ML),x ALFT3(ML),ALFT4(MML),ALFT5(MML),ALFT6(MMB),X FST1(MB),FST2(ML),FST3(ML),FST4(MML),X FST5(MML),FST6(MMB),8ETT1(MB),BETT2(ML},BETT3{ML);x BETT4(MML),BETT5(MML),BETT6(MMB)

    BIASX{I) bias for type: X measurement

    WNX(I)

    ALFTX(I)

    FSTX(I)

    BETTX(I)

    weighting factor for type X measurement noise

    (l value for type X measurement

    full scale value for t~~e X rr~asurement

    B value for type X measurement •.

    The el, full scale and B values are used by the subroutine

    CAWN to compute the measurement noise weighting factors.

    The BIAS and WN values are used by the subroutine ALLMSM

    to compute the measurements.

    Ibe_~QIDIDQn_2!Q9~LM§MLl_~11_eQ~§1Ql§_~~§~r~~n~2~

    COMMON /MSM! YM1(MB),YM2(ML),YM3(ML),YM4(MML),YMS(MML},YM6(MM8), -

    YMX{I) type X measurement

    Ib§_gQmmQn_Q1Qg~L~§!Ll_~~2Yf~m~~~_§Y§~~m_!g!Q~~~t!Qn~

    COMMON IMSI! MSK1(MB},MS~2(ML)7M6K~(ML),MSK4(ML}~MSK5(ML)7X MSK6(MB),NM,NTYP(~M)7NMSM(MM)·

    MSKX{I) mask vector for ty~e X measurement

    Par type 1, 2, and 3 rreasurements ("modulus measurements II )

    element I = 1 means that the corresponding measurement in/MSM! is used by the estimator and ~lement I = 0 thabthe'measurement is not used. For type 4, 5, 6 measurements

    (lipower measurements") the meaning of the maskvector elements

    is given in the folloWing table!

  • NTYP(I)

    r.."MSM (r)

    -10-

    element.

    o measurement is not used1 only active measurement is used

    2 only reactive measurement is used

    3 both active and reactive measurement are

    used.

    NM number of measurements used by the estimator.

    active and reactive power measurements are counted

    separatelymeasurement I is of type NTYP(I)

    measurement I is the NMSM(I)-th measurement of type

    NTYP(I)

    examples:

    NMSMT{I)

    5

    4

    5

    NTYP(I)

    1

    3

    4

    4 6

    voltage measurement at bus 5

    line current measurement at B-end of line 4

    active line flow measurement at A-end of

    line 3

    reactive lineflow measurement at A-end of

    line 3

    The measurement order information stored in NTYP(I) and

    NMSM(I) is used by rrethod B.

    From this information the subroutine RDMSM computes the mask-

    vec'tors.

    Xbe_~QmmQn_Q!Q£~LE~§ll_~h~_f~!!gY~2~

    COMMON IRESI RES1(MB),RE~i(ML),RES~{ML),AES4(MML),RES5(MML),X RES6(MMB)

    RESX(I) The residue y - g(!) for measurement I of type X.

  • -11-

    COMMONXXXX

    /METE/ WF1(MB).WF2(ML).WF3(ML),WF4(MML),WF5(MML).WF6(MMB)9 ALFE1{MB),ALFE2(ML),ALFE3(ML),ALFE4(MML),AlFE5(MML),AlFE6(MMB).FSE1(MB).FSE2(ML),FSE3(ML),FSE4(MML).FSE5(MML),FSE6(MMB),BETE1(MB),BETE2(ML),BETE3(Ml),8ETE4(MML),BETE5(MML),BETE6(MMB)

    WFX(I) weighting factor for measurement I of type X

    ALFEX (I)}FSEX(I) see corresponding T variables in /METT/BETEX(I}

    The weighting factors WFX{I) are computed from the a, full

    .scale and 8 values by the subroutine CAWF•

    .IU~-g~gQD_Q!Qg~L!?~E;!Ll_~§!;1IDS!!g~_n~~t!£H::!5:_gS!E~:.

    COMMON_ IENET I NBE ,NLE.l TAE (ML ),L TBE (tel) ,YAAE (ML) ,ZASE (ML) ,YBSE (ML)Estimator netw6rk data. See /TNETj.

    :rh~_gQ!'IDQn_g!Qg!sL~2ILJ.._211_~2:t;!ID~S~~_Y2:f!t!gl~§.:._COMMON lEST! XE(MB),YE2(ML),YE3(ML),YE4(_L),YE5(ML),YE6(MB)

    All complex estimated variables. See /TRUE/~

    xh~_QQmmgn_Q!Qg~L~~£Ll_!h~_~~£QE!~n.:.

    COMMON !JAC! AJAC1(MB,2),AJAC2(ML,4),AJAC3(ML,4),AJAC4{MML,4),,X AJAC5(MML,4),AJAC6(MMB,MMB)

    The jacobian. Only the non-zero jacobian elements are stored

    for type 1, 2, 3, 4. and 5 measureIrents •type 1 : voltage rreasurement

    OVAJACl(I,l) element oe

    AJACl(I,21 elelOOnt 6V"'fl

  • -12-

    type 2 + 3: li·ne current measurement

    AJACX(I,l} element c!Iab '"6'e a

    AJACX(I,2) elementolIablofa

    X = 2 or 3

    AJACX(I,3) elementolIabloeb

    AJACX(I,4) elementallah'6fb

    type 4 + 5: line flow measurement

    AJACX(l,l)

    AJACX(I,2)

    AJACX(I,3)

    AJACX(I,4)

    1 0 • •e ement. oea

    1 o. •eement~a

    element 0 ••deb

    1 t 6 ••e emen rr-b

    X • 4 or 5

    I odd H = Pab

    I even • ':.·.Qab

    type 6:bus injection measurement

    AJAC6(I,J) all jacobian elements for a bus injection

    measurement are stored.

    !~!_gg~Q~L~~~~#L.!_J.1g~~*~~~~~~1::_!l!!:!:H29_~.:.COMMON 'MATI A(MM8,""B),T(MMB.MMB)

    'A(I,J)matrix'GTWG

    T(I,J) triangularized version of A(I,J)

    This common block is only used by method A.

  • EE(I)

    EEM(I,l)EEM(I,2)

    AEE

    EEMT(l)

    EEMT(2)

    EEMMT(l)

    EEMMT(2)

    EEMMT(3)

    EL(I)

    ELM(I,l)ELM(I,2)

    -13-

    !~~_92mmQU_£!QE~~Y~~Ll_9!~gQ~~!_E:m~!£!E~§_!Qf_~EbQ9_~~

    COMMON /VAR! COV(MMB}9PNEW(MM8)

    CoV(I) covariance for statevariable I in method B

    example:cov(3) = covariance of real part of bus voltage 2.

    PNEW(I) new covariance for statevariable I.

    This common block is only used by method B.

    !h~_99ID~QU_e1Q2~L~!Ll_ill~Ef!£~§_!Qf_~EhQ9_g~

    ,COMMON !MAT! A(MB,M8),T{M8,M8)

    A(I,J) matrix BTDB of method C

    T(I,J} triangularized version of A.

    This common block is only used by method C.

    !h~_9QmmQn_e!Q2~L~Y~Ll_~Y.~~g!E!QU_E2!2ID@~~!~~

    COMMON IEVL! EE(MTMX1),EEM(MTMX1,~),AEE,EEMT(2),EEMMT(3)x EL(MTMX1),ELM(MTMX1,2),AEL,ELMT(2),ELMMT(3)X EM(MTMX1),AEM,EMMT(2)

    estimation error at timepoint I

    maximum e lament in EE ( I)

    place of EEM(I,I)

    two exanples:. EEM (I, 2) = 4: imagillary partof bus voltage 2, EEM(I,2) = 5: real part ofbus vol tage 3 •

    . average' estimation error

    maximum estimation error

    time point of maximum estimation error.

    maximum element in all estimation errors

    place of EEMMT(I). See EEM(I,2)

    time point of EEMMT(I)

    lineflow error at time point I

    maximum element in EL(I)

    place of ELM(I,])

    ELM(I,2) positive means at A-end of lina, negative

    at B-end of line

  • AEL

    ELMT (l)

    ELMT (2)

    ELMMT(l)

    ELMMT(2)

    ELMMT(3)

    EM(I)

    AEM

    El-1MT (1)

    EMMT(2)

    -14-

    examples: ELM(I,2) = 3: active flow at A-end of line2. ELM(I,2) = -4: reactive flow at B-end of line 2.average lineflow error

    maximum lineflow error

    time point of ELMT(l)

    maximum element in all lineflow errors

    place of ELMMT(2). See ELM{I,2)

    time point of ELMMT(3).

    measurement index at time point I

    average measurement indexmaximum measurement index

    time point of EMMT(l)

  • -15-

    4. The subroutines and mainprograms.

    In this chapter there is given a short description of each sub-

    routine. If necessary a flow diagram and further conments are

    included. The subroutines are presented about in the order as

    they occur in the simulation program in the following sections:

    4.1 The subroutines PRENET and PRTNET.

    4.2 The data read routines (part 1 in fig. 2.1).

    4.3 The subroutine CASDB (part 2 in fig. 2.1).

    4.4 The subroutines for computing all true variables (part ~

    in fig. 2.1).

    4.5 The subroutines for computing the measurements (part 4 in

    fig. 2.1) •

    4.6 The jacobian routines (used by estimator A and B) •

    4.7 The routines and mainprogram~ for method A.

    4.8 The routines and mainprogram for method B.

    4.9 The routines and mainpr~gram for method C.4.10 The subroutine EVAL.

    4.11 The plot program.

    Chapter 5 starts with two table~_ giving the relationships between

    the various routines and ·programs.

  • -16-

    4.1 The subroutines PRENET and PRTNET.----------------------------------SUBROUTINE PRENET

    Prints the estimator network data stored in the common block /ENET/.

    SUBROUTINE PRTNET

    Prints the true network data stored in the common block /TNET/.

    4~2 The data read routines.-----------------------SUBROUTINE RDTNET (IPRINT, IERR)

    Reads the true network data into the common block /TNET/ and

    prints the read data.

    SUBROUTINE RDMETT (IPRINT)Reads for all possible measurements the bias, a, full scale and

    8 values into the common block /METT/ and prints the read data.flow diagram:

  • -17-

    read data for active

    injection n:easurerrent

    I ' I

    I, read ,dat," for voltage Iine~t--- I"

    t

    r-,-.- ,-I"'J----,i read data for naacti\Ie

    injection neasu:r:enent

    I

    I!\III

    :I

    I....1 00:.;.::;;..) last bus?

    !'-------------1 yes ---.Iread data for l.i.m current (l rreasurenent at A-end

    Flow diagram:

    r *:!In:!ad data for reactiV'e lireflcw IIn:eas~ocatA-ero l

    1: ~

    l""ad data for line curnmtn:easu.renent at B-em

    r -----JI

    rnaad data for :etive liref~OV'j neas~rrent at A-end

  • -18-

    SUBROUTINE RDGEN (IPRINT, IERR)

    Reads the generator data into the common block /GEN/ and prints

    t~he read data.

    SUBROUTINE RDLD (IPRINT, IERR)

    Reads and prints the demand data necessary for the subroutine

    CASDB to compute at each time point the new load demand.

    Flow diagram:

  • -19-

    r OJt" STA1~ J

    Iii

    . ±- --"l~~d s.lcpe tirm J

    r-' __=1 .. -read maxinulffi and minimum demmd and ICaIpute standard slcpe for bus I ~

    c-.__.•.~l"----_, i

    _...;I...;10_··I...._1as~~_:~~J

    rIi

    Il._--------_.

    Flow diagram:

    last bUS?'lI ~-.._.~-_._--------- I1_•.__. I}~S

    I rend mm-b::r Of_'-,-S_'im_.l_la_ti_'_o._n11! tirre points

    L - 'J.read nl~r of slc:pe

    ch.znges

    I reed slcpe cha.'1ge ti:rrei! point and new slcpeII ..

  • -20-

    comments:

    The subroutine CASDB computes the new load demand at time point

    K + 1 for bus I as load (K+l) = load (K) + U(K+l)x standard slope(I). U(K+l) is the demand control vector element. The standard

    slope for bus I is defined as :

    ma~imum demand - minimum demand

    slope time

    example: simulation time = 10

    nr of slope changes = 2

    slope change

    time point

    5

    6

    new slope

    1.0

    0.0

    Then U is: 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0

    The load for bus 1 e.g. is:X. X • )( X

    standardslope

    start demo X X. " )(

    1 2 3 4 5 6 7 8 9 10time •

    SUBROUTINE RDENET (IPRINT, IERR). .

    Reads estimator network data into the common block /ENET/ and

    prints the read data

    SUBROUTINE RDMETE (IPRINT)

    Reads for all possible ~asurements the CI., full scale and 8 values

    into the common &lock /METE/

    flowdiagram: see the subroutine RDMETT

  • -21-

    SUBROUTINE RDMSM (IPRINT, IERR)

    Reads which of all possible measurements are to be used by theestimator and in which order they are to be processed. This data

    is read into NM, NTYP(I) and NMSM(I) in the common block /MSI/.

    From this data the mask vectors are computed. Active and reactive

    measurements are treated separately. see the description of thecommon block /MSI/ in the previous chapter.

    4.3 The subroutine CASDB.---------------------SUBROUTINE CASDB (SOB, SSL, u, IPRINT)Computes the new load demand for all buses given the old demand,

    the standard slopes and the demand control vector element.See the subroutine RDLD.

    4. 4 Ih~_~Y2~Q!:!!:!!!~f!-!Q~-9.Q!!!E.1!:E:!n~L~11-!;:1!~-y~~:!~el~~.:.

    SUBROUTINE TRUEV (SOB, IPRINT, IERR)

    Computes all true variables from the load demand

    flow diagram:

  • -22-

    comments:

    ~. the subroutine ELDNL distributes the total active demand

    over all generators. The total reactive demand is d1strubutedover the generators in the same ratio as the active demand.

    SUBROUTINE ELDNL (AI, A2, PMIN, PGEN, PMAX, POEM, EPS, NG;IPRINT; IERR)

    Performs an economic load dispatch ne~lecting l1nelosses byminimizing the generator cost function with a Lagrange multi-plier method and taking into account minimum and maximum generated

    power restrictions.

    SUBR9UTINE NRLFR (NB, NL, LTA, LTB, YAA, ZAB, YBB, SIRJ, VB,EPS, IS, MAXIT, IPRINT, JFAIL)Performs a conventional Newton.Raphson load flow to compute thetrue bus voltages. The subroutine TRUEV assumes that bus NB isthe slack-bus.

    SUBROUTINE DECOM (A, NN, IA, EPS, ISING)SUBROUTINE SOLva (B, X, NN, NNB, LA)

    Solves the linear system of equations A x X = B by means ofGauss decomposition of matrix A (DECOM) and forward and backwardsubstitution (SOLVB).These routines are used in NRLFR and are taken form the programlibrary of the Division of Automatic Control of the LundInstitute of Technology.

    SUBROUTINE MPRI (A, M, N, lA, INO, IFORM, IERR)

    Prints a matrix.

    The routine is used in NRLFR and a few other routines. It isalso taken from" the above mentioned program library.

    SUBROUTINE GXT (IPRINT, IERR)Computes a,ll other true- variables from the true state.Flow diagram:

  • Flow diagram:

    -23-

    (srARr J

    eatpute current in !i series branch of lire I I

    I~-------'-"------r

    conpute lire current Iat A-end of line I --l. I ,conpute lire current Iat B-erxl of line I l

    c- I ,I conpute lireflOl1 IIat A-end of line I \

    ..carputJe+imfleJw;

    at B-end of line I'- .....-- ....J

    Iadd lineflatl at &-emIto businjeetion at &-end

    of line I

    yes,

  • -24-

    SUBROUTINE CAWN (IPRINT)

    Computes for all possible measurements the measurement noise

    weighting factors WN:

    1WN = a x full scale + B x true value

    The computed weighting factors are stored in the common block/METT/.

    SUBROUTINE ALLMSM (NODD, IPRINT)

    Computes all possible measurements.

    flow diagram:

    (smRr )l

    Igererate· neasurenent,noise with NDI

    H'

    nultiply noise by l,/WN

    lit

    !add bias am noiseIIto trt:e val~

    npJ last neasurenent? I-IJ(mr

    ( RmURN )

    1

  • -25-

    comments: for type 4, 5 and 6 the active and reactive measure.

    ments are treated separately.

    ad 1. the subroutine NODI needs an odd number to generate

    random numbers. This is supplied by NODD in the subroutine call

    to ALLMSM. A good start value for NODD = 19. This must besupplied at the first call to ALLMSM. Successive calls to

    ALLMSM make use of the value of NODD upon exit of the previouscall.

    SUBROUTINE NODI (NODD, GAUSS)

    function: to provide a random number from a standard normal

    N(O,l) probability distribution.

    The routine is taken from the program library of the Division

    of Automatic Control and is used in ALLMSM.

    .{~ )

    .Lloss =: 0.0

    J1

    ~'~ctor == 11no .

    J..vesloss = loss + 'Ne1ghting

    . 2factor x residue

    no last neasUl'::'elmnt? \.

    sQ~_~QYs!n!!_y§!g_e~_~11_~Shgg!~

    FUNCTION ALOSS (IPRINT)Tfunction: to calculate the loss function {~- g(!)} W{~ - g(!)}

    It is assumed that the matrix W is diagonal and':that the

    residues ~ - g(!) are given.flow diagram·

  • -26-

    co~~ents: for type 4, 5, and 6 active and reactive measurements

    are treated separately; dependent on the value of the mask

    vector the active or reactive or both measurements are used in

    the calculation of the loss function.

    SUBROUTINE CARES (IPRINT, IERR)

    computes the residues from the estimated state and-the measure-

    ments. Before the residues first all estimated variables are

    computed with the subroutine GXT. The computed residues are

    stored in the common block /RES/.

    SUBROUTINE PRRES

    Prints the residues as stored in IRES/, the corresponding used

    measurements and estimated values.

    SUBROUTINE CAWF (IPRINT)

    Computes the weighting factors WF for all possible measurerrents.

    Only the weighting factors of the measurements processed by the

    estimator are used in the calculations of the loss function.

    SUBROUTINE PRWF

    prints all weighting factors as stored in the common block /METE/.

    4.6 Xbe_jQQQQ1~n_!QY~!n~!~

    The following four routines make use of the formula's given in

    the Appendix of /1/ for rectangular coordinates. These routines

    are used by both method A and B.

    SUBROUTINE JACV (U, DU, IR, 10, TERR)

    Computes the two non zero jacobian elements for a voltage measure-ment.

  • -27-

    SUBROUTINE JACI (VA, UB, ZAB, YAA, DI, IR, 10, IERR)

    Oorrputes the four non zero jacobian elements for a line current

    measurement.

    SUBROUTINE JACLF (M, UA, UB, ZAB, YAA, OP, IRP, DO, IRQ,

    ID, rERR)

    Computes the non zero jacobian elements for an active, reactive

    or both line flow measurements dependent on the value of the

    mask vector.

    SUBROUTINE JACBI (M, lA, OPI, IRP, DOl, IRQ, 10, IERR)

    Computes the jacobian row(s} for an active, a reactive or both

    bus .injection measurements, dependent on the value of the mask

    vector. The row(s) are calculated by computing the jacobian

    elements of all lineflow·ij}easurements at the bus concerned.

    SUBROUTINE CAJAC (IPRINT, IERR)

    Con~utes the jacobian for method A using the previous four routines.

    Only the jacobian elements of the measurements used by estimator

    A are computed.

    SUBROUTINE PRJAC

    Prints the jacobian as stored in the common block./JAC/.

    4.7 !h~_!g~~!n~g_2ng_ID!!nErQgE~m_!QE_~~hgg_~~

    SUBROUTINE ADMA (MAXIT, JS, CRLOSS, XL, CRLIN, IEXIT, TIME,

    IPRINT)

    Main routine for method A.

    Flmv dia9raro:

  • I;'low diagram:

    -28-

    ..,.----1

    Iconpute the residues IL I JI

    !

    ,------ye-S-Alno

    J < J*? i_. ye_s t>(i)rew I "~

    no....__..::.ye_s 4 it ::: O? I

    rno *-

    it ::: it + 1

    Jo1d

    :::: Jrew

    ~ld::: !

    yes

  • -29-

    1

    carpute t.!with ESTA

    1yes

    JS =: 2? II ~oI

    ,,,I no

    l f1ireariZatiOn ?\TPSII'

    I. set LIN ::: 1 1 I set LIN = 0Il

    carpute t:b:! jacobian

    ....no LIN ::: 11I

    I yes°1 ~ f( l

    1!~

    yesit = 1 A lin =11

    I ~!

    JS == 0 IIIi

    IIII"

    II

  • -30-

    2

    CDIJ" .,L, .I..

    co~rgence Ino convergence divergenre II- i .I

    I,

    ! =!old II Iean:pute the residmsI i

    J = Jt2W old

    ,

  • -31-

    comments:

    ad 1. The linearization decision is made by computing the norm of

    the vector ~l - !, where ~l is the last linearization point. Whenthis norm comes over a critical value (CRLIN in the subroutine

    call) a linearization is done around the present estimate.

    The estimator can operate in various modes determined by JS

    JS modeo Normal operation, iterate till loss function

    is less than the critical loss J. (CRLOSS in the

    subroutine call) or till the maximum number of

    iterations (MAXIT). Linearize if necessary.

    1 Iterate at least once irrespective of the value

    of the loss function. Upon exit JS = O.2 Linearize in two iterations (if maxit permits this).

    Upon exit (MAXIT ~ 2) is JS = O.

    Table 4-1 Estimator modes for method A.

    Examples:

    JS = 2, MAXIT = 3: Start up of the estimator from e~g. flatvoltage. In the first 'iteration a linearization is made around

    the flat voltage profile. In the second around::the estimate ob-

    tained after the first iteration.,.JS = 0, MAXIT = 1: Normal operatton under normal conditions.Ad 2:. When after an iteration the loss function has increased

    the divergence exit ~s taken. The estimate is set equal to the

    estimate after the previous iteration. The residues are calculated

    again and the loss is set equal to the loss after t~e previousiteration.

    SUBROUTINE ESTA (LIN, OX, IPRINT; IERR)

    ~erforms one iteration of method A by solving

    It is assumed that the jacobian G and the residues l - g(!) are.available in the common blocks /JAC/ and IRES/.Flow diagram:

  • -32-

    Flow diagram:

    (srARr )to

    1~

    I Tq;>date G W{y - gdate G~ for rreasurenent I

    ~

    last neasurenent:' no

    yes

    solve f;TltG] L\! == G'rw{:i - g(~)}

    ~

    (RF:IDRN }

    1

    3

    comments:

    ad 1. see subroutine UPDBA

    ad 2. See subroutine UPDAAad 3. This is done by the subroutines DESYM and SOLVS. A mistake

    in the present realization is that DESYM is also called when there

    is no linearization (LIN == 0). This means that GTWG is decomposed

    every time ESTA is called. see the item on computing times in /2/.

  • -33-

    SUBRou'rrNE DESYM (A, G, Nt EPS, IF.ANK, IA)

    SUBROUTINE SOLVS (G, B, X, NN, NNB, 11\)

    Solves the linear system of equations A x X = B for a sywmetric

    A matrix by triangularization (decomposition) of A (DESYM) and

    for~ard and backward sUbstitution (SOLVS). These routines are

    t.aken from the program library of the Div. of Automatic Control

    of the Lund Institute of Technology.

    SUBROUTINE: UPDAA (INDEX, ELT, NOE, WI, A)T

    Updates G (~l)WG(~l) for a measurement. The NOE non-zero ele-

    ments of G that have to do with the measurement are given in

    the vector ELT. The NOE elements in INDEX give the corresponding

    places· of the jacobian element.s in the complete jacobian row.

    WI is the weighting factor for the measurement and A the matrix

    to be updated.

    example:

    NOE :: 2 INDEX(1) ::: 1

    INDEX(2) "'" 3

    ELT (l )_. 2. 0

    ELT(2) == 4.0

    WI == 2

    matrix A before updating matrix A after updating

    0 0 0 8 0 16

    0 a 0 0 0 00 0 0 16 0 32

    In this way multiplications wi'th zero are avoided in computing

    GTWG , but this implementation also asks much computing time

    because of the complicated subroutine call. This can be irrproved

    by transferring a number of variables (e.g. matrix A) through

    common blocks.

    SUBROUTINE UFDBA (INDEX, ELT, NOE, WI, B, RES)

    Updates GT(~)W{~ - g(~k)} for a measurement. Since W is diagonalonly the places corresponding to non zero jacobian elements are

    changed in the right hand vector.

  • -34-

    INDEX, ELT and NOE are organized in the same way as in UPDAA.

    WI is again the weighting factor while RES is the resldue for

    the me asureme nt. B is the r i ghthand v€: ctor .

    example:

    NOE == 2 INDEX (1) ::: 1 ELT (1) ::: 2.0 WI ;:: 2 RES "" 0.25

    INDEX(2} ::: 3 ELT (2) ._. 4.0

    B before updating

    ooo

    B after updatingJ,.

    ·0

    2

    Concerning computing time the same can be said as for UPDAA.

    ~~!DEf29f~W_~J~~

    The three mainprograms for the three methods all are organized assketched in fig. 2.1. The only differences are the estimator

    parameters read in part 1 of ~ig. 2.1 the initialization of the

    estimator at time point 0 and of course the used estimator:ADMA, ADMB and ADMC respectively.

    For method A the estimator parameters that are read are given inthe following table:

    ~.iAXIT

    JSCRLOSS

    CRLIN

    maximum number of iterations

    estimator mode, see ADMA, table 4-1the critical value of the loss function: J*

    the linearizing distance) t.!.l

    Table 4-2 EStimator parameters for ADMA

    Estimator A is initialized by setting the initial estimate at t = 0

    equal to the true state and linearizing around the true state inone iteration. So we know that the estimator starts with G~WG

    computed at the true state ~At the end of the program all evaluation quantities are printed

    for all time .pointsand the totals. See also the description of

    the subroutine EVAL and the common block !EVL/.

  • -35-

    The data needed for the plotprogram (the estimation error, the

    lineflow error, and the measurement index for all time points)

    are written in internal code to a file with internal filename 1-

    For more details see the prograrnlisting.

    4.8 Ihg_fQg~!g~§~~n2_m2!nE~Q9~em_fQ~_m~~hQg_~~

    SUBROUTINE ADMB (MAX IT , JS, CRLOSS, JQ, PIN, Q;IEXIT, TIME,.IPRINT)

    Main routine for method B.Flow diagram:

  • -36-

    Flow diagram:

    ~

    I~_-,1~_'1

    I P ::: Pk

    IL~_w---.-__ .. 1

    no

    2

    I eatpute J rew II 1

    L~ure ~ reSidUO;=Iy '\

    yes

    __.lye~S:'- .---.-...(9

  • -37-

    [ 1.. ~!I .~ .

    II it 2:.. rnaxit? yes (2)I j ~/.. .,~,II i no...1-- ,I Istart iteration II!I it ::: it + 1 !• _---I

    II

    -~IJ ::0 J II I~old feW Ix :::-: ~ !1 l-old -- II IP - PI . Old_ - r-eN II

    I ,-I!

    ~I I

    . ",lconpute ~ I

    3,IWith~ I

    II

    .-lI iJS ::: 0 III II

  • 1

    -38-

    2 3j

    , 1-----,! IIdiy.;erg:moe IL . _--1

    ----~-~! I

    l}{=~ld I,- -0 '1 . '1 1

    ,I...

    i p _ p I'I new - old- I ,----

    I

    4

    II

    II I.1I Jrew = Jo1d

    11

    1I

    I Pk ::: Pnew 5

  • -39-

    comments:

    ad 1. Pk and P are stored in the common block /VAR/ in COV(r). newand PNEW(I) respectively.

    ad 2 •. Note that the contents of Pk are not changed during it:erations.

    So each iteration starts with the same Pk •

    The estimator can operate in various modes determined by JS and JQ.

    They are given in the folloWing table.

    JS mode

    o Normal operation, iterate till loss function is less..than the critical loss J or till the maximum numberof iterations.

    1 Iterate at least once irrespective of the value of

    the loss function.

    JQ modeo To the final diagonal P-matrix after the previous

    time point a certain diagonal Q-rnatrix is added

    to be used as initial covariance for each iteration.

    1 The initial covariance matrix before each iteration

    has all diagonal elements equal to P .•l.n

    Table 4-3 Estimator modes for method B.

    Ad 3.-In ESTB P is computed.newAd 4. Concerning divergence the same can be said as for ADMA, only

    here the covariance also has to be restored.

    Ad 5. Note that first here Pk (COV (I) in /VAR/} is.changed againafter 2.

    SUBROUTINE ESTB (IPRINT, IERR)

    Performs one iteration of method B.

    Flow diagram:

  • -40-

    Flow diagram:

    1

    1-----------

    II

    I carpute the jaccbian ele-rents for maasurenent I

    2

    3

    6

    5

    4r 1 - TL~anpute t.he row gain I

    I

    [* ,

    eatpute _ ~ es~te j,t

    I iI_~~ P j

    f

    ------...no........-f~t Jreas-::::? I~----r -I

    !.

    'yes~

    7

  • -41-

    comments:

    Ad 1 + 7. Pk and P are stored in the common block /VAR/ andnewPNEW(I) respectively.

    Ad 2. The residue for each measurement is computed in ESTB."

    CARES can not be used in ESTB because the estimate changes

    during the measurement processing.

    Ad 3. The jacobian routines JACV, JACI, JACLF and JACBI are

    used.Ad 2 - 6. For the measurement processing use is made of the

    measurement order information stored in IMSI/.

    See the description of this common block.

    Ad 4 - 6. For type 2, 3, 4 and 5 measurements only four gain

    elements are non-zero and only four P- and estimate elements

    are changed. Therefore there was written a separate subroutine

    for type 2-- 5 measurements: the subroutine UPDEP.

    SUBROUTINE UPDEP (IA, IB, RES, WF, G, P, AK, XE)

    See the comments of ESTC.

    ~~!9E~Qgf~ID_~~~~~

    The general remarks mentioned with MAINA are also valid here.

    The estimator parameters read by MAINB are given in the followingtable:

    MAXIT

    JS

    JQ

    CRLOSSPIN

    Q(I)

    maximum number of iterations

    mode parameters. See ADMB, table 4-3

    mode parameters. See ADMB, table 4-3

    the critical value of the loss function J.

    the value of all diagonal elements of the

    initial covariance matrix when JQ = O. See table

    4-3vector of elements to be added to the initial

    covariance matrix when JQ = 1. See table

    4-3

    Table 4-4 Estimator parameters for ADMB.

  • -42-

    The estimator is initialized by setting the initial estimate

    at t = 0 equal to the true state and performing one iteration

    of ADMB with JS = 1, JQ = 1 and all elements of the diagonalcov. matrix equal to the value read in PIN.

    SUBROUTINE ADMC (~EWA, CRLOSS, ~~XIT, EPS, IEXIT, TIME, IPRINT)

    Main routine for method C.

    Flow diagram:

  • -43-

    Flow diagram:

    I coopute ti~ residoos 1I ~.l

    I;- :ir:

    2

    1

    ! 17;\\!-"Y§~s ....... ~)

    I

    Icoopute J oldII

    r ..

    -J.

    no

    .........\I NEViA:::· 1 ?I

    yes

    carpute the linevolta99

    weighting factors

    I~

    !I set the reference voltage

    equal to the neasumd

    reference voltag;?I

    !old:: !

    cCJTPute the estimate

    with ES'IC

    I

  • -44-

    !I carpute J

    new

    direct conver-

    genceI final loss 5.,.J* I

    CD 3

    J' -J tre"Ii - old I

    III II

    Ii. .__---:..__-... -..a..l ---...

    ~

  • -45-

    comments:

    ~d 1 + 2. The subroutine ESTC needs the line voltage weighting

    factors. These are computed by the subroutine CAD.

    Ad 2 + 3. The computation of the estimate in ESTC is doneiteratively. This iteration process mayor may not convergence.

    This is represented by IEXIT = 1 or 2 respectively. But thisconvergence is independent from convergence in the sense of

    the loss function: J < J •• Therefore there are five exit

    possibilities. See also ESTC.

    SUBROUTINE CAD (DA, DB~ IPRINT).

    Computes the linevoltage weighting factors for the active line-

    flow measurements. Only the active weighting factors are used

    since method C assumes that both the active and reactive measure-ment are available.

    SUBROUTINE ESTC (NR, DA, DB, MAXIT, EPS, NEWA, IEXIT, TIME,

    IPRINT)

    Basis routine for method C.

    Flow diagram:

  • Flow dj.ag.r.am:

    I

    III

    II,

    ..... 1.-. ---rJ l1_ corrp. lISt == 9:: - ~ I! -~!--.:.re!:"--=--.J

    t-'__.;%1__,. -I

    t· !=~ J!i

    1

    2

    3

    4

  • -48-

    CYr--~,COll"'r

  • -49-

    conunents:

    Adl+ 2. The updating of BTDB is done by the subroutine UPDAC.

    It is assumed that the linevoltage weighting factors 0 are al-

    ready calculated. The updating of the righthand side vector

    BCD(~ - AgEg ) is done by UPDBC. Note that Band D are real andthat z - A E is complex.

    - 9 9Ad 3 + 4. The triangularization is done by DESYM. The solution

    of fBTDB]E =: BTD{Z - A E) is done by solving the two setsL: new - 9 9 .-

    of equations, one for the real parts of ~ and one for theimaginary parts, by SOLVS. Note that the dimension of BTDB is

    about half of the corresponding GTWG-matrix in ESTA.

    Ad 5 .. see the comments on IEXIT in ADMC.~STC is written to have more than one reference voltage in Egbut ADMC uses ESTC with only one reference voltage.

    SUBROUTINE UPDAC (lA, IB, DA)

    updates the matrix BTDB for a complex lineflow measurement.

    The subroutine functions in the same way as UPDAA. Note that

    in this routine the matrix to be updated is given in:ehe common

    block /MAT/.

    SUBROUTINE UPDBC (CB, lA, IB, NR, XEA, XEB, ZL, YA, CYM, CLV, OA)Updates BTD(Z - A E ) for a complex lineflow measurement.

    - g gThe subroutine computes the complex linevoltage CLV from the

    complex line flow measurement CYM. It functions in the same way

    as UPOBA. The only difference is the implementation of the termT

    -B DAgEg • Also here Eg may consi,st of more than one referencevoltage. .

    See ESTC.

    ~e!~E~Qg~em_~!~g~

    The general remarks in MAINA are also valid here.

    The estimator'parameters read by MAINC for ADMC are:

  • NEWA

    MAXIT

    CRLOSS

    -50-'

    TIf NEWA = 1 a new B DB matrix is computed.This is only necessary when there has been

    a change in network structure. So normal

    operation is NEWA = O.Maximum number of iterations for ESTC.

    jIj;The critical loss J for ADMC.

    BPS Convergence criterion for ESTC.

    Table 4-5 Estimator parameters for ADMe.

    The estimator is initialized by setting the initial estimate

    at time point 0 equal to the t»ue state. An estimate withrp

    method C is done in which 13-"D13 is calculated. Direot convergence•is aVOided by setting J = l~O •

    SUBROUTINE EVAL (K, IPRINT)

    The subroutine computes the following quantities at a time point:

    - 'the estimation error.

    - the maximum element in ~he estimation error.

    - the lineflow error.

    the maximum element in the lineflow error.

    - the measurement index.

    It updates the following quanti ties:

    - the average estimation error.

    - the maximum estimation error.the maximum element in all estimation errors.

    - the average line flow error.- the maximum line flow error.- the maximum element in all lineflow errors ..- the average measurement index.

    - the maximum measurement index.

    All these quanti ties are stored in /E:VL/. The average values

    AEE, AEL and AEM are updated by adding the corresponding computed

    errors. To obtain the real average values AEE, AEL and AEM have

    to be divided by the number of time points. For the organization

    of the evaluation data see the description of EVL.

  • -51-

    ~~!DE~29f~~_~~!~

    This program is used to plot a number of plots from either

    MAINA, MAINB or MAINe. It is build around the plotroutine

    RITA from the program library from the Div. of Automatic Control

    of the Lund Institute of Technology.

    For each plot the data is read from an internal file with in-

    ternal filename 10+ plotnumber. So if there have to be plotted

    4 plots the plotdata have to be supplied to PLT in files with

    names 11, 12, 13, and 14 respectively.

  • -52-

    5. The program l~st·tngs"_

    ; .The chapter starts with a table showing the relationships

    . .between the routines and mainprograms. The remainder consists

    of the program listings of the subroutines ordered alpha-betically and the listings of the four mainprograms.

  • -53-

    ROUTINE/PROGRAM CALLS:

    ADMA ALOSS CAJAC CARES ESTA PRRES PRWFADMB ALOSS CARES ESTB PRRES PRWFADMC ALOSS CAD CARES ESTC PRRESALLMSM NODI

    ALOSS PRRESCAD

    CAJAC JACBI JACI JACLF JACB PRENET PRJACCARES GXE PRRESCASDB

    CAWFCAWNDECOMl )

    DESYMl }

    ELDNL

    ESTA DESYM MPRI PRJAC PRRES SOLVS UPDAA

    UPDBAESTB JACBl JACI JACLF JAC~ UPDEPESTC DESYM MPRI SOLVS UPDAC OPDBCEVAL

    GXE PRENETGXT PRTNETJACBl JACLF

    JACI

    JACLF

    JACVMPRI l )

    . NODI l )

    NRLFR DECOM MFRI SOLVB

    l)program library Div:~ of Autom. Control, Lund lnst! t'qte of Techno....

    Table 5-1 Relationships between routines and programs(Part 1 of 4).

  • -54-

    PRENET

    PRJAC

    PRRES

    PRTNET

    PRWFRDENET PRENET

    RDGENRDLDRDMETE

    RDMETT

    RDMSM

    RDT~"'ET PRTNETSOLVB~)

    SOLVS1 )

    TRUEV ELDNL GXT NRLFRUPDAA

    UPDACUPDBAUPDBC

    UPDEP

    MAINA ADMA ALLMSM CASDB CAWF CAWN EVAL

    RDENET RDGEN r ROW RDMETE ROMETT RDMSM

    RDTNET TRUEVMAINB ADMB ALLl-1SM CASDB CAW!' CAWN EVAL

    RDENET RDGEN ROLD RDMETE ROMETT RDMSM

    RDTNET TRUEVMAINC ADMC ALLMSM CA$DB CAWF CAWN £VAL

    RDENET RDGEN ROLD RDMETE RDMETT RDMSMROTNET TRUEV

    PLT PLOT" PLOTS RITA

    1)program library Div. of Autom. Control, Lund Institute of Techn.

    Table 5-1 Relationships between routines and programs

    (Part 2 of 4).

  • -55-

    ROUTINE CALLED BY:

    ADMA MAINA

    ADMB MAINBADMC MAINCALLMSM MAINA MAINB MAINCALOSS ADMA ADMB' ADMCCAD ADMCCAJAC ADMACARES ADMA ADMB. ADMCCASDB MAINA MAINB MAINCCAWF MAINA MAINB MAINC

    CAWN MAINA MAINB MAINCDECOM1) NRLFRDESYM1 ) ESTA ESTC

    ELDNL TRUEV

    ESTA ADMAESTB ADMBESTC ADMCEVAL MAINA MAINB MAINCGXE CARESGXT TRUEVJACBI CAJAC ESTBJACI CAJAC ESTBJACLF CAJAC ESTB JACBIJACV CAJAC ESTBMPRI l ) ESTA ESTC NRLFRNODI l ) ALLMSMNRLFR TRUEVPRENET CAJAC GXE RDENETPRJAC CAJAC ESTAPRRES l..DMA ADMB ADMC ALOSS CARES ESTA

    l)program libJrary Div". of Autom. Control, Lund Institute of Techn.

    Table 5-1 Relationships between routines and programs(Par t 3 0 f 4).

  • -56-

    PRT1>iET RDTNET

    PR~iF ADMA ADMBRDENET MAINA MAINB ~_INC

    RDGEN MAINA MAINB MAINe

    RDLD ~'1AINA Ml\INB Ml'.INC

    RDMETE MAINA MAINB HArNC

    RDMETT MAINA MAINB M.'\INC

    RDMSM MAINA MAINB MAINe

    RDTNET MArNA flIlAINB MAINeSOLVBl} NRLFR

    SOLVsl ) ESTA ESTC

    TRUEV MArNA MAINB MAINC

    UPOAA ESTA

    UPDAC ESTC

    UPDBA ESTA

    UPDBC ESTC

    UPDEP ESTB

    l)program library Div·.. of Autom. Control, Lund Institute of Techno.

    Table 5-1 Relationships between routines and programs

    (Part 4 of 4).

  • -57-

    RDHS.tI-i 148RDTNE'r 151TRUEV 152UPDAA 154UPDA.C 155UPDBA 156UPDBC 157UPDEP 159

    MAINA 160Yi.A.INB 167MAINe 174PLT 181

    Table 5-2: The program listings (part 2 of 2).

  • -58--

    PROGRAM page

    ADl'-1A 59

    ADrvlB 64

    ADMC 69

    ALLMSM 73

    ALOSS 77

    CAD 79

    CAJAC 81

    CARES 83

    CASDB 85CAWF 86

    CAWN 88

    ELDNL 91

    ESTA 95ESTB 100

    ESTC 106

    EVAL IIIGXE 116

    . GX'l' 118

    JACBI 120

    JACI 122

    SAeLF '123JACV 125NRLFR 126pRENET 131

    PRJAC 132

    PRRES 135PRTNET 137

    PRWF 138RDENET 139RDGEN 140RDLD 141

    RDMETE 144RDMETT 146

    Table 5-2: The program listings (part 1 of 2).

  • -59-

    IPRINT:l

    IPRINT:2

    IPRINT=O

    IPRINT:3

    MAXITJ5=0

    .;5=2CRL.OSSXL(*JCRLIN

    IEXIT:-3lEXIT=-2IEXIT:-lIEXIT: 1lEXIT: 2lEXlT= 3

    TIMEIPRINT=~IPRINT=~

    SUBROUTINE AOMA(MAXIT,J5,CRLOSS,XL'CRLIN,IEXIT,11~E'lPKl~T)

    MAIN ROUTINE FOR ESTIMATORS OF METHOD AIT IS ASSUMED 'HAT BUS NU IS THE SLACK BUS

    AUTHOR, TON VAN OVERBEEK 1974-02-08

    MAXIMUM NUMBER OF ITERATIONSNORMAL OPERATION: ITERATE TILL CONVEnGENCEOR MAXIT, LINEARIZE IF NECESARRyITEHATE AT LEAST ONCE, IRRESPECTiVE vFTHE VALUE OF THE LOSS FUNCTIONL1NEARIZ~, IF MAxIT .GE. 2 IN TWO ITEkATl~NSCONVERGENCE CRITERION: VALUE OF ThE LOSS FUNCTIONVECTOR CONTAINING LAST LINEARIZAlION POINTLINEARIZATION CRITERION: DISTANCEBETWEEN ESTIMATE AND XLERROR IN ESTAt.RROR IN CAJACERROR IN NB OR NLCONVERGENCE WITHIN MAXIT ITERATIONSNO CONVERGENCE AFTER MAXIT ITERA1IONSDIVERGENCE: THE LOSS FUNCTION INCkEA~ESIN THE N-TH ITERATION. XE CONTA.NS THEESTIMATE AFTER N- 1 ITERATIONSTOTAL TIME IN MSECSNO PRINTOUTl1'.ITIAL VALUES OF THE. ESTIMATE' THE Rt.SlOuESAND IF ~s .EQ. 0 THE LOSS FUNCTION.LINEARIZATION ITERATION NUMBERS.THE RESULTS: NUMBER OF ITERATIONS, TOTAL TIMETHE ESTIMATE' THE LOSS FUNCTION ",NU THE Rt;.SIOUES.SAME + INPUT DATA: MAXIT, JS, CKLOS~' CH~INAND THE wEIGHTING FACTORSSAME + IN EACH ITERATION: OX, ThE ESTIMATE'THE LOSS FUNCTION AND THE ITERATION TIMESAME + IN EACH ITERATION THE JACO~lAN ANDHiE RES I DUESSAME + IN EACH ITERATION THE A- AND T-MA-TRICES AND THE a-VECTOR

    SUBROUTINE REQUIREDALOSS

    PRRESCA"'AC

    "'AttHJACLF

    ""AC1JACL.F..lACVPRENE,TPRJAC

    cCCCCCCCCCCCCCCCCCCCCCCCCCCCC:cCCCCCCCCCCCCCccCccCc.C

  • -60-

    EQUIVALENCE (COX,OX)

    INTEGER TIME,T~EG,TENO,TBIT,TEIT'TIT

    IESTI X~(MB),YE2(ML),YE3(ML),YEq(ML),YE5(ML)'YE6(~B)IENETI N~'NL,LTA(ML),LTB(ML),YAA(~L),ZAB(ML)"tiB(ML)IM$M/ YM1(MB),YM2(ML),YM3(ML),YM4(MML),YM5(MM~),Y~6(MMB)IMETEI wFl(MB),WF2(ML),WF3(ML),WF4(MML},wF5(MML),

    .F6(MMB),ALFE1(MB),ALFE2(ML),ALFEj(ML),ALFl4(MML),ALFES(MML),ALFE6(MMB),FSE1(MB),FSt2(ML),fSt3(ML)'FSE4(MML),FSE5(MML),FSE6(MM8),BET~1(M~),aETE2(~L)'

    6ETE3(ML),SETE4(~ML),BETE5(MML)'B~TE6(MMb)

    IRESI RES1(M8),RlS2(ML),RES3(ML),RES4(MM~),RtS5(M~L)'Rt.S6(f"MB)

    IMATI A(MM~'MMB),T(MMB,~MB) .IMSII MSK1(MB)'MSK2(ML),MSK3(ML),MSK4(Ml)'~S~5(ML),

    MSK6(M8),NM,NTYP(MM),NMSM(MM)• I~ACI AJAC1(MO,2)'A~AC2CML,4)'AJACJ(ML'4)'AJA,4(M~L,4),

    AJAC5(MML,~),AJAC6(MMB,MMB)

    COMMONXXXXXXX

    COMMONXXXXXX

    CARESGXE

    PKENETPRR~S

    ESTAOESYMMPRlPR~AC

    PRRt::SSOL\lSUPOAAUPOtiA

    PRRESPRWF

    PARAMETER MB=10,ML=13PARAMETE~ MMB=~*MB,MML=2*ML,MBl:MB+MML,MM=3*MBL

    . COMPLEX YAA,ZAb,YBB,XE,YE2'YE3,YE~'YE5'XE6,XOCMd),X~tMB)'COX(MB)

    DIMENSION OXCMMb),PR(9)/'(lHO,',O,0,'VERGEN',1 'CE AFT','ER,15""11H 1T,,'fRATIO','NS)'1

    c

    cC

    c

    c

    cccccccccccc··ccc

    CC CHECK NB AND NLC

    IF (NS) 20'20,1010 IF (~B-M8) 40,~Of2020 lEXIT:-1

    wRITE(6,30) NBJO FORMAT(13HONB IN ADMA =,15)

    RETURNC

    ~O_IF (Nl) 60,60,~O

  • -61-

    50 IF (NL-ML) 80,80,6060 IEXIT:-l

    WRITE(6,70) NL70 FORMATllJHONL IN AOMA :,15)

    RETURNCC INITIALIZATIONC

    80 IT=OIF lIPRINT-S) 90,150,150

    90 ~RITE(6,100)ioo FORMATC19HOPRINTOUT FROM ADMA/IX'18(lH*)/

    F15HOINITIAL VA~UES/1X,1~(lH-»IF (IPRINT-~) i10,130'1~O

    110 WRITE{o,120) MkXIT'~S.CHLOSS,CRLIN120 FOR~AT(20HOINPU10ATA: MAXIT :,15,6H JS :,12,

    FIOH CRLOSS :,F10.5,9H CRLIN =,flO.S)CAlLPRwF

    130 WRITE(6,140)(!,XE(I),1=1,NB)140 FORMAT(17hOINITIAL ESTIMATE/l~HOaUSNR

    F,10HkE(XE)F,6HIM(X~)11

    ."" F(15,5X'2FI0.~»150 T6EG=MSCPU(X)

    T81T:T6EGcC LAST PART OF THE ITERATION, ALSO USED FOR INITIALIZATION.C CALCULATION OF THE RESIOUES AND THE LOSS FUNCTIONC

    160 CALL CARES(2,I£)IF (IPRINT-~) 170,170,190

    170 IF (IT) 180,180,190180 CALL PRRES190 IF (IT .EQ. 0 .AND. JS .GT. 0) GO TO 240

    FLOSS~=AlOSS(2)

    IF (lPRINT-~) 200,200,2~0200 IF'(IT) 220,220,210210 IF (lPRINT-2) ~20,220,240220 ~RITE(6,230) fLOSSN230 fORMAT(20HOTHE LOSS FUNCTION =.flS.S)240 TEIT:MSCPU(X)

    TIT:TEIT-TBITIF (IPRINT .LE. 2) ~RITE(6'250) IT.TIT

    250 FORMAT(22HOTIMf FOR ITERATION NR'I~.4H lS,15'6H MSECS)cC CONVERGENCE OR MAXIT ?C

    IF (JS) 260,260,270 "260 IF (FLOSSN-ABS(CHLOSS» 520,264,26426q IF (IT) 270,270,268268 IF (FLOSSN-FLOSSO) 270,270'530270 If(IT .GE. MAXIT) GO TO 525c

  • -62- .

    HERE STA~TS TH~ ITERATION

    IT=IT+lIF (IPRINT-2) 280.280,300vd,lT£(6,290), IfFO~MAT(13HOITErtATIONNR,15/1X,17(lH*»fLOSSO:fl.OSSi-..uO 305 l:l,N~XO(,1)=X£(I)TbIT=tl.SCPU(X)IF (~S-2) 310,J40,340

    LINEARIZATION l

    XEL=O.ODO 320 l=l,NBx£L=XEL+CABS{X~(I}-XL(I»**2

    XEL=SORT(XELilF (X£l.-Ati$(CRLIN» 330,340,340LHIi=OGO TO 380L.IN=!IF (!PRINT-4) j50,350,380wRITE(6,370) IffORt-IAT (27HOLINi:AfUlATION IN ITERATION.IS)

    CALCULATION OF IPR~(=lPRINT IN THE SUBROUTINE CAJAC)AND IPRAl=IPRINT IN ThE SUBROUTIN£ [STA)

    380 IPRJ=IPRINT+lIPRA=IPfh.lIF (!PRINT .EQ. 2) IPRJ:l

    . ,IF (lP.RINT .EO. 0) IPRA:OCC CALCULATION OF THE JACOBIANC

    cC

    2dO2~0

    300

    305

    CCC

    310

    320

    330

    340

    350370

    CCCC

    " I

    IF (LIN) 440,4~O'42000 430 1:1,No'XL (l) =Xt:: (l )CALL ES1A(LIN,uX,lPRA,IERR)IF (IERR) 470,470,450lEXIT:-3riRITE(6,460) ITFOftMAT(27HOERROR IN ESTA IN ITERATION,IS)RETURN

    CALL CAJAC(IPR~.lERR)IF (IERR) 410,~10,390iEXIT=-2WfHTt:(6,400) ITfOR~AT(,8HOEHRvH IN CAJAC IN ITERATION. 15)RETURN

    ESTIMATE OX

    390

    400

    CCC

    410&J20430440

    450

    &JOO

  • -63-

    c470 DO ~80 I=l,NB480 XE(l>=XE{I)+CDX{I}

    IF (IPRI~T~2) ~90,490,5l0~90 wRITE(6,500){I,XE(I),I:l,NB)500 FOkMAT{13HOTHE [STIMATE/14HOBUSNR

    F,10HRE'XE,)F , 61'1 lfJj ( XE ) I IF tI5, 5X, 2F 10.5) )

    510 IF

  • -64-

    IPRINT=2

    IPRINT=lIPRINT=O

    lEXIT=-llEXlT=-Z11M£IPRHH=4IPRINT=3

    MAXITvS=O

    ...15=1

    cRLOSSuG=l

    JG=O

    PIN

    (H*)

    IEXlT= 1IEXIT= 21£Xl1= 3

    AUTHOR, TON VA~ OVERSEEK 197~-03-05

    MAXIMU~ NUMBER OF ITERATIONSNORMAL OPERATION: ITERATE TILL ~ONV~HGlN~EOR MAXITITERATE AT LEAST OheE, IRRESPECTIVe OFThl VALUE OF THE LOSS FUNCTIONCONVERGE~CE CRITERION: VALUE OF THE LOSS FUNCTIOhTHE COY MATRIX HAS DIAGONAL ELEMtNTS PIN DEFOREtACH ITERATIONTHE COY MATRIX HAS DIAGONAL ELEMlN1SCOY(l.I) + G(l) BEFORE EACH ITERATIONVALUE OF ALL DIAGONAL ELEMENTS OF THE INITIALCOy MATRIX WHEN JQ =0, USUALLY LARGlVECTOR CONTAINIMG THE ELEMENTS TO bE AODiO TO THEDIAGONAL ELEMENTS OF THE COV MATKIX wHEN ~Q = 1CONVERGEI..CE WITHIN MAXIT ITERATI\olNSNO CONVEkGENCE AFTER MAXIT ITERA110NS(llVERG£NCt::: THE LOSS FUNCTION INCr{EASESIN THE N-TH ITERATION. XE CONTAINS ThE'ESTIMATE AFTER N - 1 ITERATIONS~kROR IN Ne, NL OH NMEHROR IN £5T8TOTAL TIME IN MSEC$NO PRltHOUTTHE INITIAL ESTIMATE AND COY.THE RESULTS: NU~8ER OF ITERATIONS, ToTAL TIMETHE E.STIMATE AND COV, THE LOSS FUNcTIuN AJ,.OTHE RESIuUESSAME + INPUT DATA: MAXIT, JS, CMLOS5, JQ. THEWEIGHTING FACTORS AND IF JG.EG. 0 PIN ELSElHE (if-VECTOR~AME + AT EACH ITERATION PRINTOuT FROM ESTBSAME + AT EACH ITERATION PRINTOuT FROM ESTB

    MAIN ROUTINE FOR ESTI~ATORS OF METHOD eIT 15 A5SUME~ [HAT BUS wB IS THE SLACK BUS

    SUBROUTINE REGUiREOALOSS

    PRRt.SCARES

    GXEPKENET

    PRRt.SESTa

    ~ACclI

    JACLF'-'AC!~ACLF

    ,JACVupor,:p

    cccccccCcccccccccccc(.

    cccccccccccccccccccccccccccccccc

  • -65-

    CCC

    c

    c

    ,c

    c

    PRR£SPRWF

    PARAMETER M8=lu,ML=13PAkAMETlR MMu=2*MB'M~L=2*~L,MM=3*(M8+MML)

    COMPLEX YAA,lAd,Yb8,XE,YE2,YE3,VE4,YE5,YE6,XOIMd)

    OIMENSJON POLO{MM~),Q(1)'PR(9)/'(lHO"'O,O"VERGEN"1 teE AFT"'ER,I5,t,'11H IT','ERATrO"'NS)'/

    INTEGER TIME,TuEG,TENO,TBIT,TEIT,TIT

    COMMONXXXXx·xX

    COMMONXXXX

    IESTI X~(MU),YE2(ML),YE3(ML)'YE4(ML)'YE5(ML)'YE6(M8)/E~ET/ hb,NL,LTAIMLJ,LTB(ML),YAA(ML),ZABIML),YBB(ML)IMSM/ YM1(~B),YM2{~L),Y~3(ML),YM4(MML}'Y~5(MML)'YM6(M~UJ

    , IMETEI ~Fl{MB),WF2{ML},WF3{ML),WF4(M~L),wF5(MML),wF6(MM8)'ALFElIMB)'ALFE2(ML)'ALFEjIML),ALF~4(M~L),ALFE5(MML)'ALFE6(MMB),FSE1(M8)'FS~2(ML)'FS~3(ML)'FSE4(MML),FSE5(M~L),FS£6(MMb),SET~1(Me),~~lE2(ML),dETE3(~L),aETE4(MML)'BETE5(~ML)'B~lt6(MMu)

    IMSII M~Kl(MB)'M5K2(~L)'MSK3(ML)'MSK4(ML)'MSK~(~L)'~~K6(MB)'NM'NTYP(MM),NMSM(MM)

    IRE51 RtS1(Mb),RES2(ML)'RESJ(ML),RES4(MML),R~S5(MML),R~S6(MMa)

    /VARI COV(MMB),PNEw(MMB)cC CHECK NB, NL AND NMC

    IF (NS) 20'20,1010 IF (NU-kB) 40,40,2020 IEXIT:-l

    wRITE(6,30) NO30 FORMAT(13~ONB ih ADMB :,15)

    HETURNC

    40 IF (NL) 60'60,5050 IF (wL-ML) aO,bO,6060 IlXIT=-l

    WHITE(6,70) NL70 FORMAT(13HONL IN AOMB :'15)

    R~TURN

    c80 IF (NM) 100,10u,9090 IF CNM-MM) 120'120,100

    100 lEXIT=-l~RITE(6,110) NM

    110 FORMAT(13HONM LN AOMB :,15)RETU~N

    CC INITIALIZATIONC

  • -66-

    NNB1=NNB-l11:0

    cIF (lPRI~T-3) 160,130,220

    130 I'rfUTE(6,140}l~O FOKMAT(19HOPRl~TOUT FROM AOMB/1X'18(lH*J/

    FloHOlNITIAL VA~U~S/lX,14(lH-»IF C!PRINl-2l 150,150,220

    150 wRIT£(6,160) MAXrT,~S,CRLOSS,JG160 FOHMATl12HOINPUT LATA:/dHOMAXIT =,15,6H JS :'12'

    FlOH CRLOSS :,FIO.5,6H ~Q =,13). IF (JO) 190,190,170

    1"10 WI

  • -67-

    350~)60

    370,?UO.390

    ltOUCCC

    'flOJ:t20'430440

    CCC

    '-i504bO465

    ~10

    475

    CCC

    IF llPRINT-3) j~O,350,390IF (IT) 370,370,J60IF (lPKINT-l) J70,370,390~RIT~(6,j80) FLOSSNFORMAT(2UHOTHE LOSS FUNCTION='F15.S)TEl T=r-'SO'U(X)rIT=Tt:.IT-TEiITIF (lPRINT .lE- 1) wRITE(6,400) IT,TITFORMAT(22HOTI~f FOR ITERATION NR,15,4H 15,15,6" ~S~CS)

    CONVEkGENCE OR MAXIT ?

    IF (JS) 410,41u,420IF (FLOSSh-ABS{CRLOSS» 510,420,420IF (IT) 440,44u,430IF (FLOSS~-FLO~SO) 440,440,530IF (IT .G£. MA~Il) GO TO 520

    HERE STARTS THl ITERATION

    IT=1T+1IF (IPR1NT-l) 450,450,465~-vR1TE(6,460) ITFORMAT(13HOITE~ATION NR,15/1X,17(lH*»FLOSSQ=fLOSSNuO 470 1=1'1\18XU (l ) =XE ( 1>00 475 I=l,NNBPOLQ(!):PHEw(I)TU 1T::t-iSCPU (X)

    COMPUTE THE ESTIMATE

    CALL ESTB(IPRINT,lERR)IF (IERR) 500'~OO,q80

    480 wRIIE(6,490) If490 FORMATC27HOERR~R IN ESTd IN ITERATION.I~)

    lEXlT:::-2HETURN

    c. 500 ";$=0

    GO TO 310cC END OF ESTIMATION, PRINTOUT OF THE RESULTSC

    510 IEXIT=lGO TO 540

    520 lEXll=2

  • c

    c

    -68-

    PH(2)::t/lH+lltPRe,;>::' 16HOl'00 550 I=ltNi3

    550 XE { l} =Xo ( I>00 555 r::l,NNEj

    555 P~£~(l)=POLO(I'CALL CAk~S(2'1~)FLOSSN=FL.05S0GO TO 590

    5bO IF GO TO 570PH(2)::':,)hNO •

  • -69-

    NEWA=l

    f~EWA=O

    CklOSS

    IPkINT=LtIPRINT=O-3

    MAXITEPSIEXIT:-3

    . lE.XIT=-2lEXlT=-l

    . lEXlT= 0iEXIT= 1l£XIT= 2I£XIT= 3ll=:XIT= LtlEXlT= 5

    NEW LINEVOlTAGE WEIGHTING FACTORS AND A N~WA-MATRIX ARE CALCULATEDNO NEw WEIGHTING FACTORS AND MATkIX AkE CALCULAT~1CONVERGENCE CRITLRIONIF THE INITIAL LOSS .LE. CRLOSS THEN ~STCIS NOT CALLEDMAXIMUM NU~BER OF ITERATIONS FOR ESTCCONVLRGENCE CRITERION FOR ESTCE,f{HOH I N MASK VECTOR FOR VOLTAGE MEASukEMtl'lTU£COMPOSLTION OF A HAS FAILED IN E~TC~RROR IN Nd OR NliNITIAL L05S .LE~ CRLOSSCONVERGENCE OF ESTC, FINAL LOSS .LT. cRLOSS~O CONVERGfNCE OF ESTe, FINAL LO~S .LT. CkLOSSCONVERGENCE OF ESTC. FINAL LOSS .GT. CRlO~SNO CONVE~GENCE OF ESTe, FINAL LOSS .GT. CkLOSSuIVEkGENCE: THE LOSS FUNCTION INCkEA~ESTHE ESTIMATE IS SET EQUAL TO THE INI1IAL ~ST~MATfNO PRINTUUT~E.E ESTCTHE INITAL AND FINAL RESIDUES AND lOSS FUNCTIONAHE ALSO PRINTED

    SUBROUTINE REQulHEDALOSS

    PRRES·CADCARES

    GXEPR;;.NET

    PRRESESTC

    DES1MMPRISOlVSUPOA(;UPOuC

    PRRES

    0IME~SION OA(ML),DB(ML),PR(6)/'(13HOF"'XNAl L','oSS .,',0,1 '1H CKL"'OSS)'I

    SUBROUTINE ADMC(NEWA,CR~OSS.MAXIT.EPS.IEXIT.TI~~'lPHIN1)

    MAINROUTINE FO" METHOD c. IT IS ASSUMED THAT THERE IS ONLYO~£ REFLRENCE vOLTAGE: THE VOLTAGE AT BUS ~B

    AUTHOR. TON VAN OVERBEE~ 1974-03~14

    PARAMETER MB=10,ML=13PARAMET~H MMa=2*M~'~ML=2*Ml'MM=3*(M8+MMl)

    INTEGER TIME,TbEG,TENOc

    c

    ccccccccCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

  • -70-

    CCOMPLEX YAA,ZAd'Yb6,XE,tE2'YE3,YE4,YE5,YE6,XEO(~BJ

    cCOMMON

    XXXXXXXX

    lEST 1 X~(MB)'YE2(ML),YE3(ML),YE4(ML)'YE5IML),YE6(MB)IENETI NB'~l,LTA(ML),LTB(ML),YAA(ML),ZAB(ML),YB8(~L)I~SMI YM1(~B},YM2(ML),YM3(ML),Y~4(MMl).YM5(~ML),Y~6(MMB)

    IMET~I ~Fl(MB)'WF2{Ml),WF3(ML),WF4{MML),~F~(MMl)'~F6(~MB

    IMSll M~Kl(MB),MSK2(ML),MSK3(~L),MSK4(ML),MSK5(ML)'M~~b(Md),N~,NTYP(MM),NMSM(MM)

    IRESI R~Sl(MB),RlS2(~L)'RES3(~L),RES4(~ML)fRtS5(M~L)'Rt.St> (M,..Il:3 )

    IMATI ACMb;MB),TIMB,MB)CC CHECK HB ANQ NLC

    c

    IF (NS) 20,20,1010 IF (N~-Mb) 40,40'202.0 LEXl T=-..1.

    WRITE(6,30) HB30 FORMAT(13HONB IN ADMC :,15)

    R£TUHN

    40 IF (NL) 60'60,5050 IF (NL-ML) 80,dO,6060 lEXIT:-l

    ~fUT£ (6, 70) NL70 FORMAT(13HONL 1~ ADMC =,15)

    RETUR~

    CC CALCULATE THE INITAL RE~IOUES ANO LOSS FUNCTIONC

    80 TBEG:MSCPU(X)CALL CArt[S(2'I~)fLOSSO:ALOSS(2l

    cIF (IPRINT-3) 9U,90,120

    90 wRITE(o,lOO) CKLOSS100 FORMAT(19HOPHINTOUT FROM ADMC/IX'18(lH*)1

    F15HOINITIAL VALUtS/lX,1~(lH-)/9HOCRLOSS :,F10.S)CALL PRRESWRITE(6,110) FLOSSO

    110 FOR~AT(2QHOTHE LOSS FUNCTION :,F15.5)c;C DIRECT CONVERG~~CE ?\:

    120 IF (FLOS~O-A8S(CRLOSS» 130.130,170130 IEXIT:O

    Tf."'O="~SCPU (X)TIME:TENLJ-TBEG

    cIF (lPRl~T-3) 140,140,990

    140 _RITE(o,150)(1,XE(!},1=1,NB)150 FOKMAT(19HODIR~~T CONVEkGENCEI

  • CCCC

    1"10HW19UZOO

    210

    C220"2-30

    -71-

    FIHO,1~X,12HTHE ESTIMATE/F14H08USNKF,lOliHt;:tXE)f , bHUH XE) / IF(15,~X,~rlU.o)J

    WKll£(6,160) lIME160 ~OkMAT(22HOTOTAL TIME FOR ADMe :,15,6H MSECS)

    GO TO 990

    CALCULATE THE LINEVOLTAGE WEIGHTING FACTORS IF NECESARRYAND COMPUTE lHE ~SlIMATE

    IF (~EWA) 190,19U,180CALL CAD(uA,UB,IPKINT+l}IF (M~Kl(NB» 20U,200,220H.XIT::-3WKITE{o,210) N8,MSKltNB)rORMAT(1jHOEH~OR IN MSK,5X'~HMSK1(,15,3H) =.15)

    . GO TO 990

    uO 230 l=l,NbXf..O ( 1r=x(t 1 )XE(No)=CMPLX(YMltNB),O.O)1'41

  • c

    c

    -72-

    340 CALL CAKES(2,IE)FL05SN=FlOSSO

    350 TENO=MSCPU{X)TIME=TEi~O-TB£GIF (lPRINT-3) 360,360,990

    360 WRIT£(6,110) F~OSSNwRITE(6,160) T!M£

    990 KETURNf::ND

  • -73-

    ~U8ROUTINE ALLMSM(NOOO,IPMINT)

    AUTHOR, TON VAN QVERBEEK 1974-01-16

    SU8ROUTINE REQUIREDNODI

    PARAMETER MB=10,Ml=13PAR~METER HMa=2*MB,MHt=Z*ML

    PARAHF.Tf R FOR THE StJBROllTINF. NOOI.AT FI~ST CALL OF ALlMSM NoOO MUST EQUAL AN nDOINTEGER(F..G. 19). NOOD IS RETURNFO CO~TAINtNG ANEw 000 INT~GER WHICH IS USEO By REPEATED CALLSNO PRINTOUTTRUE VALueS,BIAs,NOISE,ANO MEASUREMENTS ARE PRINTE

    ~JOOD

    COMPUTES ALL POS~J8lE HEA~UREMENTS RY ADDING NOISE ANDBIAS TO THE TRUE VALUES

    IPRtNT=1tPRrNT=O

    c

    ccccccccccccccCt

    COMPLEX XT,YT2,YT3,VT4,YT),VT6C

    fTUFt' N8,NlITRUEI XT(~8),YT2(Ml),VT3(ML),YT4(ML),YT5(Ml),YT6(~B)IMSMI VM1(HB),YM2(ML),YM3(ML),YM4(MMLi,YMS(MMl),YM6(MMA)IMETTI BIAS1(MR),6IAS2(ML),BIAS5(Mt),6JAS4(MMl),

    BIAS5(HML),HIAS6(MMn),WN1(MR),WN2(Ml),W N3(Ml),WN4(MML),WN~(MML),WN6(MM6) .

    COMt-1QN,?34S

    cC MODULUS MEASu~EMENTS,TYPE ~,2,3C

    IF (IPRINT .GE. 1) GO TO cOWRITE(6,10)

    10 FORMAT(21H1PRINTOUT FROM AllMSM/1X,20C1H*)11F14H MSMNR ~ .F,10HTRUEF,12HBIASF,8H\JNf,10HNOISEF ,3tiMSMI)

    cC TYPE 1C

    20 If (IPRINT~') 25,35,3525 IT=, .

    WRITE(6,30) IT30 ~ORMAT(5HOTYPE,I2/)35 00 60 I="N8

    Yl=CA8S(XT(I»CALL NOOI(NOOQ,ERR)ERR=F.RR/WN1 (0yM1(J>=YT+BIAS1(I)+fRRIF 40,60,60

  • -74-

    40 WRITE(6,SO) I,YT,qIAS'(1)'~N'(I)~eRR,YM1(r)50 FORMAi(15,5X,2f10.5,F10.2,lFl0.S)6t CONTINUE' .

    cC TYPE 2C

    iF (IPR!NT-1) 61,65,~561 IT=~

    WRITe(6,30) IT6S DO ~O I=1,Nl

    V1=CA8S(YT2(I»CALL NOOT(~ODD,ERR)ER~=ERR/WN2(I)

    YM2(t)=YT+BIAS2(I)+ERRIF (lPRINT-1' 70,~O,80

    70 WRITE(6,SO) i,YT,BIASZ(I),WN2(1),ERR,YMZ(J)80 CONTINUE .

    cC TYPE :sC

    IF (tP~INT-1) H',85,8581 IT=3 .

    WRITE(6,30) IT85 DO 100 1=1,NL

    YT=C AaS (YT3 ct ) )CALL NODI(NOOO,E~R)ERR=ERR/WN3(1) .YM3(I)=YT+BIAS3(t)+F.RRIF (tPRINT-1) 90,100,100

    90 WRITE(6,50) I,YT,8IAS3(1),WN3(I),~RR,YM3(T)1QO CONtINUE '. .

    CC ACTIVE ANn REACTIVE ~EASUNEMeNTS,TYPE 4,5,6C

    IF (IPRINT .GE. 1) GO TO ]20WRITe(6,110)

    110 FORMAT(/1HO,33xf,53HACTIVEF,8tiREACTIVE/F14HOMSMNRF,10HTRUEf,12HBIASff~HWN

    F,10WNOISEF,1)t4HSMF,10tll'RUEF,'2H6I~S

    F.8HWNF,'O~NOIS£

    .f,.3 HMSMI)

  • -75-

    cC TYPf 4C

    IF (IP RtNT-1' 1'5,120,120115 11=4

    WRITE(6,30) IT120 00 150 I=1,NL

    1'=2*1-1t2=?*IYTR=RE Al(YT4(I»YTI=AIMAGCYT4(1»CAll NOOJ(NODD,ERRR)CALL NOOI(NOOO,ERRI>F.RRR=ERRR/WN4(!1)fR Rt=fRRI/WN4(IZ)Y~4(I1)=YTR+8IAS4(I1)+ERR~

    yM4(12):VT1+81AS4(I2)+EPRlIF (IPRINT"1) 130,150,150

    130 WRITE(6,140) I,YTR,BIAS4(11),WN4(I1),fRRR,YM4(t1),1 YTJ,AIAS4(ll),WN4(YZ),ERRI,YM4(IZ)

    140 rORMAT(I5,2(5X,2F10.5,F10.l,lF10.5»150 CONTINUe .

    cc rVpf, 5C

    , 81

    185

    ccc

    IF (IPRINT-1) 161,165,165161 IT=S

    WRITE(6,30) IT165 00 170 I:1,NL

    11=7*1-112=2*1YTR=RE Al(YT5(I»YTI=AIMAG(YT~{I»

    CAll NOOICNOOO,ERRR)CAll NOOI(NODO,ERRI>eRR R=ERRR/WN5(I1)F.RRI=fRRI/WN~(IZ)

    YM5(I1)=YTR+6IAS5(I1)+ERRRyM5(IZ)=YT1+BIAS5(I2)+ERRIIF (IPRINT-1) 160,170,110

    160 WRITE(6,140) I,YTR,BIAS~(11),WN5(I1),ERAR,YMS(t1)f1 YTI.8IAS5(ll)fWN5(tZ),ERRl,Y~5(12)

    170 cONTINUe

    TYPr: 6

    IF (tPRINT-1) 191,185,185IT=6 .~JRJTE(6,30) IT00 190 1=1,N811·2*1-112=2*1YTR=REAl(YT6(1')YTl=AJMAG(YT6(I»

  • c

    -76-

    I

    CALL NOOI(NOOO,ERPR)t~Ll NODI(NODO,ERRI)ERRR=ERRR/WNb(I1)ERRI=eRRt/ WN6(12)YMb(I1)cYTR+BIAS6(I1)+ERRHYM6(I2)=YiT+BIAS6(12)+ERRlIF (IPRINT-1) 1~O,190,1YO

    180 WRITE(o,140) 1,YTR,BIAS6(11),WN6(y1),FRRR,YM6(I1),1 YTI,RIASb(12),WN6(T2)f~RRlfYM6(I2)

    190 CONTINUE

    nETURNEND

  • -77-

    ,~ .)" ~ ~ . '" "'- ... . .fUt'('Cllu,. ALOSSlJ.f-'Rli-4T)

    SUk:H,CUT li~t. Ht:.Qu lkEDPl{(-U:.:S

    PARA~ETEk ~b=lU,hL=13

    P~kA~~TEk M~G=~*MU,h~L=~*Ml,MBL=Mb+MML.MMclL=2*MbL

    1,,0 PliENTS, THE CvRh[SPiJhiDItJGLSTIMATED VALuES ANU THE RESIDUES

    .lPHllll=2J,PtUi'JT=l.l.Pk.a.i"T=O

    C{\LCULl\lES THE: LOSS FUNCllON GIVEi''l THE HESIOUES Aim THE "'EIGHTH..",f l,cTuHS

    cccccC

  • c

    -78-

    IF (lPR1~T-1) ~0,lOO,99U90 CALL PRHE.$

    lUO ~~11c{b,110) ~~~SS110 F~riMAl{20nOTHE ~USS FUNCTION =.F15.S)

    990 HLlIJt\l<d.1)

  • OA

  • c

    -80-

    IF CIPRINT) 80.8U,100dO ~RITE(6,90) I'h~4~'OA(1),~F5A'Dd(1)YO FOkMAT(15,2(5X,fl0.5,FlU.2»

    lOU CON1INU£

    kETURh[NU

  • -81-

    "AUTHOR, TON VAN OV~RBEEK 1974-01-28

    PARAMETER MS=lO,ML=13PARAMETER MMU=2*MB,MML=2*ML

    COMPLEX YAA,ZAB,YBB,YA,ZL,V8,x,XA.XA

    SUBROUTlliE CAJAC (lPRINT, IERR)

    CALCULATES THE JACOBIAN FOR ESTIMATION METHOD A GIVEN T~ELSTIMATE AND ESTIMATOR NETWORK DATA

    SUBROUT H!E REOUIREDJACBI

    Ji\CLFJACIJACLFJACVPRENETPRJAC

    1\10 PRINTOUTTHE JACOBIAN IS PRINTEDSAME + ESTIMATE AND ESTIMATOR NETWORK DATAERROR IN JACV, JACI, JACLF OR JACBINO ERROR

    IENETI NB'NL,LTA(ML),LTA(ML),YAACML),ZABCML),YBBtML)/ESTI X(Mii)/MSII MSK1(MB),MSK2CML),MSK3fML),MSK4(ML),MSK5(ML),MSK6fMA/JAC/ AJAC 1(MB,.2) , AJAC2 (ML, 4) , AJAC3 (ML, 4) • AJAC4 04ML, 4) •

    AJAC5(MML,4),AJAC6(MMO.M~B)

    IPRINT=2IPRINT=lIPRINT=OIERR=lIERR=O

    COMMON123"..

    IF (lPRINT-2) 10.50.5010 wRITE{6,20)20 FORMAT(20HOP11NTOUT FROM CAJAC/IX,19(IH*)}

    IF (!PRINT) 30,30,5030 CALL PR£NET

    WRITE(6,40)(I,X(!),I=1,NB)40 FORMAT(l3HOTHE ESTIMATE/IX,12(lH-)/14HOBUSNR

    F.I0HRE(XE)F.6HIMCXE)//CI5.5X,2FI0.S»

    C

    c

    ccccccCcCccCCCCCCCCCC

    cC TYPE 1 AND 6C

    50 00 110 I=l.NBIF (MSK1CI» 90,90'60

    60 CALL JACVCX(I),AJACl,I.MB.IERR)IF (IERM) 90.90,70

    70 WRITE(6,80) I80 FORMAT t16HOERROR AT BUS NR, IS)""" kETURN

  • -82-

    c90 IF (MSK6(I» 110'110,100

    100 CALL JACBI(MSK6(I),I,AJAC6,2*I-l,AJAC6,2*I.MMB,IERR)IF (IERU) 110,110,70

    110 CONT HIUECC TYPE 2, 3, 4 AND 5C

    c

    C

    c

    00 210 l::l,NLIA::LTA(l)IB:LTB (I)XA::XCIA)XH=X(IB)YA=YAA(l)lL:lAB(l)H3::YBB

  • -83-

    SUBROUT Ii JE C/\RES ( I PR INT, I ERR)

    EQUIVALENCE (YEA,XEl,(YEB,YE4),(YMA,YM1),(YMB,YM4),1 (MSKA,MSKl),(MSKB,MSK4),(RESA,RES1),(RESB,RrS4)

    COMPLEX YAA,ZAB,YBB,XE,YE2,YE3,YE4,Yf5,YE6,YEA(MBLl,Y£B(MRL),1 YMB(MBL),RESB(MBL)

    SUBROUTINE REQUIREDGXE

    PRENETPRRES

    NO PRINTOUTTHE USED :,'EASlIRE'4ENTS, THE CORRESPONDING ESTIMATV~LUES AN~ THE RESIDUES ARE PRINTEDSAME + ESTIMATOR NETWORK DATAERROR IN NB OR NLNO ERROR

    IENETI NB,NL,LTA(ML),LTBcML),YAA(ML),ZAB(ML),YBR(ML)IESTI XE(MB),YE2(ML),YE3CML),YE4(ML),YE5(ML),YE6(M8)IMSMI Y~1(MB),YM2(~L),YM3(ML),Y~4(MML),YM5(MML),YM6(MMB)IMSII MSKl(~B),MSK2(ML),MSK3(ML),MSK4(ML),MSK5(ML),

    MSK6(MMB)IRESI RES1(MB),RES2(MLl,RES3(ML),RES4(MML),RES5(MML),

    RES6(t..1MB)

    IPRINT=OIERR=llERH=O

    IPRINT=2IPRINT=l

    COMMON123456

    CALCULATES THE HESIOlJES GIVEN THE f\1E.I\SURn~ENTS AND THE ESTIMATEDSTATE. WHEN THE ~~SK VECTOR ELEMENTS FOR TYPE 4, S ANn 6 MEA-SUREMENTS AR~ 1 OR 2 THE RESIDUES FOR BOTH THE ACTIVE AND REACTIMEASUREMENT ARE CO~PUTEO

    AUTHOR, TON VAN OVERBEEK 1974-01-23

    PARAMETER MB=10,ML=13PARAMETER MM8=2*MB,MML=2*ML,MBL=MB+MML.MM8L=2*MBL

    DIMENSION YMA(M8L) ,MSKA(MSL) ,MSKB(MBL),RESA(MDL)

    IF (lPRINT-2) 10'30,3010 wRITE(6,20)20 FORMAT(2UHOPRINTOUT FROM CARES/IX,19(!H*»30 uO 40 I=l,MBL

    RESA (!) =0.040 kES8(I>=(0.0,0.0)

    CALL GXE(IPRINT,IERR)IF (IERN-I) 50,990,990

    50 00 90 I=l,MBLIF (MSKA(I» 70,70,60

    60 RESA(I>:VMA(I}-CARS(YEA(I»70 IF (MSKB(I» 90,90,80

    c

    c

    c

    c

    c

    c

    cccCCCCCCCCCCCCCCCCC

  • c

    c

    -84-

    80 KESB(I)=YM8(I)-YE~(~)90 CONTINUE '

    IF (IPRINT-2) 100,990,990100 CALL PRk£S

    990 kETURNEND

  • SCS(*>SSL(*>UIPRINT=lIPRINT=O

    cccccccccccCccccc

    C

    c

    C

    -85-

    SUURQUTINE CASUB(SOB,SSL,U,IPRINT)

    COMPUTES THE NEW LOAD DEMAND GIVEN THE OLD DEMAND, THESTA~DARU SLOPE~ AND THE LOAD CONTROL VECTOR ELEMENT UACCORDING TO: SDB(.> =SOB(.} + U*SSL

  • -86-

    IPRINT=lIPtHNT=O

    PARAMETER MS=10,ML=13PARAMETER MM8=~*MB'MML=2*ML

    IENETI N6,NL.IMETEI ~Fl(MB),WF2(ML)'WF3(ML)'WF~(MML)f.F5(MM~)'

    wF6(MMB)'ALFE1(M8),ALFE2(ML)'ALFE3(ML)~ALF~~(M~L

    ALFE5(MML),ALFE6(M~8),FSE1(MB),FSl2(ML),FS£3(ML)

    FSE4(MML),FSE5(MML),FSE6(~MB),BET~1(MbJ'dETE2.t~L

    BETE3(ML)'BETE4(~ML),BETE5(MMl)'8~TE6tMM~)

    IMSM/ YM1(MB),YM2(ML),YM3(ML),YM4(M~L)fYM~'MML)'YM6(MMb

    NO PHINTOUTALFA, FULL SCALE, BETA' MEASUREM(NT A~D wFVALUES AkE PRINTED

    ~UBROUTINE REQUIREDNONE

    COr-~MON

    l'2-3456

    SUbROUTINE CAwF(IPRINT) .

    COMPUTES THE W~lGhT FACTORS WF FOR THE ESTl~ATORS:WF=l/CALFA*FULL SCALE VALUE. BETA*MEASUREMENT)

    AUTHOR, TON VAN OVERBEEK 197~-Ol-21

    DO 10 I=1,N812=2*111=12-1WF1(I)=1/(AL.FElll)*FSE1(I)+BETE1(I'.YM1(I»WF6(11)=1/(ALF~b(11)*FS~6(Il)+BETE6tll).YM6(11»

    10 wF6(12)=1/(ALF~6(12)*FSEb(12)+BETE6'I2.)*YM6(I2»00 20 l=l,NL1.2=2*111=12-1wF2(1)=1/(ALFE~(I)*FSE2l1)+6ETE2(I)·YM2(I»WF3(1):1/(ALFE3(1)*FSE3(1)+BETE3(1).YM3(!»WF4(11)=1/(ALFE4(tl)*FSl4{Il)+BETE~(Il)~YM4(Il»

    WFIf (12' =1/ (ALFc.~(12) *FSf.4 (12) +BETE4 (12·) *YM4 t 12) )WF5(11)=1/(ALF~5(11)*FSE5(Il)+BETE5(Il)*YM5(Il»

    20 wF5(12)=1/(ALFc.5(12)*FSE5(I2)+8ETESt12'.YMS(12»

    c

    C

    cccccccccCCCC

    CC PRINTOUTC

    IF (IPRINT-l) 30,990,99030 wRITE(b,40)~O FORMAT(19HOPRI~TOUT FROM CAWF/IX'18(lH*)/

    F14HOMSMNRF,6HALFA.F,14HFULl. SCALEF,lOHt3ETAF,12HMSMTF,2HwF/F,7liOTYPE 1/)

    .. F, 14HOMSMNR

  • c

    -87-

    WRITE(b,50j(I,ALFE1(I),F5El(I)'BETtl(I},YMl(I);nFl(lJ'1:1,Nti)SO FORMAT(15,5X,4FIO.5,FIO.2)

    WRITE(6,oO)60 FORkAT(7HOTYPE 2/)

    wRIT£(6,50)(I,ALFE2(I),FSE2(I)'BETE2(I),YM2(I)t~F2(1)'l=ltNL)wRITE(6,70)

    70 FORMAT(7HOTYPE 3/)WRITE(6,50)(I,ALFE3(I)'FSE3(I),eETE3(I)'YM3(I),~FJ(1),l=l,NL)~NITE(6,8U) .

    80 FORMAT(/IHO,33XF,53HACT1VEF,8HREACTIVEIF f 14HOMSi~NRF,oHALFAF,lqHFULL SCALEF,lOHBETAF,12HMSMTF,13HwFF,bHALFAF,14HFULI.. SCALEF,lOHBETAF,12HMSMTF,2HwFIF ,"7HOTYPE q/)

    00 90 I=l,NL12=2*111=12-1

    90 ~RITE(6,100) I'ALFE~(Il),FSE4(Il),eETE~(11),Y~~(Il),~Fq(11)'1 AlFE~(I2)'FSE~(I2)'BETE4(I2),YM~(I2)'WF4(12)

    100 FORMAT(!5,2(5X,4FI0.5,FIO.2»wRITE(f)fllO)

    110 FORMAT(7HOTYPE 5/)00 120 I=l,Nl12=2*111=12-1

    120 wRIT£(6,100) I'AlFES(Il),FSE5(Il),BETE5(Il),YM5'Il),~F5(11)'1 AlFE5(12),FSE5(12),BETE5jI2),YM5'I~),wF5(12)

    wRITE(6,130)130 FORMAT(1HOTYPE 6/)

    00 140 l=l,NB12=2*111=12-1

    l~O WRITE(6,laO) I'AlFE6(I1),FSE6(11),BETE6(I1),YM6(11),~F6(11),1 AlFE6(12)~FSE6(I2),BETE6(12),YM6(ll)'~F6(12)

    990 RETURNEND

  • -88-

    COMPLEX XT,YT2,YT3,YT4,YT5,YT6

    SUBROUTINEREOUIREONONE

    PARAMETER MB=lO,Ml=13PARAMET~R MM3=2*MB,MML=2*ML

    DIMENSION YA1(M8)'YA2CML),YA3(ML)'YR4(ML),YI~(ML),1 YRS(ML),YISCML),YR6CMB},YI6(MB)

    NO PRINTOUTALFh, FULL SCALE, BETA, TRUE MEASUREMENT AND wNVALUES ARE PRINTED

    ITNET/ NB,NLINETTI BIAS1(MB},BIAS2CML),BIAS3(ML),BIAS4(MML),

    8IASS(MML),BIAS6(MMB),WN1(MO),WN2CML)'WN3(ML},WN4(MML),WNSCMML),WN6(MMR).ALFT1(MB),ALFT2CML),ALFT3(Ml),ALFT4(MML}·,ALFTSCMML),AlFT6CMMB),FST1CMG>,FST2(ML),FST3(~L),FST4CMML),

    FSTS(MML),FST6(MMB),BETT1(M8),OETT2CML},RETT3(ML)BETT4(NML),BErT5CMML},BETT6(~MB)

    ITRUEI XT(MB),YT2(ML),YT3(Ml),YT4(Ml),YT5(ML),YT6(MB)

    IPRINT=lIPRINT=O

    COMMON12345678

    SUBROUTINE CAWN(!PRINT}

    COMPUTES THE STANDARD DEVIATIONS WN FOR THE MEASUREMENTNOISE: WN=l/CALFA*FULL SCALE VALl~ + BETA*TRUE MEASUREMENT)

    AUTHOR, TON V~N OVERBEEK 1974-01-21

    UO 10 I:l,NB12:2*111=12-1YA11I)=CABS(XTCI»YR6(1):kEALCYT6(1»YI6lI>:AIMAGCYTb(!)}~Nl{I}=1/(ALFTl(1)*FST1(I)+BETTl(I)*YA1(I»

    WN6(Il):1/(ALFT6(Il)*FST6(11)+~ETT6(Il)*YR6(1»10 _N6(I2}:1/(ALFT6(I2)*FST6(I2)+BETT6(I2).Y16(I»

    DO 20 I=l,NL12=2*111=12-1)A2(I}=CAnS(YT2(I)}YA3(I)=CABS(YT3(I»YR4(I)=REAL(YT4CI»YI4(I)=AIMAG(YT~CI»

    YR5(!)=kEAL(YTS(I»YI5(I):AIMAG(YT5(I})~N2(1)=1/(ALFT2(1)*FST2(I)+BETT2(I)*YA2(I»WN3(1)=1/(ALFT3(1)*FST3(I)+BETT3(I)*YA3(I»WN4(Il)=1/(ALFT4(Il}*FST4(Il)+8ETT4(Il)*YR~(I»

    c

    C

    c

    c

    ccccccCcCcccc

  • -89-

    \'iN4 (12) =11 (M.FT'" (12) *FST4 (12) +8ETT4 (12) *YI4 (I»~N5(Il)=1/{ALFT5(Il)*FST5(Il)+BETT5(Il)*YRS(I»

    20 ~N5(12)=1/(ALFT5(I2)*FST5(I2)+BETT5(12)*YIS(I})cC PHINTOUTC

    IF

  • -90-

    I>.fUTE (6,130),;,,:,0 FOfU·1AT{7HOTYPE 6/)

    GO 140 1=1"-.1812=2*111=12-1

    140 ~RITE(6,lOO) I,ALFT6(Il),FST6(Il),8ETT6(Il),YR6(I),WN6(Il),1 ALFT6II2),FST6{I2),BETT6(I2),YI6(I},WN6(I2)

    990 HETLJRNENO

  • -91-

    COMPUTES A SOLUTION 10

    REF£HENCL, L.K. KIRCHMAYER, 'ECONOMIC OPERATION~ OF POwER SYST~MSt

    5UBKOUTi~£ REQUIRED~lONE

    ~CEFFICIENTS IN THE GEFJ[RATOR COST FUf'4CTIONF(PG)=Al(I)*PG(I)+A2(I)*PG(1)**2M1Nltl:ut-: PLHr· ISSIBLE ACTIVE PO~ER AT G£IoERA10R ICO~PUTEC ACTIVE PowER AT GENEHATOrt IMAXIMU~ P£HMISSI8L£ ACTlVE PO_ER AT GENERAtOR ITOTAL OEMANG OF ACTIVE POWERTHE ITEHAT LON IS TER~-HNATED WhENTHE POwER MISMATCH IS LESS THAN EPS*P~EMNUMBER OF GENERATORS~AXIMU~ PklNTOUT FROM ELONLI~PUT DATA AND RESULTS ARE PRINTEQhO PRINTOuTA SOLUTION HAS BEEN COMPUTEDt:kKOR IN NGIOTAL CfMANO OUTSIDE LOAD BOUNDARiES

    NGlPIUI~l=O

    IPRlI~T=l

    IPRINT=2lERR=OlEkH=lIE:..Htt=2

    Al (1)A2(IlPMIN

  • ...

    . -92-

    ~fl~H A2oj

    ... \.1 70 I::l,hGIJ .hlT~(LP,eO) I,P~lN(I),PMAX(1)'Al(I),A2(1)~u rVkMAT(17,2F15.1'F15.3,~1~.5)

    .~lJ£(~P,90) PuEM~0 fUH~AT(l~H T01~L GEMAND =,F22.1)

    ,UMPUTE MINIMU~ AND MAXIMUM CAPACITY, INITIAL PG~ ANU PG~

    ll.iiJ PGI'-,IN=O. 0t'G~lh'\=O. 0...0 110 r=l,l'lG~~M!~=PG~IN+PM!NII)

    llu ~vMAx=PG~AX+PMAX{I)PGIJ::t'6MA>.-PUEr·1Pl.iA::PGMLN-POEMIF(P~o) 130,15u,1~O

    lJlJ t.I

  • -93-

    cC. HERE STAKTS THe ITERATIUNC

    2'+0 ITER=lTEk+lcC CO~PUTE A NE~ LAMBDAC

    IFCPMM) 250,25u,260250 ALA=r\lN

    PGA=PI'~M

    00 TO 271.J260 Al£j::ALN

    Pbcl::Pfl:.M270 AL~::ALA+PGA*(ALb-ALA)/CP~A-PGB)

    Alh=A~AX1(ALN'HlA+O.l*(ALB-ALA»

    J'\LN=/\t" 11',.1 (ALi'H AL.b-0.1 * CALd-ALA) )cC OETERMINE FEASlbLE LOADS AND PO~ER MISMATCHC

    P6N=O.0LiO 3~S I=l'NGPG£lH 1) ==u. 5* (AL.r..-Al (I» I A2 (1)IFCP"EN{l)-pr.1h4(I» 310,320,320

    310 PGtN(I)::PMIN(I)G

  • -94-

    4jO ~RIIE(LP,~40) 1,P~EN(I)~40 f0HMAT(17,F15.j}

    ~RIT~{LP,45U} ALh,PM~

    4~O fORMAT(19h l~CI(EME~TAL COST :,F18.51117H POW~R MISMKICH :,F20.5)

    990 riLTUHNEhO

  • -95-

    AUTHOR, TON VAN OVERBEEK 1974-02-01

    SUBROUTINE ESTA(LIN'OX,lPRINTf

  • cCr",.

    -96-

    IF lIPRINT-4J 10'40,4010 wHll£(6,ZO)20 FORMAlt19HOPRINTOUT FROM ESTA/IX,18(lH*»

    IF (lPRI~T-3) jO,40,40PRHES

    CAU.. PRJAC

    UPDATING OF A-MATRIX AND a-VECTOR

    ltD NNS=2*N800 55 l=l,NNBkHU=O.OIF (LIN} 55,55,45DO 50 ";::1,NN6

    50 /\(1,,;):;0.0CONTINUE

    TYPE 1

    DO 80 1::1,1'48IF (MSK1:::Z*I-l!NDEX(2)=Z*1ELT(1)=A~AC1(1'1)

    ELT(2)=A~AC1(I'2)

    CALL UPDBA€lNOEX'ELT,2,WF1(I),B,RES1(I»IF (LIN) 80,80,70

    10 CALL UPUAA(IND~X'fLT,2'WF1{1)'A)CONTINUE

    cC TYPE 2

    DO 120 1=:1, NI_IF (MSK2{!» 120'120,90

    90 lA=l.TAO)16=L HH I)lNOEX (U=2*IA-lINDEX(2)=2*lAINDEX (3):::2*IB-l&'''.#1-.'' (~)=2* 10DO 100 ...1::1'4

    ina T(J)=AJAC2(I,~}CA~L UPDBA(INDfX'EL1,4'~F2(1)'B,RES2(1»rF (l ) 120,120'110

    tlO UPDAA{lND~~'ELT,4'WF2(I)'A)o CONT!NUE

    160 l=l,NL.l,F (MSt

  • 1~0

    I 150160

    C(;

    C

    -97-

    IB=LTB (1)INDEX (l) =2*18-1INOEX(Z)=2*lBINDEX(3)::2*IA-lINDEX(4):2*IA00 11+0 J=1,4ELT(J)::AJAC3

  • C

    c

    -98-

    INO£X(3)::2*IA-lINDEX(4)=Z*lA

    IF (M-2i 300,270'210270 DO 280 J=l,~280 ELT(J)=AJAC5(I2,~)

    CALL UPOUA(IND~X'£LT,4,wF5(I2)'B,RES5(I2»IF (LIN) 300,3uO,290

    290 CALL UPOAA(INDEX'£LT,4,WF5(I2),A)

    300 IF (M-2) 310,34u.310310 00 320 J=1,4320 £LT{J):AJAC5(11,J)

    CALL UPD6A(IND~X'ELT,4'WF5(Il)'B,RES5(Il)IF (LIN) 340,340'330

    330 CALL UPDAA(IND~X'ELT,4'WF5(Il)'A)

    340 CONTINUEcC TYPE 6C

    NNBl:NNB-l00 350 I=1,NN81

    350 INDEX(1)=I00 440 l=l,NNBlM=MSK6(1)IF (M) 440,440'360

    360 12=2*111=12.-1

    c

    c

    IF tM-2) 400,370'370370-D0380-J=1,NNBl380 ELT(J)=AJAC6(1~,J)

    CALL UPOC3A( INDEX'ELl ,NNB1,WF6(2) ,B,RES6( 12) )IF (LIN) 400'400'390

    390 CALL UPOAA(lND~X'ELT,NNBltWF6(12)'A)

    400 IF (M-2) 410,440'410410 00 420 J=l,NNBl420 EL T(J) =A..IACo tIl,..I)

    CALL UPDBA (INOz;;,X, ELT,NN~l t WF6 (11) ,B,RES6 (11)~·IF (LIN) 440,440'430

    430 CALL UPDAA(INOEX'ELT,~N81,WF6(Il),A)

    t}40 CONTINUECC PRINTOUTC

    .c

    IF (IPRINT) 450,450;470450 WRITE(6.460)~60 FORMAT(9HOMATR!X A/IX,8l1H-)//)

    CALL MPKl(A,NNul'NN81,MMB,8,0,IE)

  • -99-

    10 CALL OESYMCA,T,NN81,1.E-7,IRANK,MMB)IF tiRANKJ 480f480,500

    t~60 lEHH:::lI (6,490)

    490 FOAMATl34HODECOMPOSITION OF A FAILED IN ESTA)HE1UaN

    ,..IEfOXlNNB)::O.O

    (:. INTOUT

    IF (lPRINT-4) 505,990,990!F lIPRINT-l) 510,530,550

    510 WRITE(6,520)520·FORMAT(9HOMATRLX T/IX,8l1H-)/I)

    CALL MPRI(T,NNdl,NNcl,MMB,8,O,IE)Q ITE(6,540}(B(I),I=1,NNB1)

    S40 FCRMAT{lHO,6X,~H8-VECTOR/7X,8(lH-)II(Fl1.3,F10.3)J550 WRIT£(6,560)(I,OXl2*I-l),QX(2*I),X=1,NB)

    o FORMAT{14HOBUSNRF, IOtiRE (0)0FccHUHOX)/1Fi,I5,5X,2Fl0.5)}

    990 m:.TURNE'~\JQ

  • PERFORMS ONE IlEKAT10N uF METHOO 8

    kUTHOR, TON VAN OVER8EE~ 1974-03-04

    ccc

  • -101-

    F,l~hObU~NR

    F dOHKt::. (X£)F , ISH I i~' (XE. )f , 1 Ulit-l.EGf~ l!~F, l~HIMGAlt..f,lOHPHEALF,5HPIMA6//(1~,oX'2F10.5,5X,2FI0.5.5X,2FIO.5»

    70 FORMAT(13HOEkRvR IN MSK,5X,5HMSK ='15,f7H TYPE ::,It;u8H M~MI"R =,15)

    c

    SEQUENTIAL PROCESSING OF ~EASUREMENTS

    00 620 j,=l,NMIF qPtUIH .LE. 0) wRITt.(6,lOS) 1fOHMAT(13HOMEA~UREM~NT ,15/1X.17(lH*»NT=NTYP(i) .IM=NMSM(I)GO 10 (110'170'210'290,j20'~50),NT

    l'-.NB=2*NBNMH::NN8-1IEI{R=Q00 75 l=l,NNtilP (I ) =COV (1>P *Gtl)AK2::P(IM2)*G

  • -102-

    IF (1M .EG. NB) AK2=0.OXE(rM)=X£A+CMP~XCAK1,AK2)*HES

    P(lMl)=~CIM1)*ll-AKl*G(1»

    PCIM2)::PCIM2J.,1-AK2*G(2»IF (IPRI~T) 16U,lbO,62U

    100 wRITEC6,bO) IM'AE{I~,),A~1,AK2,P(IM1),P(IM2)1.10 TO 620

    cC TYPE 2 AND 3C

    170 IF (MSK2CIM» !bO,1~0,190180 wRITEC6,7U) MSKGCIM),NT,IM

    lERR=lt

  • -103-

    kE.S=Yf"i-GXECALL JAC1{XEA,XE.8,lL,YA,G,1,1,IE)CALL UPUEP(IA,lu,RES,WF,G,PP,AK,XE)P(IAlJ=PPO)P(lA2}::PP(2)P{lo1}::::PP(3)P(lB2)::PPt4}IF (IPRl~T) 28u,280,620

    280 wRITE

  • -104-

    CALL JACLF(MSK,XEA,XEB,LL,YA,G,l'G,l,l,IE)CGXE=XEA*CON~G«XEA-XEB}llL+XEA*YA}

    IF (M) 390,390,360cC ACTIVE M~ASUH£MENTC

    360 IF CIPRINT) 370,370,380310 w~lTE(6,~O) NT,lM,YM,WF

    WRITE(6,40)WRITEC6,50) IA,XEA,PP(lJ,PP(2),

    1 IB,X£6,PP(3),PP(4)j80 kES=YM-R£AL

    P

  • 1.+90

    5UO

    CCC

    510520

    530

    CCC

    540550"

    560C.

    510

    580

    c

    c

    C

    -105-

    "lb=LTA(,J)YA='(ti8(,J)XEB=X[(ltl}ZL=ZAb(,J)C6X[=CGX£+XEA*'ON~G{(XEA-XEB)/ZL+YA*XEA)CONl !roJU£IF (~;j 540,540'510

    ACTIVE ~EASUREM£NT

    IF (lPRINTl 520,520,530wRITEC6,20) NT,lM,YM,~FfiRIT£(6,40)WkITE(b'~O)(J,A~(J),P(2*J-l),P(2*J),J=1'N8)

    kES=YM-REAL(CGAE}GO TO 510

    REACTIV£ MEASUk~MENT

    IF (IPRINT) 55u,~50'560~HIT~(6,30) NT,IM,YM,wF~rnTE (6,,+0)WRITE(6,~O){~,X~(J),P(2*J-l},P(2*J),J=1,NB)H£S=YM-AIMAG(CG~£>

    DEN=O.O00 580 J=l,NNUlAK(,J):P(,J)*G(J)UEN:OEN+AK(J)*b(,J)LJEN=UEN+I/WFAj';.(NNB):O.OuO b90 ,J:l,NB..;2=2*JJ1=""2-1AK(Jl):AK(Jl)/u~N

    AKC""2>=AK(,J2)/LLN590 XE{"")=X£(J)+CMP~X(AK(Jl)'AK(J21)*RES

    00 6UO v:1,f\l!\l8.l.600 P(,J):P(v)*{!-AK(J>*G(J})

    PlI'I/Nb)=O.OIF (lPRlt~T) 610,010,620

    610 ~RITE{6,60){~'A~(~)'AK(~*~-1)'AK{2.~),P(2*J-l),P(2*~)'~=l,NB)

    020 CONTINUE

    uo 025 I=1t NtliB625 PNEw(I':P(I)

    IF (IPRINT-l) 030,630,990630 wRIIE(o,640)640 FORMAT{lHO,23X'11HFINAL EST AND COy)

    WRITE{6,50)(J'AE(J)'P(2*J-l),P(,*JJ'~=t'Nd). "990 RETURN

    t:.NO

  • -106-

    IPRINT=O

    IPRINT=3IPRINl=l

    NROAI*)l.Jb(*)MAXIT-t,PS

    NEWA=l

    NUMBER OF COMPLEX REFERENCE VOLTAGESWEIGHTIN~ FACTOR FOR LINEVOLTAGE AT A-E~uIOEM FOR b-Et'lOr-;AXbIW-1 ItUr"'SER OF I TERAT IONSTHE ITERATING IS TERMINATED wHENCABS - XElIY» .lE. E~SA NEW A-MA1RIX IS CALCULATED AND DECOMPOS~DIN ThE FIRST ITERATIONNO NEW A-MATRIX IS CALCULATEDDECOMPOSITION OF A HAS FAILEDERROR IN NS, NL OR NRCONVERGEwCE WITHIN MAXIT ITERATIONSNO CONVEKGENCE AFTER MAXIT ITERATIONSlOTAL TIM~ IN MSECSNO PRINTOUTINITIAL £STIMATE, THE NUMBER OF ITERATIONS'lOTAL TI~E AND THE ESTIMATE ARE PRINTEDSAME + ThE INPUT DATA: NR, OA, oa, ~AXIT AND EFSAME + IN EACH ITERATION: ThE CALCULATEUlINEvOLTAGES, THE a-VECTOR, THE £SlIMAT£ AND OELSAME + IN THE FIRST ITERATION THE A- ANDT-MATRICES

    SUBROUTINE REQUIREDOESYMMPRISOLVSUPOACuPuSC

    ~~BROUTINE ESTCINRtOA.D8,MAXIT,EPS,NEWA,IEXIT,T1Mi,lPRlhTJ

    bASIS ROvTINE FOk METH00 C. IT ESTl~ATES ThE BuSVO~TAG~STHAl DON'T BEL0NG TO TH~ REFERENCE VECTOR. THE REFEkENC~VOLTAGES AND TH~ LINEVOLTAGE ~EIGHTING FACTORS uAI*> AND 081.)ARE ASSUM£O TO bE GIVEN

    AUTHOR, TON VAN OVERBEEK 1974-03-12

    PARAMETER Mb=10,Ml=13PARAMETEH MMB=~*Me'MML=2*ML

    NEwA=OIEXll=-2IEXIT::-lIlXIT:: 1lEXlT= 2TIMEIPRlf~T=4IPRINT=3

    DIMENSION DA(1),OB(1),X(MB,2),B(MD,2),1 PRI91/'llHO",O"17HCON"'VERGEN"'CE AFT.,2 'ER,l5,t"11H IT"'ERATIO','NS)'/ >

    COMPLEX YAA,lAB,Y~B'XE,XEA.XEB'ZL,CYM~(M~)'CYMS(Ml)'1 CLVA(MLj'CLVB(ML),CB(MSJ,XEN(M8)

    COMMON IENET I Nb,NL, LTA (ML) ,LTtHML), Y·AA tML), ZA1HML)' YB8(ML)X /(STI Xt:tMB)

    c

    c

    c

    c

    cccccccccccccccccccccccccccccccCccC.cc.c

  • 107-

    X IMATI A(M8,MbJ,TtM8,Mo }X IMSMI Y~1(M8J,YM2(MLJ,Y~3eML)'YM4(M~L)'Y~5(MML)'YM6(MMB)X IMSI/ M~Kl(M8},MSK2(ML)'MSK3(~L)'MSK4(ML)'MSKO{ML)'M~K6{

    EQUIVALENCE (CYM4'YM4)'(CYM5,Y~5)c

    :cC ChECK NS, NL AND NRC

    IF eN8) 20,20'LU10 IF (~b-M~) 40,4U,2020 llXIT=-1

    ..~RITE(6,30) t.830 FOkMAT(13hONb iN ESTC =,15)

    RETURNc

    c

    c

    40 IF (NL) 60,60,~o50 IF (NL-ML) 80.tiO,6060 If..XIT::-l

    WHITE (tH 70) hiL7U FORMAT(ljHO~L IN £STC =,15)

    HETUliN

    60 IF (NR) 100,100,9090 iF lNR-NBJ 120,120'100

    100 IEXiT=-l~k I H.l6,. 110) Nk

    110 FCRMAT(13HONR IW ESTc =.15)RETUkN

    120 IF (IPRI~T-2) ljO,130,lbO130 ~RITE(6,140) NH,MAXIT,EPS,~EWA140 FURMAT{12hOlNP~T OATA:/SHONR =,I5,5X,7HMAXIT =,IS,5X,

    FbHEPS =,£7.1'5Xf6HI~EWA =,15)~RITE{6,150){I'MSK4(I}'DA(I),MSK5{1)'08(1)'1=1,~L)

    150 FORMAT(lHO'5X,~3HALLLl~EVOLTAGE ~EIGHTING FACTURSIF12HO LINEF.20HMSK4 DAF,10HMSK5 0611F(15,I10,flO.2,llO,FlO.2»

    160 IF (IPRI~T-3) 170,170,lYO170 wRITE(6,180)(1,XE(I),I=1,NB)180 fORMAT(lhO'13X'16Hl~ITlALESTIMATEI

    F14HOBUSNRF,10HRE{Xt::)F,bHHHXE)11Ftl5,5X,2flO.5} )

    c, INITIALIZATIONC

    190 11=0NE:NB-NRIF (NEWA) 220'~20,200

    200 UO 210 l=l'NE

  • -108--

    00 210 ..;=l,N£210 A(I,..;}=O.O220 TBEG=jo1SCPU (X)

    CC hEHE STARTS THe. I TERATI ()t~C

    230 IT=IT+1uo 240 r=l,NU

    240 CB(I)::(O.O,O.O)CC CALCULATION OF B AND A(.

    00 -320 1=1, NLlA::LTA(I)IB=LTtH 1>XEA=XE (lA)XEtj=Xt,;(lu)lL=ZAU(I>IF (MSK4(1}-2) 280'280,250

    250 IF (NEWA) 210,270,260260 CALL UPuAC(IA,~~'OA(I)}270 CALL UPOBC(C6,1A,IB,NR,XEA,XEB,ZL,YAAlI),CVM4CI)'CLVA(I),OACl280 IF (MSK~(I)-2> 320,320,~90290 IF (HEwA) 310,310,300300 CALL UPOAC(ld,lA'U8(I»310 CALL UPuuC(CB,!B,IA,NR,XE6,XEA,ZL,VaSCI),CYM5(I),CLvd(I),OBII320 COIHII\Ut::.

    cC ITERATIUN PRINruUTC

    IF (IPRINT-!) 330,330,450330 wRITE(o,340) IT340 FOkMAT (13HOIT£KATION NRd5/1X' 17 (lH*) I

    FIHO,21X,25HTHE C~MPUTEO LINEVOLTAGESIF13hO LINEF,10HRE(LVA)F,loHIM(LVA)F,lOhkE(LVB)F , .,HU~ ( LVI:U / )

    00 410 l=l'NLwRITE(6,350) I

    350 FOk~iATn5)IF (MSK4(1)-2) 380'380'360

    360 ~RITE(6,370) C~VA(I)J70 FORMAT(lh+.9X'~F10.5)380 IF (MSK5tI}-Z) 41u'~10,J90390 ~RITE(6,~OO) CL~8(1)400 FORMAT(lH+,34X,2FIO.5}410 CONTINUE::

    ~RITE(6'~20)(I'Ca(I),1=1,NE)

    420 FORMAT(lHO,15X'dHB-VECTuR/16X,S(lH-J/1F(15,5X,2F10.2}),IF (IT-1) 4JO'~30,520

  • 109-

    430 IF CrPRINT) 44U,440,450440 wRIIE(6,445)44~ FORMAT(YHOMAIRLX-A/IX,8(lH-)/)

    CALL ~P~1(A,NE'NE,NH,8'O'IE)CC SOLUTION OF A.~=BC

    450 IF OJEWA) 520, ~2U, 460460 CALL O£~YM(A'T,NE,1.0E-7'IRANK,M8)

    IF (IRANK) 470'470,490470 wRITt.(6,IH~O)4aO FORMATl21HOOECOMPOSITION FAILED)

    1£:.XIT=-2RETURN

    C490 IF (IPRINT) 50U,500,520500 ~RIT~l6,510)510 fOHMAT(9HOMATR!X-T/IX,8(lH-)/J

    .CALL MPRl(T,NE,hE,MB,8,0,IE)c

    c

    c

    ~20 00 530 I:l.NEB(l,l):R£:.AL{CB(I»

    530 ij(1,2):AIMAG(Cu(I»CALL SOLVS(T,B,X,NE,2,Mu)DELX=O.ODO 540 I=l,NEXEN(1)=CMPLX(X(1,1),X(I,2»O[LX:OELX+CABS(XEN(l)-XE(l»

    ~40 XE(I)=XEN(I)

    IF (lPRINT-l) ~50,550,560550 wRITE(6,560)(!tXE(I),I:l,NB)560 FOHMAT(lHO'15X'12HTHE ESTIMATE/

    F14H08lJSNRF,lOHHE(XE:.:)F,6HIM(XEJ/IF 05, 5x, 2F 10.5) i

    WRITE(6,570) D~LX570 FOHMAT(7hOOELX :EI0.3)

    580 IF (OELX-A6$(EPS» 600,600'590590 IF (rT .GE. MAXrT) GO TO 610

    NEwA:O60 TO 23U

    cC E~O OF ESTIMATiON, PRINTOUT OF THE RESULTSC

    bOO lEXIT=lPH(Z>:'/1H+,'GO TO 620

    610 !£XIT=2PR(2i:'3HNO ,t

    . baa TE~O=MSCPU(X)

  • c

    c

    -110-

    TIr~E=TENO-TBEG

    IF (lPl

  • -111-

    SUBROUTINE REQUIREDNONE

    PARAMETER MB=lO,ML=1~,MTMX=360PARAMETER MMB:2*MB'MML=2*ML'M8L=MU+MML,MM6L=2*M8L,MTMX1=~ITMX+l

    DIMENSION AXE(MMB),AXT(MMB)'AYE4(MML),AYT4{MML),AYE5(MML),1 AYT5(MML)'YMA(MBL),MSKA(MBL),YMB(MMBL)'MSKb(Mo~)

    COMPLEX XE,YE2,YE3'YE4,YE5'YE6,XT,YT2,YT3,YT4,YTS,YT6,1 YEA(MB~)'YEB{~BL),YTA(MBL),YTB(MBL)'AME

    SUBROUTINE EVA~(K,rPRINT)

    THIS SUtiROUTIN[ COMPUTES FOR TIMEPOINT K THE FOLLUWING QUANTrTltTHE ESTIMATION ERRORTHE MAXIMUM ELEMENT IN THE ESTIMATION ERRORTHE LIi-.E FLO~\I ERRORThE MAA1MUM ELEMENT IN THE LINE FLOW ERRORTHE MEASUREMENT QUALITY INDEX

    IT UPDATES THE FOLLOwING QUANTITIES:THE AV~RAGE ESTIMATION ERRORTHE MAAIMUM ESTIMATION ERRORTHE MAXiMUM ELEME~T IN ALL ESTIMATION ERRORSThE AVLRAGELINL FLOW ERRORTHE MAAIMUM Llh~ FLOW ERRORTHE MAAIMUM ELEME~T IN ALL LINE FLOW ERRORSTHE AVLRAGE MEASUREMENT QUALITY "INDEXTHE MAAIMUM MEASUREMENT QUALITY INDEX

    ALL THESE QUANTITIES ARE STORED IN THE COMMON B~OCK IEVLI

    AUTHOR; TON VAN OVERBEEK 1974-02-18

    ccccCCCCCCCCCCCCCCCCCC(.

    C"CCC

    c

    C

    KIPRINT=lIPRINT=O

    TIME POINTNO PRINTOUTTHE AROVE MENTIONED QUANTITIES AKE PRINTEu

    C

    C

    COMMONXXXXXXX

    IESTI XE(MB),YE2(ML),YE3(ML),YE4(ML),YE5(ML),YE6(MB)ITRUEI AT(~B),YT2(ML),YT3(ML),YT4(ML)'YT5(ML),YT6(MB)1£l'oETI Nb,NLIMSII M~Kl(Mb)'MSK2(ML)'MSK3(ML)'MSK4(ML),MSKo(ML),MSK6(~IM5MI YM1(MB},YM2(ML},YM3(ML)'YM4(MML)'YM5(~ML),YM6(MMB)IEVLI E~(MTMX1),tEM(MTMX1'2),AEE'EEMT(2)'E~MMT(3),

    EL(MTMX1),tLM{MTMX1,2),AEL,ELMT(2),ELMMT(3),EM(MTMX1),AEM,EMMT(2)

  • -112-

    ~ ESTIMATION ERRvRC

    t:E.. (Kl> =0.0EEM(Klrl):O.ONNH1=2*Nb-!DO 30 !:l,NNBlAE=A~S(AXE(I)-AxT(l»

    £=A£**2£E (Kl) :EE (KU +£IF (EEM(Kl,l)-A~) 10,10,30

    10 EEM(Kl,l>:::AEEEM(Kl,2):FLOAT(I)

    ·IF (EEMMT(l)-A~) 20,20,3020 £EMMT (l) =AE

    EEMMT(2)=FLOAT(1)E£MMT(3):::FLOAT(K)

    30 CONT H~UEEE(Kl):SGRT(EE{Kl»IF (EEMT(l)-E(Kl» 40,40,50

    40EEMT(l):EE(Kl) .EEMT(2):FLOAT(K)

    SO AEE:AEE+E[(Kl)CC LINE FLOw ERRORC

    EL(KU=O.OELM(Kl,l):O.ONNL:2*NLDO 110 l=l,NNLAE4=ABS(AYE4(I>-AYT4(I»AE5=ABS(AYE5(I)-AYT5(1»E4:AE4**2E5:AES**2EL(Kl)=~L(Kl)+~4+E5

    IF (ELM(Kl,1)-A~4) 00,60,8060 ELM{Kl,1)=A£4

    ELM(Kl,2):FLOA1(1)IF (ELMMT(1)-A£4) 70,70,80

    70 ELMMT(1):AE4ELMMT(2):ELM(Kl,2)ELMMT(3):FLOAT(K)

    80 IF (ELM(K!,1)-Al5) 90'90,11090 £LM(K1,1):AE5

    ELM(Kl,2)=-FLOAT(I)IF (ELMMT(l)-A~~) 100,100,110

    100 ELMMT(1):AE5ElMMT(2):ELM{Kl,2)ELMMT(3)=FLOAT(K)

    110 CONTINUEEL(Kl):SGRT(ELlKl»IF (ELMTll)-EL(K1) 120,120,130

    1