Skip to main content
. 2018 Nov 19;7(4):35. doi: 10.3390/ht7040035
Algorithm 1: The forward-backward finite difference numerical scheme.
  • Step 1:

  • for j=M,,0, do:

  •      Xj=X0, Yj=Y0, Dj=D0, Vj=V0, Zj=Z0, η1j=0, η2j=0.

  • end for

  • for j=N,,N+M, do:

  •      λ1j=0,λ2j=0,λ3j=0,λ4j=0,λ5j=0,λ6j=0.

  • end for

  • Step 2:

  • for j=0,,N1, do:

  •      Xj+1=Xj+h[sμXjk(1η1j)VjXj],

  •      Yj+1=Yj+h[keλτ(1η1j)XjMVjMδYjpYjZj],

  •      Dj+1=Dj+h[(1η2i)aYjδDjβDj],

  •      Vj+1=Vj+h[βDjuVjqVjWj],

  •      Wj+1=Wj+h[gVjWjhWj],

  •      Zj+1=Zj+h[cYjZjbZj],

  •      λ1Nj1=λ1Njh[1+λ1Nj(μ+k(1η1j)Vj+1)]

  •                 +χ[0,tfτ](tNj)λ2Nj+Mk(η1j+M1)eλτVj+1],

  •      λ2Nj1=λ2Njh[λ2Nj(δ+pZj+1)λ3Nja(1η2j)λ6NjcZj+1],

  •      λ3Nj1=λ3Njh[λ3Nj(δ+β)λ4Njβ],

  •      λ4Nj1=λ4Njh[λ1Njk(1η1j)Xj+1+λ4Nj(u+qWj+1)

  •                 +χ[0,tfτ](tNj)λ2Nj+Mk(η1j+M1)eλτXj+1],

  •      λ5Nj1=λ5Njh[1+λ2NjqVj+1+λ5Nj(hgVj+1)],

  •      λ6Nj1=λ6Njh[1+λ2NjpYj+1+λ6Nj(bcYj+1)],

  •      R1j+1=(1/A1)(kλ2Nj1eλτVjM+1XjM+1kλ1Nj1Vj+1Xj+1)

  •      R2j+1=(1/A2)λ3Nj1aYj+1,

  •      η1j+1=min(1,max(R1j+1,0)),

  •      η2j+1=min(1,max(R2j+1,0)),

  • end for

  • Step 3:

  • for j=1,,N, write

  •   X*(tj)=Xj,Y*(tj)=Yj,D*(tj)=Dj,V*(tj)=Vj,W*(tj)=Wj,

  •  Z*(tj)=Zj,η1*(tj)=η1j,η2*(tj)=η2j.

  • end for