Scilab

26
“SCILAB (open source software for numerical computation) in Chemical Engineering” Submitted By: Guided By: Kripal Priyadarshi (11BCH026) Asst Prof. Priya Saxena

Transcript of Scilab

Page 1: Scilab

“SCILAB (open source software for numerical computation) in Chemical Engineering”

Submitted By: Guided By: Kripal Priyadarshi (11BCH026) Asst Prof. Priya Saxena

Page 2: Scilab

Learning Outcome After Presentation

After Presentation we would be able to understand the following topics:-

• Introduction Open source softwares

• Difference between Scilab and Matlab

• Scilab basics and simple types of problem solving using scilab

• Engineering problems solving using Scilab

Page 3: Scilab

Introduction To Open source Software

• Open-source software is computer software with its source code made available and licensed with a license in which the copyright holder provides the rights to study, change and distribute the software to anyone and for any purpose.

• Software’s are used in designing, finance, computer simulation, mathematics, science, geographical information, nanotechnology, etc.

• Some of the software’s are Scilab, Firefox, Openoffice, GIMP, FreeNX, OpenVPN, rdesktop DVDFlick, Mozilla Calendar,etc

Page 4: Scilab

Introduction to Scilab

Scilab is a freely distributed open source scientific software package, first developed by researchers from INRIA and ENPC, and now by the Scilab Consortium. It is similar to Matlab, which is a commercial product. Yet it is almost as powerful as Matlab. Scilab consists of three main components: an interpreter libraries of functions libraries of Fortran and C routines

Page 5: Scilab

Difference between Scilab and Matlab

• Functions in SCILAB are not considered as separate files

• Functions in MATLAB are considered as separate files

• To execute a script file you must use • exec("filename") in SCILAB

• To execute a script file in MATLAB you just need to type the name of the file.

• Scilab comments begins with: // • Matlab commands begin with:%

• Boolean variables are %T, %F in SCILAB

• Boolean variables are 0,1 in MATLAB

• Polynomial matrices are defined by the function poly in SCILAB.

• They are considered as vectors of coefficients in Matlab

Page 6: Scilab

Installing the Scilab

• First, you must have the software. Go to the download section in the Scilab homepage, find a right version for your operating system (platform), and then click to download. For easy installation, it is advisable to download the installer (for binary version). Then double click the downloaded file and follow the instructions to complete the installation

Page 7: Scilab

Scilab Screen• The Scilab environment: Console and Prompt

• Once the user has opened Scilab, the window shown on the right appears.

• The main part is the Scilab Console, in which is contained the Prompt of commands, identified by the symbol -->

• Here the user types the commands and interacts with the environment.

Page 8: Scilab

Scilab Basics+ Addition

- Subtraction

* Multiplication

/ Division

^ Power

' conjugate transpose

Common Operators

Common Functions

sincos tanasin acos atan min max Sqrtsum

Special Constants

%pi,

%e,

%i

To enter a string, enclose it with either single or double quotations.

Strings

Page 9: Scilab

Entering Matrices

Page 10: Scilab

Addition of columns and rows

Page 11: Scilab

Using basic single commands

Page 12: Scilab

Finding Inverse of matrix

Page 13: Scilab

Solving linear system

Page 14: Scilab

Chemical engineering problems using Scilab

Scilab can be useful in solving the chemical engineering related problems such as:-• Heat transfer• Regrettions• Fluid flow operations• Different operation such as absorption, distillation etc with graphical

feautures• Designs of various equipment

Page 15: Scilab

Numerical based on Fluid Flow

Ouestion:-Find the Type of Flow of stream in pipe of diameter of 0.06m.

Page 16: Scilab

Using Graphical Feauture

• Question:-Plot a graph of dx/dt=sin2t.•

• Scilab coding→Graph ←

Page 17: Scilab

Solving Equilibrium stage operation numerical

• Question:-By means of a plate column, acetone is absorbed from its mixture with air in a nonvolatile absorption oil. The entering gas contains 30 mole % acetone, and the entering oil is acetone-free. Of the acetone in the air 97 % is to be absorbed, and the concentrated liquor at the bottom of the tower is to contain 10 mole % acetone. The equilibrium relationship is ye=1.9xe. Plot the operating line and determine the number of ideal stages.

Page 18: Scilab

Solving Equilibrium stage operation numerical

Page 19: Scilab

Solving Equilibrium stage operation numerical

Page 20: Scilab

Solving Designing of cyclone separator numerical

Particle size distribution  

50 95

40 85

30 70

20 20

10 10

5 3

2 1

Permissible Pressure Drop,mmH20 125

Flow rate of gas,m^3/hr 2000

Density of solid particle 2500

Permissible pressure drop ?

%Recovery of solid 85%

Design a suitable cyclone for a given process.:

Page 21: Scilab

Solution

Page 22: Scilab

Solution

Page 23: Scilab

Optimization in Scilab

Scilab provides algorithms to solve constrained and unconstrained continuous and discrete problems:• Linear optimization Examples: karmaker,linpro• Non-linear optimization Examples: fminsearch, optim, derivative, leastsq• Semidefinite programming Example: semidef• Linear matrix inequalities Example: lmisolver

Page 24: Scilab

Optimization in Scilab

Page 25: Scilab

REFERENCES

[1] https://www.scilab.org, 8/1/2014, 19:23

[2] http://en.wikipedia.org/wiki/SCILAB, 15/1/2014, 18:27

[3] http://hkumath.hku.hk/~nkt/Scilab/IntroToScilab.html, 16/1/2014, 22:42

[4] http://www.openeering.com/scilab_tutorials, 25/1/2014, 19:56

[5] http://en.wikipedia.org/wiki/List_of_free_and_opensource_software_packages, 31/1/2014 19:27

[6]http://www-irma.ustrasbg.fr/~sonnen/SCILAB_HELP/matlabvsscilab_html.htm 31/1/2014, 19:40

Page 26: Scilab

Thank You