```# PC 204 Final Project
# Python 3.4
# Module 1

import math

class A(object):

La=0 #coefficient for oral absorption
L2=0 #coefficent for central compartment
L3=0 #coefficient for effect compartment
ka=0 #rate of absorption
k=0 #rate of elimination
keo=0 #theoretical rate constant from pharmacokinetics to pharmacodynamics
tau=0 #dosing interval

Cp = [] #plasma concentration
Ce = [] #concentration in the effect compartment
t = [] #time

def __init__(self, La, L2, ka, k, keo, tau):
self.La = float(La)
self.L2 = float(L2)
self.ka = float(ka)
self.k = float(k)
self.keo = float(keo)
self.tau = int(math.floor(float(tau)))

denominatorLae = self.keo-self.ka
if 0<=(self.keo - self.ka) < 0.01:
print("Warning: zero denominator")
denominatorLae = 0.01
if 0<(self.ka - self.keo) <0.01:
denominatorLae = -0.01
self.Lae = -self.La*self.keo/denominatorLae

denominatorL2e = self.keo-self.k

if 0<=(self.keo - self.k) < 0.01:
print("Warning: zero denominator")
denominatorL2e = 0.01
if 0<(self.ka - self.keo) <0.01:
denominatorL2e = -0.01
self.L2e =-self.L2*self.keo/denominatorL2e
self.L3e = self.La-self.L2
self.t = [x for x in range(0, self.tau)]
#self.Cp = []   #self.t
self.Ce = []    #self.t

# where the calculation is done
def calculate(self):
import math
for element in list(self.t):
##            self.Cp.append(self.L1 * math.exp(element * -self.ka) +
##                               self.L2 * math.exp(element * -self.k))

self.Ce.append(self.Lae * math.exp(element * -self.ka) +
self.L2e * math.exp(element * -self.k) +
self.L3e * math.exp(element * -self.keo))

Matrix = [[0 for x in range(2)] for x in range(len(self.t))]
for index_row in range(len(self.t)):
Matrix[index_row][0] = self.t[index_row]
Matrix[index_row][1] = self.Ce[index_row]
return Matrix
```