CFPRIME AOEL                                                            AOEL        1
C***********************************************************************RIGHTE      1
C*                                                                     *RIGHTE      2
C*        Extended Transient-Midterm Stability Program (ETMSP)         *RIGHTE      3
C*        ====================================================         *RIGHTE      4
C*                                                                     *RIGHTE      5
C*       Copyright (C) (1993) Electric Power Research Institute        *RIGHTE      6
C*                                                                     *RIGHTE      7
C* EPRI reserves all rights in the software and associated             *RIGHTE      8
C* documentation as delivered. The software and its associated         *RIGHTE      9
C* documention or any portion thereof may not be reproduced in any form*RIGHTE     10
C* whatsoever without the consent of EPRI, except as explicity provided*RIGHTE     11
C* for by license. Licensee shall submit a detailed description to EPRI*RIGHTE     12
C* of any changes or modifications to the software within two (2)      *RIGHTE     13
C* months after such changes or modifications are made. At EPRI's sole *RIGHTE     14
C* discretion, the software, as changed or modified, shall be given a  *RIGHTE     15
C* new designation sufficiently different from its then current        *RIGHTE     16
C* designation as to prevent mistake,confusion, or deception as between*RIGHTE     17
C* the current software as changed or modified.                        *RIGHTE     18
C*                                                                     *RIGHTE     19
C* A license under EPRI's rights in the software can be obtained       *RIGHTE     20
C* directly from EPRI.                                                 *RIGHTE     21
C*                                                                     *RIGHTE     22
C* This program and supporting materials may be independently available*RIGHTE     23
C* from Electric Power Software centre (EPSC) for an appropriate       *RIGHTE     24
C* distribution fee. The EPSC is a service of                          *RIGHTE     25
C*                                                                     *RIGHTE     26
C*                    Power Computing Company                          *RIGHTE     27
C*                    1930 Hi Line                                     *RIGHTE     28
C*                    Dallas, Tx 75207                                 *RIGHTE     29
C*                                                                     *RIGHTE     30
C* NEITHER EPRI, ANY MEMBER OF EPRI, NOR ANY PERSON OR  ORGANIZATION   *RIGHTE     31
C* ACTING ON BEHAVE OF THEM:                                           *RIGHTE     32
C*                                                                     *RIGHTE     33
C* 1. MAKE ANY WARRANTY OR REPRESENTATION WHATSOEVER, EXPRESS OR       *RIGHTE     34
C*    IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR FITNESS OR *RIGHTE     35
C*    ANY PURPOSE WITH RESPECT TO THE SOFTWARE OR ITS ASSOCIATED       *RIGHTE     36
C*    DOCUMENTATION; OR                                                *RIGHTE     37
C*                                                                     *RIGHTE     38
C* 2. ASSUMES ANY LIABILITY WHATSOEVER WITH RESPECT TO ANY USE OF THE  *RIGHTE     39
C*    SOFTWARE OR ITS ASSOCIATED DOCUMENTATION OR ANY PORTION THEREOF  *RIGHTE     40
C*    OR WITH RESPECT TO ANY DAMAGES WHICH MAY RESULT FROM SUCH USE.   *RIGHTE     41
C*                                                                     *RIGHTE     42
C* THIS NOTICE MAY NOT BE REMOVED FROM THE SOFTWARE BY ANY USER        *RIGHTE     43
C* THEREOF.                                                            *RIGHTE     44
C*                                                                     *RIGHTE     45
C***********************************************************************RIGHTE     46
      SUBROUTINE AOEL                                                   AOEL        3
CD                                                                      AOEL        4
CD    TO FORMULATE THE JACOBIAN MATRICES OF USER DEFINED OVER EXCITATIONAOEL        5
CD    CURRENT LIMITER FOR USE IN THE IMPLICIT INTEGRATION METHOD.       AOEL        6
CD                                                                      AOEL        7
CD    THE INTERCONNECTION OF THE JACOBIANS OF THE USER DEFINED          AOEL        8
CD    OVER EXCITATION CURRENT LIMITER WITH THOSE OF THE EXCITER AND     AOEL        9
CD    MACHINE IS DONE IN SUBROUTINE DGENLN.                             AOEL       10
CD                                                                      AOEL       11
      INCLUDE 'PARX.INS'                                                AOEL       12
      INCLUDE 'CNPT.INS'                                                AOEL       13
      INCLUDE 'CNB5.INS'                                                AOEL       14
      INCLUDE 'CNB8.INS'                                                AOEL       15
      INCLUDE 'CNB19.INS'                                               AOEL       16
      INCLUDE 'CNEXC.INS'                                               AOEL       17
      INCLUDE 'CNGDAT.INS'                                              AOEL       18
      INCLUDE 'CNFLAG.INS'                                              AOEL       19
      INCLUDE 'CNVOLT.INS'                                              AOEL       20
      INCLUDE 'CNUDM.INS'                                               AOEL       21
      INCLUDE 'CNUDMA.INS'                                              AOEL       22
      INCLUDE 'CNUDMB.INS'                                              AOEL       23
      INCLUDE 'CNUNIT.INS'                                              AOEL       24
      INCLUDE 'CNABAK.INS'                                              AOEL       25
C                                                                       AOEL       26
      LDEB=.FALSE.                                                      AOEL       27
C                                                                       AOEL       28
      VCM=VALIN(1)                                                      AOEL       29
      VCD=VCM*COS(VALIN(2))                                             AOEL       30
      VCQ=VCM*SIN(VALIN(2))                                             AOEL       31
      VM=VALIN(4)                                                       AOEL       32
      VD=VALIN(6)                                                       AOEL       33
      VQ=VALIN(7)                                                       AOEL       34
      CR=VALIN(8)*BASPRN                                                AOEL       35
      CI=VALIN(9)*BASPRN                                                AOEL       36
C                                                                       AOEL       37
C     FORM: DEL U0=XUI*DEL I+XUV*DEL V+XUY*DEL YB+XUW*DEL W+XUTM*DEL TM AOEL       38
C                 +XUIF*DEL IF                                          AOEL       39
C                                                                       AOEL       40
      DO 50 I=1,20                                                      AOEL       41
      DO 40 J=1,NXUDB                                                   AOEL       42
      XUY(I,J)=0.0                                                      AOEL       43
  40  CONTINUE                                                          AOEL       44
      DO 50 J=1,LOUTP                                                   AOEL       45
      XUI(I,J)=0.0                                                      AOEL       46
      XUV(I,J)=0.0                                                      AOEL       47
  50  CONTINUE                                                          AOEL       48
C      CALL FMOVE(0,XUI,XUI,20*LOUTP)                                   AOEL       49
C      CALL FMOVE(0,XUV,XUV,20*LOUTP)                                   AOEL       50
C      CALL FMOVE(0,XUY,XUY,20*NXUDB)                                   AOEL       51
      CALL FMOVE(0,XUVS,XUVS,20)                                        AOEL       52
      CALL FMOVE(0,XUVU,XUVU,20)                                        AOEL       53
      CALL FMOVE(0,XUW,XUW,20)                                          AOEL       54
      CALL FMOVE(0,XUIF,XUIF,20)                                        AOEL       55
      CALL FMOVE(0,XUTM,XUTM,20)                                        AOEL       56
C                                                                       AOEL       57
      IBEND=IUDAT(JE7+1)                                                AOEL       58
C                                                                       AOEL       59
      XUI(3,1)=-VD-2.0*RK*CR                                            AOEL       60
      XUI(3,2)=-VQ-2.0*RK*CI                                            AOEL       61
      XUI(8,1)=1.0                                                      AOEL       62
      XUI(9,2)=1.0                                                      AOEL       63
      XUI(10,1)=VD                                                      AOEL       64
      XUI(10,2)=VQ                                                      AOEL       65
      XUI(11,1)=VQ                                                      AOEL       66
      XUI(11,2)=-VD                                                     AOEL       67
C                                                                       AOEL       68
      XUV(1,1)=VCD/VCM                                                  AOEL       69
      XUV(1,2)=VCQ/VCM                                                  AOEL       70
      XUV(2,1)=-VCQ/VCM/VCM                                             AOEL       71
      XUV(2,2)=VCD/VCM/VCM                                              AOEL       72
      XUV(3,1)=-CR                                                      AOEL       73
      XUV(3,2)=-CI                                                      AOEL       74
      XUV(4,1)=VD/VM                                                    AOEL       75
      XUV(4,2)=VQ/VM                                                    AOEL       76
      XUV(5,1)=-VQ/VM/VM                                                AOEL       77
      XUV(5,2)=VD/VM/VM                                                 AOEL       78
      XUV(6,1)=1.0                                                      AOEL       79
      XUV(7,2)=1.0                                                      AOEL       80
      XUV(10,1)=CR                                                      AOEL       81
      XUV(10,2)=CI                                                      AOEL       82
      XUV(11,1)=-CI                                                     AOEL       83
      XUV(11,2)=CR                                                      AOEL       84
C                                                                       AOEL       85
      XUTM(3)=1.0                                                       AOEL       86
      XUW(3)=-DAMPK                                                     AOEL       87
      XUW(12)=1.0                                                       AOEL       88
      XUIF(16)=1.0                                                      AOEL       89
C                                                                       AOEL       90
C     FORM THE REMOTE BUS ARRAY AND CONTROL A B C D MATRICES            AOEL       91
C                                                                       AOEL       92
      LCYO=1                                                            AOEL       93
      LWIF=1                                                            AOEL       94
      NBUSS=1                                                           AOEL       95
      NBUSR=0                                                           AOEL       96
      NBUSR1=NBUSR                                                      AOEL       97
      BASERT=1.0                                                        AOEL       98
      CALL AUDMB(LCYO,LWIF,NBUSR,NBUSS)                                 AOEL       99
      IF(KERUDM.NE.0) GO TO 900                                         AOEL      100
      MSUDM(2,3)=NBUSR                                                  AOEL      101
      IF (NBUSR.NE.0) THEN                                              AOEL      102
         DO 100 I=1,NBUSR                                               AOEL      103
            MSUDM(I+2,3)=MBUSR(NBUSS+I)                                 AOEL      104
  100    CONTINUE                                                       AOEL      105
      END IF                                                            AOEL      106
C                                                                       AOEL      107
C     SOLVE THE CONTROL EQUATIONS                                       AOEL      108
C                                                                       AOEL      109
      LOUT=2                                                            AOEL      110
      LREM=2*NBUSR                                                      AOEL      111
      CALL AUDMC(LOUT,LCYO,LWIF,LREM)                                   AOEL      112
      IF(KERUDM.NE.0) GO TO 900                                         AOEL      113
C                                                                       AOEL      114
C     FORM: DEL XDOT = AXB*DEL X+BUI*DEL I+BUV*DEL VS+BUVR*DEL VR+      AOEL      115
C                      BUW*DEL W+BUTM*DEL TM+BUIF*DEL IF                AOEL      116
C                                                                       AOEL      117
C             DEL VO = CYX*DEL X+CYI*DEL I+CYV*DEL VS+CYVR*DEL VR+      AOEL      118
C                      CYW*DEL W+CYTM*DEL TM+CYIF*DEL IF                AOEL      119
C                                                                       AOEL      120
      MSEXC=MSUDM(1,1)                                                  AOEL      121
      MSSTA=MSUDM(1,2)                                                  AOEL      122
      MSUAL=MSUDM(1,3)                                                  AOEL      123
      IWS1=MSEXC+MSSTA+MSUAL                                            AOEL      124
      DO 110 I=1,KORD                                                   AOEL      125
         BXTM(IWS1+I)=BUTM(I)                                           AOEL      126
  110 CONTINUE                                                          AOEL      127
C                                                                       AOEL      128
  900 RETURN                                                            AOEL      129
      END                                                               AOEL      130
