Professional Documents
Culture Documents
TRNG I HC VN HIN
KHOA IN T - VIN THNG
N TT NGHIP
Ti:
PHN A
GII THIU
LI CM N
Sinh vin: Nguyn Tn Pht xin chn thnh cm n:
Qy thy c trng i Hc Vn Hin ni chung v thy c trong khoa in T Vin Thng ni ring ht lng dy bo v trang b cho em nhng kin thc qu bu
trong nhng nm qua v cng chnh l hnh trang vo i ca em sau ny.
c bit, Em xin chn thnh cm n c gio:ThS. Phan Th Chiu M tn tnh
hng dn, truyn t, cung cp ti liu cng nh b sung nhng kin thc cn thit v
ng gp nhiu kin quan trng cho em trong thi gian lm ti.
Em xin cm n v ghi nh cng lao ca cha m v nhng ngi thn ng vin,
to iu kin gip em hon thnh tt nhim v trong nhng nm hc va qua.
ng thi, xin chn thnh cm n tt c cc bn sinh vin gip , ng gp v
ng vin em hon thnh tt tp lun vn ny, c bit l sinh vin lp C08E1.
NHN XT
N CA GIO VIN HNG DN
H v tn: NGUYN TN PHT
GVHD: ThS. PHAN TH CHIU M
Tn ti: M PHNG MCH DAO NG RLC BNG MATLAB
Li nhn xt ca gio vin hng dn:
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
.........................................................................................................................
TP.H Ch Minh,ngythngnm 2011
Gio vin hng dn
NHN XT
N CA GIO VIN PHN BIN
H v tn: NGUYN TN PHT
GVHD: ThS. PHAN TH CHIU M
Tn ti: M PHNG MCH DAO NG RLC BNG MATLAB
Li nhn xt ca gio vin phn bin:
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
TP H.Ch Minh,ngythngnm 2011
Gio vin phn bin
LI M U
Khoa hc k thut ngy cng pht trin p li nhu cu ngy cng cao ca con
ngi trong mi lnh vc nh l: thng tin truyn thng, vin thng, in tBn cnh
th cht lng ca sn phm v chnh xc cao trong tn hiu, m thanh cng l
mt vn rt quan trng. loi b nhng tn s nhiu, nhng tn hiu khng mong
mun y th mch dao ng ra i.
Trong khun kh n tt nghip ny, vi mc ch tm hiu v mch dao ng,
sinh vin thc hin n la chn ti mch dao ng RLC v ng dng ngn
ng lp trnh matlab m phng. Vi s gip v hng dn trc tip ca c gio:
ThS PHAN TH CHIU M. Tuy ti cn n gin, nhng hi vng y s l mt ti
liu b ch cho nhng ai quan tm.
Do thi gian, ti liu tham kho c hn v kinh nghim thc tin cn non km, nn
ti chc chn cn nhiu thiu xt. Rt mong nhn c nhng kin ng gp, gip
chn tnh qu bu ca qu thy c cng cc bn sinh vin.
MC LC
Trang
Phn A: Gii thiu .................................................................................................
Trang ba ............................................................................................................
Li cm n ........................................................................................................
Quyt nh giao ti .......................................................................................
Nhn xt gio vin hng dn ..........................................................................
Nhn xt gio vin phn bin ............................................................................
Li ni u .......................................................................................................
Mc lc ............................................................................................................
Lit k hnh .......................................................................................................
Phn B: Ni dung ...................................................................................................
CHNG I: MCH DAO NG RLC ............................................................. 1
1.1 VI NT V MCH DAO NG ................................................................ 1
1.2 LINH KIN TH NG TRONG MCH IN XOAY CHIU ............ 1
1.2.1 in tr R ................................................................................................. 1
1.2.2 Cun dy L ............................................................................................... 2
1.2.3 T in C .................................................................................................. 2
1.3 MCH DAO NG SIN TN S THP..................................................... 3
1.3.1 Dao ng dch pha (phase shift oscillator)............................................... 4
1.3.1.1 Nguyn tc ................................................................................. 4
1.3.1.2 Mch dch pha dng op-amp ...................................................... 8
1.3.1.3 Mch dao ng dch pha dng FET ........................................... 9
1.3.1.4 Mch dng BJT .......................................................................... 10
LIT K HNH
PHN B
NI DUNG
Trang 1
Trang 2
(1)
VL = L
Thay: i(t)=Imsinwt vo VL ri ly o hm ta c:
VL=LImcost=LImsin(t+90)
(2)
Vc=
Thay: i(t)=Imsint vo Vc ri ly tch ta c:
Vc=
Vc=
Nh vy: in p Vc tr pha hn dng in i 90.
CHNG I: MCH DAO NG RLC
(3)
Trang 3
c ngha nh R l sc cn in ca
Ta c: Xc=
Trang 4
Trang 5
T hnh 3.3 ta c:
T :
V:
Trang 6
Trang 7
Trang 8
Trang 9
Trang 10
Trang 11
R = R + (R1||R2||Zb)
Vi Zb = re nu c CE v Zb = (re + RE) nu khng c CE.
Tng tr ca mch khi cha c hi tip R0 RC khng nh lm nn lm nh
hng n tn s dao ng. Mch phn gii c v li
Ti tn s dao ng 0:
Trang 12
Trang 13
Trang 14
Trang 15
Trang 16
khc phc iu ny, ngi ta thng thay i R1, R2 hoc C1, C2 cng lc
(dng bin tr i hoc t xoay i) khng lm thay i h s. Hnh 2.11a m t
vic iu chnh ny.
(a)
(b)
Trang 17
Trang 18
Trang 19
Trang 20
Trang 21
Trang 22
Trang 23
Trang 24
Trang 25
Trang 26
Trang 27
Trang 28
Trang 29
Trang 30
Trang 31
Trang 32
Trang 33
Trang 34
Trang 35
Trang 36
Trang 37
Trang 38
.
Dng in ny s np vo t C to ra v0 (gim dn)
Trang 39
Trang 40
Trang 41
in th nh - nh ca tam gic:
Ch l nu VR = 0 th Vmax = -Vmin
Xc nh tn s:
Khi VS 0
Khi v0 = -V0 (ng tin) th ta c:
Trang 42
Trang 43
V khi VS = 0 tp = tn
to sng tam gic n cc (gi s dng) ta mc thm mt diode ni tip vi
R1 nh hnh 6.13a
Khi v0 = -V0: diode D dn
Khi v0 = +V0: diode D ngng
Trang 44
Trang 45
Trang 46
Trang 47
% v vecto b
grid on
% to li
2.1.4 To biu ct
bar(b)
% to biu ct
xlabel (tien,color,r)
% t tn cho trc x
% t tn cho trc y
kt qu:
Trang 48
2.1.5 V vect b
plot (b,*)
% v vect b bng du *
axis([0 10 0 10])
% to ta trc
kt qu:
Trang 49
2.2 MA TRN
2.2.1 Nhp ma trn
A = [ 1 2 0; 2 5 -1; 4 10 -1]
kt qu:
A=
1
-1
10
-1
Trang 50
10
-1
-1
12
24
12 30
59
24
117
59
25
-10
-10
Trang 51
X=
5
-2
-2
-1
-2
-5
-1
Trang 52
Trang 53
kt qu:
q=
1
-10
35
-52
35
-10
r = conv(p,q)
plot (r)
% v r
kt qu:
r=
1
-15
90
-278
480
-480
278
2.3 BI TP P DNG
CHNG II: TM HIU NGN NG LP TRNH MATLAB
-90
15
V hm s: x=[-15,15]
Y1 = x
Y2 = 2x+3
Y3 = x + 2
a/ tm ta giao im ca y1 v y2
b/ tm ta giao im ca y2 v y3
c/ tm giao im ca y2 v y3
clc
% lm sch ca s lnh
clear all
% xa tt c cc lnh
close all
% ng tt c cc ca s
subplot(221)
% ca s ph th nht
x = -15:15;
y1 = x.^2
plot(x,y1,r);
% v hm s y1
title(y1=x.^2);
% tiu ca y1
pause(2)
Trang 54
subplot(222);
% ca s ph th hai
y2=2*x+3
% hm s y2
plot(x,y2,b);
% v hm s y2
title(y2=2*x+3);
% tiu ca hm y2
pause(2)
Trang 55
subplot(223)
% ca s ph th ba
y3=x.^3+2
% hm s y3
plot(x,y3,g);
% v hm s y3
title(y3=x^3+2);
pause(2)
Trang 56
subplot(224);
% ca s ph th t
y1=x.^2,plot(x,y1,r);
hold on
y2=2*x+3,plot(x,y2,b)
y3=x.^3+2,plot(x,y3,g)
title(y1=x.^2,y2=2*x+3,y3=x.^3+2);
Trang 57
TT C CC TH:
Trang 58
a/.giao im ca y1 v y2
clc
clear all
close all
x=-15:15
y1=x.^2,plot(x,y1,r);
grid on
%to li
hold on
y2=2*x+3,plot(x,y2,g);
gird on
CHNG II: TM HIU NGN NG LP TRNH MATLAB
Trang 59
text (x,y,(3,0),(-1,0))
b/giao im ca y2 v y3
clc
clear all
close all
x=-15:15
y2=2*x+3,plot(x,y2,r);grid on
hold on
y3=x.^3+2,plot(x,y3,g)
CHNG II: TM HIU NGN NG LP TRNH MATLAB
Trang 60
Trang 61
Trang 62
2.4.1.1 semilogx
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XScale,log,YScale,linear); % log trc x,trc y tuyn tnh
set(gca,XGrid,off,YGrid,off);
Trang 63
2.4.1.2 semilogy
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XScale,linear,YScale,log); %trc x tuyn tnh,log trc y
set(gca,XGrid,off,YGrid,off);
2.4.1.3 Loglog
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XScale,log,YScale,log);
set(gca,XGrid,on,YGrid,on);
Trang 64
Trang 65
2.4.2 Grid
2.4.2.1 Neither
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XScale,log,YScale,log);
set(gca,XGrid,off,YGrid,off);
2.4.2.2 Xgird
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XGrid,on,YGrid,off);
% to li trc x
Trang 66
2.4.2.3 Ygird
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XGrid,off,YGrid,on);
% to li trc y
Trang 67
Trang 68
2.4.2.4 Both
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XGrid,on,YGrid,on);
% to li trc x v trc y
2.4.3 Direction
2.4.3.1 Normal
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XGrid,off,YGrid,off);
Trang 69
2.4.3.2 Reversex
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XGrid,off,YGrid,off);
set(gca,XDir,reverse,YDir,normal); %o trc x
Trang 70
Trang 71
2.4.3.3 Reversey
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XGrid,off,YGrid,off);
set(gca,XDir,normal,YDir,reverse);
%o trc y
Trang 72
2.4.3.4 Rev.both
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XGrid,off,YGrid,off);
set(gca,XDir, reverse,YDir,reverse);
%o trc x vo trc y
2.4.4 Color
2.4.4.1 Default
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XGrid,on,YGrid,on);
Trang 73
2.4.4.2 Bbule
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XGrid,on,YGrid,on);
set(gca,XColor,bule,YColor,bule);
Trang 74
2.4.4.3 Red
x=logspace(-2,0,500);
plot(x,((sin(1./x)).^2)./x);
set(gca,XGrid,on,YGrid,on);
set(gca,XColor,red,YColor,red);
Trang 75
2.5 HA:V 2D
2.5.1 Line Plot of a chirp
x=0:0.05:5;
y=sin(x.^2);
% hm s y
plot(x,y);
% v hm s y
Trang 76
% gii hn trc x
bar(x,exp(-x.*x));
Trang 77
%gii hn ca trc x
Stairs(x,sin(x));
Trang 78
%gii hn trc x
y=erf(x);
%hm s y
e=rand(size(x))/10;
% gi tr sai s ca e
errorbar(x,y,e);
Trang 79
%gii hn ca t
Trang 80
%gii hn trc x
y=sin(x.^2).*exp(-x);
% hm s y
Stem(x,y)
% v hm s y
Trang 81
Trang 82
Trang 83
Trang 84
%--------------------DE TAI---------------------uicontrol('style','text',...
'FontName','VNI-Times',...
'Backgroundcolor','w',...
'foregroundcolor','b',...
'FontSize',22,...
'FontWeight','bold',...
'HorizontalAlignment','center',...
'String','MO PHONG MACH DAO ONG BANG MATLAB',...
'position',[100 300 700 60]);
%---------------------------GVHD----------------uicontrol('style','text',...
'FontName','VNI-Times',...
'Backgroundcolor','w',...
'foregroundcolor','g',...
'FontSize',15,...
'FontWeight','bold',...
'HorizontalAlignment','left',...
'String','GVHD : ThS. Phan Th Chieu My',...
'position',[400 200 400 50]);
%---------------------PHAT------------------------uicontrol('style','text',...
'FontName','VNI-Times',...
'Backgroundcolor','w',...
'foregroundcolor','g',...
'FontSize',15,...
'FontWeight','bold',...
'HorizontalAlignment','left',...
'String','SVTH : Nguyen Tan Phat',...
'position',[400 170 400 50]);
%---------MSSV-----------------------------------uicontrol('style','text',...
'FontName','VNI-Times',...
'Backgroundcolor','w',...
'foregroundcolor','g',...
'FontSize',15,...
'FontWeight','bold',...
'HorizontalAlignment','left',...
'String','MSSV : 0858660056',...
'position',[400 140 300 50]);
%------------------load bieu tuong-----------------I=imread('BIEUTUONG.png')
axes('units', 'normalized',...
'Position',[0.06 0.75 0.2 0.2],...
CHNG III: NG DNG MATLAB M PHNG MCH DAO NG RLC
'BusyAction','Queue','Interruptible','off',...
'Ydir', 'reverse',...
'Xlim', [.5 128.5],...
'Ylim', [.5 128.5],...
'Clim',[0 1],...
'Xtick',[],'Ytick',[],...
'Box','on');
imshow(I);
%------------------------nut thoat----------------uicontrol('style','Pushbutton',...
'FontName','VNI-Times',...
'Backgroundcolor','r',...
'foregroundcolor','y',...
'FontSize',13,...
'FontWeight','bold',...
'HorizontalAlignment','left',...
'String','THOAT',...
'position',[250 25 100 50],...
'ToolTipString','VE CUA SO LENH',...
'Callback','thoat');
%----------------------nut tiep tuc-----------------uicontrol('style','Pushbutton',...
'FontName','VNI-Times',...
'Backgroundcolor','r',...
'foregroundcolor','y',...
'FontSize',13,...
'FontWeight','bold',...
'HorizontalAlignment','left',...
'String','TIEP TUC',...
'position',[620 25 100 50],...
'ToolTipString','Continue',...
'Callback','giaodientaonut');
Trang 85
Trang 86
Trang 87
'HorizontalAlignment','center',...
'VerticalAlignment','middle');
%-----------------------------------------% tao nut CLOSE
uicontrol( 'style','push',...
'position',[3 60 100 30],...
'string','close',...
'fontsize',16,...
'backgroundcolor',[1 0 0],...
'foregroundcolor',[1 1 0],...
'fontname','VNI-Times',...
'callback','close',...
'fontweight','bold');
%---------------------------------------%tao nut tinh MACH DAO DONG CAUWIEN
uicontrol('style','push',...
'position',[3 140 100 25],...
'string','mach cau wien ',...
'fontsize',16,...
'fontname','VNI-Times',...
'foregroundcolor',[0 0 0.1],...
'backgroundcolor',[0 0.6 0],...
'fontweight','bold',...
'callback','giaodiencauwien');
%-------------------------------------%tao nut tinh MACH SOM PHA
uicontrol('style','push',...
'position',[3 115 100 25],...
'string','mach som pha ',...
'fontsize',16,...
'fontname','VNI-Times',...
'foregroundcolor',[0 0 0],...
'backgroundcolor',[0 0.6 0],...
'fontweight','bold',...
'callback','giaodiensompha');
%------------------------------------%tao nut tinh MACH T DOI
uicontrol('style','push',...
'position',[3 90 100 25],...
'string','mach T doi ',...
'fontsize',16,...
'fontname','VNI-Times',...
'foregroundcolor',[0 0 0],...
'backgroundcolor',[0 0.6 0],...
CHNG III: NG DNG MATLAB M PHNG MCH DAO NG RLC
Trang 88
'fontweight','bold',...
'callback','giaodienTdoi');
Trang 89
Trang 90
Trang 91
Trang 92
Trang 93
'ToolTipString','Exit Figure',...
'Callback','giaodienchinhdd');
Trang 94
giatridientro =num2str(giatridientro);
giatritanso =num2str(giatritanso);
giatritu =num2str(giatritu);
giatritansocat =num2str(giatritansocat);
giatrihesohoitiep =num2str(giatrihesohoitiep);
%----------------------------------------set(r,'string',giatridientro);
set(f,'string',giatritanso);
set(c,'string',giatritu);
set(fc,'string',giatritansocat);
set(b,'string',giatrihesohoitiep);
3.3.2 V s mch dao ng cu wien
close all;
clc;
clear all;
%----------------------------------------R=input('xin nhap gia tri R=');
C=input('xin nhap gia tri C=');
%tan so dao dong
f=1/(2*pi*R*C);
w=2*pi*f
a=1/(w*R*C);
A=1/(9+[(1/a)-a].^2)
B=abs(A);
goc=(atan((-1/a)+a)) /3
string=[' Vay mach se dao dong tai tan so dao dong: ' num2str(f)]
string=[' co do lech pha bang ' num2str(goc)]
string=[ ' He so hoi tiep ' num2str(B)]
tu=[0 R*C 1];
mau=[(R.^2)*(C.^2) 3*R*C 1];
G=tf(tu,mau)
subplot(221)
bode(G)
subplot(222)
STEP(G)
subplot(223)
nyquist(G)
subplot(224)
impulse(G)
%---------------------------------pause(10)
CHNG III: NG DNG MATLAB M PHNG MCH DAO NG RLC
Trang 95
Trang 96
clc
clear all
nen=figure('name','GIAO DIEN THIET KE MACH SOM PHA ',...
'color','r',...
'numbertitle','off',...
'menubar','none',...
'position',[5 20 1024 720]);
%----------------------load hinh nen---------------------axes('Position',[0 0 1 1],...
'XTick',[],...
'YTick',[],...
'Xlim',[0 4],...
%gioi han truc x trong doan [0 4]
'Ylim',[0 4],...
%gioi han truc y trong doan [0 4]
'Box','on');
imshow('nen6.jpg');
%--------------------------------------------------------t8=text(500,50,'THIET KE MACH DAO ONG SM PHA');
%t7=text(250,220,'MACH DD SOM PHA');
set(t8,...
'color','r',...
'fontname','VNI-Times',...
'fontsize',25,...
'fontweight','bold',...
'HorizontalAlignment','center',...
'VerticalAlignment','middle');
%--------------------TAN SO MONG MUON------------------uicontrol('style','text',...
'FontName','VNI-Times',...
'Backgroundcolor','w',...
'foregroundcolor','r',...
'FontSize',15,...
'FontWeight','bold',...
'String','TAN SO MONG MUON',...
'position',[200 500 300 30]);
f= uicontrol('style','edit',...
'FontName','VNI-Times',...
'Backgroundcolor','c',...
'foregroundcolor','k',...
'string','0',...
'FontSize',13,...
'FontWeight','bold',...
'position',[510 500 100 30]);
uicontrol('style','text',...
CHNG III: NG DNG MATLAB M PHNG MCH DAO NG RLC
Trang 97
'FontName','VNI-Times',...
'Backgroundcolor','y',...
'foregroundcolor','r',...
'string','Hz',...
'FontSize',13,...
'FontWeight','bold',...
'position',[620 500 50 30]);
%---------------------TINH KET QUA-----------------uicontrol('style','Pushbutton',...
'FontName','VNI-Times',...
'Backgroundcolor','BLACK',...
'foregroundcolor','Y',...
'FontSize',13,...
'FontWeight','bold',...
'HorizontalAlignment','left',...
'String','TNH KET QUA',...
'position',[270 440 170 30],...
'Callback','tinhtoansompha');
%--------------------CHON GIA TRI TU---------------uicontrol('style','text',...
'FontName','VNI-Times',...
'Backgroundcolor','b',...
'foregroundcolor','w',...
'FontSize',15,...
'FontWeight','bold',...
'String','CHON GIA TR TU',...
'position',[200 380 300 30]);
c=uicontrol('style','edit',...
'FontName','VNI-Times',...
'Backgroundcolor','c',...
'foregroundcolor','b',...
'string','0',....
'FontSize',13,...
'FontWeight','bold',...
'position',[510 380 100 30],...
'callback','');
uicontrol('style','text',...
'FontName','VNI-Times',...
'Backgroundcolor','b',...
'foregroundcolor','w',...
'string','F',...
'FontSize',15,...
'FontWeight','bold',...
'position',[620 380 50 30]);
CHNG III: NG DNG MATLAB M PHNG MCH DAO NG RLC
Trang 98
Trang 99
uicontrol('style','text',...
'FontName','VNI-Times',...
'Backgroundcolor','m',...
'foregroundcolor','w',...
'string','rad/s',...
'FontSize',15,...
'FontWeight','bold',...
'position',[620 260 50 30]);
%--------------------HE SO HOI TIEP------------------uicontrol('style','text',...
'FontName','VNI-Times',...
'Backgroundcolor','m',...
'foregroundcolor','y',...
'FontSize',15,...
'FontWeight','bold',...
'String','HE SO HOI TIEP',...
'position',[200 200 300 30]);
b=uicontrol('style','edit',...
'FontName','VNI-Times',...
'Backgroundcolor','c',...
'foregroundcolor','b',...
'string','0',...
'FontSize',13,...
'FontWeight','bold',...
'position',[520 200 100 30],...
'callback','');
%----------------------THOAT----------------uicontrol('style','Pushbutton',...
'FontName','VNI-Times',...
'Backgroundcolor','c',...
'foregroundcolor','black',...
'FontSize',13,...
'FontWeight','bold',...
'HorizontalAlignment','left',...
'String','THOAT',...
'position',[500 80 100 40],...
'ToolTipString','VE CUA SO LENH',...
'Callback','thoat');
%------NUT TIEP TUC---------------------------uicontrol('style','Pushbutton',...
'FontName','VNI-Times',...
'Backgroundcolor','r',...
'foregroundcolor','y',...
'FontSize',13,...
CHNG III: NG DNG MATLAB M PHNG MCH DAO NG RLC
Trang 100
'FontWeight','bold',...
'HorizontalAlignment','left',...
'String','TIEP TUC',...
'position',[300 80 100 40],...
'ToolTipString','Continue',...
'Callback','machdaodongsompha');
%--------------------NUT TRO VE---------------uicontrol('style','Pushbutton',...
'FontName','VNI-Times',...
'Backgroundcolor','b',...
'foregroundcolor','y',...
'FontSize',13,...
'FontWeight','bold',...
'HorizontalAlignment','left',...
'String','TR VE',...
'position',[100 80 100 40],...
'ToolTipString','Exit Figure',...
'Callback','giaodienchinhdd');
Trang 101
Trang 102
giatridientro=get(r,'string');
giatritanso=get(f,'string');
giatritu=get(c,'string');
giatritansocat=get(fc,'string');
giatrihesohoitiep=get(b,'string');
%--------------------------------------------------giatridientro = str2num(giatridientro);
giatritanso = str2num(giatritanso);
giatritu = str2num(giatritu);
giatritansocat = str2num(giatritansocat);
giatrihesohoitiep = str2num(giatrihesohoitiep);
%--------------------------------------------------giatridientro =1/(2*pi*(sqrt(6))*giatritanso*giatritu);
giatritansocat=2*pi*giatritanso;
giatrihesohoitiep=1/(1-5*[(1/giatritansocat*giatridientro*giatritu).^2])i*(1/giatritansocat*giatridientro*giatritu)*(6[(1/giatritansocat*giatridientro*giatritu).^2]);
%--------------------------------------------------giatridientro =num2str(giatridientro);
giatritanso =num2str(giatritanso);
giatritu =num2str(giatritu);
giatritansocat =num2str(giatritansocat);
giatrihesohoitiep =num2str(giatrihesohoitiep);
%-------------------------------------------------set(r,'string',giatridientro);
set(f,'string',giatritanso);
set(c,'string',giatritu);
set(fc,'string',giatritansocat);
set(b,'string',giatrihesohoitiep);
3.4.2 V biu mch dao ng sm pha
close all;
clc;
clear all;
%-------------------------------------R=input('xin nhap gia tri R=');
C=input('xin nhap gia tri C=');
%tan so dao dong
f=1/(2*pi*(sqrt(6))*R*C);
A=1/((1-5*[(1/2*pi*f*R*C).^2])-i*(1/2*pi*f*R*C)*(6-[(1/2*pi*f*R*C).^2]));
B=abs(A);
goc=atan((1/2*pi*f*R*C)*6-[(1/2*pi*f*R*C).^2])/(1-5*[(1/2*pi*f*R*C).^2])
string=[' Vay mach se dao dong tai tan so dao dong: ' num2str(f)]
CHNG III: NG DNG MATLAB M PHNG MCH DAO NG RLC
Trang 103
Trang 104
Trang 105
Trang 106
Trang 107
Trang 108
'ToolTipString','Exit Figure',...
'Callback','giaodienchinhdd');
Trang 109
giatrihesohoitiep=(([(1/giatritansocat*giatridientro*giatritu).^2]1)/([(1/giatritansocat*giatridientro*giatritu).^2]1)+i*4*(1/giatritansocat*giatridientro*giatritu));
%--------------------------------------------giatridientro =num2str(giatridientro);
giatritanso =num2str(giatritanso);
giatritu =num2str(giatritu);
giatritansocat =num2str(giatritansocat);
giatrihesohoitiep =num2str(giatrihesohoitiep);
%--------------------------------------------set(r,'string',giatridientro);
set(f,'string',giatritanso);
set(c,'string',giatritu);
set(fc,'string',giatritansocat);
set(b,'string',giatrihesohoitiep);
3.5.2 V biu Mch dao ng cu T i
close all;
clc;
clear all;
%-------------------------------------R=input('xin nhap gia tri R=');
C=input('xin nhap gia tri C=');
%tan so dao dong
w=1/(R*C);
f=1/(2*pi*R*C);
a=1/(w*R*C);
A=(a.^2-1)/(a.^2-1)+(i*4*a)
B=abs(A);
goc=atan(4*a)/(1-(a.^2))
string=[' Vay mach se dao dong tai tan so dao dong: ' num2str(f)]
string=[' co do lech pha bang ' num2str(goc)]
string=[' He so hoi tiep ' num2str(B)]
tu=[-R.^2*C.^2 4*R*C 1];
mau=[-R.^2*C.^2 3*R*C 1];
G=tf(tu,mau)
subplot(221)
bode(G)
subplot(222)
STEP(G)
subplot(223)
nyquist(G)
CHNG III: NG DNG MATLAB M PHNG MCH DAO NG RLC
Trang 110
subplot(224)
impulse(G)
%--------------------------------------pause(10)
% tao nut close
uicontrol('style','push',...
'position',[600 350 230 30],...
'string','close',...
'fontsize',9.5,...
'fontname','VNI-Time',...
'backgroundcolor',[1 1 0],...
'foregroundcolor',[1 0 0],...
'fontweight','bold',...
'callback','giaodienchinhdd');
kt qu:
Xin nhp gi tr R = 159
Xin nhp gi tr C = 0.000001
Trang 111
Trang 110
Trang 111