Question: I encountered syntax error of a differential equations plot. Please i also need help to plot a 3d graph of each state equations


 

  restart:

#
# Define gamma as local (don't like doing this!)
#
  local gamma:local pi:
#
# Replaced 'indexed' parameters with 'inert subscript'
# parameters - otherwise one gets a problem defining
# both the unindexed 'phi' and the indexed phi[c]
#
  M__h := 100: beta__o := 0.034: beta__j := .025: mu__1 := 0.0004:
  epsilon := .7902: alpha := 0.11: psi := 0.000136: phi := 0.05:
  omega := .7: eta := .134: delta := .245: f := 0.21:
  M__v := 1000: beta__k := 0.09:   mu__v := .0005: M__c := .636:
  beta__g := 0.15: mu__c := 0.0019: pi :=0.01231: theta := 0.12: mu__e := 0.005
#
# D() is Maple's differential operator replated D(T)
# with DD(T) in the following to avoid confusion
#
  ODE1 := diff(B(T), T) = M__h-beta__o*B(T)-beta__j*B(T)-mu__1*B(T)+epsilon*G(T)+alpha*F(T):
  ODE2 := diff(C(T), T) = beta__o*B(T)*J(T)-beta__j*C(T)-(psi+mu__1+phi)*C(T):
  ODE3 := diff(DD(T), T) = beta__j*B(T)*L(T)- beta_o*E(T)-(omega+mu__1+eta)*DD(T):
  ODE4 := diff(E(T), T) = beta_o*E(T)-beta__j*C(T)-(delta+mu__1+eta+phi)*E(T):
  ODE5 := diff(F(T), T) = psi*C(T)-(alpha+mu__1)*F(T)+f*delta*E(T):
  ODE6 := diff(G(T), T) = omega*DD(T)-(epsilon+mu__1)*G(T)+(1-f)*delta*E(T):
  ODE7 := diff(H(T), T) = M__v-beta__k*H(T)-mu__v*H(T):
  ODE8 := diff(J(T), T) = beta__k*H(T)-mu__v*J(T):
  ODE9 := diff(K(T), T) = M__c-beta__g*K(T)-mu__c*K(T):
  ODE10:= diff(L(T), T) = beta__g*K(T)-mu__c*L(T):
  ODE11:= diff(M(T), T) = pi*(DD(T)+ theta*E(T))-mu__e*M(T):

  B0 := 100: C0 := 90: D0 := 45: E0 := 38:
  F0 := 10: G0 := 45: H0 := 50: J0 := 70: K0 :=20: L0:= 65: M0 :=22:
#
# Solve system
#
  ans := dsolve( { ODE1, ODE2, ODE3, ODE4, ODE5, ODE6, ODE7, ODE8,
                   B(0) = B0, C(0) = C0, DD(0) = D0, E(0) = E0,
                   F(0) = F0, G(0) = G0, H(0) = H0, J(0) = J0, K(0) = K0, L(0) = L0, M(0) = M0,
                 },
                 numeric
               );
#
# Plot solutions for a few of the dependent variablss
# just to show everything is working (more-or-less!)
#
  plots:-odeplot( ans, [T, B(T)], T=0..5);
  plots:-odeplot( ans, [T, C(T)], T=0..5);
  plots:-odeplot( ans, [T, DD(T)], T=0..5);
  plots:-odeplot( ans, [T, E(T)], T=0..5);
  plots:-odeplot( ans, [T, F(T)], T=0..5);
  plots:-odeplot( ans, [T, G(T)], T=0..5);
  plots:-odeplot( ans, [T, H(T)], T=0..5);
  plots:-odeplot( ans, [T, J(T)], T=0..5);
  plots:-odeplot( ans, [T, K(T)], T=0..5);
  plots:-odeplot( ans, [T, L(T)], T=0..5);
  plots:-odeplot( ans, [T, M(T)], T=0..5);

Error, missing operator or `;`

 

``


 

Download MltxPLOTS.mw

Please Wait...