Sei sulla pagina 1di 8

CH2301 Computer Application Laboratory Prof. A. K.

Verma, IIT(BHU) Varanasi

Page: 1

INDIAN INSTITUTE OF TECHNOLOGY (BANARAS HINDU UNIVERSITY) VARANASI DEPARTMENT OF CHEMICAL ENGINEERING & TECHNOLOGY VARANASI -221 005 Subject: CH2301: Computer Applications Laboratory

(July December 2012)

Lab Manual (Excel users)


Introduction
Spreadsheets have been developed to carry out repeated calculations and to present in tabular form. Initial spreadsheets such as Lotus1-2-3 fulfilled this. However, later spreadsheets incorporated graphical facilities. Excel and CoralGraph belonged to this category. Excel went a step further. It introduced a facility to write user-defined functions in BASIC and later in VISUAL BASIC. These can be saved as reusable code and are called as Add-ins. You can also create an Add-in easily. Normally Excel sheets are saved as xls file, but Add-in is created by saving as xls file. Numerous Excel Add-ins useful to chemical engineers are available on the web and may be studied to understand what can be done by Excel users. Optimization problems can be solved using SOLVER add-in. Another powerful spreadsheet is OPEN OFFICE CALC, which may be called as clone to Excel and is available as a part of OPEN OFFICE, an open source software. Experiment 1 Objective: To explore computational capability of a software (e.g. EXCEL or MATHCAD) and solve a problem based on material and energy balance. Problem: Benzene is incinerated at 2100 K with excess air. Determine the composition of the product when the air is supplied in (a) stotiometric ratio (b) 10% excess (c) 20% excess. Instructions: The example demonstrates the use of the software as an advanced calculator. Follow the steps given below. 1. 2. 3. 4. 5. 6. Write down the chemical reaction. You may use a Text Box. Chemical reaction may be written word and then pasted here. Write down names of components in one column. Write MW in the next column, followed by composition of the inlet gas. Write down composition of the gas after incineration in the next column. Repeat the steps 3 & 4 for various conditions of inlet gases Change the font size, colour, properties of the TextBox to improve the presentation.

Experiment 2 Objective: To explore graphical capability of the given software (e.g. EXCEL or MATHCAD)

CH2301 Computer Application Laboratory Prof. A. K. Verma, IIT(BHU) Varanasi Problem:

Page: 2

Plotting friction factor as a function of Reynolds number using the following implicit correlations for Re<2000 for 3000<Re<106 2.1 2.2

Instructions:

Friction factor is used for estimation of pressure drop for fluid flow in pipes. Different equations are used for laminar and turbulent flow. Both equations are plotted on a single log-log graph. Follow the steps given below. 1. 2. 3. 4. 5. 6. 7. 8. Prepare a set data points by estimating values of f for various values of Re. Use separate sets for both equations. Since the values on x-axis(i.e. Re) are same, keep all the values of Re in one column. To get two different curves keep the values of f in separate columns. Select the entire set and save as scatter plot Write proper labels for x and y axis. Use proper options to make a curve without data points (marker) on it and appropriate tickmarks (inside) and border to the graph. Copy the graph and paste to Word.

Experiment 3 Objective: Problem: To solve a nonlinear equation To determine adiabatic flame temperature for CO gas burnt at constant pressure with 100% excess air. The reactants enter at 100 C. 3.1 3.2 3.3 Cp values are in J/(g-mol)(K) and temperature values are in K.

Instructions:

The heat of the products may be written as where x is the mole fraction. The expression for Cp may be integrated to give

3.4 Hence numerical integration is not required. Follow the steps given below. 1. Estimate the composition of the reactants and products.

CH2301 Computer Application Laboratory Prof. A. K. Verma, IIT(BHU) Varanasi 2. 3. 4. 5. 6. 7. 8.

Page: 3

Fill a guess value of T in one cell. Write the expression for Cp for each individual gas in different cells. Enter the formula for In another cell write the value of Write the difference of the two values of Change the value of T such that the difference of values becomes zero. Alternatively, one can use the function GOALSEEK. The target cell is the difference of values.

Experiment 4 Objective: Problem: To solve an explicit non-linear equation Determine the specific volume of a gas at given T and P using Van Der Waals equation 4.1 Where 4.2 4.3 Let for a gas TC= 405.5 K, PC= 111.3 atm, [R=0.082056] Determine the volume of the gas at 500 K and 50 atm. Instructions: The volume cannot be expressed implicitly. The EXCEL does not allow circular reference. The value of V may be determined using iterative procedure. Equation 4.1 has 3 roots of V. If there is only root, it corresponds to the value of V for gas. If all the roots are real, then the largest value corresponds to that for the gas. The iterative procedure gives only one root at a time depending upon the initial guess. Follow the steps given below. 1. 2. 3. 4. Enter various values in cells. Enter the formula given in Equation 4.1 as f= Enter a guess value of V. The best guess can be using ideal gas law. Use SOLVER. The target cell is the cell containing the value of f. Select the cell containing the guess values of V as the values which will be varied by the SOLVER.

Experiment 5 Objective: Application: To use numerical differentiation To determine the order of reaction using differential method

CH2301 Computer Application Laboratory Prof. A. K. Verma, IIT(BHU) Varanasi Instructions: The rate of reaction

Page: 4

can be determined using differential method of analysis

from the concentration of the reactant as a function of time. For example the following data is available t. s CA, mol/lit 0 10 20 8 40 6 60 5 120 3 180 2 300 1

1. Enter the data in two columns. 2. Plot CA vs t. 3. Estimate rA=dCA/dt using two-point formula 4. Plot (-rA) vs CA on linear plot 5. Add trendline and choose the power type of function. Choose option of displaying the equation on the graph. 6. Plot (-rA) vs CA on log-log scale and a linear trendline may be added. Compute the constants and compare with the results obtained in step 5. 7. Repeat by taking the value of C as an average between the two data points considered for estimating reaction rate rA. Estimate the order of reaction and compare with values estimated earlier.

Experiment 6 Objective: Problem: Instructions: Numerical Integration by (a) Trapezoidal rule (b) Simpsons rule Predict the performance of an ideal batch reactor The performance of a batch reactor relates the time, t, for which the reaction is carried out in a reactor to achieve a desired concentration or conversion. It is expressed as 6.1 Integration may be carried out numerically applying any of the following formulae. Trapezoidal rule: 6.2 Simpsons rule: 6.3 1. 2. 3. Take the data given in Experiment 5. Determine rA. Tabulate 1/(-rA) vs CA taking a small stepsize,h, e.g. increment of CA = 0.1 mol/lit. Integrate using Trapezoidal rule and estimate t.

CH2301 Computer Application Laboratory Prof. A. K. Verma, IIT(BHU) Varanasi 4. 5. 6. 7. Experiment 7 Objective: Problem: To solve a set of ordinary differential equations using Eulers method Variation of concentration with time for a series reaction Initial Conditions: Rate Constants: Integrate using Simpsons rule and estimate t. Compare both values of t. Reduce the step size and study the improvement. Plot t vs h.

Page: 5

t=0, CA =50 mol m-3, CB =10 mol m-3, CC =1 mol m-3 k1 =0.01 s-1, k2 =0.015 s-1

Plot the concentration profile upto 3 hrs. Instructions: The rate expression can be written as 7.1 7.2 7.3 Follow the steps given below. 1. 2. 3. 4. 5. 6. 7. 8. 9. Experiment 8 Objective: Problem: To Solve simultaneous linear Equations using Inverse of matrix method Solve the following set of simultaneous linear equations by matrix inverse method X+aY+a2Z=7 -X+Y+a Z=11 (a+a )X+aY+(a +a )Z=2 For a=3, 5 and -2. Instructions: Matrix functions in EXCEL require a special trick, not discussed in most of the books on EXCEL. Follow the steps given below to solve the problem. Note that matrix
2 2 3 3

Make 7 columns for t, CA, CB, CC, rA, rB and rC respectively Start writing the values in the first row. Fill the initial values of t, CA, CB and CC Fill the values of rA, rB and rC using the equations 7.1, 7.2 and 7.3 respectively. For the second row take a small step size of time (e.g. h=0.1) For the second row (and onwards) t=told + h The new values of CA, CB and CC are obtained by adding h*rA, h*rB and h*rB to the old values of CA, CB and CC respectively. Fill the values of rA, rB and rC using the new values of CA, CB and CC respectively. Repeat the steps 5-7 until the final time is obtained. Plot CA, CB and CC as a function of time on the same graph.

8.1 8.2 8.3

CH2301 Computer Application Laboratory Prof. A. K. Verma, IIT(BHU) Varanasi

Page: 6

elements are written as algebraic functions using a trick based on the use of scenario. 1. Enter value of a in one of the cell. Select the cell and write a in the tab scenario. Press ctrl+enter keys. The cell can now be referred as a. 2. Enter the values of the coefficients of X, Y and Z in a region of 3x3 cells. Leave few columns (not necessary) and enter the values on RHS in a column of 3 cells. 3. Select another region of 3x3 cells. Write =MINVERSE( and select the region containing the coefficients of the matrix. Close the bracket and press ctrl+shift+enter simultaneously. It fills the elements of the inverse of the matrix into the cells. 4. To find the values of X, Y and Z, use the MMULT function to multiply inverse of A to the Vector of RHS of the equations. The region to be selected is 1x3 (column with 3 cells). Write =MMULT( and select the region containing the coefficients of the matrix. Type , and select the region containing the values on RHS of equations. Type) and press ctrl+shift+enter. 5. Experiment 9 Objective: Problem: To solve ordinary differential equation using Runga-Kutta method Solve the following differential equation and plot y vs x for 0x1. Initial conditions is y=1 at x=0 Instructions: Approximate solution to differential methods may be obtained by Runga-Kutta method. The formula for the fourth order Runga-Kutta method is given below. 9.1 9.2 9.3 9.4 Y at x+h is then y+k where 9.5 Follow the given steps. 1. 2. 3. 4. Enter the initial conditions of x and y in cells. Choose a small value of h and enter in a cell. Enter the values of k1 to k4 in cells. In the next row the new values of x i.e. x+h and y at x+h. Repeat the process till the value of x=1. Verify the results by multiplying original matrix to the answer.

CH2301 Computer Application Laboratory Prof. A. K. Verma, IIT(BHU) Varanasi 5. 6.

Page: 7

Plot y vs x. In an alternate method write a module for calculating y at x+h and use this function to estimate values of y.

Experiment 10 Objective: Problem: To optimize a constrained problem. To maximize the profits of a thermal cracker A thermal cracker can access various feeds like ethane, propane, debutanized natural gasoline (DNG) and gas oil. Some of them may be fed simultaneously based on plant data, eight products are formed with varying proportions according to the following table Product Methane Ethane Ethylene Propane Propylene Butadiene Gasoline Fuel Oil Total Ethane 0.07 0.40 0.50 -0.01 0.01 0.01 -1.00 Propane 0.25 0.06 0.35 0.10 0.15 0.02 0.07 -1.00 Gas Oil 0.10 0.04 0.20 0.01 0.15 0.04 0.25 0.21 1.00 DNG 0.15 0.05 0.25 0.01 0.18 0.05 0.30 0.01 1.0

The capacity of cracker is 200,000kg/stream hour. Ethane uses equivalent of 1.1kg of capacity per kg-ethane, propane uses 0.9 kg of capacity per kg-propane, gas oil uses 0 .9 kg/kg-propane and DNG/gas oil ratio =1.0. Downstream processing limits exists for 50,000 kg/stream hour on the ethylene and 20,000 kg/stream hour on propylene. The fuel requirements to run the cracker for each feedstock type are: Ethane: 8364 BTU/lb; Propane: 5016 BTU/lb; Gas Oil : 3900 BTU/lb; DNG : 4553 BTU/lb Methane and fuel oil produced by cracker are recycled as fuel. All the ethane and propane produced are recycled as feed. Heating values of the fuel are as follows: Natural gas 21,520 BTU/lb Methane 21,520 BTU/lb Fuel oil 18,000 BTU/lb Because of heat losses and the energy requirements for pyrolysis, a fixed fuel requirement of 20.0 x 106 BTU/stream hour occurs. The price of the feed and various products are as follows: Feed: Ethane 6.55 cents/lb Propane 9.73 cents/lb Gas Oil 12.50 cents/lb

CH2301 Computer Application Laboratory Prof. A. K. Verma, IIT(BHU) Varanasi DNG Methane Ethylene Propylene Butadiene Gasoline Fuel Oil Follow the steps given below. Products: 1. 2. 10.14 cents/lb 5.38 cents/lb (fuel value) 17.75 cents/lb l3.79 cents/lb 26.64 cents/lb 9.93 cents/lb 4.50 cents/lb (fuel value)

Page: 8

Instructions:

Enter the data in a worksheet. The objective function is the cost of the products + cost of feed and cost of the energy. Enter the objective function in terms of feed streams, recycle streams and fuel added, in a cell.

3.

Start SOLVER Add-in and write down the constraints i.e. the inequalities to be satisfied in the dialog box. The constraints are the capacity and recycles.

4.

Choose maximize option and the cell containing the objective function as the target cell.

Experiment 11 Objective: Problem: To fit a nonlinear function to a given set of data The vapour pressure vs temperature (K) is given below. Fit the Antonie equation T, K P, atm 270 58.8 280 61.0 290 63.1 300 65.3 310 67.4 320 69.5 330 71.6 340 73.7 The Antonie equation is given as 11.1 1. 2. 3. 4. 5. Experiment 12 Objective: Problem: To carry out material and energy balance in a process plant A problem from text book on process calculations. Tabulate the values of T and P in different columns. Enter values of A, B and C in three different cells. These are guess values. Create another column to store estimated values of P. In the next column enter the square of errors. Use SUM function to estimate square of errors and minimize using SOLVER

Instructions:

Potrebbero piacerti anche