| 1 | ! ---------------------------------------------------------------------- |
| 2 | ! ---------------------------------------------------------------------- |
| 3 | ! Slow manifolds computation in the self-coupled FitzHugh-Nagumo system |
| 4 | ! ---------------------------------------------------------------------- |
| 5 | ! C o m p. o f t h e r e p e l l 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 repelling 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(1) |
| 67 | PAR(5) = U(3) ! s(0) |
| 68 | PAR(6) = U(3) ! s(1) |
| 69 | |
| 70 | END SUBROUTINE STPNT |
| 71 | |
| 72 | ! ---------------------------------------------------------------------- |
| 73 | ! ---------------------------------------------------------------------- |
| 74 | SUBROUTINE BCND(NDIM,PAR,ICP,NBC,U0,U1,FB,IJAC,DBC) |
| 75 | ! ---------- ---- |
| 76 | |
| 77 | IMPLICIT NONE |
| 78 | INTEGER, INTENT(IN) :: NDIM, ICP(*), NBC, IJAC |
| 79 | DOUBLE PRECISION, INTENT(IN) :: PAR(*), U0(NDIM), U1(NDIM) |
| 80 | DOUBLE PRECISION, INTENT(OUT) :: FB(NBC) |
| 81 | DOUBLE PRECISION, INTENT(INOUT) :: DBC(NBC,*) |
| 82 | |
| 83 | ! Define boundary conditions */ |
| 84 | |
| 85 | ! Define the critical manifold S as {(v,h,s) ; 2*h-v^3+v-1-v*s=0} |
| 86 | ! (we use the fact that gamma is fixed at the value 0.5) |
| 87 | |
| 88 | FB(1) = 2*U1(2)-U1(1)**3+U1(1)-1-U1(3)*U1(1) |
| 89 | FB(2) = U1(1) - PAR(4) ! End point is on the intersection between S |
| 90 | FB(3) = U1(3) - PAR(6) ! and the plane {s=0.05/v=0.0} |
| 91 | |
| 92 | FB(4) = U0(3) - PAR(5) ! Initial point is in a cross-section containing |
| 93 | ! the folded node: Sigma_fn={s=0.27970} |
| 94 | |
| 95 | IF(NBC==4) RETURN |
| 96 | |
| 97 | ! FB(1) and FB(5): {(v,h,s) ; s - (1 - 3*v^2=0)} |
| 98 | ! together define the folded node F |
| 99 | FB(5) = U1(3) - (1 - 3*U1(1)**2) |
| 100 | |
| 101 | END SUBROUTINE BCND |
| 102 | |
| 103 | ! ---------------------------------------------------------------------- |
| 104 | ! ---------------------------------------------------------------------- |
| 105 | SUBROUTINE PVLS(NDIM,U,PAR) |
| 106 | ! ---------- ---- |
| 107 | |
| 108 | IMPLICIT NONE |
| 109 | INTEGER, INTENT(IN) :: NDIM |
| 110 | DOUBLE PRECISION, INTENT(IN) :: U(NDIM) |
| 111 | DOUBLE PRECISION, INTENT(INOUT) :: PAR(*) |
| 112 | |
| 113 | DOUBLE PRECISION, EXTERNAL :: GETP |
| 114 | |
| 115 | ! Define external parameter which monitors the v- and the h-coordinate |
| 116 | ! of the initial point in section Sigma_fn */ |
| 117 | PAR(8) = GETP("BV0", 1, U) |
| 118 | PAR(9) = GETP("BV0", 2, U) |
| 119 | END SUBROUTINE PVLS |
| 120 | ! ---------------------------------------------------------------------- |
| 121 | ! ---------------------------------------------------------------------- |
| 122 | ! ---------------------------------------------------------------------- |
| 123 | ! ---------------------------------------------------------------------- |
| 124 | SUBROUTINE ICND |
| 125 | END SUBROUTINE ICND |
| 126 | ! ---------------------------------------------------------------------- |
| 127 | ! ---------------------------------------------------------------------- |
| 128 | SUBROUTINE FOPT |
| 129 | END SUBROUTINE FOPT |