ogunmiloro

35 Reputation

2 Badges

1 years, 23 days

MaplePrimes Activity


These are replies submitted by ogunmiloro

#
 

restart

N__1 := 9;

9

 

3

 

1

 

4

 

0.4e-1

 

.4

 

.3

 

0.1e-1

 

.1

 

.2

 

.6

 

0.3e-1

 

.8

 

proc (t) options operator, arrow; N__1 end proc

 

proc (t) options operator, arrow; N__2 end proc

 

proc (t) options operator, arrow; N__3 end proc

 

proc (t) options operator, arrow; N__4 end proc

 

3

(1)

for n from 0 to m do `x__n+1` := N__1+lambda*t-d*(int(add(x__n__, n = 0 .. m), t = 0 .. t))-beta*(int(add(x__n, n = 0 .. m)*x__n*v__n, t = 0 .. t)); `w__n+1` := N__2+(1-q)*beta*(int(add(x__n*v__n, n = 0 .. m), t = 0 .. t))-e*(int(add(w__n, n = 0 .. m), t = 0 .. t))-delta*(int(add(w__n, n = 0 .. m), t = 0 .. t)); `y__n+1` := N__3+q*beta*(int(add(x__n*v__n, n = 0 .. m), t = 0 .. t))-a*(int(add(y[n], n = 0 .. m), t = 0 .. t))+delta*(int(add(w__n, n = 0 .. m), t = 0 .. t)); `v__n+1` := N__4+k*(int(add(y[n], n = 0 .. m), t = 0 .. t))-mu*(int(add(v[n], n = 0 .. m), t = 0 .. t)) end do;

9+.4*t-0.4e-1*x__n__*t-.16*x__n^2*v__n*t

 

3+0.32e-1*x__n*v__n*t-1.6*w__n*t

 

1+.128*x__n*v__n*t-.2*y[0]*t-.2*y[1]*t-.2*y[2]*t-.2*y[3]*t+1.2*w__n*t

 

4+.6*y[0]*t+.6*y[1]*t+.6*y[2]*t+.6*y[3]*t-mu*(t*v[0]+t*v[1]+t*v[2]+t*v[3])

 

9+.4*t-0.4e-1*x__n__*t-.16*x__n^2*v__n*t

 

3+0.32e-1*x__n*v__n*t-1.6*w__n*t

 

1+.128*x__n*v__n*t-.2*y[0]*t-.2*y[1]*t-.2*y[2]*t-.2*y[3]*t+1.2*w__n*t

 

4+.6*y[0]*t+.6*y[1]*t+.6*y[2]*t+.6*y[3]*t-mu*(t*v[0]+t*v[1]+t*v[2]+t*v[3])

 

9+.4*t-0.4e-1*x__n__*t-.16*x__n^2*v__n*t

 

3+0.32e-1*x__n*v__n*t-1.6*w__n*t

 

1+.128*x__n*v__n*t-.2*y[0]*t-.2*y[1]*t-.2*y[2]*t-.2*y[3]*t+1.2*w__n*t

 

4+.6*y[0]*t+.6*y[1]*t+.6*y[2]*t+.6*y[3]*t-mu*(t*v[0]+t*v[1]+t*v[2]+t*v[3])

 

9+.4*t-0.4e-1*x__n__*t-.16*x__n^2*v__n*t

 

3+0.32e-1*x__n*v__n*t-1.6*w__n*t

 

1+.128*x__n*v__n*t-.2*y[0]*t-.2*y[1]*t-.2*y[2]*t-.2*y[3]*t+1.2*w__n*t

 

4+.6*y[0]*t+.6*y[1]*t+.6*y[2]*t+.6*y[3]*t-mu*(t*v[0]+t*v[1]+t*v[2]+t*v[3])

(2)

NULL

NULL


 

Download MPGH_sim.mw

@Carl Love thanks very much. I corrected that, but i still have the system solutions repeating itself. This #is what i got.

@tomleslie thank you very much for the job well done. This is the problem i encounter
(1) My maple version is not running the graphs as it ought to be, but it ran through in yours

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/someODEs2.mw .
 

Download someODEs2.mw

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/someODEs2.mw .
 

Download someODEs2.mw

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/someODEs2.mw .
 

Download someODEs2.mw

Maple Worksheet - Error


Maple Worksheet - Error

.
 

Download someODEs2.mw

 

 

Download someODEs2.mw

 

 

 

 

. you will see it in the code i uploaded. i mean it was giving me something like
PLOT( )
PLOT( ) and so on.

(2) i want to obtain the numerical values  from the series code you wrote as

(3)Also, if the answers are thesame i think the combined graphs should fit together
i mean the code you wrote as
display([v1, a1]); display([v2, a2]); display([v4, a4])

@Christian Wolinski 
I initialized at B(0) := .50; C(0) := .30; DD(0) := .21; E(0) := .14; F(0) := .70; G(0) := .45; H(0) := .14 but it wasnt running smoothly
 

@mmcdara thanks for your help. The first two points raised by you are very correct. B(T) is the priori model of the empirical observations iV. So I want iV to be considered as a observation for C(T) or DD(T). The model is resumed by 16 empirical observations by 7 matrix dimensions. Also, I want to know if transmissibility parameters like beta1 and betao values can be fitted to the experimental observations iV. You can please go forward with the coding/computations. Thanks.

@mmcdara
There is no relationshipt between i(t) and B(T), C(T),....H(T)....it is wrong. i intend to write either B(T) or....H(T) where i wrongly wrote i(T).
 pt := odeplot(N, [t, i(t)], 1 .. len, color = blue)
My intention is to fit the data values with each state variables and see the behavior on the two on the same graph

@mmcdara 777 thanks a lot for your expalantions and the code correction.
These are my intentions;
(1) The system of equations describes an epidemic transmission which i got an assumed data values for infected individuals per year in different localities earlier listed in the begining of the code. i intend to fit this data to the model equations which still retains its parameters and variable values.
I want to fit this data values with each variables to see the relationship/behavior between real life data and parameters/variable values involved in the model system equations.
Or if you have another fitting method you can help with that and i will gladly apprreciate.
Please i need help on that.
Thanks
 

@tomleslie Thanks once again for your good work and special attention to this program.
My question is
(1) You have varied the parameter "xi" at three different values. I checked the code for alteration so that i can also vary other parameters like "Mh, psi, mu" etc. but i couldnt get it.
How do i vary other parameters.

@tomleslie thank you very much for taking your time to attend to my problems, i'm very grateful. Here are some points i need to raise;
(1)A particular code you wrote as
interface(rtablesize = [22, 10]); M := Matrix([`~`[lhs](ans(0)), seq(`~`[rhs](ans(j)), j = 0 .. 20)])
is not running on my maple sheet. I dont know if my version cant support that or better still, another code that can give the matrix is appreciated.
(2) The code i wrote for the series is the differential transformation method(DTM) series applied to model equations. My intentions were to see wether the series solution for DTM will agree with the numerical values/solutions using RK4
(3) Also, i need codes for parametric plots, e.g., for Mh, beta1 etc.
Once again, I appreciate @tomleslie
 

restart; with(plots); _local(gamma)

M__h := .50:

ODEs := diff(B(T), T) = M__h-beta__1*psi*B(T)*G(T)-mu__r*B(T), diff(C(T), T) = beta__1*psi*B(T)*G(T)-sigma*psi*beta__1*E(T)*DD(T)-(alpha+xi+mu__r)*C(T), diff(DD(T), T) = alpha*C(T)-(gamma+mu__r)*DD(T), diff(E(T), T) = gamma*DD(T)+sigma*psi*beta__1*E(T)*G(T)-mu__r*E(T), diff(F(T), T) = M__c-psi*beta__o*F(T)*C(T)-mu__b*F(T), diff(G(T), T) = psi*beta__o*F(T)*C(T)-mu__b*G(T):

ans := dsolve([ODEs, bcs], numeric):

 

 

 

 

 

 

interface(rtablesize = [22, 10]); M := Matrix([`~`[lhs](ans(0)), seq(`~`[rhs](ans(j)), j = 0 .. 20)])

Error, (in interface) rtablesize must be a positive integer, or infinity

 

M := Vector(4, {(1) = ` 22 x 7 `*Matrix, (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

(1)

#
# Generate power series solutions of order 12
# (Maple default is 6) for all ODEs
#
  Order:=12:
  ans2:= convert~
         ( evalf~
           ( dsolve
             ( {ODEs, bcs},
               indets([ODEs], function(name)),
               'series'
             )
           ),
           polynom
         );
#
# Plot the "numeric" solution obtained earlier
# and the equivalent power series solution
# obtaine above on th same graph.
#
# Note that the range of the plots is reduced,
# because even with 12-th order polynomials,
# the power series soluton and the numerical
# solution start to deviate for T>~6
#
  for j in indets([ODEs], function(name)) do
      display
      ( [ odeplot
          ( ans,
            [T, j],
            T = 0 .. 10,
            thickness = 4, style = point,
            color = red
          ),
          plot
          ( eval(j, ans2),
            T = 0 .. 10,
            thickness = 2, style = point,
            color=blue
          )
        ],
        title = cat(convert(j,string), " (Numerical and PowerSeries compared)"),
        titlefont = [tims, bold, 20]
      )
   end do

{B(T) = .5000000000+.4997992350*T-0.1003402817e-3*T^2+0.1470042520e-7*T^3-0.4186689729e-11*T^4+0.1797722185e-13*T^5-0.7652371692e-15*T^6+0.2923183302e-16*T^7-0.8844182475e-18*T^8+0.2215403975e-19*T^9-0.4589870880e-21*T^10+0.5389509965e-23*T^11, C(T) = .3000000000-0.4811931399e-1*T+0.3859529419e-2*T^2-0.2063396439e-3*T^3+0.8267055682e-5*T^4-0.2631388485e-6*T^5+0.6554216926e-8*T^6-0.5551714044e-10*T^7-0.1520371564e-10*T^8+0.2777703195e-11*T^9-0.3923000816e-12*T^10+0.4970214040e-13*T^11, DD(T) = .2100000000-.1140840000*T+0.3730565453e-1*T^2-0.8568110732e-2*T^3+0.1494601849e-2*T^4-0.2091819518e-3*T^5+0.2441368229e-4*T^6-0.2442660302e-5*T^7+0.2138541461e-6*T^8-0.1664279070e-7*T^9+0.1165691616e-8*T^10-0.7422668732e-10*T^11, E(T) = .1400000000+.1469441693*T-0.3995870043e-1*T^2+0.8709964152e-2*T^3-0.1500287681e-2*T^4+0.2093639084e-3*T^5-0.2441847491e-4*T^6+0.2442759169e-5*T^7-0.2138545263e-6*T^8+0.1664257448e-7*T^9-0.1165658906e-8*T^10+0.7422262550e-10*T^11, F(T) = .7000000000+.6324990290*T-0.1581608397e-2*T^2+0.2679492283e-5*T^3-0.6093270788e-8*T^4+0.1272029637e-9*T^5-0.4253521584e-11*T^6+0.1189725836e-12*T^7-0.2702521878e-14*T^8+0.3074973933e-16*T^9+0.3481499101e-17*T^10-0.6346661500e-18*T^11, G(T) = .4500000000-0.2249028960e-2*T+0.5983397429e-5*T^2-0.5345061622e-7*T^3+0.2810718704e-8*T^4-0.1239204116e-9*T^5+0.4250786124e-11*T^6-0.1189706297e-12*T^7+0.2702520657e-14*T^8-0.3074973865e-16*T^9-0.3481499102e-17*T^10+0.6346661500e-18*T^11}

 

Warning, inserted missing semicolon at end of statement

 

 

 

 

 

 

 

``


 

Download MAPQ12.mw
 

restart; with(plots); _local(gamma)

M__h := .50:

ODEs := diff(B(T), T) = M__h-beta__1*psi*B(T)*G(T)-mu__r*B(T), diff(C(T), T) = beta__1*psi*B(T)*G(T)-sigma*psi*beta__1*E(T)*DD(T)-(alpha+xi+mu__r)*C(T), diff(DD(T), T) = alpha*C(T)-(gamma+mu__r)*DD(T), diff(E(T), T) = gamma*DD(T)+sigma*psi*beta__1*E(T)*G(T)-mu__r*E(T), diff(F(T), T) = M__c-psi*beta__o*F(T)*C(T)-mu__b*F(T), diff(G(T), T) = psi*beta__o*F(T)*C(T)-mu__b*G(T):

ans := dsolve([ODEs, bcs], numeric):

 

 

 

 

 

 

interface(rtablesize = [22, 10]); M := Matrix([`~`[lhs](ans(0)), seq(`~`[rhs](ans(j)), j = 0 .. 20)])

Error, (in interface) rtablesize must be a positive integer, or infinity

 

M := Vector(4, {(1) = ` 22 x 7 `*Matrix, (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

(1)

#
# Generate power series solutions of order 12
# (Maple default is 6) for all ODEs
#
  Order:=12:
  ans2:= convert~
         ( evalf~
           ( dsolve
             ( {ODEs, bcs},
               indets([ODEs], function(name)),
               'series'
             )
           ),
           polynom
         );
#
# Plot the "numeric" solution obtained earlier
# and the equivalent power series solution
# obtaine above on th same graph.
#
# Note that the range of the plots is reduced,
# because even with 12-th order polynomials,
# the power series soluton and the numerical
# solution start to deviate for T>~6
#
  for j in indets([ODEs], function(name)) do
      display
      ( [ odeplot
          ( ans,
            [T, j],
            T = 0 .. 10,
            thickness = 4, style = point,
            color = red
          ),
          plot
          ( eval(j, ans2),
            T = 0 .. 10,
            thickness = 2, style = point,
            color=blue
          )
        ],
        title = cat(convert(j,string), " (Numerical and PowerSeries compared)"),
        titlefont = [tims, bold, 20]
      )
   end do

{B(T) = .5000000000+.4997992350*T-0.1003402817e-3*T^2+0.1470042520e-7*T^3-0.4186689729e-11*T^4+0.1797722185e-13*T^5-0.7652371692e-15*T^6+0.2923183302e-16*T^7-0.8844182475e-18*T^8+0.2215403975e-19*T^9-0.4589870880e-21*T^10+0.5389509965e-23*T^11, C(T) = .3000000000-0.4811931399e-1*T+0.3859529419e-2*T^2-0.2063396439e-3*T^3+0.8267055682e-5*T^4-0.2631388485e-6*T^5+0.6554216926e-8*T^6-0.5551714044e-10*T^7-0.1520371564e-10*T^8+0.2777703195e-11*T^9-0.3923000816e-12*T^10+0.4970214040e-13*T^11, DD(T) = .2100000000-.1140840000*T+0.3730565453e-1*T^2-0.8568110732e-2*T^3+0.1494601849e-2*T^4-0.2091819518e-3*T^5+0.2441368229e-4*T^6-0.2442660302e-5*T^7+0.2138541461e-6*T^8-0.1664279070e-7*T^9+0.1165691616e-8*T^10-0.7422668732e-10*T^11, E(T) = .1400000000+.1469441693*T-0.3995870043e-1*T^2+0.8709964152e-2*T^3-0.1500287681e-2*T^4+0.2093639084e-3*T^5-0.2441847491e-4*T^6+0.2442759169e-5*T^7-0.2138545263e-6*T^8+0.1664257448e-7*T^9-0.1165658906e-8*T^10+0.7422262550e-10*T^11, F(T) = .7000000000+.6324990290*T-0.1581608397e-2*T^2+0.2679492283e-5*T^3-0.6093270788e-8*T^4+0.1272029637e-9*T^5-0.4253521584e-11*T^6+0.1189725836e-12*T^7-0.2702521878e-14*T^8+0.3074973933e-16*T^9+0.3481499101e-17*T^10-0.6346661500e-18*T^11, G(T) = .4500000000-0.2249028960e-2*T+0.5983397429e-5*T^2-0.5345061622e-7*T^3+0.2810718704e-8*T^4-0.1239204116e-9*T^5+0.4250786124e-11*T^6-0.1189706297e-12*T^7+0.2702520657e-14*T^8-0.3074973865e-16*T^9-0.3481499102e-17*T^10+0.6346661500e-18*T^11}

 

Warning, inserted missing semicolon at end of statement

 

 

 

 

 

 

 

``


 

Download MAPQ12.mw
 

restart; with(plots); _local(gamma)

M__h := .50:

ODEs := diff(B(T), T) = M__h-beta__1*psi*B(T)*G(T)-mu__r*B(T), diff(C(T), T) = beta__1*psi*B(T)*G(T)-sigma*psi*beta__1*E(T)*DD(T)-(alpha+xi+mu__r)*C(T), diff(DD(T), T) = alpha*C(T)-(gamma+mu__r)*DD(T), diff(E(T), T) = gamma*DD(T)+sigma*psi*beta__1*E(T)*G(T)-mu__r*E(T), diff(F(T), T) = M__c-psi*beta__o*F(T)*C(T)-mu__b*F(T), diff(G(T), T) = psi*beta__o*F(T)*C(T)-mu__b*G(T):

ans := dsolve([ODEs, bcs], numeric):

 

 

 

 

 

 

interface(rtablesize = [22, 10]); M := Matrix([`~`[lhs](ans(0)), seq(`~`[rhs](ans(j)), j = 0 .. 20)])

Error, (in interface) rtablesize must be a positive integer, or infinity

 

M := Vector(4, {(1) = ` 22 x 7 `*Matrix, (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

(1)

#
# Generate power series solutions of order 12
# (Maple default is 6) for all ODEs
#
  Order:=12:
  ans2:= convert~
         ( evalf~
           ( dsolve
             ( {ODEs, bcs},
               indets([ODEs], function(name)),
               'series'
             )
           ),
           polynom
         );
#
# Plot the "numeric" solution obtained earlier
# and the equivalent power series solution
# obtaine above on th same graph.
#
# Note that the range of the plots is reduced,
# because even with 12-th order polynomials,
# the power series soluton and the numerical
# solution start to deviate for T>~6
#
  for j in indets([ODEs], function(name)) do
      display
      ( [ odeplot
          ( ans,
            [T, j],
            T = 0 .. 10,
            thickness = 4, style = point,
            color = red
          ),
          plot
          ( eval(j, ans2),
            T = 0 .. 10,
            thickness = 2, style = point,
            color=blue
          )
        ],
        title = cat(convert(j,string), " (Numerical and PowerSeries compared)"),
        titlefont = [tims, bold, 20]
      )
   end do

{B(T) = .5000000000+.4997992350*T-0.1003402817e-3*T^2+0.1470042520e-7*T^3-0.4186689729e-11*T^4+0.1797722185e-13*T^5-0.7652371692e-15*T^6+0.2923183302e-16*T^7-0.8844182475e-18*T^8+0.2215403975e-19*T^9-0.4589870880e-21*T^10+0.5389509965e-23*T^11, C(T) = .3000000000-0.4811931399e-1*T+0.3859529419e-2*T^2-0.2063396439e-3*T^3+0.8267055682e-5*T^4-0.2631388485e-6*T^5+0.6554216926e-8*T^6-0.5551714044e-10*T^7-0.1520371564e-10*T^8+0.2777703195e-11*T^9-0.3923000816e-12*T^10+0.4970214040e-13*T^11, DD(T) = .2100000000-.1140840000*T+0.3730565453e-1*T^2-0.8568110732e-2*T^3+0.1494601849e-2*T^4-0.2091819518e-3*T^5+0.2441368229e-4*T^6-0.2442660302e-5*T^7+0.2138541461e-6*T^8-0.1664279070e-7*T^9+0.1165691616e-8*T^10-0.7422668732e-10*T^11, E(T) = .1400000000+.1469441693*T-0.3995870043e-1*T^2+0.8709964152e-2*T^3-0.1500287681e-2*T^4+0.2093639084e-3*T^5-0.2441847491e-4*T^6+0.2442759169e-5*T^7-0.2138545263e-6*T^8+0.1664257448e-7*T^9-0.1165658906e-8*T^10+0.7422262550e-10*T^11, F(T) = .7000000000+.6324990290*T-0.1581608397e-2*T^2+0.2679492283e-5*T^3-0.6093270788e-8*T^4+0.1272029637e-9*T^5-0.4253521584e-11*T^6+0.1189725836e-12*T^7-0.2702521878e-14*T^8+0.3074973933e-16*T^9+0.3481499101e-17*T^10-0.6346661500e-18*T^11, G(T) = .4500000000-0.2249028960e-2*T+0.5983397429e-5*T^2-0.5345061622e-7*T^3+0.2810718704e-8*T^4-0.1239204116e-9*T^5+0.4250786124e-11*T^6-0.1189706297e-12*T^7+0.2702520657e-14*T^8-0.3074973865e-16*T^9-0.3481499102e-17*T^10+0.6346661500e-18*T^11}

 

Warning, inserted missing semicolon at end of statement

 

 

 

 

 

 

 

``


 

Download MAPQ12.mw
 

restart; with(plots); _local(gamma)

M__h := .50:

ODEs := diff(B(T), T) = M__h-beta__1*psi*B(T)*G(T)-mu__r*B(T), diff(C(T), T) = beta__1*psi*B(T)*G(T)-sigma*psi*beta__1*E(T)*DD(T)-(alpha+xi+mu__r)*C(T), diff(DD(T), T) = alpha*C(T)-(gamma+mu__r)*DD(T), diff(E(T), T) = gamma*DD(T)+sigma*psi*beta__1*E(T)*G(T)-mu__r*E(T), diff(F(T), T) = M__c-psi*beta__o*F(T)*C(T)-mu__b*F(T), diff(G(T), T) = psi*beta__o*F(T)*C(T)-mu__b*G(T):

ans := dsolve([ODEs, bcs], numeric):

 

 

 

 

 

 

interface(rtablesize = [22, 10]); M := Matrix([`~`[lhs](ans(0)), seq(`~`[rhs](ans(j)), j = 0 .. 20)])

Error, (in interface) rtablesize must be a positive integer, or infinity

 

M := Vector(4, {(1) = ` 22 x 7 `*Matrix, (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

(1)

#
# Generate power series solutions of order 12
# (Maple default is 6) for all ODEs
#
  Order:=12:
  ans2:= convert~
         ( evalf~
           ( dsolve
             ( {ODEs, bcs},
               indets([ODEs], function(name)),
               'series'
             )
           ),
           polynom
         );
#
# Plot the "numeric" solution obtained earlier
# and the equivalent power series solution
# obtaine above on th same graph.
#
# Note that the range of the plots is reduced,
# because even with 12-th order polynomials,
# the power series soluton and the numerical
# solution start to deviate for T>~6
#
  for j in indets([ODEs], function(name)) do
      display
      ( [ odeplot
          ( ans,
            [T, j],
            T = 0 .. 10,
            thickness = 4, style = point,
            color = red
          ),
          plot
          ( eval(j, ans2),
            T = 0 .. 10,
            thickness = 2, style = point,
            color=blue
          )
        ],
        title = cat(convert(j,string), " (Numerical and PowerSeries compared)"),
        titlefont = [tims, bold, 20]
      )
   end do

{B(T) = .5000000000+.4997992350*T-0.1003402817e-3*T^2+0.1470042520e-7*T^3-0.4186689729e-11*T^4+0.1797722185e-13*T^5-0.7652371692e-15*T^6+0.2923183302e-16*T^7-0.8844182475e-18*T^8+0.2215403975e-19*T^9-0.4589870880e-21*T^10+0.5389509965e-23*T^11, C(T) = .3000000000-0.4811931399e-1*T+0.3859529419e-2*T^2-0.2063396439e-3*T^3+0.8267055682e-5*T^4-0.2631388485e-6*T^5+0.6554216926e-8*T^6-0.5551714044e-10*T^7-0.1520371564e-10*T^8+0.2777703195e-11*T^9-0.3923000816e-12*T^10+0.4970214040e-13*T^11, DD(T) = .2100000000-.1140840000*T+0.3730565453e-1*T^2-0.8568110732e-2*T^3+0.1494601849e-2*T^4-0.2091819518e-3*T^5+0.2441368229e-4*T^6-0.2442660302e-5*T^7+0.2138541461e-6*T^8-0.1664279070e-7*T^9+0.1165691616e-8*T^10-0.7422668732e-10*T^11, E(T) = .1400000000+.1469441693*T-0.3995870043e-1*T^2+0.8709964152e-2*T^3-0.1500287681e-2*T^4+0.2093639084e-3*T^5-0.2441847491e-4*T^6+0.2442759169e-5*T^7-0.2138545263e-6*T^8+0.1664257448e-7*T^9-0.1165658906e-8*T^10+0.7422262550e-10*T^11, F(T) = .7000000000+.6324990290*T-0.1581608397e-2*T^2+0.2679492283e-5*T^3-0.6093270788e-8*T^4+0.1272029637e-9*T^5-0.4253521584e-11*T^6+0.1189725836e-12*T^7-0.2702521878e-14*T^8+0.3074973933e-16*T^9+0.3481499101e-17*T^10-0.6346661500e-18*T^11, G(T) = .4500000000-0.2249028960e-2*T+0.5983397429e-5*T^2-0.5345061622e-7*T^3+0.2810718704e-8*T^4-0.1239204116e-9*T^5+0.4250786124e-11*T^6-0.1189706297e-12*T^7+0.2702520657e-14*T^8-0.3074973865e-16*T^9-0.3481499102e-17*T^10+0.6346661500e-18*T^11}

 

Warning, inserted missing semicolon at end of statement

 

 

 

 

 

 

 

``


 

Download MAPQ12.mw
 

restart; with(plots); _local(gamma)

M__h := .50:

ODEs := diff(B(T), T) = M__h-beta__1*psi*B(T)*G(T)-mu__r*B(T), diff(C(T), T) = beta__1*psi*B(T)*G(T)-sigma*psi*beta__1*E(T)*DD(T)-(alpha+xi+mu__r)*C(T), diff(DD(T), T) = alpha*C(T)-(gamma+mu__r)*DD(T), diff(E(T), T) = gamma*DD(T)+sigma*psi*beta__1*E(T)*G(T)-mu__r*E(T), diff(F(T), T) = M__c-psi*beta__o*F(T)*C(T)-mu__b*F(T), diff(G(T), T) = psi*beta__o*F(T)*C(T)-mu__b*G(T):

ans := dsolve([ODEs, bcs], numeric):

 

 

 

 

 

 

interface(rtablesize = [22, 10]); M := Matrix([`~`[lhs](ans(0)), seq(`~`[rhs](ans(j)), j = 0 .. 20)])

Error, (in interface) rtablesize must be a positive integer, or infinity

 

M := Vector(4, {(1) = ` 22 x 7 `*Matrix, (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

(1)

#
# Generate power series solutions of order 12
# (Maple default is 6) for all ODEs
#
  Order:=12:
  ans2:= convert~
         ( evalf~
           ( dsolve
             ( {ODEs, bcs},
               indets([ODEs], function(name)),
               'series'
             )
           ),
           polynom
         );
#
# Plot the "numeric" solution obtained earlier
# and the equivalent power series solution
# obtaine above on th same graph.
#
# Note that the range of the plots is reduced,
# because even with 12-th order polynomials,
# the power series soluton and the numerical
# solution start to deviate for T>~6
#
  for j in indets([ODEs], function(name)) do
      display
      ( [ odeplot
          ( ans,
            [T, j],
            T = 0 .. 10,
            thickness = 4, style = point,
            color = red
          ),
          plot
          ( eval(j, ans2),
            T = 0 .. 10,
            thickness = 2, style = point,
            color=blue
          )
        ],
        title = cat(convert(j,string), " (Numerical and PowerSeries compared)"),
        titlefont = [tims, bold, 20]
      )
   end do

{B(T) = .5000000000+.4997992350*T-0.1003402817e-3*T^2+0.1470042520e-7*T^3-0.4186689729e-11*T^4+0.1797722185e-13*T^5-0.7652371692e-15*T^6+0.2923183302e-16*T^7-0.8844182475e-18*T^8+0.2215403975e-19*T^9-0.4589870880e-21*T^10+0.5389509965e-23*T^11, C(T) = .3000000000-0.4811931399e-1*T+0.3859529419e-2*T^2-0.2063396439e-3*T^3+0.8267055682e-5*T^4-0.2631388485e-6*T^5+0.6554216926e-8*T^6-0.5551714044e-10*T^7-0.1520371564e-10*T^8+0.2777703195e-11*T^9-0.3923000816e-12*T^10+0.4970214040e-13*T^11, DD(T) = .2100000000-.1140840000*T+0.3730565453e-1*T^2-0.8568110732e-2*T^3+0.1494601849e-2*T^4-0.2091819518e-3*T^5+0.2441368229e-4*T^6-0.2442660302e-5*T^7+0.2138541461e-6*T^8-0.1664279070e-7*T^9+0.1165691616e-8*T^10-0.7422668732e-10*T^11, E(T) = .1400000000+.1469441693*T-0.3995870043e-1*T^2+0.8709964152e-2*T^3-0.1500287681e-2*T^4+0.2093639084e-3*T^5-0.2441847491e-4*T^6+0.2442759169e-5*T^7-0.2138545263e-6*T^8+0.1664257448e-7*T^9-0.1165658906e-8*T^10+0.7422262550e-10*T^11, F(T) = .7000000000+.6324990290*T-0.1581608397e-2*T^2+0.2679492283e-5*T^3-0.6093270788e-8*T^4+0.1272029637e-9*T^5-0.4253521584e-11*T^6+0.1189725836e-12*T^7-0.2702521878e-14*T^8+0.3074973933e-16*T^9+0.3481499101e-17*T^10-0.6346661500e-18*T^11, G(T) = .4500000000-0.2249028960e-2*T+0.5983397429e-5*T^2-0.5345061622e-7*T^3+0.2810718704e-8*T^4-0.1239204116e-9*T^5+0.4250786124e-11*T^6-0.1189706297e-12*T^7+0.2702520657e-14*T^8-0.3074973865e-16*T^9-0.3481499102e-17*T^10+0.6346661500e-18*T^11}

 

Warning, inserted missing semicolon at end of statement

 

 

 

 

 

 

 

``


 

Download MAPQ12.mw
 

restart; with(plots); _local(gamma)

M__h := .50:

ODEs := diff(B(T), T) = M__h-beta__1*psi*B(T)*G(T)-mu__r*B(T), diff(C(T), T) = beta__1*psi*B(T)*G(T)-sigma*psi*beta__1*E(T)*DD(T)-(alpha+xi+mu__r)*C(T), diff(DD(T), T) = alpha*C(T)-(gamma+mu__r)*DD(T), diff(E(T), T) = gamma*DD(T)+sigma*psi*beta__1*E(T)*G(T)-mu__r*E(T), diff(F(T), T) = M__c-psi*beta__o*F(T)*C(T)-mu__b*F(T), diff(G(T), T) = psi*beta__o*F(T)*C(T)-mu__b*G(T):

ans := dsolve([ODEs, bcs], numeric):

 

 

 

 

 

 

interface(rtablesize = [22, 10]); M := Matrix([`~`[lhs](ans(0)), seq(`~`[rhs](ans(j)), j = 0 .. 20)])

Error, (in interface) rtablesize must be a positive integer, or infinity

 

M := Vector(4, {(1) = ` 22 x 7 `*Matrix, (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

(1)

#
# Generate power series solutions of order 12
# (Maple default is 6) for all ODEs
#
  Order:=12:
  ans2:= convert~
         ( evalf~
           ( dsolve
             ( {ODEs, bcs},
               indets([ODEs], function(name)),
               'series'
             )
           ),
           polynom
         );
#
# Plot the "numeric" solution obtained earlier
# and the equivalent power series solution
# obtaine above on th same graph.
#
# Note that the range of the plots is reduced,
# because even with 12-th order polynomials,
# the power series soluton and the numerical
# solution start to deviate for T>~6
#
  for j in indets([ODEs], function(name)) do
      display
      ( [ odeplot
          ( ans,
            [T, j],
            T = 0 .. 10,
            thickness = 4, style = point,
            color = red
          ),
          plot
          ( eval(j, ans2),
            T = 0 .. 10,
            thickness = 2, style = point,
            color=blue
          )
        ],
        title = cat(convert(j,string), " (Numerical and PowerSeries compared)"),
        titlefont = [tims, bold, 20]
      )
   end do

{B(T) = .5000000000+.4997992350*T-0.1003402817e-3*T^2+0.1470042520e-7*T^3-0.4186689729e-11*T^4+0.1797722185e-13*T^5-0.7652371692e-15*T^6+0.2923183302e-16*T^7-0.8844182475e-18*T^8+0.2215403975e-19*T^9-0.4589870880e-21*T^10+0.5389509965e-23*T^11, C(T) = .3000000000-0.4811931399e-1*T+0.3859529419e-2*T^2-0.2063396439e-3*T^3+0.8267055682e-5*T^4-0.2631388485e-6*T^5+0.6554216926e-8*T^6-0.5551714044e-10*T^7-0.1520371564e-10*T^8+0.2777703195e-11*T^9-0.3923000816e-12*T^10+0.4970214040e-13*T^11, DD(T) = .2100000000-.1140840000*T+0.3730565453e-1*T^2-0.8568110732e-2*T^3+0.1494601849e-2*T^4-0.2091819518e-3*T^5+0.2441368229e-4*T^6-0.2442660302e-5*T^7+0.2138541461e-6*T^8-0.1664279070e-7*T^9+0.1165691616e-8*T^10-0.7422668732e-10*T^11, E(T) = .1400000000+.1469441693*T-0.3995870043e-1*T^2+0.8709964152e-2*T^3-0.1500287681e-2*T^4+0.2093639084e-3*T^5-0.2441847491e-4*T^6+0.2442759169e-5*T^7-0.2138545263e-6*T^8+0.1664257448e-7*T^9-0.1165658906e-8*T^10+0.7422262550e-10*T^11, F(T) = .7000000000+.6324990290*T-0.1581608397e-2*T^2+0.2679492283e-5*T^3-0.6093270788e-8*T^4+0.1272029637e-9*T^5-0.4253521584e-11*T^6+0.1189725836e-12*T^7-0.2702521878e-14*T^8+0.3074973933e-16*T^9+0.3481499101e-17*T^10-0.6346661500e-18*T^11, G(T) = .4500000000-0.2249028960e-2*T+0.5983397429e-5*T^2-0.5345061622e-7*T^3+0.2810718704e-8*T^4-0.1239204116e-9*T^5+0.4250786124e-11*T^6-0.1189706297e-12*T^7+0.2702520657e-14*T^8-0.3074973865e-16*T^9-0.3481499102e-17*T^10+0.6346661500e-18*T^11}

 

Warning, inserted missing semicolon at end of statement

 

 

 

 

 

 

 

``


 

Download MAPQ12.mw

 

 

 

 

 

@tomleslie 
 

restart:

#
# Statement not terminated in the following - fixed it
#
  B[0]:= 1.7e8:  C[0]:=0:  P[0]:=0.1: E[0]:=2:
#
# Why does this (commented) Digits command exist?
#
#Digits:=10:

#
# OP never uses 'gamma' in this worksheet - why the
# hell unprotect an inbuilt variable for no purpose???
#
unprotect('gamma'):


 A__h := 10:
 beta__1 := 0.34e-1:
 psi__o := 0.25e-1:
 mu := 0.4e-3:
 theta := .7902:
 alpha := .11:
 k := 0.136e-3:
 z := 0.5e-1:
 delta := .7:
 eta := .134:
 xi := .12:
 beta := 0.1e-1:
 Q1 := 1:
 Q2 := 1:
 h := .1:
tau:=1.0;
  kappa:=2.0;
#
# The variables 'tau' and 'kappa' are used in the following,
# but neither of these is defined. Gave them a "random"
# values here just to assist debug
#
  
 

1.0

 

2.0

(1)

#Step 1
n:=100:
#
# Fixed the names of all of the following for some kind
# of consistency
#
lambda1[n] := 0: lambda2[n] := 0: lambda3[n] := 0: lambda4[n] := 0: u0[0] := 0:

for i from 0 to n-1 do

     B[i+1] := h*(theta*E[i]+A__h+B[i])/(1+ psi__o*h*P[i])/(P[i]+xi)+mu+u0[i]+beta*C[i];
#
# Following statement is a recursive assignment.
# It was a recursive assignment the last time the
# OP posted some code, and it is still a recursive
# assignment now!!!!
#
# Let's see if I can make this explanation simple enough
# for the brain-dead.
#
# C[i+1] is undefined. Therefore, assigning C[i+1] in
# terms of C[i+1] is doomed to failure.
#
# Changing C[i+1] to C[i] on the rhs is *may* be incorrect
# but at least the statement can now be evaluated!!
#
#     C[i+1] := h*B[i+1](beta*C[i]-psi[o]*P[i])/(P[i]+xi)-(alpha+mu+k)*C[i+1];
#
# I'm also assumin that psi[o] ought to be psi__o, so
# I made this change
#
     C[i+1] := h*B[i+1](beta*C[i]-psi__o*P[i])/(P[i]+xi)-(alpha+mu+k)*C[i];
     P[i+1] := h*z*C[i+1]/(1+delta+eta);
     E[i+1] := h*(alpha*C[i+1]+B[i+1]*u0[i]+E[i])/(1+theta+mu);

#
# The following statement has one more oopening parenthesis (ie '(')
# than closing parenthesis - again basic syntax
#
# I randomly added a closing parenthesis, just to make it syntactically
# correct, but the odds that I got this closing parenthesis in the
# desired location are almost nil!!!!!
#
#   lambda1[n-i-1] := -h*(Q1+(beta*C[i]+(psi__o*P[i]/(P[i]+xi)))*lambda2[n-i]-lambda1[n-i]-mu+u0[i]/(1+beta*C        [i]+P[i]/(P[i]+xi));
#
  lambda1[n-i-1] := -h*(Q1+(beta*C[i]+(psi__o*P[i]/(P[i]+xi)))*lambda2[n-i]-lambda1[n-i]-mu+u0[i])/(1+beta*C[i]+P[i]/(P[i]+xi));
#
# The variable 'kappa' in the following is undefined
#
  lambda2[n-i-1] := -h*(-beta*B[i+1]*lambda1[n-i-1]+Q2-alpha-mu-kappa+z*lambda3[n-i]+alpha*lambda4[n-i]-lambda2[n-i])/(-beta*B[i+1]+1);

  lambda3[n-i-1] := h*((psi__o*B[i+1]*P[i+1]/(P[i+1]+xi)^2+theta)*lambda1[n-i-1]-lambda2[n-i-1]*psi__o*B[i+1]*P[i+1]/(P[i+1]+xi)^2-lambda3[n-i])/(1+delta+eta);

  lambda4[n-i-1] := h*lambda4[n-i]/(1-theta-mu);
#
# The variable 'tau' was undefined, so (obviously) the
# following cannot be fully evaluated
#

     R1:= (lambda1[n-i-1]-lambda4[n-i-1])*B[i+1]/tau;
#
# Since R1 has not been fully evaluated, u0[i+1] cannot
# be fully evaluated either - and so the chaos continues!
#
    
      u0[i+1] := min(1, max(R1, 0));    
    end do:

#
# These two command are assigned to nothing. They are
# are never used for anything - why do they exist??
#
seq(i,i=0..30):
seq(B[i],i=0..30):

with(plots):

with(DEtools):

#
# The quantity 'h', was earlier defined to be 0.1
# Thus h(t)=0.1, h(0)=0.1 and so on. Probably not
# what the OP desired. Even funnier is when the
# OP uses initial conditions such as h(0)=400,
# which of course will evaluate to 0.1=400. This
# is a whole new level of misunderstanding
#
# Obviously this mean that the definition of these
# ODEs is completely incorrect - so it is a complete\
# waste of time trying to solve them!
#

DE1 := diff(a(t),t) = A__h-beta__1*a(t)*g(t)-psi__o*a(t)*v(t)/(v(t)+xi)-mu*a(t)+theta*m(t);
DE2 := diff(g(t),t) = beta__1*a(t)*g(t)-psi__o*a(t)*v(t)/(v(t)+xi)-(alpha+mu+k)*g(t);
DE3 := diff(v(t),t) = z*g(t)-(delta+eta)*v(t);
DE4 := diff(m(t),t) = alpha*g(t)-(theta+mu)*m(t);

SIRsys := [DE1, DE2, DE3, DE4];
#
# The commands DE1plot(), DE2plot(), DE3plot() DE4plot()
# do not exist in Maple so the following will never
# evaluate. OP (probably??) means DEplot(). However with
# the incorrect use of the name 'h' described above,
# even a syntactically correct command will not
# produce anything meaningful. Correct command with
# crap arguments will still fail!!
#

aplot := DEplot(SIRsys, [a(t), g(t), v(t), m(t)], t = 0 .. 100, a = 0.167e9 .. 0.17e9, [[a(0) = 0.17e9, g(0) = 0, v(0) = 4, m(0) = 2]], scene = [t, a(t)], thickness = 2, linecolor = red, stepsize = .1);

gplot := DEplot(SIRsys, [a(t), g(t), v(t), m(t)], t = 0 .. 100, g = 0 .. 0.211, [[a(0) = 0.17e9, g(0) = 0, v(0) = 4, m(0) = 2]], scene = [t, g(t)], thickness = 2, linecolor = red, stepsize = .1):

vplot := DEplot(SIRsys, [a(t), g(t), v(t), m(t)], t = 0 .. 100, v = 0 .. 0.1e4, [[a(0) = 0.17e9, g(0) = 0, v(0) = 4, m(0) = 2]], scene = [t, v(t)], thickness = 2, linecolor = red, stepsize = .1):

mplot := DEplot(SIRsys, [a(t), g(t), v(t), m(t)], t = 0 .. 100, m = 0 .. 0.1e4, [[a(0) = 0.17e9, g(0) = 0, v(0) = 4, m(0) = 2]], scene = [t, m(t)], thickness = 2, linecolor = red, stepsize = .1):

#
# Did no syntax checking beyond this point becuase I got
# really, REALLY BORED
#

L:=<<seq(i,i=0..100)>|<seq(B[i],i=0..100)>>:
#points:= {seq(B[i],i=0..100)};
 

diff(a(t), t) = 10-0.34e-1*a(t)*g(t)-0.25e-1*a(t)*v(t)/(v(t)+.12)-0.4e-3*a(t)+.7902*m(t)

 

diff(g(t), t) = 0.34e-1*a(t)*g(t)-0.25e-1*a(t)*v(t)/(v(t)+.12)-.110536*g(t)

 

diff(v(t), t) = 0.5e-1*g(t)-.834*v(t)

 

diff(m(t), t) = .11*g(t)-.7906*m(t)

 

[diff(a(t), t) = 10-0.34e-1*a(t)*g(t)-0.25e-1*a(t)*v(t)/(v(t)+.12)-0.4e-3*a(t)+.7902*m(t), diff(g(t), t) = 0.34e-1*a(t)*g(t)-0.25e-1*a(t)*v(t)/(v(t)+.12)-.110536*g(t), diff(v(t), t) = 0.5e-1*g(t)-.834*v(t), diff(m(t), t) = .11*g(t)-.7906*m(t)]

 

Warning, plot may be incomplete, the following errors(s) were issued:
   cannot evaluate the solution further right of .33370860e-5, probably a singularity

 

PLOT(CURVES([[0., 170000000.], [.1000000000, undefined], [.2000000000, undefined], [.3000000000, undefined], [.4000000000, undefined], [.5000000000, undefined], [.6000000000, undefined], [.7000000000, undefined], [.8000000000, undefined], [.9000000000, undefined], [1.000000000, undefined], [1.100000000, undefined], [1.200000000, undefined], [1.300000000, undefined], [1.400000000, undefined], [1.500000000, undefined], [1.600000000, undefined], [1.700000000, undefined], [1.800000000, undefined], [1.900000000, undefined], [2.000000000, undefined], [2.100000000, undefined], [2.200000000, undefined], [2.300000000, undefined], [2.400000000, undefined], [2.500000000, undefined], [2.600000000, undefined], [2.700000000, undefined], [2.800000000, undefined], [2.900000000, undefined], [3.000000000, undefined], [3.100000000, undefined], [3.200000000, undefined], [3.300000000, undefined], [3.400000000, undefined], [3.500000000, undefined], [3.600000000, undefined], [3.700000000, undefined], [3.800000000, undefined], [3.900000000, undefined], [4.000000000, undefined], [4.100000000, undefined], [4.200000000, undefined], [4.300000000, undefined], [4.400000000, undefined], [4.500000000, undefined], [4.600000000, undefined], [4.700000000, undefined], [4.800000000, undefined], [4.900000000, undefined], [5.000000000, undefined], [5.100000000, undefined], [5.200000000, undefined], [5.300000000, undefined], [5.400000000, undefined], [5.500000000, undefined], [5.600000000, undefined], [5.700000000, undefined], [5.800000000, undefined], [5.900000000, undefined], [6.000000000, undefined], [6.100000000, undefined], [6.200000000, undefined], [6.300000000, undefined], [6.400000000, undefined], [6.500000000, undefined], [6.600000000, undefined], [6.700000000, undefined], [6.800000000, undefined], [6.900000000, undefined], [7.000000000, undefined], [7.100000000, undefined], [7.200000000, undefined], [7.300000000, undefined], [7.400000000, undefined], [7.500000000, undefined], [7.600000000, undefined], [7.700000000, undefined], [7.800000000, undefined], [7.900000000, undefined], [8.000000000, undefined], [8.100000000, undefined], [8.200000000, undefined], [8.300000000, undefined], [8.400000000, undefined], [8.500000000, undefined], [8.600000000, undefined], [8.700000000, undefined], [8.800000000, undefined], [8.900000000, undefined], [9.000000000, undefined], [9.100000000, undefined], [9.200000000, undefined], [9.300000000, undefined], [9.400000000, undefined], [9.500000000, undefined], [9.600000000, undefined], [9.700000000, undefined], [9.800000000, undefined], [9.900000000, undefined], [10.00000000, undefined], [10.10000000, undefined], [10.20000000, undefined], [10.30000000, undefined], [10.40000000, undefined], [10.50000000, undefined], [10.60000000, undefined], [10.70000000, undefined], [10.80000000, undefined], [10.90000000, undefined], [11.00000000, undefined], [11.10000000, undefined], [11.20000000, undefined], [11.30000000, undefined], [11.40000000, undefined], [11.50000000, undefined], [11.60000000, undefined], [11.70000000, undefined], [11.80000000, undefined], [11.90000000, undefined], [12.00000000, undefined], [12.10000000, undefined], [12.20000000, undefined], [12.30000000, undefined], [12.40000000, undefined], [12.50000000, undefined], [12.60000000, undefined], [12.70000000, undefined], [12.80000000, undefined], [12.90000000, undefined], [13.00000000, undefined], [13.10000000, undefined], [13.20000000, undefined], [13.30000000, undefined], [13.40000000, undefined], [13.50000000, undefined], [13.60000000, undefined], [13.70000000, undefined], [13.80000000, undefined], [13.90000000, undefined], [14.00000000, undefined], [14.10000000, undefined], [14.20000000, undefined], [14.30000000, undefined], [14.40000000, undefined], [14.50000000, undefined], [14.60000000, undefined], [14.70000000, undefined], [14.80000000, undefined], [14.90000000, undefined], [15.00000000, undefined], [15.10000000, undefined], [15.20000000, undefined], [15.30000000, undefined], [15.40000000, undefined], [15.50000000, undefined], [15.60000000, undefined], [15.70000000, undefined], [15.80000000, undefined], [15.90000000, undefined], [16.00000000, undefined], [16.10000000, undefined], [16.20000000, undefined], [16.30000000, undefined], [16.40000000, undefined], [16.50000000, undefined], [16.60000000, undefined], [16.70000000, undefined], [16.80000000, undefined], [16.90000000, undefined], [17.00000000, undefined], [17.10000000, undefined], [17.20000000, undefined], [17.30000000, undefined], [17.40000000, undefined], [17.50000000, undefined], [17.60000000, undefined], [17.70000000, undefined], [17.80000000, undefined], [17.90000000, undefined], [18.00000000, undefined], [18.10000000, undefined], [18.20000000, undefined], [18.30000000, undefined], [18.40000000, undefined], [18.50000000, undefined], [18.60000000, undefined], [18.70000000, undefined], [18.80000000, undefined], [18.90000000, undefined], [19.00000000, undefined], [19.10000000, undefined], [19.20000000, undefined], [19.30000000, undefined], [19.40000000, undefined], [19.50000000, undefined], [19.60000000, undefined], [19.70000000, undefined], [19.80000000, undefined], [19.90000000, undefined], [20.00000000, undefined], [20.10000000, undefined], [20.20000000, undefined], [20.30000000, undefined], [20.40000000, undefined], [20.50000000, undefined], [20.60000000, undefined], [20.70000000, undefined], [20.80000000, undefined], [20.90000000, undefined], [21.00000000, undefined], [21.10000000, undefined], [21.20000000, undefined], [21.30000000, undefined], [21.40000000, undefined], [21.50000000, undefined], [21.60000000, undefined], [21.70000000, undefined], [21.80000000, undefined], [21.90000000, undefined], [22.00000000, undefined], [22.10000000, undefined], [22.20000000, undefined], [22.30000000, undefined], [22.40000000, undefined], [22.50000000, undefined], [22.60000000, undefined], [22.70000000, undefined], [22.80000000, undefined], [22.90000000, undefined], [23.00000000, undefined], [23.10000000, undefined], [23.20000000, undefined], [23.30000000, undefined], [23.40000000, undefined], [23.50000000, undefined], [23.60000000, undefined], [23.70000000, undefined], [23.80000000, undefined], [23.90000000, undefined], [24.00000000, undefined], [24.10000000, undefined], [24.20000000, undefined], [24.30000000, undefined], [24.40000000, undefined], [24.50000000, undefined], [24.60000000, undefined], [24.70000000, undefined], [24.80000000, undefined], [24.90000000, undefined], [25.00000000, undefined], [25.10000000, undefined], [25.20000000, undefined], [25.30000000, undefined], [25.40000000, undefined], [25.50000000, undefined], [25.60000000, undefined], [25.70000000, undefined], [25.80000000, undefined], [25.90000000, undefined], [26.00000000, undefined], [26.10000000, undefined], [26.20000000, undefined], [26.30000000, undefined], [26.40000000, undefined], [26.50000000, undefined], [26.60000000, undefined], [26.70000000, undefined], [26.80000000, undefined], [26.90000000, undefined], [27.00000000, undefined], [27.10000000, undefined], [27.20000000, undefined], [27.30000000, undefined], [27.40000000, undefined], [27.50000000, undefined], [27.60000000, undefined], [27.70000000, undefined], [27.80000000, undefined], [27.90000000, undefined], [28.00000000, undefined], [28.10000000, undefined], [28.20000000, undefined], [28.30000000, undefined], [28.40000000, undefined], [28.50000000, undefined], [28.60000000, undefined], [28.70000000, undefined], [28.80000000, undefined], [28.90000000, undefined], [29.00000000, undefined], [29.10000000, undefined], [29.20000000, undefined], [29.30000000, undefined], [29.40000000, undefined], [29.50000000, undefined], [29.60000000, undefined], [29.70000000, undefined], [29.80000000, undefined], [29.90000000, undefined], [30.00000000, undefined], [30.10000000, undefined], [30.20000000, undefined], [30.30000000, undefined], [30.40000000, undefined], [30.50000000, undefined], [30.60000000, undefined], [30.70000000, undefined], [30.80000000, undefined], [30.90000000, undefined], [31.00000000, undefined], [31.10000000, undefined], [31.20000000, undefined], [31.30000000, undefined], [31.40000000, undefined], [31.50000000, undefined], [31.60000000, undefined], [31.70000000, undefined], [31.80000000, undefined], [31.90000000, undefined], [32.00000000, undefined], [32.10000000, undefined], [32.20000000, undefined], [32.30000000, undefined], [32.40000000, undefined], [32.50000000, undefined], [32.60000000, undefined], [32.70000000, undefined], [32.80000000, undefined], [32.90000000, undefined], [33.00000000, undefined], [33.10000000, undefined], [33.20000000, undefined], [33.30000000, undefined], [33.40000000, undefined], [33.50000000, undefined], [33.60000000, undefined], [33.70000000, undefined], [33.80000000, undefined], [33.90000000, undefined], [34.00000000, undefined], [34.10000000, undefined], [34.20000000, undefined], [34.30000000, undefined], [34.40000000, undefined], [34.50000000, undefined], [34.60000000, undefined], [34.70000000, undefined], [34.80000000, undefined], [34.90000000, undefined], [35.00000000, undefined], [35.10000000, undefined], [35.20000000, undefined], [35.30000000, undefined], [35.40000000, undefined], [35.50000000, undefined], [35.60000000, undefined], [35.70000000, undefined], [35.80000000, undefined], [35.90000000, undefined], [36.00000000, undefined], [36.10000000, undefined], [36.20000000, undefined], [36.30000000, undefined], [36.40000000, undefined], [36.50000000, undefined], [36.60000000, undefined], [36.70000000, undefined], [36.80000000, undefined], [36.90000000, undefined], [37.00000000, undefined], [37.10000000, undefined], [37.20000000, undefined], [37.30000000, undefined], [37.40000000, undefined], [37.50000000, undefined], [37.60000000, undefined], [37.70000000, undefined], [37.80000000, undefined], [37.90000000, undefined], [38.00000000, undefined], [38.10000000, undefined], [38.20000000, undefined], [38.30000000, undefined], [38.40000000, undefined], [38.50000000, undefined], [38.60000000, undefined], [38.70000000, undefined], [38.80000000, undefined], [38.90000000, undefined], [39.00000000, undefined], [39.10000000, undefined], [39.20000000, undefined], [39.30000000, undefined], [39.40000000, undefined], [39.50000000, undefined], [39.60000000, undefined], [39.70000000, undefined], [39.80000000, undefined], [39.90000000, undefined], [40.00000000, undefined], [40.10000000, undefined], [40.20000000, undefined], [40.30000000, undefined], [40.40000000, undefined], [40.50000000, undefined], [40.60000000, undefined], [40.70000000, undefined], [40.80000000, undefined], [40.90000000, undefined], [41.00000000, undefined], [41.10000000, undefined], [41.20000000, undefined], [41.30000000, undefined], [41.40000000, undefined], [41.50000000, undefined], [41.60000000, undefined], [41.70000000, undefined], [41.80000000, undefined], [41.90000000, undefined], [42.00000000, undefined], [42.10000000, undefined], [42.20000000, undefined], [42.30000000, undefined], [42.40000000, undefined], [42.50000000, undefined], [42.60000000, undefined], [42.70000000, undefined], [42.80000000, undefined], [42.90000000, undefined], [43.00000000, undefined], [43.10000000, undefined], [43.20000000, undefined], [43.30000000, undefined], [43.40000000, undefined], [43.50000000, undefined], [43.60000000, undefined], [43.70000000, undefined], [43.80000000, undefined], [43.90000000, undefined], [44.00000000, undefined], [44.10000000, undefined], [44.20000000, undefined], [44.30000000, undefined], [44.40000000, undefined], [44.50000000, undefined], [44.60000000, undefined], [44.70000000, undefined], [44.80000000, undefined], [44.90000000, undefined], [45.00000000, undefined], [45.10000000, undefined], [45.20000000, undefined], [45.30000000, undefined], [45.40000000, undefined], [45.50000000, undefined], [45.60000000, undefined], [45.70000000, undefined], [45.80000000, undefined], [45.90000000, undefined], [46.00000000, undefined], [46.10000000, undefined], [46.20000000, undefined], [46.30000000, undefined], [46.40000000, undefined], [46.50000000, undefined], [46.60000000, undefined], [46.70000000, undefined], [46.80000000, undefined], [46.90000000, undefined], [47.00000000, undefined], [47.10000000, undefined], [47.20000000, undefined], [47.30000000, undefined], [47.40000000, undefined], [47.50000000, undefined], [47.60000000, undefined], [47.70000000, undefined], [47.80000000, undefined], [47.90000000, undefined], [48.00000000, undefined], [48.10000000, undefined], [48.20000000, undefined], [48.30000000, undefined], [48.40000000, undefined], [48.50000000, undefined], [48.60000000, undefined], [48.70000000, undefined], [48.80000000, undefined], [48.90000000, undefined], [49.00000000, undefined], [49.10000000, undefined], [49.20000000, undefined], [49.30000000, undefined], [49.40000000, undefined], [49.50000000, undefined], [49.60000000, undefined], [49.70000000, undefined], [49.80000000, undefined], [49.90000000, undefined], [50.00000000, undefined], [50.10000000, undefined], [50.20000000, undefined], [50.30000000, undefined], [50.40000000, undefined], [50.50000000, undefined], [50.60000000, undefined], [50.70000000, undefined], [50.80000000, undefined], [50.90000000, undefined], [51.00000000, undefined], [51.10000000, undefined], [51.20000000, undefined], [51.30000000, undefined], [51.40000000, undefined], [51.50000000, undefined], [51.60000000, undefined], [51.70000000, undefined], [51.80000000, undefined], [51.90000000, undefined], [52.00000000, undefined], [52.10000000, undefined], [52.20000000, undefined], [52.30000000, undefined], [52.40000000, undefined], [52.50000000, undefined], [52.60000000, undefined], [52.70000000, undefined], [52.80000000, undefined], [52.90000000, undefined], [53.00000000, undefined], [53.10000000, undefined], [53.20000000, undefined], [53.30000000, undefined], [53.40000000, undefined], [53.50000000, undefined], [53.60000000, undefined], [53.70000000, undefined], [53.80000000, undefined], [53.90000000, undefined], [54.00000000, undefined], [54.10000000, undefined], [54.20000000, undefined], [54.30000000, undefined], [54.40000000, undefined], [54.50000000, undefined], [54.60000000, undefined], [54.70000000, undefined], [54.80000000, undefined], [54.90000000, undefined], [55.00000000, undefined], [55.10000000, undefined], [55.20000000, undefined], [55.30000000, undefined], [55.40000000, undefined], [55.50000000, undefined], [55.60000000, undefined], [55.70000000, undefined], [55.80000000, undefined], [55.90000000, undefined], [56.00000000, undefined], [56.10000000, undefined], [56.20000000, undefined], [56.30000000, undefined], [56.40000000, undefined], [56.50000000, undefined], [56.60000000, undefined], [56.70000000, undefined], [56.80000000, undefined], [56.90000000, undefined], [57.00000000, undefined], [57.10000000, undefined], [57.20000000, undefined], [57.30000000, undefined], [57.40000000, undefined], [57.50000000, undefined], [57.60000000, undefined], [57.70000000, undefined], [57.80000000, undefined], [57.90000000, undefined], [58.00000000, undefined], [58.10000000, undefined], [58.20000000, undefined], [58.30000000, undefined], [58.40000000, undefined], [58.50000000, undefined], [58.60000000, undefined], [58.70000000, undefined], [58.80000000, undefined], [58.90000000, undefined], [59.00000000, undefined], [59.10000000, undefined], [59.20000000, undefined], [59.30000000, undefined], [59.40000000, undefined], [59.50000000, undefined], [59.60000000, undefined], [59.70000000, undefined], [59.80000000, undefined], [59.90000000, undefined], [60.00000000, undefined], [60.10000000, undefined], [60.20000000, undefined], [60.30000000, undefined], [60.40000000, undefined], [60.50000000, undefined], [60.60000000, undefined], [60.70000000, undefined], [60.80000000, undefined], [60.90000000, undefined], [61.00000000, undefined], [61.10000000, undefined], [61.20000000, undefined], [61.30000000, undefined], [61.40000000, undefined], [61.50000000, undefined], [61.60000000, undefined], [61.70000000, undefined], [61.80000000, undefined], [61.90000000, undefined], [62.00000000, undefined], [62.10000000, undefined], [62.20000000, undefined], [62.30000000, undefined], [62.40000000, undefined], [62.50000000, undefined], [62.60000000, undefined], [62.70000000, undefined], [62.80000000, undefined], [62.90000000, undefined], [63.00000000, undefined], [63.10000000, undefined], [63.20000000, undefined], [63.30000000, undefined], [63.40000000, undefined], [63.50000000, undefined], [63.60000000, undefined], [63.70000000, undefined], [63.80000000, undefined], [63.90000000, undefined], [64.00000000, undefined], [64.10000000, undefined], [64.20000000, undefined], [64.30000000, undefined], [64.40000000, undefined], [64.50000000, undefined], [64.60000000, undefined], [64.70000000, undefined], [64.80000000, undefined], [64.90000000, undefined], [65.00000000, undefined], [65.10000000, undefined], [65.20000000, undefined], [65.30000000, undefined], [65.40000000, undefined], [65.50000000, undefined], [65.60000000, undefined], [65.70000000, undefined], [65.80000000, undefined], [65.90000000, undefined], [66.00000000, undefined], [66.10000000, undefined], [66.20000000, undefined], [66.30000000, undefined], [66.40000000, undefined], [66.50000000, undefined], [66.60000000, undefined], [66.70000000, undefined], [66.80000000, undefined], [66.90000000, undefined], [67.00000000, undefined], [67.10000000, undefined], [67.20000000, undefined], [67.30000000, undefined], [67.40000000, undefined], [67.50000000, undefined], [67.60000000, undefined], [67.70000000, undefined], [67.80000000, undefined], [67.90000000, undefined], [68.00000000, undefined], [68.10000000, undefined], [68.20000000, undefined], [68.30000000, undefined], [68.40000000, undefined], [68.50000000, undefined], [68.60000000, undefined], [68.70000000, undefined], [68.80000000, undefined], [68.90000000, undefined], [69.00000000, undefined], [69.10000000, undefined], [69.20000000, undefined], [69.30000000, undefined], [69.40000000, undefined], [69.50000000, undefined], [69.60000000, undefined], [69.70000000, undefined], [69.80000000, undefined], [69.90000000, undefined], [70.00000000, undefined], [70.10000000, undefined], [70.20000000, undefined], [70.30000000, undefined], [70.40000000, undefined], [70.50000000, undefined], [70.60000000, undefined], [70.70000000, undefined], [70.80000000, undefined], [70.90000000, undefined], [71.00000000, undefined], [71.10000000, undefined], [71.20000000, undefined], [71.30000000, undefined], [71.40000000, undefined], [71.50000000, undefined], [71.60000000, undefined], [71.70000000, undefined], [71.80000000, undefined], [71.90000000, undefined], [72.00000000, undefined], [72.10000000, undefined], [72.20000000, undefined], [72.30000000, undefined], [72.40000000, undefined], [72.50000000, undefined], [72.60000000, undefined], [72.70000000, undefined], [72.80000000, undefined], [72.90000000, undefined], [73.00000000, undefined], [73.10000000, undefined], [73.20000000, undefined], [73.30000000, undefined], [73.40000000, undefined], [73.50000000, undefined], [73.60000000, undefined], [73.70000000, undefined], [73.80000000, undefined], [73.90000000, undefined], [74.00000000, undefined], [74.10000000, undefined], [74.20000000, undefined], [74.30000000, undefined], [74.40000000, undefined], [74.50000000, undefined], [74.60000000, undefined], [74.70000000, undefined], [74.80000000, undefined], [74.90000000, undefined], [75.00000000, undefined], [75.10000000, undefined], [75.20000000, undefined], [75.30000000, undefined], [75.40000000, undefined], [75.50000000, undefined], [75.60000000, undefined], [75.70000000, undefined], [75.80000000, undefined], [75.90000000, undefined], [76.00000000, undefined], [76.10000000, undefined], [76.20000000, undefined], [76.30000000, undefined], [76.40000000, undefined], [76.50000000, undefined], [76.60000000, undefined], [76.70000000, undefined], [76.80000000, undefined], [76.90000000, undefined], [77.00000000, undefined], [77.10000000, undefined], [77.20000000, undefined], [77.30000000, undefined], [77.40000000, undefined], [77.50000000, undefined], [77.60000000, undefined], [77.70000000, undefined], [77.80000000, undefined], [77.90000000, undefined], [78.00000000, undefined], [78.10000000, undefined], [78.20000000, undefined], [78.30000000, undefined], [78.40000000, undefined], [78.50000000, undefined], [78.60000000, undefined], [78.70000000, undefined], [78.80000000, undefined], [78.90000000, undefined], [79.00000000, undefined], [79.10000000, undefined], [79.20000000, undefined], [79.30000000, undefined], [79.40000000, undefined], [79.50000000, undefined], [79.60000000, undefined], [79.70000000, undefined], [79.80000000, undefined], [79.90000000, undefined], [80.00000000, undefined], [80.10000000, undefined], [80.20000000, undefined], [80.30000000, undefined], [80.40000000, undefined], [80.50000000, undefined], [80.60000000, undefined], [80.70000000, undefined], [80.80000000, undefined], [80.90000000, undefined], [81.00000000, undefined], [81.10000000, undefined], [81.20000000, undefined], [81.30000000, undefined], [81.40000000, undefined], [81.50000000, undefined], [81.60000000, undefined], [81.70000000, undefined], [81.80000000, undefined], [81.90000000, undefined], [82.00000000, undefined], [82.10000000, undefined], [82.20000000, undefined], [82.30000000, undefined], [82.40000000, undefined], [82.50000000, undefined], [82.60000000, undefined], [82.70000000, undefined], [82.80000000, undefined], [82.90000000, undefined], [83.00000000, undefined], [83.10000000, undefined], [83.20000000, undefined], [83.30000000, undefined], [83.40000000, undefined], [83.50000000, undefined], [83.60000000, undefined], [83.70000000, undefined], [83.80000000, undefined], [83.90000000, undefined], [84.00000000, undefined], [84.10000000, undefined], [84.20000000, undefined], [84.30000000, undefined], [84.40000000, undefined], [84.50000000, undefined], [84.60000000, undefined], [84.70000000, undefined], [84.80000000, undefined], [84.90000000, undefined], [85.00000000, undefined], [85.10000000, undefined], [85.20000000, undefined], [85.30000000, undefined], [85.40000000, undefined], [85.50000000, undefined], [85.60000000, undefined], [85.70000000, undefined], [85.80000000, undefined], [85.90000000, undefined], [86.00000000, undefined], [86.10000000, undefined], [86.20000000, undefined], [86.30000000, undefined], [86.40000000, undefined], [86.50000000, undefined], [86.60000000, undefined], [86.70000000, undefined], [86.80000000, undefined], [86.90000000, undefined], [87.00000000, undefined], [87.10000000, undefined], [87.20000000, undefined], [87.30000000, undefined], [87.40000000, undefined], [87.50000000, undefined], [87.60000000, undefined], [87.70000000, undefined], [87.80000000, undefined], [87.90000000, undefined], [88.00000000, undefined], [88.10000000, undefined], [88.20000000, undefined], [88.30000000, undefined], [88.40000000, undefined], [88.50000000, undefined], [88.60000000, undefined], [88.70000000, undefined], [88.80000000, undefined], [88.90000000, undefined], [89.00000000, undefined], [89.10000000, undefined], [89.20000000, undefined], [89.30000000, undefined], [89.40000000, undefined], [89.50000000, undefined], [89.60000000, undefined], [89.70000000, undefined], [89.80000000, undefined], [89.90000000, undefined], [90.00000000, undefined], [90.10000000, undefined], [90.20000000, undefined], [90.30000000, undefined], [90.40000000, undefined], [90.50000000, undefined], [90.60000000, undefined], [90.70000000, undefined], [90.80000000, undefined], [90.90000000, undefined], [91.00000000, undefined], [91.10000000, undefined], [91.20000000, undefined], [91.30000000, undefined], [91.40000000, undefined], [91.50000000, undefined], [91.60000000, undefined], [91.70000000, undefined], [91.80000000, undefined], [91.90000000, undefined], [92.00000000, undefined], [92.10000000, undefined], [92.20000000, undefined], [92.30000000, undefined], [92.40000000, undefined], [92.50000000, undefined], [92.60000000, undefined], [92.70000000, undefined], [92.80000000, undefined], [92.90000000, undefined], [93.00000000, undefined], [93.10000000, undefined], [93.20000000, undefined], [93.30000000, undefined], [93.40000000, undefined], [93.50000000, undefined], [93.60000000, undefined], [93.70000000, undefined], [93.80000000, undefined], [93.90000000, undefined], [94.00000000, undefined], [94.10000000, undefined], [94.20000000, undefined], [94.30000000, undefined], [94.40000000, undefined], [94.50000000, undefined], [94.60000000, undefined], [94.70000000, undefined], [94.80000000, undefined], [94.90000000, undefined], [95.00000000, undefined], [95.10000000, undefined], [95.20000000, undefined], [95.30000000, undefined], [95.40000000, undefined], [95.50000000, undefined], [95.60000000, undefined], [95.70000000, undefined], [95.80000000, undefined], [95.90000000, undefined], [96.00000000, undefined], [96.10000000, undefined], [96.20000000, undefined], [96.30000000, undefined], [96.40000000, undefined], [96.50000000, undefined], [96.60000000, undefined], [96.70000000, undefined], [96.80000000, undefined], [96.90000000, undefined], [97.00000000, undefined], [97.10000000, undefined], [97.20000000, undefined], [97.30000000, undefined], [97.40000000, undefined], [97.50000000, undefined], [97.60000000, undefined], [97.70000000, undefined], [97.80000000, undefined], [97.90000000, undefined], [98.00000000, undefined], [98.10000000, undefined], [98.20000000, undefined], [98.30000000, undefined], [98.40000000, undefined], [98.50000000, undefined], [98.60000000, undefined], [98.70000000, undefined], [98.80000000, undefined], [98.90000000, undefined], [99.00000000, undefined], [99.10000000, undefined], [99.20000000, undefined], [99.30000000, undefined], [99.40000000, undefined], [99.50000000, undefined], [99.60000000, undefined], [99.70000000, undefined], [99.80000000, undefined], [99.90000000, undefined], [100.0000000, undefined]], COLOUR(RGB, 1.00000000, 0., 0.), STYLE(LINE), THICKNESS(2)), AXESLABELS(t, a(t)), VIEW(0. .. 100., 167000000. .. 170000000.))

 

Warning, plot may be incomplete, the following errors(s) were issued:
   cannot evaluate the solution further right of .33370860e-5, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
   cannot evaluate the solution further right of .33370860e-5, probably a singularity

Warning, plot may be incomplete, the following errors(s) were issued:
   cannot evaluate the solution further right of .33370860e-5, probably a singularity

 

SIRsys; a(0);g(0);v(0); m(0);

dsolve([SIRsys[], a(0) = 0.17e9, g(0) = 0, v(0) = 4, m(0) = 2]);

[diff(a(t), t) = 10-0.34e-1*a(t)*g(t)-0.25e-1*a(t)*v(t)/(v(t)+.12)-0.4e-3*a(t)+.7902*m(t), diff(g(t), t) = 0.34e-1*a(t)*g(t)-0.25e-1*a(t)*v(t)/(v(t)+.12)-.110536*g(t), diff(v(t), t) = 0.5e-1*g(t)-.834*v(t), diff(m(t), t) = .11*g(t)-.7906*m(t)]

 

a(0)

 

g(0)

 

v(0)

 

m(0)

(2)

p1:=pointplot(L, color=blue, symbol=diamond):
display([p1,aplot]);

Error, (in plots:-display) cannot make plot structure from object with name DE1plot

 

J := `<|>`(`<,>`(seq(i, i = 0 .. 100)), `<,>`(seq(C[i], i = 0 .. 100))); p2 := pointplot(J, color = blue, symbol = soliddiamond); display([p2, gplot])

Matrix(%id = 18446744074240523190)

 

Error, (in plots:-display) cannot make plot structure from object with name DE2plot

 

NULL


 

Download corrections2.mw

@tomleslie thanks very much for being patient with me( a maple beginner). i am sending a code that ran successfully please compare with mine for futher assistance
 

 

restart:

H[0]:= 1.7e8:  J[0]:=0:  V[0]:=400:
#Digits:=10:
unprotect('gamma');
lambda:=5e5:
mu:=0.003:
beta:=4e-10:
delta:=0:
alpha:=0.043:
sigma:=alpha+delta:
k:=6.24:
gamma:=0.65:
A1:=1:
A2:=1:

h:=1:

#Step 1
n:=100:
 lambda__1[n]:= 0:   lambda__2[n]:= 0:   lambda__3[n]:= 0:
u__1[0]:= 0:  u__2[0]:= 0:

for i from 0 to n-1 do
     H[i+1]:=(H[i]+delta*J[i]*h+lambda*h)/(1+mu*h+beta*V[i]*h*(1-u__1[i]));
     J[i+1]:= (J[i]+beta*H[i+1]*V[i]*h*(1-u__1[i]))/(sigma*h+1);
     V[i+1]:=(V[i]+k*J[i+1]*h*(1-u__2[i]))/(1+gamma*h);
lambda__1[n-i-1]:= -(-lambda__1[n-i]-lambda__2[n-i]*beta*V[i+1]*h+lambda__2[n-i]*beta*V[i+1]*h*u__1[i]-h)/(mu*h+beta*V[i+1]*h-beta*V[i+1]*h*u__1[i]+1);
     lambda__2[n-i-1]:= -(-lambda__2[n-i]-lambda__1[n-i-1]*delta*h-lambda__3[n-i]*k*h+lambda__3[n-i]*k*h*u__2[i])/(1+sigma*h);
     lambda__3[n-i-1]:= (lambda__3[n-i]-lambda__1[n-i-1]*beta*H[i+1]*h+lambda__1[n-i-1]*beta*H[i+1]*h*u__1[i]+lambda__2[n-i-1]*beta*H[i+1]*h-lambda__2[n-i-1]*beta*H[i+1]*h*u__1[i])/(1+gamma*h);
     R1:= (1/A1)*(lambda__1[n-i-1]-lambda__2[n-i-1])*beta*V[i+1]*H[i+1];
     R2:= -(1/A2)*lambda__3[n-i-1]*k*J[i+1];
     u__1[i+1]:= min(1, max(R1,0));
     u__2[i+1]:= min(1, max(R2,0));
    end do:

seq(i,i=0..30):
seq(H[i],i=0..30):

with(plots):

with(DEtools):

DE1 := diff(s(t),t)=lambda-mu*s(t)-beta*s(t)*r(t)+delta*g(t);
DE2 := diff(g(t),t)=beta*s(t)*r(t)-sigma*g(t);
DE3 := diff(r(t),t)=k*g(t)-gamma*r(t);

SIRsys:= [DE1, DE2, DE3];

splot:=DEplot(SIRsys, [s(t),g(t),r(t)], t = 0..100,s=1.67e8..1.7e8,[[s(0)=1.7e8,g(0)=0,r(0)=400]], scene=[t,s(t)], thickness=2, linecolor=red, stepsize=0.1):
gplot:=DEplot(SIRsys, [s(t),g(t),r(t)], t = 0..100,g=0..400, [[s(0)=1.7e8,g(0)=0,r(0)=400]], scene=[t,g(t)], thickness=2, linecolor=red, stepsize=0.1):

rplot:=DEplot(SIRsys, [s(t),g(t),r(t)], t = 0..100,r=0..1e3,[[s(0)=1.7e8,g(0)=0,r(0)=400]], scene=[t,r(t)], thickness=2, linecolor=red, stepsize=0.1):

A:=<<seq(i,i=0..100)>|<seq(H[i],i=0..100)>>;
#points:= {seq(H[i],i=0..100)};

diff(s(t), t) = 0.5e6-0.3e-2*s(t)-0.4e-9*s(t)*r(t)

diff(g(t), t) = 0.4e-9*s(t)*r(t)-0.43e-1*g(t)

diff(r(t), t) = 6.24*g(t)-.65*r(t)

[diff(s(t), t) = 0.5e6-0.3e-2*s(t)-0.4e-9*s(t)*r(t), diff(g(t), t) = 0.4e-9*s(t)*r(t)-0.43e-1*g(t), diff(r(t), t) = 6.24*g(t)-.65*r(t)]

Matrix(%id = 18446744074227558990)

(1)

p1:=pointplot(A, color=blue, symbol=diamond):
display([p1,splot]);

 

B:=<<seq(i,i=0..100)>|<seq(J[i],i=0..100)>>;
#points:= {seq(J[i],i=0..100)};
p2:=pointplot(B, color=blue, symbol=soliddiamond):
display([p2,gplot]);

Matrix(%id = 18446744074227559950)

 

C:=<<seq(i,i=0..100)>|<seq(V[i],i=0..100)>>;
#points:= {seq(V[i],i=0..100)};
p3:=pointplot(C, color=blue, symbol=diamond):
display([p3,rplot]);

Matrix(%id = 18446744074227552614)

 

DD:=<<seq(i,i=0..100)>|<seq(u__1[i],i=0..100)>>;
#points:= {seq(u__1[i],i=0..100)};
pointplot(DD, color=black, symbol=diamond);

Matrix(%id = 18446744074227553454)

 

E:=<<seq(i,i=0..100)>|<seq(u__2[i],i=0..100)>>;
#points:= {seq(u__2[i],i=0..100)};
pointplot(E, color=blue, symbol=diamond);

Matrix(%id = 18446744074227554054)

 

 

 

 

 

 

 

 

 

 

 

`?`

(2)

%?


 

Download The_improved_GSS1_method1.mws

#Great job done by @tomleslie4564, thank you.
 

restart:

B[0]:= 1.7e8:  C[0]:=0:  P[0]:=400: E[0]:=20
#Digits:=10:
unprotect('gamma'):


 A__h := 10:
 beta__1 := 0.34e-1:
 psi__o := 0.25e-1:
mu := 0.4e-3:
theta := .7902:
 alpha := .11:
 k := 0.136e-3:
 z := 0.5e-1:
delta := .7:
eta := .134:
 xi := .12:
beta := 0.1e-1:
Q1 := 1:
Q2 := 1:
h := .1:

 

Error, missing operator or `;`

 

#Step 1
n:=100:
lambda__1[n] := 0: lambda__2[n] := 0: lambda__3[n] := 0: lambda__4[n] := 0: u__o[0] := 0:

for i from 0 to n-1 do

     B[i+1] := h*(theta*E[i]+A__h+B[i])/(1+ psi__o*h*P[i])/(P[i]+xi)+mu+u__[o][i]+beta*C[i];
     C[i+1] := h*B[i+1](beta*C[i]-psi[o]*P[i])/(P[i]+xi)-(alpha+mu+k)*C[i+1];
     P[i+1] := h*z*C[i+1]/(1+delta+eta);
     E[i+1] := h*(alpha*C[i+1]+B[i+1]*u__[o][i]+E[i])/(1+theta+mu);


     lambda__1[n-i-1] := -h*(Q1+(beta*C[i]+(psi__o*P[i]/(P[i]+xi)))*lambda__2[n-i]-lambda__1[n-i]-mu+u__o[i]/(1+beta*C        [i]+P[i]/(P[i]+xi));

     lambda__2[n-i-1] := -h*(-beta*B[i+1]*lambda__1[n-i-1]+Q2-alpha-mu-kappa+z*lambda__3[n-i]+alpha*lambda__4[n-i]-           lambda__2[n-i])/(-beta*B[i+1]+1);

     lambda__3[n-i-1] := h*((psi__o*B[i+1]*P[i+1]/(P[i+1]+xi)^2+theta)*lambda__1[n-i-1]-lambda__2[n-i-1]*psi__o*B[i+1]*P      [i+1]/(P[i+1]+xi)^2-lambda__3[n-i])/(1+delta+eta);

     lambda__4[n-i-1] := h*lambda__4[n-i]/(1-theta-mu);

     R1:= (lambda__1[n-i-1]-lambda__4[n-i-1])*B[i+1]/tau;
    
      u__o[i+1] := min(1, max(R1, 0));
    
    end do:

Error, `;` unexpected

 

seq(i,i=0..30):
seq(B[i],i=0..30):

with(plots):

with(DEtools):

DE1 := diff(a(t),t) = A__h-beta__1*a(t)*g(t)-psi__o*a(t)*h(t)/(h(t)+xi)-mu*a(t)+theta*m(t);
DE2 := diff(g(t),t) = beta__1*a(t)*g(t)-psi__o*a(t)*h(t)/(h(t)+xi)-(alpha+mu+k)*g(t);
DE3 := diff(h(t),t) = z*g(t)-(delta+eta)*h(t);
DE4 := diff(m(t),t) = alpha*g(t)-(theta+mu)*m(t);

SIRsys := [DE1, DE2, DE3, DE4];

aplot := DE1plot(SIRsys, [a(t), g(t), h(t), m(t)], t = 0 .. 100, a = 0.167e9 .. 0.17e9, [[a(0) = 0.17e9, g(0) = 0, h(0) = 400, m(0) = 20]], scene = [t, a(t)], thickness = 2, linecolor = red, stepsize = .1):

gplot := DE2plot(SIRsys, [a(t), g(t), h(t), m(t)], t = 0 .. 100, g = 0 .. 400, [[a(0) = 0.17e9, g(0) = 0, h(0) = 400, m(0) = 20]], scene = [t, g(t)], thickness = 2, linecolor = red, stepsize = .1):

hplot := DE3plot(SIRsys, [a(t), g(t), h(t), m(t)], t = 0 .. 100, h = 0 .. 0.1e4, [[a(0) = 0.17e9, g(0) = 0, h(0) = 400, m(0) = 20]], scene = [t, h(t)], thickness = 2, linecolor = red, stepsize = .1):

mplot := DE4plot(SIRsys, [a(t), g(t), h(t), m(t)], t = 0 .. 100, m = 0 .. 0.1e4, [[a(0) = 0.17e9, g(0) = 0, h(0) = 400, m(0) = 20]], scene = [t, m(t)], thickness = 2, linecolor = red, stepsize = .1):



L:=<<seq(i,i=0..100)>|<seq(B[i],i=0..100)>>:
#points:= {seq(B[i],i=0..100)};
 

diff(a(t), t) = A__h-beta__1*a(t)*g(t)-psi__o*a(t)*h(t)/(h(t)+xi)-mu*a(t)+theta*m(t)

 

diff(g(t), t) = beta__1*a(t)*g(t)-psi__o*a(t)*h(t)/(h(t)+xi)-(alpha+mu+k)*g(t)

 

diff(h(t), t) = z*g(t)-(delta+eta)*h(t)

 

diff(m(t), t) = alpha*g(t)-(theta+mu)*m(t)

 

[diff(a(t), t) = A__h-beta__1*a(t)*g(t)-psi__o*a(t)*h(t)/(h(t)+xi)-mu*a(t)+theta*m(t), diff(g(t), t) = beta__1*a(t)*g(t)-psi__o*a(t)*h(t)/(h(t)+xi)-(alpha+mu+k)*g(t), diff(h(t), t) = z*g(t)-(delta+eta)*h(t), diff(m(t), t) = alpha*g(t)-(theta+mu)*m(t)]

(1)

p1:=pointplot(L, color=blue, symbol=diamond):
display([p1,aplot]);

Error, (in plots:-pointplot) points cannot be converted to floating-point values

 

Error, (in plots:-display) expecting plot structures but received: [p1]

 

J := `<|>`(`<,>`(seq(i, i = 0 .. 100)), `<,>`(seq(C[i], i = 0 .. 100))); p2 := pointplot(J, color = blue, symbol = soliddiamond); display([p2, gplot])

J := Vector(4, {(1) = ` 101 x 2 `*Matrix, (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

 

Error, (in plots:-pointplot) points cannot be converted to floating-point values

 

Error, (in plots:-display) expecting plot structures but received: [p2]

 

``


 

Download Iterative_scheme.mw

#Corrections have been made but i still have problems in running and plotting the code.
#The corrections are posted below

@tomleslie thanks very much

 

1 2 Page 1 of 2