Download inv.eso

Back to the list

   1 : C INV       SOURCE    CHAT      05/01/13    00:42:58     5004           
   2 : C***********************************************************************
   3 : C*                                                                     *
   4 : C* PROJET      : Opérateur LIMI                                        *
   5 : C* NOM         : INV sous-programme                                    *
   6 : C* DESCRIPTION : Ce sous-programme calcule l'inverse d'une matrice     *
   7 : C*               carrée de rang 3, par la méthode des cofacteurs       *
   8 : C* LANGAGE     : Esope                                                 *
   9 : C* AUTEUR      : Guillaume VENCO - DRN/DMT/SEMT/LTMF                   *
  10 : C*                                                                     *
  11 : C***********************************************************************
  12 : C*                                                                     *
  13 : C* APPELES     : Fonction DET                                          *
  14 : C*                                                                     *
  15 : C***********************************************************************
  16 : C*                                                                     *
  17 : C* ENTREES     : A   : -Matrice carrée 3*3                             *
  18 : C*                                                                     * 
  19 : C* SORTIES     : B   : -Matrice carrée 3*3 inverse de la matrice A     *
  20 : C*                                                                     *
  21 : C***********************************************************************
  22 : C*                                                                     *
  23 : C* VERSION     : 20/04/2000                                            *
  24 : C* CREATION    :                                                       *
  25 : C*                                                                     *
  26 : C***********************************************************************
  27 :        
  28 :       SUBROUTINE INV(A,B)
  29 :       IMPLICIT INTEGER(I-N)
  30 :       IMPLICIT REAL*8 (A-H,O-Z)
  31 : C*       *********************************
  32 : C*       *** Déclaration des variables ***
  33 : C*       *********************************
  34 : 
  35 :         REAL*8 A(3,3),B(3,3)
  36 :         REAL*8 Y
  37 : 
  38 : C*       *********************************
  39 : C*       ******** Sous-programme *********
  40 : C*       *********************************
  41 : 
  42 : C---- Condition d'inversibilité
  43 :         IF (DET(A).EQ.0) THEN
  44 :            write(6,*) 'La matrice n''est pas inversible'
  45 :            RETURN
  46 :         ENDIF
  47 : 
  48 : C---- Calcul du déterminant de A
  49 :         Y= DET(A)
  50 : 
  51 : C---- Calcul de l'inverse de A 
  52 :         B(1,1)= (A(2,2)*A(3,3)-A(2,3)*A(3,2))/Y
  53 :         B(1,2)= -(A(1,2)*A(3,3)-A(1,3)*A(3,2))/Y
  54 :         B(1,3)= (A(1,2)*A(2,3)-A(1,3)*A(2,2))/Y
  55 :         B(2,1)= -(A(2,1)*A(3,3)-A(2,3)*A(3,1))/Y
  56 :         B(2,2)= (A(1,1)*A(3,3)-A(1,3)*A(3,1))/Y
  57 :         B(2,3)= -(A(1,1)*A(2,3)-A(1,3)*A(2,1))/Y
  58 :         B(3,1)= (A(2,1)*A(3,2)-A(2,2)*A(3,1))/Y
  59 :         B(3,2)= -(A(1,1)*A(3,2)-A(1,2)*A(3,1))/Y
  60 :         B(3,3)= (A(1,1)*A(2,2)-A(1,2)*A(2,1))/Y
  61 :         
  62 : c        write(6,1003) B(1,1),B(1,2),B(1,3)
  63 : c        write(6,1003) B(2,1),B(2,2),B(2,3)
  64 : c        write(6,1003) B(3,1),B(3,2),B(3,3)
  65 : 
  66 :         RETURN
  67 : 
  68 :  1003   FORMAT(3(1X,1PE11.4))
  69 :  
  70 :         END
  71 : 
  72 : 
  73 : C*       *********************************
  74 : C*       ****  Fin Sous-Programme  *******
  75 : C*       *********************************
  76 :  
  77 :  
  78 :  

© Cast3M 2003 - All rights reserved.
Disclaimer