0% found this document useful (0 votes)
133 views13 pages

Scilab Vs Matlab

describtion of codes in matlab and scilab

Uploaded by

KunalTelgote
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
133 views13 pages

Scilab Vs Matlab

describtion of codes in matlab and scilab

Uploaded by

KunalTelgote
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 13
anvaatr ‘terial Introduction ‘This document describes how to perform common tasks in 6.302 using Octave, Scilab, and Matlab, The first two software packages are free alternatives to Matlab, and their use is encouraged. Each software package employs different methods to create, examine, print, and save transfer functions. For the purposes of this tutorial, we will use the following transfer function as an example: L(s) = 3e4 * (8.055 + 1)*2 / ((s+1)*3 * (8.018 + 1)) Octave GNU Octave is a numerical computation software package very similar to Matlab. In fact, the syntax is almost exactly the same. For help, type help function_nane. For an excellent tutorial on control-related functions, type DENOcontrol Creating transfer functions For the purposes of 6.302, there exist two ways to create transfer functions in Octave, The first is tf2sys, which takes as arguments the coefficients of the numerator and denominator of the transfer function. With the example transfer function, you would type: L f2sys(3e4 * [0.0025 0.1 1], [0.01 1.03 3.03 3.01 1]); Another command is zp2sys, which takes as arguments the zeros, poles, and leading coefficient of the transfer fiction, Consequently, you would type: L = zp2sys([-2@ -20], [-1 -1 -1 -100], 3e4); Displaying transfer functions ‘You will notice that if you merely type L, the output isn't very readable. Use sysout(L, “t#") to display the function in polynomial form and sysout(L, zp") for zero-pole form. The graph commands Root locus For root locus, use rlocus(L). L = tf2sys(3e4 * [0.0025 0.1 1], [@.01 1.03 3.03 3.01 1]); title("Root locus of L"); Plocus(L); 2 [Graph not available because rendering was not complete even after several hours] Bode For Bode, use bode(L). L = tf2sys(3e4 * [0.0025 0.1 1], [@.01 1.03 3.03 3.01 1])5 bode(L); hitpsiweb ited. s02nwwwleompartrepor.im! 13 anraot7 ‘terial IEANLigu) 1. Gain in aB A, ut 80 50 40 oa 20 20 -40 meee i 9.0L ot 1 10 Frequency in rad/sec Phase’ in dep phaso(LVUIGu)), uu, 100 1000 150 100 50 0 fe -100 -150 9.04 ot 1 10 Frequency in rad/sec Nyquist For Nyquist, use nyquist(L). L = tf2sys(3ea * [0.0025 0.1 1], [0.01 1.03 3.03 3.01 1])5 nyquist(L, logspace(-1, 1, 100))3 title("Nyquist plot of L"); xlabel(" "ys ylabel(" replot; hitpsiweb ited. s02nwwwleompartrepor.im! 100 1000 23. anvaatr ‘terial Nyquist plot of L Imag axis a 20000 set Ras: S 19900 10000 5000 5000 ~10000 15000 hs Soe 20000 Shmenuel perinen hoasenge beeen hs ome a ae v—— Ne fe 8000 0 5000 10000 15000 Real axis Nichols For Nichols, use nichols(L). L = tf2sys(3e4 * [8.0025 0.1 1], [0.01 1.03 3.03 3.01 1])5 nichols(L); title("Nichols plot of L"); replots hitpsiweb ited. s02nwwwleompartrepor.im! 20000 25000 30000 an

You might also like