Projekt KOMPUTEROWA SYMULACJA UKŁADÓW DYNAMICZNYCH SYSTEM MatLab |
---|
NR ĆWICZENIA 1 |
DATA WYKONANIA ĆWICZENIA |
26.9.2010 |
Przykład 1.
$$E = Ri\left( t \right) + L\frac{\text{di}(t)}{\text{dt}} + Uc$$
$$\frac{\text{du}}{\text{dt}} = \frac{1}{C}i\left( t \right)$$
$$\frac{\text{di}}{\text{dt}} = \frac{E}{L} - \frac{R}{L}i\left( t \right) - \frac{\text{Uc}}{L}$$
$$L\frac{\text{di}\left( t \right)}{\text{dt}} = E - R*i\left( t \right) - Uc$$
$$C\frac{\text{duc}}{\text{dt}} = i(t)$$
Program:
E=10;
R=5;
L=10e-3;
C=10e-6;
sim('RLCm')
figure(1);
plot(data(:,1),data(:,2));
hold on
figure(2)
plot(data(:,1),data(:,3));
hold on
E = uc + uL
$$E = uc + L\frac{\text{di}}{\text{dt}}$$
$$L\frac{\text{di}}{\text{dt}} = E - uc$$
i = ic + iR
$$i = C\frac{\text{duc}}{\text{dt}} + iR$$
$$C\frac{\text{duc}}{\text{dt}} = i - iR$$
Program:
E=3;
R=300;
L=1;
C=100e-6;
sim('zad2')
figure(1)
plot(data(:,4),data(:,1),'r',data(:,4),data(:,2),'g',data(:,4),data(:,3),'k')
legend('Ic','I','Ir')
grid
hold on;
figure(2)
R=[100 200 300];
k=['r' 'g' 'k'];
for a=1:3
r=R(a);
sim('test')
plot(data(:,1),data(:,3),k(a))
legend('Ul [R=100]','Ul [R=200]','Ul [R=300]')
grid
hold on
end
Przykład 3.
Program:
E=10;
R1=1000;
R2=1000;
L=10;
C1=100e-6;
C2=5e-6
sim('zad3')
figure(1)
subplot(2,1,1)
plot(data(:,1),data(:,2),'r',data(:,1),data(:,3),'g')
subplot(2,1,2)
plot(data(:,1),data(:,4),'r',data(:,1),data(:,5),'g')
hold on;
Przykład 4.
e = uc + uL + uR
$$L\frac{\text{diL}}{\text{dt}} = Usin\omega - uc - ic*R$$
ic = iL + iR0
$$C\frac{\text{duc}}{\text{dt}} = iL + \frac{\text{uL}}{R0}$$
R=1000
R0=100
L=10
C=10e-6
E=4
f=10
w=2*pi*f
sim('CW4')
figure(1)
subplot(2,1,1);
plot(Data1(:,1),Data1(:,2),Data1(:,1),Data1(:,3))
legend('Ic','Il')
title('I')
grid on
subplot(2,1,2)
plot(Data(:,1),Data(:,2),Data(:,1),Data(:,3))
legend('Ul','Uc')
title('U')
grid on