CFPRIME AGOV6                                                           AGOV6       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 AGOV6(ISTATE,HM)                                       AGOV6       3
CD                                                                      AGOV6       4
CD    TO FORMULATE THE JACOBIAN MATRICES OF TYPE 6 GOVERNOR.            AGOV6       5
CD                                                                      AGOV6       6
      INCLUDE 'PARX.INS'                                                AGOV6       7
      INCLUDE 'CNB8.INS'                                                AGOV6       8
      INCLUDE 'CNB19.INS'                                               AGOV6       9
      INCLUDE 'CNEXC.INS'                                               AGOV6      10
      INCLUDE 'CNPARX.INS'                                              AGOV6      11
      INCLUDE 'CNMDAT.INS'                                              AGOV6      12
      INCLUDE 'CNMSTA.INS'                                              AGOV6      13
      INCLUDE 'CNXSTA.INS'                                              AGOV6      14
      INCLUDE 'CNSTAB.INS'                                              AGOV6      15
C                                                                       AGOV6      16
      INCLUDE 'CNABAK.INS'                                              AGOV6      17
C                                                                       AGOV6      18
C     SUBSCRIPTS                                                        AGOV6      19
C                                                                       AGOV6      20
      ISUB1=ISTATE+1                                                    AGOV6      21
      ISUB2=ISTATE+2                                                    AGOV6      22
C                                                                       AGOV6      23
C     T1 BLOCK                                                          AGOV6      24
C                                                                       AGOV6      25
      T1I=1.0/DDAT(JGG+2)                                               AGOV6      26
      A(ISUB1,ISUB1)=-T1I                                               AGOV6      27
      A(ISUB1,1)=-T1I/(WXBASE*DDAT(JGG+1))                              AGOV6      28
C                                                                       AGOV6      29
C     T2, T3 BLOCK                                                      AGOV6      30
C                                                                       AGOV6      31
      IF (IDDAT(JGG+4).NE.0) THEN                                       AGOV6      32
         T3I=1.0/DDAT(JGG+4)                                            AGOV6      33
         T2T3=DDAT(JGG+3)*T3I                                           AGOV6      34
         A(ISUB2,ISUB2)=-T3I                                            AGOV6      35
         A(ISUB2,ISUB1)=T3I-T1I*T2T3                                    AGOV6      36
         A(ISUB2,1)=-T1I*T2T3/(WXBASE*DDAT(JGG+1))                      AGOV6      37
      END IF                                                            AGOV6      38
C                                                                       AGOV6      39
C     INTEGRATION WITH MACHINE (OUTPUT EQUATION)                        AGOV6      40
C                                                                       AGOV6      41
      PFL=HM*DDAT(JGG+5)                                                AGOV6      42
      IF (IDDAT(JGG+4).NE.0) THEN                                       AGOV6      43
         A(1,ISUB2)=PFL                                                 AGOV6      44
      ELSE                                                              AGOV6      45
         A(1,ISUB1)=PFL                                                 AGOV6      46
      END IF                                                            AGOV6      47
C                                                                       AGOV6      48
      DWTERM=-PFL*DDAT(JGG+7)/WXBASE                                    AGOV6      49
      A(1,1)=A(1,1)+DWTERM                                              AGOV6      50
C                                                                       AGOV6      51
      ISTATE=ISTATE+2                                                   AGOV6      52
C                                                                       AGOV6      53
      RETURN                                                            AGOV6      54
      END                                                               AGOV6      55
