Poly (methyl methacrylate) (PMMA) is a transparent thermoplastic used in a wide range of fields including medicine, art, and aesthetics. It is also used as an alternative to glass due to its shatter-resistance property  . There has been a widespread need to use PMMA based components in Uganda especially for construction and medicine purposes, however advancing the technology that addresses industrial polymerization processes is often hampered by a lack of fundamental research activities in academic and the few industrial labs available in the country.
Industrially, PMMA is obtained from the free-radical polymerization of methyl methacrylate  which may be produced via methanolysis of methylcrylamide sulphate  . The polymerization reaction is commonly initiated by thermal radical forming agents often employing organic peroxy compounds and azo-compounds  . Suspension polymerization is used for the commercial production of many important polymers other than PMMA such as polyvinyl chloride and polystyrene  with similar properties to those produced from bulk polymerization. The limitations of increased viscosity, reaction temperature, and volume contraction in the latter process are always avoided  . The process may be described as being operated batch-wise however, in essence it is often in a semi-batch mode since some material enters the reactor after the start of polymerization.
During the process, the monomer is stirred with about twice its volume of water and dispersants forming droplet-like distribution of the monomer phase in water. The mechanism of polymerization corresponds to that of bulk polymerization and as such, the droplets become increasingly viscous during the course of polymerization. Distributors such as gelatin stabilize the suspension and prevent the droplets from adhering to one another during collisions. The system is heterogeneous therefore the polymer is collected as granular beads on completion of polymerization and it is washed to remove adhering distributor and salts then dried  .
Various works have been published on the modeling of methyl methacrylate polymerization processes. A major feature of these studies is the observation in the increase of the mass reaction viscosity with monomer conversion resulting into a deviation from the “normal” kinetic. The severe reduction in the mobility of the macroradicals auto accelerates the reaction causing an increase in the gel effect and a decrease in the termination rate constant. If the polymerization is carried out at lower temperatures, the glass effect occurs when the transition state is reached at a certain conversion causing a decrease in the propagation rate constant. This results in the interruption of the reaction before the monomer is completely consumed. The increased viscosity at high monomer conversion leads to a decrease in the initiator efficiency due to the cage effect  . In most of the reviewed works, gel and glass effects are modeled according to Chiu et al.  and the cage effect is modeled according to Achilias-Kiparissides  . Most of the models considered are reported to have worked well for MMA polymerization  , however the general model developed by Seth and Gupta  and reworked by Ghosh et al.  using free volume theory is noted as being most superior  . Several simulation packages to assess the performance of the models under consideration have been used such as MATLAB  , gPROMS  , FORTRAN  , which are based on utilization of sequential quadratic programming, ordinary differential equations and fuzzy-neural modeling.
From the above, it can be seen that techniques applied in modeling polymerization processes are reasonably well developed and several commercial simulation packages are available. However a user of such techniques and packages should keep in mind that software cannot be a substitute for engineering judgement and its use without understanding is a dangerous abandonment of professional responsibility  .
The aim of this paper is to model and simulate the polymerization of methyl methacrylate to PMMA in an isothermal suspension reactor. The reactor performance is studied by modeling and simulation using Python 3.5 instead of using experimental assessment. This is because the procedure requires low computational demand in performing the reactor studies and besides high-quality data is available for validation and comparison with literature values.
2. Model Formulation
The kinetics of MMA polymerization are described basing on the free radical polymerization mechanism scheme in Table 1 below. The scheme map comprises the initiation step, where the initiator (I) decomposes to form reactive radicals (R), the addition of monomer molecules (M) to the reactive polymer chain formed from the reactive radicals and the termination step where deactivation of polymer radicals occur. The initiator used is Benzoyl Peroxide (BPO).
P and D represent the live and dead polymer with n and m monomeric units respectively; whereas the kinetic constants for the initiator decomposition, initiation, propagation and termination are Kd, Ki, Kp and Kt respectively.
In this work, the process model in   with slight adjustments was followed. The assumptions used in this work are:
1) The reactor operates isothermally at 70˚C
2) All reaction steps in the system are irreversible
3) Chain transfer to the monomer is negligible compared to other reaction steps
4) The dispersion generated in water isolates the monomer thus negligible evaporation rate
5) Each droplet behaves as a batch reactor operating in bulk
6) Termination is due to disproportionation only
7) The volume of the liquid phase is unaffected by the small amount of initiator
8) There is no polymer at the beginning of the process
Using the above assumptions, the initiator (I), monomer (M) and radical species (R) balances are;
Table 1. Kinetic scheme for the free-radical polymerization of MMA.
The method of moments is invoked in order to reduce the infinite system of molar balance equations required to describe the molecular weight distribution  that would have presented roughly 10,000 - 50,000 stiff differential equations to be solved simultaneously  . Therefore the first three radical species and dead polymer moment balances are;
where is the momentum i of the radical species and is the momentum i of the dead polymeric species summing to;
A detailed procedure of deriving the moment equations can be found elsewhere in the works of   .
The initial conditions used in this work: , , .
At any time and point within the system, predictions for the monomer conversion (Xm), number and weight average molecular weights (Mn and Mw) can be given as;
where MWm is the molecular weight of the MMA monomer. Then the polydispersity index can be written
The enthalpy change Q during the reaction progress can be defined as
In order to account for the cage, gel and glass effects,  reformulated the model of  basing on free volume theory and the equations below were used to define the variation of the initiator efficiency f, the termination and propagation rate constants with temperature
In the above equations, the volume of the mixture V is determined from;
With and as the densities of the monomer and polymer whereas the volume of the cage, gel and glass effects of the monomer Vfm and the corresponding volume of the polymer Vfp are calculated from;
The volumetric fraction of the monomer with respect to V, denoted as and the volumetric fraction of the polymer in respect to the same, are obtained from
From Equations (26) to (28); are best fit correlation parameters that are applied as adjustable parameters for the initiator efficiency, propagation constant rate and disproportion termination constant rate respectively and may be calculated from
The ratios of the critical volumes of monomer i = 1 and initiator i = I over the polymer are determined as
where , , are the critical volumes for the monomer, initiator and polymer respectively. The molecular weights for the monomer, polymer and initiator are denoted as , , respectively. The parameters used in solving the above equations are given in Table 2.
Table 2. Parameters used in this study   .
3. Results and Discussion
A program to solve the above equations was developed using the object-oriented language Python 3.5 installed via the Anaconda distro. The NumPy module  and a customized module were used to solve for the stiff ODEs and results were ported to matplotlib whose output has a close resemblance to the well-known MATLAB format. In order to simulate the performance of the model, it was assumed that 2 tonnes of monomer were fed to the reactor and the initiator (1% wt. of monomer) was added in 1 minute at constant rate after which the addition rate was stopped. The temperature was fixed at 70˚C. The reaction progressed for the 3 hours and the reactor profiles in Figures 1-8 were obtained.
Figure 1. Monomer conversion versus time.
Figure 2. Rate of change of initiator as the reaction progresses.
Figure 3. Monomer consumption with time.
Figure 4. Enthalpy change with time.
There is a fairly linear increase in the monomer conversion with time until the start of the gel effect as observed in Figure 1. The reaction rate is then auto-accelerated thus shifting the reaction to the limiting conversion. It should be noted that maximum monomer conversion and polymer production are limited by short reaction batch times, the existence of diffusional effects in the reaction medium and by the fast decay of the initiator as observed in Figure 2.
Figure 5. Variation of Mn and Mw with conversion.
Figure 6. Weight average molecular weight versus time.
As the initiator is added during the first minute at a constant rate, there’s an initial increase at loading time but then the initiator and monomer amounts (see Figure 3) decrease with time when the initiator radicals combine with the monomer particle leading to chain propagation which finally results into formation of the polymer.
The reaction between the monomer and initiator is highly exothermic leading
Figure 7. Number average molecular weight versus time.
Figure 8. Polydispersity index versus time.
to large amounts of heat being released. Figure 4 shows the enthalpy change as the reaction progresses. It is observed that there is an increase in the enthalpy change with time a scenario which may be attributed to the changing reaction rate constants that vary with temperature at a given time. However a maximum enthalpy change is attained prior to the depletion of the monomer inside the reactor at conversions of about 92% as shown in Figures 1-3.
For the polymer being produced, the molecular weight predictions of the simulated model (Mn, Mw and PDI) are given in Figures 5-8. It can be seen that the there is a slight drop in the polymer molecular weight due to a contraction in volume at low conversions.
However on the onset of the gel effect, larger polymer chains are produced which leads to a rise in the predicted molecular weights. As monomer conversion increases, the viscosity of reacting mixture increases. This causes a cage effect till the polymer chain stops growing. The polydispersity index predicted in Figure 8 is 27, a value greater than one indicating that the produced polymer is polydisperse.
The simulation of suspension polymerization model has been performed in Python 3.5. The prediction results were in good agreement as those reported in literature. A maximum monomer conversion of about 92.8% at a minimum batch time of about 2.2 hours was achieved at the specified conditions. The results of this work have demonstrated that Python can be employed to perform modeling and simulation studies of polymerization based processes effectively with equal success as any other programming language.