In the Part 1 screencast, we developed the equations that we will now solve numerically
to determine the size of a plug flow reactor for 50% conversion of reactant A, and we're
given the various information about the feed and the rate of reaction here, and the equation
we developed in part 1.
Now let's look at how we would write a POLYMATH program to solve those equations.
So I've opened the POLYMATH program and selected the differential equation solve, and then
I put in a comment, so that number sign, anything following on that line is a comment, so "Isothermal
plug flow reactor."
Then what I'm going to do is I'm going to put in the mass balance for A. So one way
to do it is to select that we're entering differential equations, molar flow rate of
A with respect to the volume, and that's going to equal to R sub A, and initial value, I
have to have a numerical value here, so I calculated the numerical value, 1.858, and
that's 20% of the total inlet flow rate, and if I want I can put a comment like "mole balance
on A," and I'm done.
It shows up in the correct format, as well as the format for the initial condition.
So now I can just type in the differential equation - I can do it either way - and this
is, because of the stoichiometry, 2 times R sub A, and likewise I can put in differential
equations and initial conditions for C, so let me pause and just add those in.
So now I've added the initial condition for B, and the differential equation for D with
it's initial condition, and then the rate of reaction expression.
And again for some of these I put comments.
The next thing I need to do is add the starting and stopping values for the integration.
Here the initial value of B is zero.
The final value is what I'm solving for.
Since I've already solved the equation I know approximately - well, I know exactly - the
answer, I'm going to say I'll integrate to around 30, so when I wouldn't know, the easiest
thing is to put a value in, check the answer, and because it's fast to solve it I can just
change to get as accurate an answer as I want.
So it's going to integrate from B=0 to 30.
Of course what I want to do is solve for the conversion, so that is the conversion I've
written in terms of FA0, and put again in it's numerical value.
Now let me add the parameters.
So I've added the parameters, and again I've added some comments indicating the units for
the parameters, and the final thing is the algebraic equations that relate volumetric
flow rates to concentrations, and total molar flow rates, and how the volumetric flow rate
changes as the molar flow rate changes.
So again, these are just algebraic equations, I'm going to copy them in, they're developed
in the Part 1 screencast.
So there's the equations for concentration and total molar flow rate, and I've also added
some comments, and now you'll notice up here that I have the arrow is purple, indicating
that everything is there that is needed to solve the equation, so let's solve it and
let's get a table output instead of a report so we can get a good idea of what value of
volume we get a conversion of 50%.
And what I'm interested in is the value of x, so I can just scan down in the table and
you'll notice that x is at a conversion of 0.499 for a volume of 28.8 liters, and so
that's as accurate as our original data justifies, so 50% conversion at 28.8 liters.
Now I could also of course ask POLYMATH to give me a graphical output.
So I could ask for a graph instead of a table, or in addition to a table.
Let's just look at a graph, and what I'm interested in is plotting X, you can look at various
things, but for now let's just look at X as a function of volume, and you'll notice that
the volume 28.8 is where we get 50% conversion, and of course the table just gives the information
more accurately.
It's very rapid to use POLYMATH to solve sets of ordinary differential equations.