Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Tài liệu Bài tập môn học Kỹ thuật truyền dẫn ppt
Nội dung xem thử
Mô tả chi tiết
Bài tập môn học Kỹ thuật truyền dẫn
1
I. MÃ ĐƯỜNG DÂY
Các hàm được viết và lưu trong các m-file riêng với tên trùng
tên hàm. x là tọa độ mà các đoạn thẳng được vẽ tại vị trí đó
1.Các hàm bổ trợ
Các hàm vẽ các đoạn nằm dọc
function doc1(x)%ve mot doan nam doc dai 1 don vi
u=linspace(0,1,1000);
plot(x,u,'r','LineWidth',5)
hold on;
grid on;
--------------------------
function doc_1(x))%ve mot doan nam doc dai -1 don vi
u=linspace(-1,0,1000);
plot(x,u,'r','LineWidth',5)
hold on;
grid on;
--------------------------
function doc2(x)%ve mot doan nam doc dai 2 don vi
u=linspace(-1,1,1000);
plot(x,u,'r','LineWidth',5)
hold on;
grid on;
--------------------------
Các hàm vẽ các đoạn nằm ngang
function ngang0_1(x)%ve mot doan nam ngang dai 1 don vi
% nam tren truc hoanh
t=linspace(x,x+1,100);
for a=1:100
N(a)=0;
end
plot(t,N,'r','LineWidth',5)
hold on;grid on;
--------------------------
function ngang0_5(x)%ve mot doan nam ngang dai 1/2 don vi
t=linspace(x,(2*x+1)/2,100);
for a=1:100
N(a)=0;
end
plot(t,N,'r','LineWidth',5)
hold on;grid on;
--------------------------
%ve mot doan nam phia duoi truc hoanh ngang dai 1/2 don vi
function ngang_0_5(x)
t=linspace(x,(2*x+1)/2,100);
for a=1:100
N(a)=-1;
end
plot(t,N,'r','LineWidth',5)
hold on;grid on;
Bài tập môn học Kỹ thuật truyền dẫn
2
--------------------------
function ngang1_5(x)%ve mot doan nam ngang
%cao tren truc hoanh dai 1/2 don vi
t=linspace(x,(2*x+1)/2,100);
for a=1:100
N(a)=1;
end
plot(t,N,'r','LineWidth',5)
hold on;grid on;
%ve mot doan nam phia duoi truc hoanh ngang dai 1 don vi
function ngang_0_1(x)
t=linspace(x,x+1,100);
for a=1:100
N(a)=-1;
end
plot(t,N,'r','LineWidth',5)
hold on;grid on;
--------------------------
function ngang1_1(x)%ve mot doan nam ngang dai 1 don vi
t=linspace(x,x+1,100);
for a=1:100
N(a)=1;
end
plot(t,N,'r','LineWidth',5)
hold on;
--------------------------
Các hàm vẽ nửa xung dương và xung âm
function duong(x)
doc1(x)
ngang1_5(x)
doc1(x+1/2)
ngang0_5(x+1/2)
--------------------------
function am(x)
doc_1(x)
ngang_0_5(x)
doc_1((2*x+1)/2)
ngang0_5((2*x+1)/2)
--------------------------
Các hàm vẽ mã HDB3 thuận và ngược
%ve ma thuan 0000->000V
function t=HDB3_thuan(x,t)%t la bien kiem tra
for a=x:x+2
ngang0_1(a-1)
end
%V la bit pha luat
if t==0%neu truoc do la mot xung am
am(x+2)%ve mot xung am
t=0;
else
duong(x+2)%ve mot xung duong