# My coding shows error of tuple.How to avoid error of tuple?

``````import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt

#Volume of solution
V=100
#Density of Monomer
cp=48
#Density for Particular Dosage
cpdos=10
#Heat of Reaction
hrx=30

#Specific area coeffient for thermal conductivity
UA=320
#Temperature of dosage
Tdos=20
#Amount needed monomer and co-monomer
mdosco=40
mdosmo=40

#Cooling Jacket Temperature
Tc=100

#Mole fraction of monomer and co-monomer
Xm=20
XN=20

PNM=10

#Arhenieus Constants for rate equations
A1=3.85e7
A2=3.1e7
A3=1.15e8
#Activation Energy
E1=2.14e4
E2=4e4
E3=2.14e4
#Volume
Vw=10
Vp=1
#Gas Constatnt
R=8.314

def poly(Z,t,u):

#CColing Jacket Temperature
Tc=u

M=Z[0]
N=Z[1]
K=Z[2]
T=Z[3]

dMdt=mdosco+mdosmo
dNdt=((Xm+XN)/PNM)*dMdt
rpp=A1*2.718**(E1/R*T)
rpt=A2*2.718**(E2/R*T)
rpw=A3*2.718**(E3/R*T)
dKdt=dNdt-(rpp+rpt)*Vp-(rpw*Vw)
dTdt=(dMdt*cpdos*(Tdos-T)+(-hrx)*dKdt-UA*(T-Tc))

return (dTdt,dMdt,dKdt,dNdt)

#Initial Conditions
M_ss=1
N_ss=1
K_ss=1
T_ss=320

Z0=(1,1,1,320)

u_ss=300
t=np.linspace(0,10,11)
M=np.ones(len(t))*M_ss
N=np.ones(len(t))*N_ss
K=np.ones(len(t))*K_ss
T=np.ones(len(t))*T_ss
u=np.ones(len(t))*u_ss

for i in range (len(t)-1):
ts=[t[i],t[i+1]]

J=odeint(poly,Z0,ts,args=u[i])
M[i+1]=J[-1][0]
N[i+1]=J[-1][1]
K[i+1]=J[-1][2]
T[i+1]=J[-1][3]

Z0[0]=M[i+1]
Z0[1]=N[i+1]
Z0[2]=K[i+1]
Z0[3]=T[i+1]

plt.subplot (3,1,3)
plt.plot(ts[0:i+1],T[0:,i+1],'r-')
plt.xlabel('Time(Min)')
plt.ylabel('Temperature(C)')
plt.show()
``````