Tutorial: 11 SCILAB Programming Applications of Chemical Engineering Problems Date : 26/09/2016

Similar documents
SCILAB Programming Chemical Engineering Applications

EEL2216 Control Theory CT1: PID Controller Design

ES205 Analysis and Design of Engineering Systems: Lab 1: An Introductory Tutorial: Getting Started with SIMULINK

MATLAB Ordinary Differential Equation (ODE) solver for a simple example 1. Introduction

A First Course on Kinetics and Reaction Engineering Example 23.1

The roots are found with the following two statements. We have denoted the polynomial as p1, and the roots as roots_ p1.

TUTORIAL: STATE VARIABLES and MATLAB

Chapter I: Hands-on experience in SCILAB operations

GMS 8.0 Tutorial MT3DMS Advanced Transport MT3DMS dispersion, sorption, and dual domain options

2 Scalar Ordinary Differential Equation (ODE s)

Differential Equations DIRECT INTEGRATION. Graham S McDonald

Laboratory 1. Solving differential equations with nonzero initial conditions

MATLAB BASICS. Instructor: Prof. Shahrouk Ahmadi. TA: Kartik Bulusu

AMS 27L LAB #8 Winter 2009

(1) This reaction mechanism includes several undesired side reactions that produce toluene and benzene:

Solve the set of equations using the decomposition method and AX=B:

Lesson 14: Van der Pol Circuit and ode23s

1. Open polymath: 2. Go to Help, Contents F1 or Press F1

EE 4314 Lab 1 Handout Control Systems Simulation with MATLAB and SIMULINK Spring Lab Information

Athena Visual Software, Inc. 1

2 Solving Ordinary Differential Equations Using MATLAB

System Simulation using Matlab

Advanced Chemical Reaction Engineering Prof. H. S. Shankar Department of Chemical Engineering IIT Bombay. Lecture - 03 Design Equations-1

Computational Study of Chemical Kinetics (GIDES)

THE VAPOR COMPRESSION REFRIGERATION PROCESS

VANDERBILT UNIVERSITY. MATH 2610 ORDINARY DIFFERENTIAL EQUATIONS Practice for test 1 solutions

Coulomb s Law Mini-Lab

Development of Dynamic Models. Chapter 2. Illustrative Example: A Blending Process

Theoretical Models of Chemical Processes

Lab 1: Dynamic Simulation Using Simulink and Matlab

Getting started with BatchReactor Example : Simulation of the Chlorotoluene chlorination

Euler s method for solving a differential equation (approximately)

Introduction to the Problem-Solving Methodology (PSM)

Chemical Kinetics I: The Dry Lab. Up until this point in our study of physical chemistry we have been interested in

Stoichiometric Reactor Simulation Robert P. Hesketh and Concetta LaMarca Chemical Engineering, Rowan University (Revised 4/8/09)

Some tools and methods for determination of dynamics of hydraulic systems

Using SPSS for One Way Analysis of Variance

MECH : a Primer for Matlab s ode suite of functions

A COLLECTION OF TEN NUMERICAL PROBLEMS IN CHEMICAL ENGINEERING SOLVED BY VARIOUS MATHEMATICAL SOFTWARE PACKAGES

Simulink Tutorial 1 CPE562

Computer simulation of radioactive decay

Section 2.1 Differential Equation and Solutions

Lecture 8. Mole balance: calculations of microreactors, membrane reactors and unsteady state in tank reactors

Section 2.5 Mixing Problems. Key Terms: Tanks Mixing problems Input rate Output rate Volume rates Concentration

Aspen Plus PFR Reactors Tutorial using Styrene with Pressure Drop Considerations By Robert P. Hesketh and Concetta LaMarca Spring 2005

RT3D BTEX Degradation with Multiple Electron Acceptors

Application of Mathematical Software Packages in Chemical Engineering Education DEMONSTRATION PROBLEMS

MAT 311 Midterm #1 Show your work! 1. The existence and uniqueness theorem says that, given a point (x 0, y 0 ) the ODE. y = (1 x 2 y 2 ) 1/3

Math Applied Differential Equations

Matlab for Review. NDSU Matlab Review pg 1

Fundamentals of Transport Processes Prof. Kumaran Indian Institute of Science, Bangalore Chemical Engineering

Chapter 1: Introduction

CEE 160L Introduction to Environmental Engineering and Science. Lecture 5 and 6 Mass Balances

A First Course on Kinetics and Reaction Engineering Example S5.1

dt (0) = C 1 + 3C 2 = 3. x(t) = exp(3t).

1 Overview of Simulink. 2 State-space equations

A First Course on Kinetics and Reaction Engineering Example 30.1

Session 3. Question Answers

A First Course on Kinetics and Reaction Engineering Example 29.3

System Identification of RTD Dynamics (Tom Co, 11/26/2006; 11/25/2007, 11/15/2009)

A First Course on Kinetics and Reaction Engineering Example 38.2

Lesson 9: Diffusion of Heat (discrete rod) and ode45

Boyle s Law and Charles Law Activity

Practice Midterm 1 Solutions Written by Victoria Kala July 10, 2017

Titrator 3.0 Tutorial: Calcite precipitation

Math 2250 Lab 3 Due Date : 2/2/2017

Solutions for Tutorial 5 Dynamic Behavior of Typical Dynamic Systems

Lesson 4: Population, Taylor and Runge-Kutta Methods

a. Follow the Start-Up Procedure in the laboratory manual. Note the safety rules.

Applied Calculus I. Lecture 29

بسمه تعالي کنترل صنعتي 2 دکتر سید مجید اسما عیل زاده گروه کنترل دانشکده مهندسي برق دانشگاه علم و صنعت ایران پاییس 90

Sudden Expansion Exercise

Part I.

Introduction to System Dynamics

Matlab Sheet 3 - Solution. Plotting in Matlab

Tutorial 11. Use of User-Defined Scalars and User-Defined Memories for Modeling Ohmic Heating

Richter Scale and Logarithms

Development of Dynamic Models. Chapter 2. Illustrative Example: A Blending Process

Problem 1 (10 points)

A First Course on Kinetics and Reaction Engineering Example 33.2

Mathematical Modeling of Chemical Processes. Aisha Osman Mohamed Ahmed Department of Chemical Engineering Faculty of Engineering, Red Sea University

Simulink Modeling Tutorial

GUIDED NOTES 4.1 LINEAR FUNCTIONS

Using Microsoft Excel

BAE 820 Physical Principles of Environmental Systems

Task 1: Open ArcMap and activate the Spatial Analyst extension.

Taguchi Method and Robust Design: Tutorial and Guideline

Transient Heat Conduction in a Circular Cylinder

MA 102 Mathematics II Lecture Feb, 2015

( ) ( ). ( ) " d#. ( ) " cos (%) " d%

1 Newton s 2nd and 3rd Laws

Worksheet 9. Math 1B, GSI: Andrew Hanlon. 1 Ce 3t 1/3 1 = Ce 3t. 4 Ce 3t 1/ =

Date Course Name Instructor Name Student(s) Name. Atwood s Machine

CC Algebra 2H Transforming the parent function

Outlines. Discrete Time Markov Chain (DTMC) Continuous Time Markov Chain (CTMC)

Chemical Engineering

Taylor Dispersion Created by Robert P. Hesketh, Chemical Engineering, Rowan University Fall 2005

A GENERAL Strategy for Solving Material Balance Problems. Comprehend and execute the 10 elements of effective problem

10.34 Numerical Methods Applied to Chemical Engineering. Quiz 2

RT3D Rate-Limited Sorption Reaction

Transcription:

Tutorial: 11 SCILAB Programming Applications of Chemical Engineering Problems Date : 26/09/2016 Aim To solve the chemical engineering problems (steady state and unsteady state) using SCILAB Problem statements 1. Paraxylene, styrene, toluene, and benzene are to be separated with the array of distillation column as shown in figure given below: Calculate the molar flow rates of D 1, D 2, B 1 and B 2 using SCILAB. Solution Applying general mass (component) balance equation to the above separation train we have, Balance on Xylene: 0.70 0.15 = 0.07 x 1 + 0.18 x 2 + 0.15 x 3 + 0.24 x 4 Balance on Styrene: 0.70 0.25 = 0.04 x 1 + 0.24 x 2 + 0.10 x 3 + 0.65 x 4

Balance on Toluene: 0.70 0.40 = 0.54 x 1 + 0.42 x 2 + 0.54 x 3 + 0.10 x 4 Balance on Benzene: 0.70 0.80 = 0.35 x 1 + 0.16 x 2 + 0.21 x 3 + 0.01 x 3 Where x 1, x 2, x 3, and x 4 are D 1, B 1, D 2 and B 2 respectively Now, open console window of SCILAB and type the following to obtain the solution -->A=[0.07 0.18 0.15 0.24; 0.04 0.24 0.10 0.65; 0.54 0.42 0.54 0.10; 0.35 0.16 0.21 0.01]; -->B=[70*0.15; 70*0.25; 70*0.40; 70*0.20]; -->x=[a\b] x = 26.25 17.5 8.75 17.5 2. Weight Reduction Model Assume that a person who is having 100 kg now is interested to reduce his weight by 10% per month for two years. Write a model (First order initial value) describing the loss in weight. Determine x(t) as a function of t. Where x is weight of the person and t is the time. Also plot the data for two years, i.e. for 24 months, show the grid lines and label the axis Using SCILAB. Solution Weight of person = x kg Tries to reduce weight Weight loss per month = 10% of weight Starting weight = 100 kg Now, Initial conditions: x = 100 at t = 0 dx dt = 0.1x Determine x(t) as a function of t.

Analytical solution of weight reduction model Recall the model: dx dt = 0.1x x t = 0 = 100 Cross multiplying, dx x = 0.1dt Integrating both sides from 0 to t, dx x = 0.1 dt C + ln [x t ] = 0.1t Using initial conditions C = ln 100 Thus the final solution is ln!!!"" = 0.1t or x t = 100e!!.!! Summary of Weight Reduction Problem Weight of person = x kg Tries to reduce weight Weight loss per month = 10% of weight Starting weight = 100 kg, Model describing the weight loss is: x t = 100e!!.!! Compute and plot for two years, i.e. for 24 months

Time (t), Months x(t) 0 100.00 1 90.483 2 81.873 3 74.081 4 67.032 5 60.653 6 54.881 7 49.658 8 44.932 9 40.656 10 36.787 11 33.287 12 30.119 13 27.253 14 24.659 15 22.313 16 20.189 17 18.268 18 16.529 19 14.956 20 13.533 21 12.245 22 11.080 23 10.025 24 9.071 Weight loss, x(t) 100 90 80 70 60 50 40 30 20 10 0 0 5 10 15 20 25 Time, t T=0:0.1:24; B=100*exp(-0.1*T) plot(t,b); Now, put the x-y labels, grid lines and title for the plot. Put the title for the plot as Weight reduction model. -->plot(t,b); -->xlabel('time, months','fontsize',3); -->ylabel('weight loss, x(t)','fontsize',3); -->title('weight reduction model','fontsize',4); -->xgrid(1)

A SCILAB function for the model can be written as stated below: Open the SCINOTES and create a function file by typing the following: function xdot=f(t,x) xdot=-0.1*x endfunction Save the above function, goto console and provide the initial conditions -->exec('/users/admin/desktop/f.sci', -1) -->x0=100; -->t0=0; -->t=0:0.1:24; -->x=ode(x0,t0,t,f); -->plot(t,x); -->xlabel('time, months','fontsize',3); -->ylabel('weight loss, x(t)','fontsize',3); -->title('weight reduction model','fontsize',4); -->xgrid(1) 3. Write a SCILAB program for the weight gain model. The approach is similar to the problem 2 as stated above. The model is considered as:

dx dt = 0.1x x t = 0 = 9.071 kg Where x is the weight gain, initial weight at time t = 0 and x = 9.071kg. Determine and plot the graph for 24 months time period. Put the x-y labels, grid lines and title for the plot. Title for the plot is weight gain model. Open the SCINOTES and create a function file by typing the following: function xdot=f(t, x) xdot=0.1*x endfunction Open console window and try the following: -->exec('c:\users\user-pc\desktop\f.sci', -1) -->x0=9.071; -->t0=0; -->T=0:0.1:24; -->x=ode(x0,t0,t,f); -->plot(t,x); -->plot(t,x); -->xlabel('time, months','fontsize',3); -->ylabel('weight loss, x(t)','fontsize',3); -->title('weight reduction model','fontsize',4); -->xgrid(1)

4. In the following example, we solve the Ordinary Differential Equation!" =!" y! ysin t + cos (t) with the initial condition y(0) = 0. Open SCINOTES and create a function file by type the following function ydot=f(t,y) ydot=y^2-y*sin(t)+cos(t) endfunction Now go to console window and give the following conditions -->y0=0; -->t0=0; -->t=0:0.1:%pi; -->y = ode(y0,t0,t,f); -->plot(t,y); -->xlabel('time, sec','fontsize',3); -->ylabel('y(t)','fontsize',3); -->title('trignometric Function','fontsize',4); -->xgrid(1)

5. Assume that a fluid with constant density enters into a tank at the rate of 10 L/min. A control valve at the outlet of the tank controls the flow at a constant rate of 6 L/min. Derive an equation describing this process and solve the same over a 100 min interval. Write a program for the process in SCILAB. Solution We know that, Material balance equation under unsteady state condition is written as Accumulation = input output

Open SCINOTES and type the following: function vdot=unsteady(t, v) vdot=4 endfunction Goto console window and call the above written function by clicking the play button in the SciNotes (or editor) window. Provide all the initial conditions and execute the result from console window as shown below: -->exec('/users/admin/desktop/unsteady.emf', -1) -->v0=0; -->t0=0; -->t=0:10:100; -->v=ode(v0,t0,t,unsteady); -->xgrid(5,1,7); -->plot(t,v) -->xlabel('time, min'); -->ylabel('v, L/min') -->title('volumetric flow rate vs. Time') 6. The following set of differential equations describes the change in concentration of three species in a reactor.

Open the SCINOTES and create the function file Function dx=chemical(t,x) f1=k1*x(1) f2=k2*x(2) dx(1)=-f1 dx(2)=f1-f2 dx(3)=f2 endfunction Now go to console window and provide the initial conditions -->exec('c:\users\user-pc\desktop\chemical.sci', -1) -->k1=1; -->k2=2; -->t=0:0.1:5; -->x0=[5;0;0]; -->x=ode(x0,0,t,chemical); -->plot(t,x); \or you can also use-->plot( t',[x(1,:)'x(2,:)'x(3,:)']) -->legends(['a','b','c','d'],[1 2 3 4],"ur"); -->xgrid(1); -->xlabel('time, min', fotsize,4); -->ylabel('concentration, mg/l', fotsize,4); -->xtitle('chmical ODE', fotsize,4);

Result Thus we learned the use of SCILAB in solving steady and unsteady (or transient) examples from chemical engineering problems.