Debian Codegraph @

07p/demos/fnc/attr/attr.f90

raw symbols SCIP
1 ! ----------------------------------------------------------------------
2 ! ----------------------------------------------------------------------
3 ! Slow manifolds computation in the self-coupled FitzHugh-Nagumo system
4 ! ----------------------------------------------------------------------
5 ! C o m p. o f t h e a t t r a c t i n g s l o w m a n i f o l d
6 ! ----------------------------------------------------------------------
7 ! Homotopy step 1: "away from the folded node along the fold curve"
8 ! followed by
9 ! Homotopy step 2: "away from the fold curve on the critical manifold"
10 ! followed by
11 ! Actual computation of the attracting slow manifold
12 ! ----------------------------------------------------------------------
13 ! Ref.: Desroches, Krauskopf and Osinga, CHAOS 18, 015107 (2008)
14 ! ----------------------------------------------------------------------
15 ! ----------------------------------------------------------------------
16
17 SUBROUTINE FUNC(NDIM,U,ICP,PAR,IJAC,F,DFDU,DFDP)
18 ! ---------- ----
19
20 IMPLICIT NONE
21 INTEGER, INTENT(IN) :: NDIM, ICP(*), IJAC
22 DOUBLE PRECISION, INTENT(IN) :: U(NDIM), PAR(*)
23 DOUBLE PRECISION, INTENT(OUT) :: F(NDIM)
24 DOUBLE PRECISION, INTENT(INOUT) :: DFDU(NDIM,NDIM), DFDP(NDIM,*)
25
26 DOUBLE PRECISION v, h, s, epsilon, gamma, delta, T
27
28 ! Define the state variables
29 v = U(1)
30 h = U(2)
31 s = U(3)
32
33 ! Define the system parameters
34 epsilon = PAR(1)
35 gamma = PAR(2)
36 delta = PAR(3)
37
38 ! Define the integration time as a parameter
39 T = PAR(11)
40
41 ! Define the right-hand sides
42 F(1) = T * (h - (v**3 - v + 1) / 2 - gamma * s * v)
43 F(2) = T * (-epsilon * (2 * h + 2.6d0 * v))
44 F(3) = T * (-epsilon * delta * s)
45
46 END SUBROUTINE FUNC
47
48 ! ----------------------------------------------------------------------
49 ! ----------------------------------------------------------------------
50
51 SUBROUTINE STPNT(NDIM,U,PAR,T)
52 ! ---------- -----
53
54 IMPLICIT NONE
55 INTEGER, INTENT(IN) :: NDIM
56 DOUBLE PRECISION, INTENT(INOUT) :: U(NDIM),PAR(*)
57 DOUBLE PRECISION, INTENT(IN) :: T
58
59 ! epsilon gamma delta
60 PAR(1:3) = (/ 0.015d0, 0.5d0, 0.565d0 /)
61 PAR(11) = 0
62
63 ! v h s
64 U(1:3) = (/ -0.490d0, 0.61760d0, 0.27970d0 /)
65
66 PAR(4) = U(1) ! v(0)
67 PAR(5) = U(3) ! s(1)
68 PAR(6) = U(3) ! s(0)
69 PAR(7) = U(2) ! h(0)
70
71 END SUBROUTINE STPNT
72
73 ! ----------------------------------------------------------------------
74 ! ----------------------------------------------------------------------
75 SUBROUTINE BCND(NDIM,PAR,ICP,NBC,U0,U1,FB,IJAC,DBC)
76 ! ---------- ----
77
78 IMPLICIT NONE
79 INTEGER, INTENT(IN) :: NDIM, ICP(*), NBC, IJAC
80 DOUBLE PRECISION, INTENT(IN) :: PAR(*), U0(NDIM), U1(NDIM)
81 DOUBLE PRECISION, INTENT(OUT) :: FB(NBC)
82 DOUBLE PRECISION, INTENT(INOUT) :: DBC(NBC,*)
83
84 ! Define boundary conditions */
85
86 ! Define the critical manifold S as {(v,h,s) ; 2*h-v^3+v-1-v*s=0}
87 ! (we use the fact that gamma is fixed at the value 0.5)
88
89 FB(1) = 2*U0(2)-U0(1)**3+U0(1)-1-U0(3)*U0(1)
90 FB(2) = U0(1) - PAR(4) ! Initial point is on the intersection between S
91 FB(3) = U0(2) - PAR(7) ! and the plane {h=-6.0}
92 FB(4) = U0(3) - PAR(6)
93
94 FB(5) = U1(3) - PAR(5) ! End point is in a cross-section containing
95 ! the folded node: Sigma_fn={s=0.27970}
96
97 IF(NBC==5) RETURN
98
99 ! FB(1) and FB(6): {(v,h,s) ; s - (1 - 3*v^2=0)}
100 ! together define the folded node F
101 FB(6) = U0(3) - (1 - 3*U0(1)**2)
102
103 END SUBROUTINE BCND
104
105 ! ----------------------------------------------------------------------
106 ! ----------------------------------------------------------------------
107 SUBROUTINE PVLS(NDIM,U,PAR)
108 ! ---------- ----
109
110 IMPLICIT NONE
111 INTEGER, INTENT(IN) :: NDIM
112 DOUBLE PRECISION, INTENT(IN) :: U(NDIM)
113 DOUBLE PRECISION, INTENT(INOUT) :: PAR(*)
114
115 DOUBLE PRECISION, EXTERNAL :: GETP
116
117 ! Define external parameter which monitors the v- and the h-coordinate
118 ! of the end point in section Sigma_fn */
119 PAR(8) = GETP("BV1", 1, U)
120 PAR(9) = GETP("BV1", 2, U)
121 END SUBROUTINE PVLS
122 ! ----------------------------------------------------------------------
123 ! ----------------------------------------------------------------------
124 ! ----------------------------------------------------------------------
125 ! ----------------------------------------------------------------------
126 SUBROUTINE ICND
127 END SUBROUTINE ICND
128 ! ----------------------------------------------------------------------
129 ! ----------------------------------------------------------------------
130 SUBROUTINE FOPT
131 END SUBROUTINE FOPT