Anda di halaman 1dari 23

Sistem Kontrol

MATLAB
Disusun untuk mememuhi tugas mata kuliah Sistem Kontrol

Oleh :
Alief Geigy Gumilang
1231120053/03/D3-TL-3B

PROGRAM STUDI TEKNIK LISTRIK JURUSAN ELEKTRO


POLITEKNIK NEGERI MALANG
2014

Sistem Kontrol 2014

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.1
Temukan akar persamaan dari persamaan berikut :
Solusi :
>> p1=[1 -10 35 -50 24]
p1 =
1 -10 35 -50 24
>> roots_p1=roots(p1)
roots_p1 =
4.0000
3.0000
2.0000
1.0000
Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.2
Temukan akar persamaan dari persamaan berikut :

Solusi :
>> p2=[1 -7 0 16 25 52]
p2 =
1 -7 0 16 25 52
>> roots_p2=roots(p2)
roots_p2 =
6.5014
2.7428
-1.5711
-0.3366 + 1.3202i
-0.3366 - 1.3202i
Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.3
Telah diketahui akar dari polynominal adalah 1,2,3, dan 4. Hitung koefisien dari polynominal.
Solusi :
>> r3=[1 2 3 4]
r3 =
1 2 3 4
>> poly_r3=poly(r3)
poly_r3 =
1 -10 35 -50 24
Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.4
Diketahui akar dari polynominal sebagai berikut -1, -2, -3, 4+j5 dan 4-j5. Temukan koefisien dari
polynominalnya.
Solusi :
>> r4=[ -1 -2 -3 -4+5j -4-5j ]
r4 =
Columns 1 through 4
-1.0000
-2.0000
-3.0000
Column 5
-4.0000 - 5.0000i
>> poly_r4=poly(r4)
poly_r4 =
1 14 100 340 499 246
Komentar :

Putri Rizki K/1231120091/3B

-4.0000 + 5.0000i

Sistem Kontrol 2014


A.5
Contoh polynominal sebagai berikut :
Pada x = -3
Solusi :
>> p5=[1 -3 0 5 -4 3 2];
>> val_minus3=polyval(p5, -3)
val_minus3 =
1280
Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.6
Dua persamaan polynominal sebagai berikut :

Solusi:
>> p1=[1 -3 0 5 7 9];
>> p2=[2 0 -8 0 4 10 12];
>> p1p2=conv(p1,p2)
p1p2 =
2 -6 -8 34 18 -24 -74 -88 78 166 174 108
Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.7
Dua persamaan polynominal sebagai berikut :

Solusi :
>> p3=[1 0 -3 0 5 7 9];
>> p4=[2 -8 0 0 4 10 12];
>> [q,r]=deconv(p3,p4)
q=
0.5000
r=
0 4 -3 0 3 2 3
Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.8
Pada persamaan polynominal berikut, hitunglah pemurunan d/dx p

Solusi :
>> p5=[2 0 -8 0 4 10 12];
>> der_p5=polyder(p5)
der_p5 =
12 0 -32 0 8 10
Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.9
Pada persamaan berikut :

Tunjukan factor numerasi dan denumerasinya


Solusi :
>> num=[1 -3 0 5 7 9];
>> den=[1 0 -4 0 2 5 6];
>> roots_num=roots(num)
roots_num =
2.4186 + 1.0712i
2.4186 - 1.0712i
-1.1633
-0.3370 + 0.9961i
-0.3370 - 0.9961i
>> roots_den=roots(den)
roots_den =
1.6760 + 0.4922i
1.6760 - 0.4922i
-1.9304
-0.2108 + 0.9870i
-0.2108 - 0.9870i
-1.0000
>> (2.4186 + 1.0712i)*(2.4186 -1.0712i)
ans =
6.9971
>> (-0.3370+ 0.9961i)*(-0.3370-0.9961i)
ans =
1.1058
>> (1.6760+ 0.4922i)*(1.6760-0.4922i)
ans =
3.0512
>> (-0.2108+ 0.9870i)*(-0.2108-0.9870i)
ans =
1.0186
>> syms x
>> collect((x^2-4.8372*x+6.9971)*(x^2+0.6740*x+1.1058)*(x+1.1633))
ans =
4500454743147/500000000000+x^5-29999/10000*x^41323/3125000*x^3+7813277909/1562500000*x^2+1750276323053/250000000000*x
Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.10
Berdasarkan rangkaian listrik pada gambar, dimana omega pada tegangan yang digunakan
divariasikan dari 300 ke 3000 pada setiap 100 rad/s, selama amplitude konstan. Ammeter membaca
dimana kemudian menyimpan setiap frekuensinya. Perhitungan besar impedansi Z telah dihitung
dengan Z = V/A dan data telah ditabulasikan pada tabel.

Solusi :
>> w=[300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900....
2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000];
>> z=[39.339 52.789 71.104 97.665 140.437 222.182 436.056....
1014.938 469.830 266.032 187.052 145.751 120.353 103.111....
90.603 81.088 73.588 67.513 62.481 58.240 54.611 51.468....
48.717 46.286 44.122 42.182 40.432 38.845];
>> plot(w,z)

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014

>> semilogx(w,z); grid;


>> title('Magnitude of Impedance vs. Radian Frequency');
>> xlabel('w in rads/sec'); ylabel('|Z| in Ohms')

>> x=linspace(0, 2*pi, 60);


>> y=sin(x); u=sin(x+2*pi/3); v=sin(x+4*pi/3);
>> plot(x,y,x,u,x,v);
>> grid on, box on,
>> text(0.75, 0.65, 'sin(x)'); text(2.85, 0.65, 'sin(x+2*pi/3)'); text(4.95, 0.65, 'sin(x+4*pi/3)')

Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.11
Plot fungsi berikut ini :

Solusi :
>> x= -10: 0.5: 10;
>> y= x;
>> z= -2.*x.^3+x+3.*y.^2-1;
>> plot3(x,y,z); grid

Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.12
Volume pada suatu benda pada radius r dan tinggi h dengan fungsi sebgai berikut :
Plot volum benda dangan rdan h pada interval

m.

Solusi :
>> [R,H]=meshgrid(0: 4, 0: 6);
>> V=(pi .* R .^ 2 .* H) ./ 3; mesh(R, H, V)
>> xlabel('x-axis, radius r (meters)'); ylabel('y-axis, altitude h (meters)');
zlabel('z-axis, volume (cubic meters)'); title('Volume of Right Circular Cone'); box on

Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.13
Buat kode MATLAB untuk mendapatkan kurva gelombang dengan persamaan berikut :

dalam interval

Solusi :
>> t=0: 0.01: 5
t=
Columns 1 through 8
0 0.0100 0.0200 0.0300 0.0400 0.0500 0.0600 0.0700
Columns 9 through 16
0.0800 0.0900 0.1000 0.1100 0.1200 0.1300 0.1400 0.1500
Columns 17 through 24
0.1600 0.1700 0.1800 0.1900 0.2000 0.2100 0.2200 0.2300
Columns 25 through 32
0.2400 0.2500 0.2600 0.2700 0.2800 0.2900 0.3000 0.3100
Columns 33 through 40
0.3200 0.3300 0.3400 0.3500 0.3600 0.3700 0.3800 0.3900
Columns 41 through 48
0.4000 0.4100 0.4200 0.4300 0.4400 0.4500 0.4600 0.4700
Columns 49 through 56
0.4800 0.4900 0.5000 0.5100 0.5200 0.5300 0.5400 0.5500
Columns 57 through 64
0.5600 0.5700 0.5800 0.5900 0.6000 0.6100 0.6200 0.6300
Columns 65 through 72
0.6400 0.6500 0.6600 0.6700 0.6800 0.6900 0.7000 0.7100
Columns 73 through 80
0.7200 0.7300 0.7400 0.7500 0.7600 0.7700 0.7800 0.7900
Columns 81 through 88
0.8000 0.8100 0.8200 0.8300 0.8400 0.8500 0.8600 0.8700
Columns 89 through 96
0.8800 0.8900 0.9000 0.9100 0.9200 0.9300 0.9400 0.9500
Columns 97 through 104
0.9600 0.9700 0.9800 0.9900 1.0000 1.0100 1.0200 1.0300
Columns 105 through 112
1.0400 1.0500 1.0600 1.0700 1.0800 1.0900 1.1000 1.1100
Columns 113 through 120
1.1200 1.1300 1.1400 1.1500 1.1600 1.1700 1.1800 1.1900
Columns 121 through 128
1.2000 1.2100 1.2200 1.2300 1.2400 1.2500 1.2600 1.2700
Columns 129 through 136
1.2800 1.2900 1.3000 1.3100 1.3200 1.3300 1.3400 1.3500
Columns 137 through 144
1.3600 1.3700 1.3800 1.3900 1.4000 1.4100 1.4200 1.4300
Columns 145 through 152
1.4400 1.4500 1.4600 1.4700 1.4800 1.4900 1.5000 1.5100
Columns 153 through 160
Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


1.5200 1.5300 1.5400
Columns 161 through 168
1.6000 1.6100 1.6200
Columns 169 through 176
1.6800 1.6900 1.7000
Columns 177 through 184
1.7600 1.7700 1.7800
Columns 185 through 192
1.8400 1.8500 1.8600
Columns 193 through 200
1.9200 1.9300 1.9400
Columns 201 through 208
2.0000 2.0100 2.0200
Columns 209 through 216
2.0800 2.0900 2.1000
Columns 217 through 224
2.1600 2.1700 2.1800
Columns 225 through 232
2.2400 2.2500 2.2600
Columns 233 through 240
2.3200 2.3300 2.3400
Columns 241 through 248
2.4000 2.4100 2.4200
Columns 249 through 256
2.4800 2.4900 2.5000
Columns 257 through 264
2.5600 2.5700 2.5800
Columns 265 through 272
2.6400 2.6500 2.6600
Columns 273 through 280
2.7200 2.7300 2.7400
Columns 281 through 288
2.8000 2.8100 2.8200
Columns 289 through 296
2.8800 2.8900 2.9000
Columns 297 through 304
2.9600 2.9700 2.9800
Columns 305 through 312
3.0400 3.0500 3.0600
Columns 313 through 320
3.1200 3.1300 3.1400
Columns 321 through 328
3.2000 3.2100 3.2200
Columns 329 through 336
3.2800 3.2900 3.3000
Columns 337 through 344
3.3600 3.3700 3.3800
Putri Rizki K/1231120091/3B

1.5500 1.5600 1.5700 1.5800 1.5900


1.6300 1.6400 1.6500 1.6600 1.6700
1.7100 1.7200 1.7300 1.7400 1.7500
1.7900 1.8000 1.8100 1.8200 1.8300
1.8700 1.8800 1.8900 1.9000 1.9100
1.9500 1.9600 1.9700 1.9800 1.9900
2.0300 2.0400 2.0500 2.0600 2.0700
2.1100 2.1200 2.1300 2.1400 2.1500
2.1900 2.2000 2.2100 2.2200 2.2300
2.2700 2.2800 2.2900 2.3000 2.3100
2.3500 2.3600 2.3700 2.3800 2.3900
2.4300 2.4400 2.4500 2.4600 2.4700
2.5100 2.5200 2.5300 2.5400 2.5500
2.5900 2.6000 2.6100 2.6200 2.6300
2.6700 2.6800 2.6900 2.7000 2.7100
2.7500 2.7600 2.7700 2.7800 2.7900
2.8300 2.8400 2.8500 2.8600 2.8700
2.9100 2.9200 2.9300 2.9400 2.9500
2.9900 3.0000 3.0100 3.0200 3.0300
3.0700 3.0800 3.0900 3.1000 3.1100
3.1500 3.1600 3.1700 3.1800 3.1900
3.2300 3.2400 3.2500 3.2600 3.2700
3.3100 3.3200 3.3300 3.3400 3.3500
3.3900 3.4000 3.4100 3.4200 3.4300

Sistem Kontrol 2014


Columns 345 through 352
3.4400 3.4500 3.4600
Columns 353 through 360
3.5200 3.5300 3.5400
Columns 361 through 368
3.6000 3.6100 3.6200
Columns 369 through 376
3.6800 3.6900 3.7000
Columns 377 through 384
3.7600 3.7700 3.7800
Columns 385 through 392
3.8400 3.8500 3.8600
Columns 393 through 400
3.9200 3.9300 3.9400
Columns 401 through 408
4.0000 4.0100 4.0200
Columns 409 through 416
4.0800 4.0900 4.1000
Columns 417 through 424
4.1600 4.1700 4.1800
Columns 425 through 432
4.2400 4.2500 4.2600
Columns 433 through 440
4.3200 4.3300 4.3400
Columns 441 through 448
4.4000 4.4100 4.4200
Columns 449 through 456
4.4800 4.4900 4.5000
Columns 457 through 464
4.5600 4.5700 4.5800
Columns 465 through 472
4.6400 4.6500 4.6600
Columns 473 through 480
4.7200 4.7300 4.7400
Columns 481 through 488
4.8000 4.8100 4.8200
Columns 489 through 496
4.8800 4.8900 4.9000
Columns 497 through 501
4.9600 4.9700 4.9800

Putri Rizki K/1231120091/3B

3.4700 3.4800 3.4900 3.5000 3.5100


3.5500 3.5600 3.5700 3.5800 3.5900
3.6300 3.6400 3.6500 3.6600 3.6700
3.7100 3.7200 3.7300 3.7400 3.7500
3.7900 3.8000 3.8100 3.8200 3.8300
3.8700 3.8800 3.8900 3.9000 3.9100
3.9500 3.9600 3.9700 3.9800 3.9900
4.0300 4.0400 4.0500 4.0600 4.0700
4.1100 4.1200 4.1300 4.1400 4.1500
4.1900 4.2000 4.2100 4.2200 4.2300
4.2700 4.2800 4.2900 4.3000 4.3100
4.3500 4.3600 4.3700 4.3800 4.3900
4.4300 4.4400 4.4500 4.4600 4.4700
4.5100 4.5200 4.5300 4.5400 4.5500
4.5900 4.6000 4.6100 4.6200 4.6300
4.6700 4.6800 4.6900 4.7000 4.7100
4.7500 4.7600 4.7700 4.7800 4.7900
4.8300 4.8400 4.8500 4.8600 4.8700
4.9100 4.9200 4.9300 4.9400 4.9500
4.9900 5.0000

Sistem Kontrol 2014


>> y=3 .* exp(-4 .* t) .* cos(5 .* t)-2 .* exp(-3 .* t) .* sin(2 .* t) + t .^2 ./ (t+1);
plot(t,y); grid; xlabel('t'); ylabel('y=f(t)'); title('Plot for Example A.13')

Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.14
Plot fungsi berikut :
Pada interval

menggunakan 100 data poin.

Solusi :
>> x=linspace(0,2*pi,100);
>> y=(sin(x).^ 2); z=(cos(x).^ 2);
>> w=y.* z;
>> v=y./ (z+eps);
>> subplot(221);
>> plot(x,y); axis([0 2*pi 0 1]);
>> title('y=(sinx)^2');
>> subplot(222);
>> plot(x,z); axis([0 2*pi 0 1]);
>> title('z=(cosx)^2');
>> subplot(223);
>> plot(x,w); axis([0 2*pi 0 0.3]);
>> title('w=(sinx)^2*(cosx)^2');
>> subplot(224);
>> plot(x,v); axis([0 2*pi 0 400]);
>> title('v=(sinx)^2/(cosx)^2');

Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


A.15
Berdasarkan gambar rangkaian listrik, dengan nilai resistansi, induktansi, dan kapasitansi,
impedansi Zab sebagai fungsi omega dapat dihitung sebagai berikut:

a. Plot Re(z) (nilai nyata impedansi Z) versus omega.


b.Plot Im(z) (nilai imajiner impedansi Z) versus omega.
c. Plot nilai impedansi Z versus omega dalam koordinat polar.
Solusi :
>> w=0: 1: 2000;
>> z=(10+(10 .^ 4 -j .* 10 .^ 6 ./ (w+eps)) ./ (10 + j .* (0.1 .* w -10.^5./ (w+eps))));
>> real_part=real(z); plot(w,real_part); grid;
xlabel('radian frequency w'); ylabel('Real part of Z');

>> imag_part=imag(z); plot(w,imag_part); grid;


xlabel('radian frequency w'); ylabel('Imaginary part of Z');

>> mag=abs(z); rndz=round(abs(z));


>> theta=angle(z);polar(theta,rndz);
>> grid;
Putri Rizki K/1231120091/3B

Sistem Kontrol 2014


>> ylabel('Polar Plot of Z');

Komentar :

Putri Rizki K/1231120091/3B

Sistem Kontrol 2014

Putri Rizki K/1231120091/3B