Install Octave 3.6.4 for Signal & Control System to replace Matlab

Diterbitkan oleh Unknown on Tuesday, May 21, 2013

Hosting Unlimited Indonesia
This tutorial use in ubuntu 12.04.

Octave 3.6.4 is latest update from official site.

Command to install in terminal :

sudo apt-get remove octave # If you have installed octave 3.2
sudo apt-add-repository ppa:picaso/octave
sudo apt-get update
sudo apt-get install octave
 sudo apt-get install liboctave-dev

 Download this package to use octave for signal & control system :

general 
miscellaneous
struct
optim
specfun
control
signal
image

Install package :

  sudo su

go to Download directory (ex: /Downloads)

run octave

 octave
 install all package was downloaded :

octave:2> pkg install general-1.3.2.tar.gz -auto
octave:3> pkg install miscellaneous-1.2.0.tar.gz -auto
octave:4> pkg install struct-1.0.10.tar.gz -auto
octave:5> pkg install specfun-1.1.0.tar.gz -auto
octave:6> pkg install control-2.4.2.tar.gz -auto
octave:7> pkg install signal-1.2.2.tar.gz -auto
octave:8> pkg install image-2.0.0.tar.gz -auto

Installation octave & octave package finished. Now, try to run some simulation.

Ex : Bode Diagram

octave:9> num=[0,0,0,20,20]
num =

    0    0    0   20   20

octave:10> den=conv([1,5,0],[1,2,10])
den =

    1    7   20   50    0

octave:11> sys=tf
tf2sos       tf2zp        tfestimate   tfpolyones  
tf2ss        tfe          tfpoly2str   tfpolyzeros 
octave:11> sys=tf(num,den)

Transfer function 'sys' from input 'u1' to output ...

               20 s + 20        
 y1:  ---------------------------
      s^4 + 7 s^3 + 20 s^2 + 50 s

Continuous-time model.
octave:12> w=logspace(-1,2,100)
w =

 Columns 1 through 6:

     0.10000     0.10723     0.11498     0.12328     0.13219     0.14175

 Columns 7 through 12:

     0.15199     0.16298     0.17475     0.18738     0.20092     0.21544

 Columns 13 through 18:

     0.23101     0.24771     0.26561     0.28480     0.30539     0.32745

 Columns 19 through 24:

     0.35112     0.37649     0.40370     0.43288     0.46416     0.49770

 Columns 25 through 30:

     0.53367     0.57224     0.61359     0.65793     0.70548     0.75646

 Columns 31 through 36:

octave:13> bode(sys,w)
octave:14> bode(sys,w)
octave:15> [Gm, pm, wcp, wcg]=margin(sys)
Gm =  3.1366
pm =  103.66
wcp =  4.0131
wcg =  0.44264
octave:16> GmdB=20*log10(Gm)
GmdB =  9.9293
octave:17> [GmdB pm wpc wcg]
error: 'wpc' undefined near line 17 column 12
octave:17> [Gm, pm, wpc, wcg]=margin(sys)
Gm =  3.1366
pm =  103.66
wpc =  4.0131
wcg =  0.44264
octave:18> [GmdB pm wpc wcg]
ans =

     9.92929   103.65727     4.01306     0.44264

octave:19> version
ans = 3.6.4





{ 0 Comment... read them below or add one }

Post a Comment