This video we will describe a software package that makes it easy to solve ordinary differential
equation.
In this case we will look at two ordinary differential equations that we want to solve
simultaneously.
This will be an initial value problem from kinetics.
The same approach applies if we had 10 or 20 equations.
We will look at basically two equations from a constant volume batch reactor where we have
the reaction of A going to B and then B reacting to some product C.
We have two differential equations.
This depends on both concentration of A and B. Then we have our initial conditions where
we start with this concentration of A and this concentration of B.
We want to integrate from time 0 up to a time of 8 hours.
We are given the two rate constants and then we are going to use polymath to solve these
two equations.
I have opened the polymath program and the program will then solve linear equations,
nonlinear equations and differential equations.
Differential equations is what we want so we select the program different equations.
We have created a new problem.
The first thing we should do is save this file.
We can enter our first differential equation.
What we do is integrate by putting our dependent variable and time is our independent variable.
The first differential equations use star as multiplication.
Then here we put the initial value of 10.
Then we can put a comment here like "concentration of batch reactor".
It is going to put the differential equation in this format with the parenthesis around
the variables.
The number sign indicates that what follows is a comment.
We can do the same thing for a new differential equation.
This will be the concentration of B. It already specifies the time.
The concentration of B is going to be the following equation.
Initial concentration is 3 and we will not put a comment.
We know need to enter values for the constants.
Keep in mind that the order does not matter.
We have most of what we need to solve now except the initial and final values for the
independent variable.
The initial time is 0 and the final time is 8.
Now we have everything.
Let's demonstrate how this works.
Suppose there is an extra parenthesis here.
If we click on the icon you will notice that it gives us an error.
It has a lot of corrections for us.
When this solve arrow is highlighted in pink it means that the equations are ready to be
solved.
Now we have the options of outputting the data as a report, as a graph or as a table.
Let's have all three and click solve.
The initial value of CA was 10 and the final value is 0.27.
The initial value of B was 3 it hit a maximum of 6 and then decreased.
Here is the graph.
The concentration of A decreases continuously.
The concentration of B goes through a maximum and then decreases.
We could have integrated to a longer time.
We can make changes for example in the curves and functions.
Instead of versus time we could plot CA versus CB.
We can change the looks of the table.
Change the fonts and the formats by selecting the various values here.
For example if we select this graph it allows us to change what is the independent variable.
If we select the pain brush we can change the formats of the x and y axis.
We can change the fonts here as well.
We can also change the scales that we are plotting and make curves bigger.
We also have the table output.
We can just copy these and paste them into excel.
Using polymath allows us to solve these differential equations very easily.
The advantage is we can change these equations and then solve again just by clicking the
arrows.
We can change the rate constants or the time we integrate to and the solution is quick.
We can make the equations much more complicated but there is no real additional effort and
polymath will solve a large number of equations simultaneously.