polymath tutorial principles of chemical processes...

Post on 18-Mar-2018

220 Views

Category:

Documents

4 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1  

Polymath Tutorial Principles of Chemical Processes II

Objectives: Be able to use POLYMATH to solve typical chemical engineering problems using the Differential Equation, Non-Linear Equation and the Linear Equations Solver.

To be submitted as specified by the instructor using Blackboard. Submit in one word document per person. Save the word document using the following format: yournamePolymath.docx

1. Answers to questions on page 2 2. 1 page from the NLE module of C&S 2.10a 3. 1 page from the LEQ module of C&S 2.4a 4. 1 page from the DEQ solver output with graph.

1. Open polymath:

2  

2. Go to Help, Contents F1 or Press F1

3. Read the section titled Introduction to Polymath both getting started and Variables and expressions and answer the following questions typed into a word document to be submitted at the end of the tutorial:

3.1. How many simultaneous ordinary differential equations can be simultaneously solved

using the educational version of POLYMATH? 3.2. How many explicit equations can be solved using the POLYMATH ode solver? 3.3. What does NLE represent? 3.4. What symbol on the tool bar represents the polymath scientific constants menu? Give

the value of pi to an accuracy of 12 digits using polymath scientific constants. 3.5. How would you have polymath give you the absolute value of a number? 3.6. Have polymath, using the calculator give you the cosine of 30 degrees. What did you

type?

3  

Cutlip & Shacham Problem 2.10 part a:  Bubble Point Calculation for an Ideal Binary Mixture in Cutlip and Shacham. This problem is in your Cutlip and Shacham text. In presenting this tutorial I have given you an example of how I would like computer oriented problems to be submitted for homework. Every problem starts with a hand written statement of the problem following the engineering homework format given in the syllabus. Note that sample calculations of major equations are given on this page.

Place scan of 2 pages of handwritten notes

Hesketh
Placed Image
Hesketh
Text Box
mm Hg

5  

 

Figure 1:  Press the short cut for non‐linear equation solver (NLE)

 

Figure 2:  Use the templates for easy entry of equations

 

Figure 3:  The is the template with the overall equation entered.  Note this is the implicit equation.  (The definition of an implicit equation is that you can not solve directly for the variable Tbp.  In other words you can not write:  Tbp = f(all other variables)  Also note that the degree symbol can be typed pressing and holding the Alt key and then typing the numbers using the numeric keypad 0176.  Other useful symbols are for micrometer Alt+0181 for µ.

6  

 

Figure 4:  After you press the Done button the following equation is written in the program.  Notice that an error is given with the red X.  Before you can find this you will need to give an upper limit.  Notice the comments are given after the comment symbol of # and are in green.

 

Figure 5:  Press the short cut button to help you enter the explicit supporting equations.  If you prefer these could be typed directly into the window.

7  

 

Figure 6:  Explicit Equation Entry Screen 

 

 

Figure 7:  minimum and maximum values of Tbp.  You need to use your judgement of the physical situation to pick these limits. 

8  

 

Figure 8:  Show list of variables that are needed 

 

Figure 9:  Variables in red need to be defined by an equation 

 

Figure 10:  What is wrong with this program? 

9  

 

Figure 11  Enter the Problem Title and save your work 

 

10  

 

Figure 12:  The following screen results.  Copy this into a word document so that you can submit page 

 

Figure 13:  Make a graph of the solution by clicking on the box next to the word Graph (see red arrow above) 

11  

 

Figure 14:  Polymath outputs for NLE for a single explicit equation.  The graphing option is not available for more than one explicit equation 

 

Figure 15:  Options for graphs 

Copy and Paste Graph

Select what you would like to graph 

Change font size, add title to x‐axis.

12  

 

Figure 16:  The menu to change the size of the plotted line or markers 

 

Figure 17:  This menu allows you to add a title that I have used as an x‐axis title 

13  

 

Figure 18:  All graphs must have x‐axis and y‐axis labels.  When using Polymath you must manually add a y axis label. 

   

Objective Function f(Tbp) (mm Hg)

14  

Objective Function f(Tbp)  (mm Hg) 

This page plus the handwritten pages should be turned in along with the hand calculations.  Notice that if the problem requested an answer of a bubble point and mole fractions then these must be given by the student with boxes around the answer.  It is best to do this by writing the answer on the hand calculation page or by typing it on this page.  For parts b & c then a green engineering page must follow this one with the setup of 2.10 part b.  This would be page 3 of the assignment or 3/6.  

POLYMATH Report C&S 2.10a: Bubble Point Calculation for an Ideal Binary MixtureNonlinear Equation 12-Jan-2009Calculated values of NLE variables Variable Value f(x) Initial Guess

1 Tbp 63.66452 1.722E-10 55. ( 10. < Tbp < 100. )

Variable Value

1 Pvapc5 1784.045

2 Pvapc6 646.2172

3 xc5 0.1

4 xc6 0.9 Nonlinear equations 1 f(Tbp) = xc5*Pvapc5+xc6*Pvapc6-760 = 0

T is in °C and Pvap is in mm Hg

Explicit equations 1 Pvapc6 = 10^(6.87776-1171.53/(Tbp+224.366))

2 Pvapc5 = 10^(6.85221-1064.63/(Tbp+232))

3 xc6 = 0.9

4 xc5 = 0.1 General Settings Total number of equations 5 Number of implicit equations 1 Number of explicit equations 4 Elapsed time 0.0000 sec Solution method SAFENEWT Max iterations 150 Tolerance F 0.0000001 Tolerance X 0.0000001 Tolerance min 0.0000001 Data file:  

15  

Example of the Linear Equation Solver based on Cutlip & Shacham Problem 2.4 a: Steady­State Material Balancese on a Separation Train This problem is in your Cutlip and Shacham text. In presenting this tutorial I have given you an example of how I would like computer oriented problems to be submitted for homework. Again, every problem starts with a hand written statement of the problem following the engineering homework format given in the syllabus.

 

   

17  

 

 

Figure 19:  Fully entered problem.  Make sure that the hand calculations show the origination of the B column numbers.  Also enter a title and save the problem 

 

Figure 20:  Problem title screen 

18  

 

Figure 21:  This screen appears after pressing the solver button.  You should select all and then copy this page into a word document, to be submitted with your handwritten work.  Remember that you can type or write answers to problems on these pages. 

   

19  

This would be page 3 of problem 2.4a or for the 2 problem homework set page 6/6 

POLYMATH Report Problem 2.10 Steady-State Material Balances on a Separation TrainLinear Equations 12-Jan-2009

Linear Equations Solution Variable Value

1 x1 26.25

2 x2 17.5

3 x3 8.75

4 x4 17.5

The equations [1] 0.07·x1 + 0.18·x2 + 0.15·x3 + 0.24·x4 = 10.5 [2] 0.04·x1 + 0.24·x2 + 0.10·x3 + 0.65·x4 = 17.5 [3] 0.54·x1 + 0.42·x2 + 0.54·x3 + .1·x4 = 28 [4] 0.35·x1 + 0.16·x2 + 0.21·x3 + .01·x4 = 14 Coefficients matrix and beta vector x1 x2 x3 x4 beta

1 0.07 0.18 0.15 0.24 10.5

2 0.04 0.24 0.1 0.65 17.5

3 0.54 0.42 0.54 0.1 28.

4 0.35 0.16 0.21 0.01 14.

General Number of equations: 4 Data file: e:\laptop\courses\principleschemprocii\lecture\c&s2.4a.pol

A check of the answer would be that the sum of each of the 4 streams should equal 70 kmol/min:

26.25 kmol/min +17.5 kmol/min +8.75 kmol/min +17.5 kmol/min = 70 kmol/min

Remember that numbers always have units!

20  

Example of the Differential Equation Solver This example is based on a batch reactor with 2 simultaneous chemical reactions. A component mole balance is constructed for chemical species. Since this is a batch reactor then the mole balances are differential equations. If this problem was an assigned homework problem then the first page of the problem would be a hand written setup of the problem. This page would contain:

• Setup of the component species mole balances including a diagram of the process (process flow diagram, pfd)

• Initial conditions • Sample calculations showing the order of magnitude of the results.

For example the mole balances for A, B and C are given by

(1)

(2)

(3)

The initial conditions in the batch reactor at t=0 min are A(0)=1 kmol/L, B(0)=0 kmol/L and C(0)=0 kmol/L. These are known as initial values. The integration will proceed from 0 min to t=3 min. The rate constants are k1=1 min-1 and k2=2 min-1.

The following would be a sample calculation to show the order of magnitude of a change in the concentration of A with time. Using the initial conditions the initial change in A with time is:

1 1 / 1 / min (4)

An estimate of the value of after 1 minute would be (NOTICE that this is not a correct integration of the differential equation. This is ONLY an ESTIMATE and an assumption is made that the rate is constant. From this problem you will see that the rate starts at this initial value and then decreases with decreasing concentration of A.)

/~ 1 / min

1 / 1 / (5)

The above result gives the final value the concentration of A to be zero. In other words if the reaction rate was at 1 kmol/(L min) for 1 minute, then there would be no reactant A left. It is

21  

then up to the student doing the problem to evaluate if this reaction rate is what was specified or should the rate be 10 times lower.

1. Start the Differential Equations Solver by selecting Program, DEQ Differential Equations and keep the help window open

2. Choose the Differential Equations solver in the help menu

3. Enter the 3 differential Equations and supporting explicit algebraic equations. To do this and

learn about POLYMATH, I suggest that you read through the POLYMATH help file starting with the Overview section. After entering the equations and running the program return to step 3.6.

22  

4. Sort the equation by using the button

5. Now enter a problem title by selecting Edit, Enter Problem Title…

23  

6. Add a graph to the output by clicking the box and rerun the program

7. Edit the POLYMATH produced graph by

doing the following: a. Open the Design or Graph properties

window by clicking on the paint brush Increase the width of the lines to a 2

b. Add a title c. Change the x,y axis to a decimal with 2

digits showing

Graph 

Design or Graph Properties 

24  

d. Open the Curves and Functions menu and edit the x-axis by selecting the Label

button. The x-axis should have a label: time (s). Always give units on labels. Please note that the SI abbreviation for seconds is s.

e. The only part missing is the y-axis which will be entered later. You can do this

either by writing on the paper or adding text as shown next. 8. Now prepare this polymath program results to be handed in for a homework assignment.

This is what you will do for all homework assignments involving POLYMATH. a. Select the “Differential Equations Solution” output screen, click on the text and

then choose Edit, Select All. Then paste this into a word document. b. Copy the graph (you can use the copy button, Ctrl + C etc.) c. In word select the graph and use text wrapping so that the output will fit on one

page. d. Now add a y-axis using the textbox tool. Concentration (mol/m3)

Curves and Functions 

25  

Calculated values of DEQ variables Variable Initial value Minimal value Maximal value Final value

1 A 1. 0.0497871 1. 0.0497871

2 B 0 0 0.2499865 0.0473083

3 C 0 0 0.9029046 0.9029046

4 k1 1. 1. 1. 1.

5 k2 2. 2. 2. 2.

6 t 0 0 3. 3. Differential equations

1 d(A)/d(t) = -k1*A

Concentration of component A

2 d(C)/d(t) = k2*B

Concentration of component C

3 d(B)/d(t) = k1*A-k2*B

Concentration of Component B

Explicit equations 1 k2 = 2

Reaction rate constant with respect to A

2 k1 = 1 Reaction rate constant with respect to A

General

POLYMATH Report Concentration Profile of Series ReactionOrdinary Differential Equations 22-Jan-2008

Total number of equations 5 Number of differential equations 3 Number of explicit equations 2 Elapsed time 0.000 sec Solution method RKF_45 Step size guess. h 0.000001 Truncation error tolerance. eps 0.000001

Concentration mol/m3 

Figure 22:  Concentration Profile of a Series Reaction

26  

9. The above was probably too much work for a graph. An alternative method which I prefer is to use excel to produce the graph. In this case you should do the following

a. Select the Table output button

b. Run the program again c. Select the table d. Click on the upper left corner of the table (similar to excel)

e. Then select Edit, Copy With Headers. (This will copy the names of the variables

as well as the numbers) f. Paste this into an excel spreadsheet and produce a graph with all titles given and

labels. Notice that for computer generated data, no markers are used. Draw this data using a line and not markers.

Upper left Corner Selects all 

Copy with Headers

27  

Calculated values of DEQ variables Variable Initial value Minimal value Maximal value Final value

1 A 1. 0.0497871 1. 0.0497871

2 B 0 0 0.2499865 0.0473083

3 C 0 0 0.9029046 0.9029046

4 k1 1. 1. 1. 1.

5 k2 2. 2. 2. 2.

6 t 0 0 3. 3. Differential equations

1 d(A)/d(t) = -k1*A

Concentration of component A

2 d(C)/d(t) = k2*B

Concentration of component C

3 d(B)/d(t) = k1*A-k2*B

Concentration of Component B

Explicit equations 1 k2 = 2

Reaction rate constant with respect to A

2 k1 = 1

Reaction rate constant with respect to A

General

POLYMATH Report Concentration Profile of Series ReactionOrdinary Differential Equations 22-Jan-2008

Total number of equations 5 Number of differential equations 3 Number of explicit equations 2 Elapsed time 0.000 sec Solution method RKF_45 Step size guess. h 0.000001 Truncation error tolerance. eps 0.000001

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.5 1 1.5 2 2.5 3

Concen

tration (m

ol/m

3 )

Time (s)

A

C

B

Figure 23:  Concentration Profile of a Series Reaction

28  

Excel Hint:

Did you know that one way to select a column of data is to hold the shift key down and double click on the lower line? For example to select the Column C data go to cell C1 and double click on the line between rows 1 and 2 . Similarly if you want to move to the bottom of a data set you can just double click on the lower dark black line without holding the shift key.

To be submitted as specified by the instructor using Blackboard. Submit in one word document per person. Save the word document using the following format: yournamePolymath.docx

1. Answers to questions on page 2 2. 1 pagePrintout of NLE C&S 2.10a 3. 1 page printout of LEQ C&S 2.4a 4. 1 page printout of DEQ solver output with graph.

Holding the shift key; double click on the lower dark black line  

top related