Difference between revisions of "Scilab"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Advanced Level Scilab)
(Basic Level Introduction to Scilab)
 
(37 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Spoken Tutorial Banner}}
+
       
           
+
'''Scilab''' (http://scilab.org, http://scilab.in) is an open source scientific software package for numerical computations.  It has an extremely reliable and efficiently coded numerical library.  It is also a high productivity tool: Through its interpreted language, one can quickly develop the code required to solve problems.  Typically, if it takes ten lines of C code for some calculation, Scilab would require only one for the same purpose.   
Scilab (http://scilab.org, http://scilab.in, http://scilab.cn) is an open source scientific software package for numerical computations.  It has an extremely reliable and efficiently coded numerical library.  It is also a high productivity tool: Through its interpreted language, one can quickly develop the code required to solve problems.  Typically, if it takes ten lines of C code for some calculation, Scilab would require only one for the same purpose.   
+
  
 
Scilab runs on all popular operating systems.  Since 1994, it has been distributed freely along with the source code via the Internet.  It is useful for students at school, college and <span class="plainlinks">[http://www.netlook.com.br/ <span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">roupas da moda</span>] research level.  It is also useful for researchers and professionals.
 
Scilab runs on all popular operating systems.  Since 1994, it has been distributed freely along with the source code via the Internet.  It is useful for students at school, college and <span class="plainlinks">[http://www.netlook.com.br/ <span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">roupas da moda</span>] research level.  It is also useful for researchers and professionals.
  
IIT Bombay is leading the effort to popularise Scilab in India.  This is part of the Free and Open source Software for Science and Engineering Education (FOSSEE) project, supported by the National Mission on Education through ICT of MHRD (http://spoken-tutorial.org/NMEICT-Intro).
+
IIT Bombay is leading the effort to popularise Scilab in India.  This is part of the Free and Open source Software for Science and Engineering Education (FOSSEE) project, supported by the National Mission on Education through ICT of MHRD.
  
 
IIT Bombay is using Spoken Tutorials (http://spoken-tutorial.org) to create learning material for FOSS.  This is the main page for the organisation of the scripts required for Scilab spoken tutorials.  We invite the Scilab user community to participate in this activity.
 
IIT Bombay is using Spoken Tutorials (http://spoken-tutorial.org) to create learning material for FOSS.  This is the main page for the organisation of the scripts required for Scilab spoken tutorials.  We invite the Scilab user community to participate in this activity.
  
 +
'''Learners''': All Science and Engineering Students.
 +
 +
 +
 +
<blockquote style="background-color: lemonchiffon; border: solid thin grey;">
 +
The Spoken Tutorial Effort for Scilab is being contributed by Shalini Shrivastava, Rupak Rokade, Anuradha Amruthkar, Manas Ranjan Das, Mukul Kulkarni, Shamika Mohanan, Lavitha Pereira from IIT Bombay.
 +
 +
</blockquote>
 
__TOC__
 
__TOC__
  
Line 16: Line 23:
 
=General Information=
 
=General Information=
 
This topic will include all functionality in Scilab that <span class="plainlinks">[http://thebeginnerslens.com/ <span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">iphone photography</span>] is not domain specific- functionality that is required across several domains.  
 
This topic will include all functionality in Scilab that <span class="plainlinks">[http://thebeginnerslens.com/ <span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">iphone photography</span>] is not domain specific- functionality that is required across several domains.  
== Why Scilab ==
 
 
 
==Basic Level Introduction to Scilab==
 
==Basic Level Introduction to Scilab==
 
This level will include a set of tutorials that are required to be known in order to qualify as "Scilab Literate". The tutorials here will teach programming <span class="plainlinks">[http://www.bestpills4weightloss.com/ <span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">weight loss pills</span>]
 
This level will include a set of tutorials that are required to be known in order to qualify as "Scilab Literate". The tutorials here will teach programming <span class="plainlinks">[http://www.bestpills4weightloss.com/ <span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">weight loss pills</span>]
 
fundamentals and the most commonly used Scilab functionality- Matrix operations and Plotting.  
 
fundamentals and the most commonly used Scilab functionality- Matrix operations and Plotting.  
#  Installing   
+
'''Installing'''  
#* Show where to download from and how to decide which version to choose (OS and 32/64bit) (www.scilab.org/download)
+
#* Show where to download from and how to decide which version to choose  
#* Windows installation (Internet Connection is necessary)
+
#* Windows installation  
 
#* Linux installation (using package manager- show only Debian/Ubuntu as example (sudo apt-get install scilab) as well as generic binary)
 
#* Linux installation (using package manager- show only Debian/Ubuntu as example (sudo apt-get install scilab) as well as generic binary)
 
#* Mac
 
#* Mac
 
#* Compilation from source can come as a part of a more advanced tutorial
 
#* Compilation from source can come as a part of a more advanced tutorial
# Getting Started: Basic Housekeeping
+
# '''Getting Started'''
#* Expressions: Show mathematical expressions with numbers (42+4^2-64/4).
+
#* Expressions: Show mathematical expressions with numbers  
#* Variables: Assign scalars to variables- a=1, b=2, c=3.
+
#* Variables
#* Diary:CD, diary open and close and show transcript of some calculations given below
+
#* Diary command
#* Define symbolic constants. Use %i as example. Verify showing %i*%i to be -1. Also show sqrt(-1). Define a complex number (5*%i) and show a complex number expression (10+5*%i)*(2*%i). Show %pi and %e.  
+
#* Define symbolic constants.
#* Basic functions Show sin(%pi/2), cos(%pi/2), exp(1) versus %e, exp(2) versus %e^2. Define a matrix.
+
#* Basic functions  
 
#* suppressing output(;)
 
#* suppressing output(;)
 
#* help,clc
 
#* help,clc
#:--------------------------------------------------------------------------------------------------------------------------------------------
+
#'''Vector Operations'''  
#: '''Matrix Operations'''  
+
#*Define vector
#Vector Operations
+
#*Calculate length of a vector.
#* Define p = [1 2 3], q = [2 3 4]
+
#*Perform mathematical operations on Vectors such as addition,subtraction and multiplication.
#* size(p), length(p) 
+
#*Define a matrix.
#* p+q, q-p, p*q, p', p'*q, p*q'
+
#*Calculate size of a matrix.
#* Define P = [1 2 3; 4 5 6]
+
#*Perform mathematical operations on Matrices such as addition, subtraction and multiplication.
#* size(P), P'
+
#'''Matrix Operations'''
# Matrix Operations  
+
#*Access the elements of Matrix
#* Square matrices Q = [1 5; 2 4], S = [2 0; 4 1]
+
#*Determine the determinant, inverse and eigen values of a matrix.
#* det(Q), diag(Q), T=Q+S, Q-S, Q*S, E = 2*Q + 3*S
+
#*Define special matrices.
#* Matrix generation: zeros(3,4), ones(2,5), eye(4,4), diag([1 2 3]), rand(2,3). Also show how one can generate these matrices (zeros, ones, eye, rand) of the same size as another matrix by passing that other matrix as an argument- zeros(A), rand(A).
+
#*Perform elementary row operations.
#* Ranges: 1:4, 2:2:8, linspace(1, 9, 5) (linspace is to be explained in Plotting 2D graphs tutorial)
+
#*Solve the system of linear equations.
#* Referring: P(2), P(2,1), P(6), P(3,2), P(1,$), P(2,:), P(:,2), P([2 3],[1 3]), P(1,2)=8.5
+
#''' Conditional Branching'''
#* Elementary row operations:P(2,:) = P(2,:) - 4*P(1,:)
+
#*'if' and 'then' with the example  
#* Solving equations: P = [1 2 -1; -2 -6 4 ; -1 -3 3], q = [1; -2; 1], x=P\q
+
#*use of the 'else' keyword  
#:--------------------------------------------------------------------------------------------------------------------------------------------
+
#*use of the 'elseif' keyword  
# Conditional Branching  
+
#*example for select
#* Explain booleans: %T and %F- they form the basis for the if statement.
+
#''' Iteration'''  
#* First explain 'if' and 'then' with the example: n = 42, if (n == 42) then disp("The number is forty two"), end
+
#* Explain syntax of 'for' statement- tell that the variable iterates over a list/vector/matrix (or an expression that evaluates to any of these).
#* Now explain the use of the 'else' keyword: n = 54, if (n == 42) then disp("The number is forty two"), else disp("The number is not forty two"), end
+
#* Now explain the use of the 'elseif' keyword: n = 54, if (n == 42) then disp("The number is forty two"), elseif (n == 54) then, disp("The number is fifty four"), else disp("The number is neither forty two nor fifty four"), end
+
#* Say that if there are several branches, it may be clearer to use the 'select' keyword.
+
#* Give example for select: n = 100, select n, case 42, disp("The number is forty two"), case 54, disp("The number is fifty four"), else disp("The number is neither forty two nor fifty four"), end
+
<!--#* try, catch ? (Perhaps not a good idea to put try catch in this level- advanced level would be a better fit.-->
+
#* Branching can be based on satisfaction of combination of multiple conditions as well: a=1, b=2; if (a>0 & b>0), disp('product of a and b would be positive'), elseif (a==0 | b==0) disp('product of a and b would be zero'), end   
+
# Iteration
+
#* Explain syntax of 'for' statement- tell that the variable iterates over a list/vector/matrix (or an expression that evaluates to any of these).  
+
 
#* Give example: for i = 1:5, disp (i), end
 
#* Give example: for i = 1:5, disp (i), end
 
#* Then explain break condition. Use example: for i = 1:10, disp(i), if (i==5), break, end, end
 
#* Then explain break condition. Use example: for i = 1:10, disp(i), if (i==5), break, end, end
 
#* Then explain continue condition. Use example: for i = 1:10, if (i<=5) then continue, else disp(i), end, end
 
#* Then explain continue condition. Use example: for i = 1:10, if (i<=5) then continue, else disp(i), end, end
#* Explain while condition.  
+
#* Explain while condition.
#* Give example: i = 0; while(i <=5), i = i + 1; disp(i), end
+
#* Give example: i = 0; while(i <=5), i = i + 1; d
#* Then explain break, continue condition with example in while loop.
+
# '''Scripts and Functions'''
# Plotting 2D graphs  
+
#*Introduction to the file formats in Scilab.
 +
#*SCRIPT files.
 +
#*sce versus .sci
 +
#*Inline functions.  
 +
# ''' Plotting 2D graphs'''
 
#* About linspace: linspace is a linearly spaced vector.
 
#* About linspace: linspace is a linearly spaced vector.
 
#* Plot a simple graph: x=linspace(12,34,10), y=linspace(-.1,2,10), plot(x,y)
 
#* Plot a simple graph: x=linspace(12,34,10), y=linspace(-.1,2,10), plot(x,y)
#* plot2d(x,y,style=1), style can have different values, style=1 gives black coloured graph line, style=2 gives blue coloured graph line and so on
+
#* plot2d  
#* Show that if one tries to plot another graph without closing the first one, the plot will appear over the first graph. This may or may not be desirable- one may want to plot the second graph in a fresh window. Then explain how scf() can be used to alternate between graph windows.
+
#* Use of "clf()".  
#* Using clf() clear the graphic window.  
+
#* Configure the title for the plot
#* Configure the title for the plot using title("My title"), Configure the axis separately using xlabel("X"), ylabel("Y")
+
#* Configure a legend  
#* Configure a legend to know what curve is associated with y1 = x^2 and what curve is associated with y2 = 2x^2.
+
 
#* Divide a graphic window into a matrix of sub-windows using subplot(mnp)
 
#* Divide a graphic window into a matrix of sub-windows using subplot(mnp)
# Scripts and Functions
+
#''' Xcos introduction'''
#* Explain that one often repeats a set of commands- in which case it is helpful to save that set of commands for future or repeated use. The commands can be saved as scripts or functions.  
+
#*What is XCOS.
#* Change directory to the desktop. Open the scilab editor and type the commands (each on a new line): disp("Hello world"); a=1; b=2; c=a+b; disp(c); disp("Goodbye, world");
+
#*What is palette.
#* Save the above file to the desktop. Then open the same file using a regular text editor such as notepad to show that it is indeed a text file. Now load the file into scilab using the scilab editor's execute menu option.  
+
#*To collect the blocks from the palette and connect them to construct the block diagram.
#* Change the value of a to 5 in the editor, save and close it. Now execute the script directly from the scilab interpreter using exec.  
+
#*Set the parameters of different blocks.
#* Functions: Show the syntax of functions, explain the function keyword, input arguments and the structure of output arguments when there is more than one argument.  
+
#*To setup the simulation parameters.
#* Show the following function in the editor: function [degrees] = radians2degrees(radians) degrees = radians*(180/%pi); endfunction. Save the function file and exec it from scilab. Then show radians2degrees(%pi/2), radians2degrees(%pi/4).  
+
#*Simulate the constructed block diagram.
#* Inline functions: show how to define degrees2radians, i.e. inverse of the above function, as an inline function.  
+
#* .sce versus .sci: These are just conventions- sci is used for scripts containing only function definitions- sce is used for all other scripts.
+
# Input and Output
+
#* Console input and output:
+
#** input function: age = input("Enter your age: "). Then try entering name: name = input("Enter your name"). Enter name without quotes- will give an error. Then enter name with qutoes- that'll work. Explain that if string input is expected, then you can use: name = input("Enter your name", "string")
+
#** Output function: Show disp(age) and disp(name). Formatted output: mprintf("Your name is %s and your age is %d", name, age)
+
#* Reading and writing in files: Do a = rand(20, 1)
+
#** Text files:
+
#*** Output- write(): write('my-random-numbers.txt', a). Open and show the text file.
+
#*** Input- read(): b = read('my-random-numbers.txt', 20, 1). Now do b - a.
+
#** Binary files: Back up a thus: a_backup = a. Now clear a.
+
#*** Output- save(): save('my-random-numbers.dat', a). Try opening in notepad- show it's really binary.
+
#*** Input- load(): load('my-random-numbers.dat', 'a'). Now do a_backup - a.
+
#*** Say that you can load only some variables if needed: save('personaldetails.dat', name, age), clear, disp(name) //error, disp(age) //error, load('personaldetails.dat', 'name'), disp(name) //no error, disp(age) //error
+
  
 
==Advanced Level Scilab==
 
==Advanced Level Scilab==
# File Handling- Scilab File handling
+
# '''File Handling- Scilab File handling'''
# File Handling- User Defined Input and Output in Scilab
+
#* Writing to a file using write()
# [[/Advanced Level/Submatrix Operations/ | Submatrix Operations]]
+
#* Reading from a file using read()
# [[/Advanced Level/Advanced 2D graphs/ | Advanced 2D graphs]] (histrograms, bar charts, pie charts, colourmaps, contours)
+
#* Opening an existing file using mopen()
# [[/Advanced Level/Plotting 3D graphs/ | Plotting 3D graphs]]
+
#* Closing an already opened file using mclose()
# [[/Advanced Level/Polynomials/ | Polynomials ]]
+
# '''File Handling- User Defined Input and Output in Scilab'''
#* create a polynomial
+
#* Input Function
#* roots
+
#* mprintf()
#* operations: addition,multiplication,division
+
#* save() and load()
#* derivative,horner
+
#* Used to quit scilab midway through calculation and continue at later stage
#* simp,factors,pfss,trfmod
+
# '''Numerical methods- Integration'''
# [[/Advanced Level/Lists/ | Lists]]
+
#* Develop Scilab code for different Composite Numerical Integration algorithms
# [[/Advanced Level/Sparse matrix operations/ | Sparse matrix operations]]
+
#* Divide the integral into equal intervals
# [[/Advanced Level/Function Libraries/ | Function Libraries]]
+
#* Apply the algorithm to each interval
# [[/Advanced Level/Debugging/ | Debugging]]
+
#* Calculate the composite value of the integral
# [[/Advanced Level/Batch Processing/ | Batch Processing]]
+
# '''Numerical methods- Solving Non- linear Equations'''
# [[/Advanced Level/Numerical Analysis/ | Numerical Analysis]]
+
#*Learn how to solve nonlinear equations using numerical methods
# [[/Advanced Level/Toolboxes/ | Toolboxes in Scilab]]
+
#*Learn Bisection method
#* Installing a toolbox
+
#*Learn Secant method
#** In Scilab 5.2.2+, go to Applications and click on Module manager. Show list of available toolboxes and select one (say, Metanet toolbox)
+
#*Learn how to develop Scilab code for solving nonlinear equations
#** Click on the install button to install it.
+
# '''Numerical methods- Gaussian Methods'''
#** After the toolbox has been downloaded and installed, open the demos section and show a demo of the Metanet toolbox.
+
#* Explain Gauss Elimination method algorithm
#* Creating a toolbox
+
#* Explain code for Gauss Elimination method and solve an example using this code
 
+
#* Explain Gauss Jordan method algorithm
==Xcos==
+
#* Explain code for Gauss Jordan method and solve an example using this code
* [[/Xcos/Introduction/|Introduction to Xcos]]
+
# '''Numerical methods-  Iterative Methods'''
* [[/Xcos/Introduction/|Electronics Circuit Simulation using XCOS]]
+
#*Solve system of linear equations using iterative methods
 
+
#*Use Jacobi and Gauss Seidel iterative methods
=Signals and Systems=
+
#*Learn how to iterate until we converge at the solution
==Control Systems==
+
#*Learn how Gauss Seidel method is faster than Jacobi method
Outline for a set of spoken tutorials on Control Systems
+
#*Develop Scilab code for these two methods to solve linear equations
 
+
#'''Numerical methods-  Interpolation'''
Representing control systems and their properties
+
#*Develop Scilab code for different Numerical Interpolation algorithms
# [[First order systems]] (1)
+
#*Calculate new value of function from given data points
#* Defining a system
+
# '''Numerical methods- ODE- Euler methods'''
#* Simulating the system
+
#*Solve ODEs using Euler and Modified Euler methods
#** Step test
+
#*Develop Scilab code to solve ODEs
#** Sine test (at two different frequencies)
+
# '''Numerical methods- ODE- Applications'''
#* Root locus
+
#*Use Scilab ode function
#* Bode plot
+
#*Solve typical examples of ODEs
#* Nyquist plot (1)
+
#*Plot the solution
# [[Second order systems]] (2)
+
#*examples Motion of simple pendulum Van der Pol equation
#* Underdamped system
+
#*Lorenz system
#** Defining the system
+
# ''' Optimization Using Karmarkar Functions'''
#** Roots of denominator
+
#* About Optimization
#* Step test
+
#* Use of Scilab function Karmarkar in Optimization
# [[Other system representations]] (3)
+
#'''Digital Signal Processing'''
#* Discrete time systems (3)
+
#* Plotting continuous and discrete sine wave.
#** Defining a system
+
#* Plotting step function.
#** Simulating the system (step test)
+
#* Plotting ramp function.
#** Bode plot
+
# '''Control systems'''
#** Root locus
+
#*Define a continuous time system: second and higher order
#* Discretizing continuous time systems (3)
+
#*Response plot for step input
# [[State space representation]] (4)
+
#*Response plot for sine input
#* Defining the system and initial state
+
#*Bode plot
#* Simulating the system
+
#*Study numer and denom Scilab functions
#* Plotting output state and internal state
+
#*Plot poles and zeros of function
#* Root locus
+
# '''Discrete systems'''
#* Conversion to transfer function
+
#*Define discrete time system variable z
#** Compare roots of denominator of answer with eigenvalues of A matrix.
+
#*Define first order discrete time system
# [[Multiple subsystems]] (5)
+
#*Explain ones, flts, dscr, ss2tf functions
<!--
+
# '''Calling User Defined Functions in XCOS'''
System modeling and control:-->
+
#* Write a squaring function
# [[Modeling a system]] (6)
+
#* Use of scifunc block in XCOS
#*       Obtain ODE representation of a system
+
#* Use of MUX block
#*       Laplace transform representation of the system
+
#* Call functions having multiple inputs and output
#*       Comparison with a second order model (obtain natural freq. and damping factor)
+
#Simulating a PID controller using XCOS
#   [[Analyzing the system]] (7)
+
#* Modifying firstorder.xcos file to implement a PID controller
#*       Open loop step response
+
#* Closing the loop
#*       Step response with unity feedback
+
#* Setting PID gains and observing its response
#*       Steady state error: open loop system as well as unity feedback system
+
#* Plotting the required data
#*       Root locus and finding the gain from a point on the root locus.
+
#Developing Scilab Toolbox for calling external C libraries
#   [[Controlling the system]] (8)
+
#* Compiling an external C library
#*       Proportional control
+
#* Generating shared library
#*           Deciding the parameters to be achieved (overshoot/rise time, etc)
+
#* Copying the shared library to Scilab Toolbox
#*           Determining corresponding system parameters (natural freq., damping factor)
+
#* Interfacing the shared library with Scilab
#*            Obtaining location of corresponding point on root locus and gain there
+
#* Understanding the important code sections for interfacing
#*           Building and simulating the proportional controller
+
#* Building a Scilab Toolbox using this library
#   [[Other Controllers]]  (9)
+
#* Loading the toolbox
#* PI Control
+
#* Executing an example in help
#* PD Control
+
#* Verification of results
#* PID Control
+
#* Understanding how to write Help for Toolbox functions
#* Comparing all controllers
+
# Developing Scilab Toolbox for calling Python and its functions
 
+
#* About Scithon toolbox
==Robotics==
+
#* About header folder
# rtss Toolbox
+
#* Interfacing between Scilab and Python
==Signal Processing==
+
#* Files used for starting the python instance and overloaded virtual functions
#Signal Processing Basics
+
#* Links to understand the code inside the PyVar.CPP file
#Audio processing
+
#* About Builder script of scithon toolbox
#Image Processing
+
#* About Gateway functions
#Fourier Transforms
+
#* How to build a toolbox
=Other Topics=
+
#* How to load a toolbox
 
+
#* Demo on how to execute the python functions in Scilab
==Ordinary Differential Equations==
+
[http://spoken-tutorial.org/wiki/index.php/Scilab/Scripts-1 (Spoken Tutorial-1 Scripts)]<ol>
+
 
+
<li>[[/ Introduction to ODEs /Introduction to ODEs/|Introduction to ODEs]]
+
*<p>Use <math>\frac{dx}{dt} = sin(2t)</math> as the first order example and solve using ode.</p>
+
**System:
+
  <source lang="scilab" line start="1">
+
  function dx = f(t, x)
+
        dx = sin(2∗t) ;
+
  endfunction
+
</source>
+
 
+
*2nd order differntial equation, Lotka Volterra equation example,
+
*Using champ to show arrows.
+
*With input (nonlinear input/state system). van der Pol oscillator?
+
 
+
*3rd order, show example and plot.
+
 
+
*One example for discrete time system (difference equation) (of order 2)
+
 
+
*Show points evolving in plane.
+
*Linear system: syslin
+
 
+
*Solution:
+
  <source lang="scilab" line start="1">
+
  t0 = 0
+
  x0 = −0.5
+
  t = 0:0.1:5;
+
  x = ode( x0 , t0 , t , f ) ;
+
  plot2d(t , x)
+
</source>
+
</li>
+
<li> [[/ Using ODEOPTIONSs /Using ODEOPTIONS/|Using ODEOPTIONS]]</li>
+
<li> [[Implicit Differential Equations/Implicit Differential Equations/|Implicit Differential Equations]]</li>
+
</ol>
+
 
+
 
+
===Boundary Value Problems===
+
===Difference Equations===
+
===Differential Algebraic Equations===
+
===Partial Differential Equations===
+
 
+
==Linear Algebra==
+
 
+
Revise linsolve.
+
 
+
spec, det, generalized eigenvalue (spec)
+
 
+
inv and pinv (pseudo inverse), svd, companion-form
+
 
+
trace, sum of eigenvalues almost same as trace (similarly determinant and product of eigenvalues)
+
 
+
==Optimization==
+
==Probability and Statistics==
+
==Scilab Toolboxes==
+
<nowiki>Symbolic toolbox</nowiki> [http://spoken-tutorial.org/wiki/index.php/Scilab_Symbolic_Toolbox Scripts]
+
<nowiki>Scilab Wavelet toolbox</nowiki> [http://spoken-tutorial.org/wiki/index.php/Scilab_wavelet_toolbox Scripts]
+
 
+
==Special Functions==
+
#Bessel functions
+
#[[Beta function]]
+
#*Definition
+
#*beta(m,n)=beta(n,m)
+
#*beta(m,n)=gamma(m)*gamma(n)/gamma(m+n)
+
#[[Gamma function]]
+
#*Definition
+
#*gamma(1), gamma(0)
+
#*gamma(n+1)=n!
+
#*gamma(11/2), gamma(1/2)
+
#Error function
+
#Legendre functions
+
 
+
==Least squares fit, splines==
+
==Polynomial interpolation==
+
 
+
Close relation between interpolation and van der Monde matrix
+
 
+
Subset of columns of van der Monde matrix will correspond to lower degree fit.
+
 
+
Solvability of over-determined equations perhaps not possible.
+
 
+
Pseude inverse corresponds to "least squares fit" of specified degree.
+
 
+
==Data Handling==
+
# Databases
+
# XMLLab
+
==Web Interface for Scilab (W3 Scilab)==
+

Latest revision as of 15:41, 21 October 2020

Scilab (http://scilab.org, http://scilab.in) is an open source scientific software package for numerical computations. It has an extremely reliable and efficiently coded numerical library. It is also a high productivity tool: Through its interpreted language, one can quickly develop the code required to solve problems. Typically, if it takes ten lines of C code for some calculation, Scilab would require only one for the same purpose.

Scilab runs on all popular operating systems. Since 1994, it has been distributed freely along with the source code via the Internet. It is useful for students at school, college and roupas da moda research level. It is also useful for researchers and professionals.

IIT Bombay is leading the effort to popularise Scilab in India. This is part of the Free and Open source Software for Science and Engineering Education (FOSSEE) project, supported by the National Mission on Education through ICT of MHRD.

IIT Bombay is using Spoken Tutorials (http://spoken-tutorial.org) to create learning material for FOSS. This is the main page for the organisation of the scripts required for Scilab spoken tutorials. We invite the Scilab user community to participate in this activity.

Learners: All Science and Engineering Students.


The Spoken Tutorial Effort for Scilab is being contributed by Shalini Shrivastava, Rupak Rokade, Anuradha Amruthkar, Manas Ranjan Das, Mukul Kulkarni, Shamika Mohanan, Lavitha Pereira from IIT Bombay.

Note: Each numbered topic corresponds to a single spoken tutorial. Each bulleted point corresponds to a command or topic that must be covered organic nuts in the given spoken tutorial.


General Information

This topic will include all functionality in Scilab that iphone photography is not domain specific- functionality that is required across several domains.

Basic Level Introduction to Scilab

This level will include a set of tutorials that are required to be known in order to qualify as "Scilab Literate". The tutorials here will teach programming weight loss pills fundamentals and the most commonly used Scilab functionality- Matrix operations and Plotting.

  1. Installing
    • Show where to download from and how to decide which version to choose
    • Windows installation
    • Linux installation (using package manager- show only Debian/Ubuntu as example (sudo apt-get install scilab) as well as generic binary)
    • Mac
    • Compilation from source can come as a part of a more advanced tutorial
  2. Getting Started
    • Expressions: Show mathematical expressions with numbers
    • Variables
    • Diary command
    • Define symbolic constants.
    • Basic functions
    • suppressing output(;)
    • help,clc
  3. Vector Operations
    • Define vector
    • Calculate length of a vector.
    • Perform mathematical operations on Vectors such as addition,subtraction and multiplication.
    • Define a matrix.
    • Calculate size of a matrix.
    • Perform mathematical operations on Matrices such as addition, subtraction and multiplication.
  4. Matrix Operations
    • Access the elements of Matrix
    • Determine the determinant, inverse and eigen values of a matrix.
    • Define special matrices.
    • Perform elementary row operations.
    • Solve the system of linear equations.
  5. Conditional Branching
    • 'if' and 'then' with the example
    • use of the 'else' keyword
    • use of the 'elseif' keyword
    • example for select
  6. Iteration
    • Explain syntax of 'for' statement- tell that the variable iterates over a list/vector/matrix (or an expression that evaluates to any of these).
    • Give example: for i = 1:5, disp (i), end
    • Then explain break condition. Use example: for i = 1:10, disp(i), if (i==5), break, end, end
    • Then explain continue condition. Use example: for i = 1:10, if (i<=5) then continue, else disp(i), end, end
    • Explain while condition.
    • Give example: i = 0; while(i <=5), i = i + 1; d
  7. Scripts and Functions
    • Introduction to the file formats in Scilab.
    • SCRIPT files.
    • sce versus .sci
    • Inline functions.
  8. Plotting 2D graphs
    • About linspace: linspace is a linearly spaced vector.
    • Plot a simple graph: x=linspace(12,34,10), y=linspace(-.1,2,10), plot(x,y)
    • plot2d
    • Use of "clf()".
    • Configure the title for the plot
    • Configure a legend
    • Divide a graphic window into a matrix of sub-windows using subplot(mnp)
  9. Xcos introduction
    • What is XCOS.
    • What is palette.
    • To collect the blocks from the palette and connect them to construct the block diagram.
    • Set the parameters of different blocks.
    • To setup the simulation parameters.
    • Simulate the constructed block diagram.

Advanced Level Scilab

  1. File Handling- Scilab File handling
    • Writing to a file using write()
    • Reading from a file using read()
    • Opening an existing file using mopen()
    • Closing an already opened file using mclose()
  2. File Handling- User Defined Input and Output in Scilab
    • Input Function
    • mprintf()
    • save() and load()
    • Used to quit scilab midway through calculation and continue at later stage
  3. Numerical methods- Integration
    • Develop Scilab code for different Composite Numerical Integration algorithms
    • Divide the integral into equal intervals
    • Apply the algorithm to each interval
    • Calculate the composite value of the integral
  4. Numerical methods- Solving Non- linear Equations
    • Learn how to solve nonlinear equations using numerical methods
    • Learn Bisection method
    • Learn Secant method
    • Learn how to develop Scilab code for solving nonlinear equations
  5. Numerical methods- Gaussian Methods
    • Explain Gauss Elimination method algorithm
    • Explain code for Gauss Elimination method and solve an example using this code
    • Explain Gauss Jordan method algorithm
    • Explain code for Gauss Jordan method and solve an example using this code
  6. Numerical methods- Iterative Methods
    • Solve system of linear equations using iterative methods
    • Use Jacobi and Gauss Seidel iterative methods
    • Learn how to iterate until we converge at the solution
    • Learn how Gauss Seidel method is faster than Jacobi method
    • Develop Scilab code for these two methods to solve linear equations
  7. Numerical methods- Interpolation
    • Develop Scilab code for different Numerical Interpolation algorithms
    • Calculate new value of function from given data points
  8. Numerical methods- ODE- Euler methods
    • Solve ODEs using Euler and Modified Euler methods
    • Develop Scilab code to solve ODEs
  9. Numerical methods- ODE- Applications
    • Use Scilab ode function
    • Solve typical examples of ODEs
    • Plot the solution
    • examples Motion of simple pendulum Van der Pol equation
    • Lorenz system
  10. Optimization Using Karmarkar Functions
    • About Optimization
    • Use of Scilab function Karmarkar in Optimization
  11. Digital Signal Processing
    • Plotting continuous and discrete sine wave.
    • Plotting step function.
    • Plotting ramp function.
  12. Control systems
    • Define a continuous time system: second and higher order
    • Response plot for step input
    • Response plot for sine input
    • Bode plot
    • Study numer and denom Scilab functions
    • Plot poles and zeros of function
  13. Discrete systems
    • Define discrete time system variable z
    • Define first order discrete time system
    • Explain ones, flts, dscr, ss2tf functions
  14. Calling User Defined Functions in XCOS
    • Write a squaring function
    • Use of scifunc block in XCOS
    • Use of MUX block
    • Call functions having multiple inputs and output
  15. Simulating a PID controller using XCOS
    • Modifying firstorder.xcos file to implement a PID controller
    • Closing the loop
    • Setting PID gains and observing its response
    • Plotting the required data
  16. Developing Scilab Toolbox for calling external C libraries
    • Compiling an external C library
    • Generating shared library
    • Copying the shared library to Scilab Toolbox
    • Interfacing the shared library with Scilab
    • Understanding the important code sections for interfacing
    • Building a Scilab Toolbox using this library
    • Loading the toolbox
    • Executing an example in help
    • Verification of results
    • Understanding how to write Help for Toolbox functions
  17. Developing Scilab Toolbox for calling Python and its functions
    • About Scithon toolbox
    • About header folder
    • Interfacing between Scilab and Python
    • Files used for starting the python instance and overloaded virtual functions
    • Links to understand the code inside the PyVar.CPP file
    • About Builder script of scithon toolbox
    • About Gateway functions
    • How to build a toolbox
    • How to load a toolbox
    • Demo on how to execute the python functions in Scilab

Contributors and Content Editors

Lavitha Pereira, Minal, Nancyvarkey, PoojaMoolya, Pratik kamble