Académique Documents
Professionnel Documents
Culture Documents
Scilab
Noes Introdutrias
26 e 27 de Fevereiro de 2013
Scilab
Toda a informao gravada na rea local ser apagada aps logout Gravar toda a informao numa pen ou na net Scilab um pacote de software idntico ao Matlab e ao Octave Scilab ser usado como linguagem de suporte para ICP
Scilab
sin(), cos(), tan(), cotg() asin(), acos(), atan() sinh(), cosh(), tanh(), coth() asinh(), acosh(), atanh() sqrt(), exp() sum() min(), max() abs(), sign() real(f), imag(f)
Trigonometric functions, e.g. sin(.2*%pi) Arc functions Hyperbolic functions Inverse hyperbolic functions Square root, e.g. sqrt(2) / exponent Sum Minimum / maximum value Absolute value, e.g. abs(sinc(x)) / sign Real & imaginary parts of a complex f
Imaginary unit Pi Napiers constant e Precision (machine dependent) Infinite (not mathematically infinite) Not a Number
s z true false
Scilab operators ; , ' .' [] , [] ' () +, * , .* End of expression, row separator Instruction, argument or column separator Conjugate (matrix) transpose, string delimiter* Non-conjugate transpose Vector or matrix definition concatenation, transposed matrix The pair of left/ right parenthesis is used for various purposes Addition, subtraction Multiplication, element-by-element multiplication
*) Both simple (') and double (") quotes are allowed to define character strings
Scilab operators / , ./ \ , .\ ^ or ** , .^ .*. ./. , .\. | & ~ ==, >=, <=, >, <, < >, ~= Right division, element-by-element right division Left division, element-by element left division Power (exponent), element-by-element power Kronecker product Kronecker right and left division Logical OR Logical AND Logical NOT Equal to, equal or greater than, equal or less than, greater than, less than, not equal to (two alternatives)
who : list of variables browsevar Variable name: to see the contents of the variable pwd: shows working directory cd: changes the working directory mkdir: creates a new directory F1 // Help F2 // clears console
Scilab - demo a=2e-2 b=3e-5; 2+3*sin(%pi/4) c=a*b c=a*b; c^2 cos(c) x=cos(c); y=sin(c); x^2+y^2 %pi %i %e %eps (corresponds to the maximum value for which 1+%eps=1) %inf (infinity) %nan (not-a-number) test=%nan; isnan(test); (also isinf) %t (bolean True) %f (bolean False) a=3; // a=5 coments %s
Scilab - demo a=12 // real constant b=2>1 // bolean constant (i.e., logical) c=Instrumentao e controlo de processos // character string den=[1 2 3]; // row vector den // transpose: column vector r=poly(1.,x,roots) //polynomial with variable x and root 1.0 r=poly(1.,x,r) //polynomial with variable x and root 1.0 t=poly([1 2 3 4 5 6],'x',"coeff") // default value is roots t=poly([1 2 3 4 5 6],'x',c) // default value is roots s=poly([1 2 3],x) //polynomial with variable x and root 1.0, 2.0, 3.0 s=poly(den,x) //polynomial with variable x and root 1.0, 2.0, 3.0 u=(1+2*%s-5*%s^2+6*%s^3) q=r/s // rational expression roots(t) horner(u,1) //evaluates the polynomial u when the variable is replaced by 1
Scilab - demo a=1:4 // row vector with elememts from 1 to 4 b=1:0.1:4 // row vector with elememts from 1 to 4 with 0.1 space interval A=diag([1 2 3]) X=rand(3,3); A=inv(X)*A*X spec(A) // The eigenvalues of A ieee(0) // normal ieee(2) //1/0 = Inf and 0/0 = nan help poly
quit // quits scilab exit // exits scilab x=poly(0,x) y=x-1 p=-1+2*x+3*x^2 q=2-3*x+x^2 r=(p+q)/(p*q)
Scilab - demo // computer precision a=1-5*0.2 // gives correct answer 0. b=1-.2-.2-.2-.2-.2 //gives 5.551D-17 %eps // gives 2.220D-16 2+%eps c=sin(%pi) // result is 1.225D-16 and the correct answer should be 0 b==0 // is false but should be true // 8 bits of precision gives: 2^8 //possibilities // if we are measuring a temperature which values are in between 25-100C // the error would be: (100-25)/256
Scilab - demo // Just a nice plot xx = linspace(-%pi,%pi,40) yy = linspace(-%pi,%pi,40) plot3d(xx,yy,sinh(xx')*cos(yy)) // 2D plot Y=(x-1)*(x-2)*(x+1)*(x+2)*x a=-1.9:0.01:2.1 b=horner(Y,a) plot(a,b)
quando a varivel manipulada sofre uma variao em degrau unitrio por aplicao de transformadas de Laplace
Soluo de uma equao diferencial - transforma inversa usando expanso em fraces parciais -