SlideShare a Scribd company logo
Exploration with CAS-I
BMA151
Objectives:
• To enhance the numerical computational
skills of prospective engineers using open
source software/ computer algebra system(CAS)
SCILAB
• To plot graphs of complicated functions .
Experiment-1:Starting with Scilab
• Objectives:
1.1 What is SCILAB?
1.2. How to Install Scilab?
1.3.Working in the console
1.4.Arithmetic Operations with scalars
1.5.Elementary Math Build-in functions
1.6.Defining scalar variables
1.7.Script Files
Excercises
• To write a Scilab code to find the solution of following problems:
• 1. Evaluate:
(i) 271/3+ 320.2 , (ii) , (iii)
(iv) 4!+ln2+log100, (v) (2+3i)(4+5i)
2. By assigning values 2 and 5 to variables a and b respectively,
compute (i) c=(a+b)2
(ii) d=4a-3b+lna+ c2
3.Write the script file for the problem:
The radius of a circle is 2cm. Find its area.
4
64 e

0
sin cos60
6


1.1 What is SCILAB
• It is a software for Numerical computations
2D/3D Plotting.
• It is free and open source software.
• Available for various operating systems(OS)
e.g. Windows, Linux and Mac OS/X
• Its syntax is simple.
• Many numerical problems can be expressed in a
reduced number of code lines, as compared to
similar solutions using traditional languages.
1.1 What is SCILAB
• It is a software for Numerical computations
2D/3D Plotting.
• It is free and open source software.
• Available for various operating systems(OS)
e.g. Windows, Linux and Mac OS/X
• Its syntax is simple.
• Many numerical problems can be expressed in a
reduced number of code lines, as compared to
similar solutions using traditional languages.
Continued….
• CNES (French Space Satellite Agency)
using Scilab successfully.
• IIT Mumbai: Shifting all computational
labs to Scilab
1.2. How to Install Scilab
• Visit: www.scilab.org.
• Various versions of Scilab available for
different Operating systems
• Download the file as per the operating system
in your computer.
• And run it in your computer.
• An icon of Scilab is created on your desktop.
• Double click on the icon and we are in Scilab
environment: File browser, console, variable
browser and command history.
• I am using scilab-6.0.1 for the windows
platform in my system
1.3.Working in the console
• Console is the main window of Scilab
• Used for executing commands(Instructions)
• Opening other windows
• Running programs written by the user
• The ‘prompt’ : -->
The horizontal inbuilt arrow on console is called
prompt in front of which we write instruction(s) called
command line.
• role of ‘enter key’: We get the output of our
calculations done on console by pressing the enter key.
It is also used to write new command line
• ‘ans=’ as the default variable:
Continued…
• Role of commas ,
We can write Multiple commands on same command line separated by commas ,
--> 2,3,5
ans =
2.
ans =
3.
ans =
5.
• Role of semicolon ;
If a semicolon(;) is typed at the end of a command the output of the command is not
displayed
--> 2;3;5
ans =
5.
• Role of commands: clc and clear
clc is used to clear the console though data will still remain stored in the memory
clear removes data from memory
1.4.Arithmetic Operations with scalars
Operation Scilab Symbol Example
Addition + -->3+4
ans=
7
Subtraction - -->4-2
ans=
2
Multiplication * -->3*4
ans=
12
Division / -->3/4
ans=
0.75
Exponential ^ -->3^4
ans=
81 (means 34=81)
Order of precedence
Precedence Mathematical Operation
First Parenthesis (Brackets)
Second Exponential
Third Multiplication , Division( equal
Precedence)
Fourth Addition ,Subtraction( equal Precedence)
Exercises
Compute:
(i)7+8/2
(ii) (7+8)/2
(iii) ( 4+2X5)/7
(iv) 271/3+ 320.2
(Answrs: (i)11, (ii)7.5, (iii)2, (iv) 5
1.5.Elementary Math Build-in functions
Function Description Scilab Command Example
Square root sqrt(x) -->sqrt(81)
ans=
9
Real nth root of a real
number x
nthroot(x,n) -->nthroot(80,5)
ans=
2.4022489
Exponential(ex) exp(x) -->exp(5)
ans=
148.41316
Natural log(base e).
ln
log(x) -->log(1000)
ans=
6.9078
Base 10 logarithm.
log
log10(x) -->log10(1000)
ans=
3.0000
Continued…
Function Description Scilab Command Example
x! factorial(x) -->factorial(5)
ans=
120
%pi -->%pi/3
ans=
1.0471976
Complex number %i -->2+3*%i
ans=
2. + 3.i
Sine of angle x (x in radians) sin(x) -->sin(%pi/6)
ans=
0.5
Sine of angle x (x in degrees) sind(x) -->sind(30)
ans=
0.5

1
i  
1.6.Defining scalar variables
• A variable is a name made of a letter or a
combination of several letters that is assigned
a numerical value.
• = sign is called the assignment operator. It
assigns a value to a variable.
• x=15 means the number 15 is assigned to the
variable x
• A variable is actually a name of memory
location where the variable’s assignment is
stored .
1.7.Script Files
• Why we need Script files?
• Using the console to execute a series of
commands is not convenient:
(i)The commands in the console can not be
saved and executed again.
(ii) Every time the enter key is pressed only
the last command is executed, and everything
executed before is unchanged. We can not
edit the previous commands.
1.7.Script Files(Continued…)
• What are Script files?
• A different(better) way of executing commands is first to
create a file with a list of commands(program), save it, and
then run(execute) the file.
• A script file is a sequence of Scilab commands( also called
a program)
• When a script file runs, Scilab executes the commands in
the order they are written just as if they were typed in the
console.
• When a script file has a command that generates an out
put, the output is displayed in the console.
• Using an script file is convenient because it can be edited
and executed many times.
• Script files can be typed and edited in any text editor and
then pasted in to the scilab editor(also called scinotes)
1.7.Script Files(Continued…)
• Creating, saving and executing a Script file
• Scilab script files are created and edited in the editor
window( also called scinotes window)
• To Open the Editor:
Click on the Launch SciNotes icon of the toolbar given
at the top
• Creating script file:
Compute: a=(4+2X5)/7
• To save our work done on editor:
Click on the save as icon of the toolbar given at the
top.
select the folder(or Create a new folder) > name the
file > select save.
1.7.Script Files(Continued…)
• Creating, saving and executing a Script file
(continued…)
• Command line for display of the output of our
computation a done on Editor on console:
disp(a) or disp(a, ‘a=‘)
• Click on the save and execute icon on the tool bar of
the Editor.
• Go to the console and you will see the output
displayed there.
• To Open our SciNotes files:
Click on the open icon given on the tool bar of the
Editor > select the file to be opened > select open

More Related Content

PDF
Scilab for very beginners
PDF
Scilab as a calculator
PDF
First steps with Scilab
PPTX
Cape2013 scilab-workshop-19Oct13
PPTX
Scilab: Computing Tool For Engineers
PPTX
Scilab presentation
PPTX
3_MATLAB Basics Introduction for Engineers .pptx
PPTX
Simulation lab
Scilab for very beginners
Scilab as a calculator
First steps with Scilab
Cape2013 scilab-workshop-19Oct13
Scilab: Computing Tool For Engineers
Scilab presentation
3_MATLAB Basics Introduction for Engineers .pptx
Simulation lab

Similar to 1.Exploration_with_CAS-I.Lab1_(1)[1].ppt (20)

PPT
Introduction to matlab
PPT
Chapter 01.ppt
PPT
Chapter 01.ppt
PPT
Matlab Overviiew
PPTX
PPTX
PDF
Introduction to matlab
PDF
Introduction to matlab
PPTX
Introduction to scientific computing with matlab.pptx
PPT
Palm m3 chapter1b
PPT
Chapter 1.ppt
PPTX
matlab presentation fro engninering students
PDF
Matlab Introduction and Basics Guide.pdf
PPT
matlabchapter1.ppt
PDF
Scilab vs matlab
DOCX
Introduction to matlab
PPTX
Chapter 1 _ Introduction to Matlab.pptx
PPTX
MATLAB for Engineers ME1006 (1 for beginer).pptx
PPTX
Chap#0_Introducation_to_nsnsnnMATLAB.pptx
PPT
Matlab Tutorial.ppt
Introduction to matlab
Chapter 01.ppt
Chapter 01.ppt
Matlab Overviiew
Introduction to matlab
Introduction to matlab
Introduction to scientific computing with matlab.pptx
Palm m3 chapter1b
Chapter 1.ppt
matlab presentation fro engninering students
Matlab Introduction and Basics Guide.pdf
matlabchapter1.ppt
Scilab vs matlab
Introduction to matlab
Chapter 1 _ Introduction to Matlab.pptx
MATLAB for Engineers ME1006 (1 for beginer).pptx
Chap#0_Introducation_to_nsnsnnMATLAB.pptx
Matlab Tutorial.ppt
Ad

Recently uploaded (20)

PDF
3-REasdfghjkl;[poiunvnvncncn-Process.pdf
PPTX
729193dbwbsve251-Calabarzon-Ppt-Copy.pptx
PDF
Volvo EC290C NL EC290CNL excavator weight.pdf
PDF
Volvo EC20C Excavator Step-by-step Maintenance Instructions pdf
PDF
Journal Meraj.pdfuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
PPT
Kaizen for Beginners and how to implement Kaizen
PDF
intrusion control for clean steel 123.pdf
PPTX
Robot_ppt_YRG[1] [Read-Only]bestppt.pptx
PPTX
Cloud_Computing_ppt[1].pptx132EQ342RRRRR1
PDF
Volvo EC290C NL EC290CNL Hydraulic Excavator Specs Manual.pdf
PDF
Life Cycle Analysis of Electric and Internal Combustion Engine Vehicles
PPTX
Understanding Machine Learning with artificial intelligence.pptx
PPTX
Zeem: Transition Your Fleet, Seamlessly by Margaret Boelter
PPTX
UNIT-2(B) Organisavtional Appraisal.pptx
PDF
Volvo EC20C Excavator Service maintenance schedules.pdf
PPTX
Fire Fighting Unit IV industrial safety.pptx
PDF
industrial engineering and safety system
PPTX
Small Fleets, Big Change: Market Acceleration by Niki Okuk
PPTX
capstoneoooooooooooooooooooooooooooooooooo
PPTX
laws of thermodynamics with diagrams details
3-REasdfghjkl;[poiunvnvncncn-Process.pdf
729193dbwbsve251-Calabarzon-Ppt-Copy.pptx
Volvo EC290C NL EC290CNL excavator weight.pdf
Volvo EC20C Excavator Step-by-step Maintenance Instructions pdf
Journal Meraj.pdfuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
Kaizen for Beginners and how to implement Kaizen
intrusion control for clean steel 123.pdf
Robot_ppt_YRG[1] [Read-Only]bestppt.pptx
Cloud_Computing_ppt[1].pptx132EQ342RRRRR1
Volvo EC290C NL EC290CNL Hydraulic Excavator Specs Manual.pdf
Life Cycle Analysis of Electric and Internal Combustion Engine Vehicles
Understanding Machine Learning with artificial intelligence.pptx
Zeem: Transition Your Fleet, Seamlessly by Margaret Boelter
UNIT-2(B) Organisavtional Appraisal.pptx
Volvo EC20C Excavator Service maintenance schedules.pdf
Fire Fighting Unit IV industrial safety.pptx
industrial engineering and safety system
Small Fleets, Big Change: Market Acceleration by Niki Okuk
capstoneoooooooooooooooooooooooooooooooooo
laws of thermodynamics with diagrams details
Ad

1.Exploration_with_CAS-I.Lab1_(1)[1].ppt

  • 1. Exploration with CAS-I BMA151 Objectives: • To enhance the numerical computational skills of prospective engineers using open source software/ computer algebra system(CAS) SCILAB • To plot graphs of complicated functions .
  • 2. Experiment-1:Starting with Scilab • Objectives: 1.1 What is SCILAB? 1.2. How to Install Scilab? 1.3.Working in the console 1.4.Arithmetic Operations with scalars 1.5.Elementary Math Build-in functions 1.6.Defining scalar variables 1.7.Script Files
  • 3. Excercises • To write a Scilab code to find the solution of following problems: • 1. Evaluate: (i) 271/3+ 320.2 , (ii) , (iii) (iv) 4!+ln2+log100, (v) (2+3i)(4+5i) 2. By assigning values 2 and 5 to variables a and b respectively, compute (i) c=(a+b)2 (ii) d=4a-3b+lna+ c2 3.Write the script file for the problem: The radius of a circle is 2cm. Find its area. 4 64 e  0 sin cos60 6  
  • 4. 1.1 What is SCILAB • It is a software for Numerical computations 2D/3D Plotting. • It is free and open source software. • Available for various operating systems(OS) e.g. Windows, Linux and Mac OS/X • Its syntax is simple. • Many numerical problems can be expressed in a reduced number of code lines, as compared to similar solutions using traditional languages.
  • 5. 1.1 What is SCILAB • It is a software for Numerical computations 2D/3D Plotting. • It is free and open source software. • Available for various operating systems(OS) e.g. Windows, Linux and Mac OS/X • Its syntax is simple. • Many numerical problems can be expressed in a reduced number of code lines, as compared to similar solutions using traditional languages.
  • 6. Continued…. • CNES (French Space Satellite Agency) using Scilab successfully. • IIT Mumbai: Shifting all computational labs to Scilab
  • 7. 1.2. How to Install Scilab • Visit: www.scilab.org. • Various versions of Scilab available for different Operating systems • Download the file as per the operating system in your computer. • And run it in your computer. • An icon of Scilab is created on your desktop. • Double click on the icon and we are in Scilab environment: File browser, console, variable browser and command history. • I am using scilab-6.0.1 for the windows platform in my system
  • 8. 1.3.Working in the console • Console is the main window of Scilab • Used for executing commands(Instructions) • Opening other windows • Running programs written by the user • The ‘prompt’ : --> The horizontal inbuilt arrow on console is called prompt in front of which we write instruction(s) called command line. • role of ‘enter key’: We get the output of our calculations done on console by pressing the enter key. It is also used to write new command line • ‘ans=’ as the default variable:
  • 9. Continued… • Role of commas , We can write Multiple commands on same command line separated by commas , --> 2,3,5 ans = 2. ans = 3. ans = 5. • Role of semicolon ; If a semicolon(;) is typed at the end of a command the output of the command is not displayed --> 2;3;5 ans = 5. • Role of commands: clc and clear clc is used to clear the console though data will still remain stored in the memory clear removes data from memory
  • 10. 1.4.Arithmetic Operations with scalars Operation Scilab Symbol Example Addition + -->3+4 ans= 7 Subtraction - -->4-2 ans= 2 Multiplication * -->3*4 ans= 12 Division / -->3/4 ans= 0.75 Exponential ^ -->3^4 ans= 81 (means 34=81)
  • 11. Order of precedence Precedence Mathematical Operation First Parenthesis (Brackets) Second Exponential Third Multiplication , Division( equal Precedence) Fourth Addition ,Subtraction( equal Precedence)
  • 12. Exercises Compute: (i)7+8/2 (ii) (7+8)/2 (iii) ( 4+2X5)/7 (iv) 271/3+ 320.2 (Answrs: (i)11, (ii)7.5, (iii)2, (iv) 5
  • 13. 1.5.Elementary Math Build-in functions Function Description Scilab Command Example Square root sqrt(x) -->sqrt(81) ans= 9 Real nth root of a real number x nthroot(x,n) -->nthroot(80,5) ans= 2.4022489 Exponential(ex) exp(x) -->exp(5) ans= 148.41316 Natural log(base e). ln log(x) -->log(1000) ans= 6.9078 Base 10 logarithm. log log10(x) -->log10(1000) ans= 3.0000
  • 14. Continued… Function Description Scilab Command Example x! factorial(x) -->factorial(5) ans= 120 %pi -->%pi/3 ans= 1.0471976 Complex number %i -->2+3*%i ans= 2. + 3.i Sine of angle x (x in radians) sin(x) -->sin(%pi/6) ans= 0.5 Sine of angle x (x in degrees) sind(x) -->sind(30) ans= 0.5  1 i  
  • 15. 1.6.Defining scalar variables • A variable is a name made of a letter or a combination of several letters that is assigned a numerical value. • = sign is called the assignment operator. It assigns a value to a variable. • x=15 means the number 15 is assigned to the variable x • A variable is actually a name of memory location where the variable’s assignment is stored .
  • 16. 1.7.Script Files • Why we need Script files? • Using the console to execute a series of commands is not convenient: (i)The commands in the console can not be saved and executed again. (ii) Every time the enter key is pressed only the last command is executed, and everything executed before is unchanged. We can not edit the previous commands.
  • 17. 1.7.Script Files(Continued…) • What are Script files? • A different(better) way of executing commands is first to create a file with a list of commands(program), save it, and then run(execute) the file. • A script file is a sequence of Scilab commands( also called a program) • When a script file runs, Scilab executes the commands in the order they are written just as if they were typed in the console. • When a script file has a command that generates an out put, the output is displayed in the console. • Using an script file is convenient because it can be edited and executed many times. • Script files can be typed and edited in any text editor and then pasted in to the scilab editor(also called scinotes)
  • 18. 1.7.Script Files(Continued…) • Creating, saving and executing a Script file • Scilab script files are created and edited in the editor window( also called scinotes window) • To Open the Editor: Click on the Launch SciNotes icon of the toolbar given at the top • Creating script file: Compute: a=(4+2X5)/7 • To save our work done on editor: Click on the save as icon of the toolbar given at the top. select the folder(or Create a new folder) > name the file > select save.
  • 19. 1.7.Script Files(Continued…) • Creating, saving and executing a Script file (continued…) • Command line for display of the output of our computation a done on Editor on console: disp(a) or disp(a, ‘a=‘) • Click on the save and execute icon on the tool bar of the Editor. • Go to the console and you will see the output displayed there. • To Open our SciNotes files: Click on the open icon given on the tool bar of the Editor > select the file to be opened > select open