File: fjac.f

package info (click to toggle)
scilab 2.2-4
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 31,472 kB
  • ctags: 21,963
  • sloc: fortran: 110,983; ansic: 89,717; makefile: 3,016; sh: 1,892; csh: 150; cpp: 101
file content (58 lines) | stat: -rw-r--r-- 1,323 bytes parent folder | download
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
53
54
55
56
57
58
      subroutine fjac (neq, t, y, ml, mu, pd, nrpd)
c!
c  user interface for scilab built-in function ode
c  jacobian evaluation
c!
      include '../stack.h'

      integer ml,mu,neq,nrpd
      double precision pd(nrpd,*),t,y(*)
c
      integer it1
c
      character*6   name,nam1
      common /cjac/ name
      integer         iero
      common /ierode/ iero
c
      iero=0
      call majmin(6,name,nam1)
c
c INSERT CALL TO YOUR OWN ROUTINE HERE 
c The routine jex is an example: it is called when the
c string 'jex' is given as a parameter 
c in the calling sequence of scilab's ode built-in
c function 
c+
      if(nam1.eq.'jex') then
       call jex(neq,t,y,ml,mu,pd,nrpd)
       return
      endif
c+
c     dynamic link
      call tlink(name,0,it1)
      if(it1.le.0) goto 2000
      call dyncall(it1-1,neq,t,y,ml,mu,pd,nrpd)
cc fin
      return
c
 2000 iero=1
      buf=name
      return
      end

      subroutine jex (neq, t, y, ml, mu, pd, nrpd)
      double precision pd, t, y
      dimension y(3), pd(nrpd,3)
c     jacobian routine jex
c     scilab ode
c     ode([1;0;0],0,[0.4,4],'fex','jex')
      pd(1,1) = -.040d+0
      pd(1,2) = 1.0d+4*y(3)
      pd(1,3) = 1.0d+4*y(2)
      pd(2,1) = .040d+0
      pd(2,3) = -pd(1,3)
      pd(3,2) = 6.0d+7*y(2)
      pd(2,2) = -pd(1,2) - pd(3,2)
      return
      end