File: icscof.f

package info (click to toggle)
scilab 4.0-12
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 100,640 kB
  • ctags: 57,333
  • sloc: ansic: 377,889; fortran: 242,862; xml: 179,819; tcl: 42,062; sh: 10,593; ml: 9,441; makefile: 4,377; cpp: 1,354; java: 621; csh: 260; yacc: 247; perl: 130; lex: 126; asm: 72; lisp: 30
file content (52 lines) | stat: -rw-r--r-- 1,668 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
C/MEMBR ADD NAME=ICSCOF,SSI=0
c     Copyright INRIA
      subroutine icscof(ico,ntob,nex,nob,yob,ob,cof)
c     ce programme est appele par les macros icsua (ico=1) et icsuq
c     (ico=2) de icse.bas pour le calcul initial des coefficients
c     de ponderation du cout
      implicit double precision (a-h,o-z)
      dimension yob(nob,ntob),ob(nex,ntob,nob),cof(nob,ntob)
c
c     en entree:(pour ico=2)
c
c     yob      double precision (nob,ntob)
c              yob=obs*ytob,avec obs(nob,ny) matrice d'observation et
c              ytob(ny,ntob) valeurs calculees de l'etat aux instants
c              de mesure
c
c     ob       double precision (nex,ntob,nob)
c              mesures
c
c     en sortie:
c
c     cof      double precision (nob,ntob)
c              coefficients de ponderation du cout
c
      do 5 i=1,nob
      do 5 j=1,ntob
5     cof(i,j)=0.0d+0
c     si ico=1 (macro icsua:ponderation "arithmetique" du cout)
c     les coefficients de ponderation du cout cof(nob,ntob)
c     sont:cof(i,j)=nex/(|ob(1,j,i)|+..+|ob(nex,j,i)|)
      if (ico.eq.1) then
      do 10 i=1,nob
      do 10 j=1,ntob
      do 10 k=1,nex
10    cof(i,j)=cof(i,j)+abs(ob(k,j,i))
      do 15 i=1,nob
      do 15 j=1,ntob
15    cof(i,j)=dble(nex)/cof(i,j)
c     si ico=2 (macro icsuq:ponderation "quadratique" du cout)
c     les coefficients de ponderation du cout cof(nob,ntob) sont:
c cof(i,j)=1/2*[(yob(i,j)-ob(1,j,i))**2+..+(yob(i,j)-ob(nex,j,i))**2]
      else
      do 20 i=1,nob
      do 20 j=1,ntob
      do 20 k=1,nex
20    cof(i,j)=cof(i,j)+(yob(i,j)-ob(k,j,i))**2
      do 25 i=1,nob
      do 25 j=1,ntob
25    cof(i,j)=0.50d+0/cof(i,j)
      endif
      return
      end