Question: Fractional differential equation

Hi!

I am simulate the code for fractional differential equation. But the out put is not wright...
sir_(2).mw

``

S[0] := .8;

.8

(1)

V[0] := .2;

.2

(2)

R[0] := 0;

0

(3)

alpha := 1;

1

 

.4

 

.8

 

gamma = 0.3e-1

(4)

q := .9;

.9

(5)

T := 1;

1

(6)

N := 5;

5

(7)

h := T/N;

1/5

(8)

``

for i from 0 to N do for j from 0 to 0 do a[j, i+1] := i^(alpha+1)-(i-alpha)*(i+1)^alpha; b[j, i+1] := h^alpha*((i+1-j)^alpha-(i-j)^alpha)/alpha end do end do;

for n from 0 to N do Sp[n+1] = S[0]+(sum(b[d, n+1]*(mu*(1-q)-beta*S[d]*V[d]-mu*S[d]), d = 0 .. n))/GAMMA(alpha); Vp[n+1] = V[0]+(sum(b[d, n+1]*(beta*S[d]*V[d]-(mu+gamma)*S[d]), d = 0 .. n))/GAMMA(alpha); Rp[n+1] = R[0]+(sum(b[d, n+1]*(mu*q-mu*R[d]+gamma*V[d]), d = 0 .. n))/GAMMA(alpha); S[n+1] = S[0]+h^alpha*(mu*(1-q)-beta*Sp[n+1]*Vp[n+1]-mu*Sp[n+1])/GAMMA(alpha+2)+h^alpha*(sum(a[e, n+1]*(mu*(1-q)-beta*S[e]*V[e]-mu*S[e]), e = 0 .. n))/GAMMA(alpha+2); V[n+1] = V[0]+h^alpha*(beta*Sp[n+1]*Vp[n+1]-(mu+gamma)*Sp[n+1])/GAMMA(alpha+2)+h^alpha*(sum(a[e, n+1]*(beta*S[e]*V[e]-(mu+gamma)*S[e]), e = 0 .. n))/GAMMA(alpha+2); R[n+1] = R[0]+h^alpha*(mu*q-mu*Rp[n+1]-gamma*Vp[n+1])/GAMMA(alpha+2)+h^alpha*(sum(a[e, n+1]*(mu*q-mu*R[e]-gamma*V[e]), e = 0 .. n))/GAMMA(alpha+2) end do;

Sp[1] = .7184000000

 

Vp[1] = 0.692454936e-1

 

Rp[1] = 0.9508862660e-1

 

S[1] = .7632000000-0.8000000000e-1*Sp[1]*Vp[1]-0.4000000000e-1*Sp[1]

 

V[1] = .1346227468+0.8000000000e-1*Sp[1]*Vp[1]-(1/10)*(.4+gamma)*Sp[1]

 

R[1] = 0.6045568670e-1-(1/10)*gamma*Vp[1]-0.4000000000e-1*Rp[1]

 

Sp[2] = .7264000000-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]

 

Vp[2] = 0.692454936e-1+.1600000000*S[1]*V[1]-.1954431330*S[1]

 

Rp[2] = .1670886266+.1154431330*V[1]-0.8000000000e-1*R[1]

 

S[2] = .7712000000-0.8000000000e-1*Sp[2]*Vp[2]-0.4000000000e-1*Sp[2]-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]

 

V[2] = .1346227468+0.8000000000e-1*Sp[2]*Vp[2]-(1/10)*(.4+gamma)*Sp[2]+.1600000000*S[1]*V[1]-.1954431330*S[1]

 

R[2] = .1324556867-(1/10)*gamma*Vp[2]-0.4000000000e-1*Rp[2]-.1154431330*V[1]-0.8000000000e-1*R[1]

 

Sp[3] = .7344000000-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]

 

Vp[3] = 0.692454936e-1+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]

 

Rp[3] = .2390886266+.1154431330*V[1]-0.8000000000e-1*R[1]+.1154431330*V[2]-0.8000000000e-1*R[2]

 

S[3] = .7792000000-0.8000000000e-1*Sp[3]*Vp[3]-0.4000000000e-1*Sp[3]-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]

 

V[3] = .1346227468+0.8000000000e-1*Sp[3]*Vp[3]-(1/10)*(.4+gamma)*Sp[3]+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]

 

R[3] = .2044556867-(1/10)*gamma*Vp[3]-0.4000000000e-1*Rp[3]-.1154431330*V[1]-0.8000000000e-1*R[1]-.1154431330*V[2]-0.8000000000e-1*R[2]

 

Sp[4] = .7424000000-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]

 

Vp[4] = 0.692454936e-1+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]

 

Rp[4] = .3110886266+.1154431330*V[1]-0.8000000000e-1*R[1]+.1154431330*V[2]-0.8000000000e-1*R[2]+.1154431330*V[3]-0.8000000000e-1*R[3]

 

S[4] = .7872000000-0.8000000000e-1*Sp[4]*Vp[4]-0.4000000000e-1*Sp[4]-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]

 

V[4] = .1346227468+0.8000000000e-1*Sp[4]*Vp[4]-(1/10)*(.4+gamma)*Sp[4]+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]

 

R[4] = .2764556867-(1/10)*gamma*Vp[4]-0.4000000000e-1*Rp[4]-.1154431330*V[1]-0.8000000000e-1*R[1]-.1154431330*V[2]-0.8000000000e-1*R[2]-.1154431330*V[3]-0.8000000000e-1*R[3]

 

Sp[5] = .7504000000-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]-.1600000000*S[4]*V[4]-0.8000000000e-1*S[4]

 

Vp[5] = 0.692454936e-1+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]+.1600000000*S[4]*V[4]-.1954431330*S[4]

 

Rp[5] = .3830886266+.1154431330*V[1]-0.8000000000e-1*R[1]+.1154431330*V[2]-0.8000000000e-1*R[2]+.1154431330*V[3]-0.8000000000e-1*R[3]+.1154431330*V[4]-0.8000000000e-1*R[4]

 

S[5] = .7952000000-0.8000000000e-1*Sp[5]*Vp[5]-0.4000000000e-1*Sp[5]-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]-.1600000000*S[4]*V[4]-0.8000000000e-1*S[4]

 

V[5] = .1346227468+0.8000000000e-1*Sp[5]*Vp[5]-(1/10)*(.4+gamma)*Sp[5]+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]+.1600000000*S[4]*V[4]-.1954431330*S[4]

 

R[5] = .3484556867-(1/10)*gamma*Vp[5]-0.4000000000e-1*Rp[5]-.1154431330*V[1]-0.8000000000e-1*R[1]-.1154431330*V[2]-0.8000000000e-1*R[2]-.1154431330*V[3]-0.8000000000e-1*R[3]-.1154431330*V[4]-0.8000000000e-1*R[4]

 

Sp[6] = .7584000000-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]-.1600000000*S[4]*V[4]-0.8000000000e-1*S[4]-.1600000000*S[5]*V[5]-0.8000000000e-1*S[5]

 

Vp[6] = 0.692454936e-1+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]+.1600000000*S[4]*V[4]-.1954431330*S[4]+.1600000000*S[5]*V[5]-.1954431330*S[5]

 

Rp[6] = .4550886266+.1154431330*V[1]-0.8000000000e-1*R[1]+.1154431330*V[2]-0.8000000000e-1*R[2]+.1154431330*V[3]-0.8000000000e-1*R[3]+.1154431330*V[4]-0.8000000000e-1*R[4]+.1154431330*V[5]-0.8000000000e-1*R[5]

 

S[6] = .8032000000-0.8000000000e-1*Sp[6]*Vp[6]-0.4000000000e-1*Sp[6]-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]-.1600000000*S[4]*V[4]-0.8000000000e-1*S[4]-.1600000000*S[5]*V[5]-0.8000000000e-1*S[5]

 

V[6] = .1346227468+0.8000000000e-1*Sp[6]*Vp[6]-(1/10)*(.4+gamma)*Sp[6]+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]+.1600000000*S[4]*V[4]-.1954431330*S[4]+.1600000000*S[5]*V[5]-.1954431330*S[5]

 

R[6] = .4204556867-(1/10)*gamma*Vp[6]-0.4000000000e-1*Rp[6]-.1154431330*V[1]-0.8000000000e-1*R[1]-.1154431330*V[2]-0.8000000000e-1*R[2]-.1154431330*V[3]-0.8000000000e-1*R[3]-.1154431330*V[4]-0.8000000000e-1*R[4]-.1154431330*V[5]-0.8000000000e-1*R[5]

(9)

``

``

 

Download sir_(2).mw

 

Please Wait...