лабораторная работа / мэмс / Ot4et_3_lw
.doc3 lABORATORY WORK
TOPIC: Modeling of steady-state electric processes in MATLAB environment.
PURPOSE OF THE WORK: Development and debugging of the program of calculation of currents and voltages in the given electrical circuit and proof of correctness of account.
The task for fulfillment
For the given variant of the electric circuit:
Develop mathematical model of calculation of branches currents and reactive elements voltages;
Make the program realizing developed model;
Include into the program the operators, allowing carry out verification of calculation results;
Organize a graphical output of the specified functions of currents and voltages;
Debug the program;
Save results of the work (the program, listing of calculation, graphics) at your personal folder;
· Draw up report.
Individual tasks
Variant 1:
-
H
aving
denoted the directions of currents in branches the equations of
impedance and EMF in complex form were cjmposed.
-
Directed graph of the scheme:

So the branch here is just one. And there are three chords. It means that 1 equation should be composed according to the 1st K`s law and three more are to be composed according to the 2nd one.
-
Table of equations.
Table 1.1 – Table of coefficients of equations
|
|
I1 |
I2 |
I3 |
I4 |
|
|
I |
Z1 |
Z2 |
0 |
0 |
E |
|
II |
0 |
-Z2 |
Z3 |
0 |
0 |
|
III |
0 |
0 |
-Z3 |
Z4 |
0 |
|
b |
1 |
-1 |
-1 |
-1 |
0 |
-
Block-scheme of the designed program
















5. Program that executes the task
f=50;R1=0;R2=10;R3=5;L4=1e-3;C2=1e-4;C3=2e-4;R4=3;ph=0;
w=2*pi*f;XL4=w*L4;XC2=1/(w*C2);XC3=1/(w*C3);
E1=25*exp(ph*pi/180*i);
Z1=R1;Z2=R2-i*XC2;Z3=R3-i*XC3;Z4=R4+i*XL4;
M=[1 -1 -1 -1;Z1 Z2 0 0;0 -Z2 Z3 0;0 0 -Z3 Z4];
F=[0;E1;0;0];
I=M\F;
disp(['I1=',num2str(I(1,1))]);
disp(['I2=',num2str(I(2,1))]);
disp(['I3=',num2str(I(3,1))]);
disp(['I4=',num2str(I(4,1))]);
I1M=abs(I(1,1))
I2M=abs(I(2,1))
I3M=abs(I(3,1))
I4M=abs(I(4,1))
phI1=(angle(I(1,1))/pi*180)
phI2=(angle(I(2,1))/pi*180)
phI3=(angle(I(3,1))/pi*180)
phI4=(angle(I(3,1))/pi*180)
h=1/(10^2*f);
t(1)=0;
i1(1)=current(I1M,f,phI1,t(1));
i2(1)=current(I2M,f,phI2,t(1));
i3(1)=current(I3M,f,phI3,t(1));
i4(1)=current(I4M,f,phI4,t(1));
for k=2:201
t(k)=t(k-1)+h;
i1(k)=current(I1M,f,phI1,t(k));
i2(k)=current(I2M,f,phI2,t(k));
i3(k)=current(I3M,f,phI3,t(k));
i4(k)=current(I4M,f,phI4,t(k));
end
plot(t,i1,'x',t,i2,'+',t,i3,t,i4,'y');
grid on;
eps1=-I(1,1)+I(2,1)+I(3,1)+I(4,1);
eps21=E1-Z1*I(1,1)-Z4*I(4,1);eps22=E1-Z1*(I(1,1))-Z3*I(3,1);eps23=-I(2,1)*Z2+I(4,1)*Z4;
disp(['error eps1=', num2str(eps1)]);
disp(['error 1st contour eps2=', num2str(eps21)]);
disp(['error 2nd contour eps2=', num2str(eps22)]);
disp(['error 3rd contour eps2=', num2str(eps23)]);
Listing of the program
>> lw3_v1
I1=8.9167+1.2813i
I2=0.22458+0.71485i
I3=0.44915+1.4297i
I4=8.2429-0.8632i
I1M =
9.0083
I2M =
0.7493
I3M =
1.4986
I4M =
8.2880
phI1 =
8.1775
phI2 =
72.5594
phI3 =
72.5594
phI4 =
72.5594
error eps1=0+2.2204e-016i
error 1st contour eps2=1.0658e-014
error 2nd contour eps2=7.1054e-015
error 3rd contour eps2=-7.1054e-015
Plot of the currents:
Figure 1.1 – Plot of found currents
Conclusion: Having done a program that solves a pretty difficult problem of plane circuit with complex components, as the summary it should be said the simulation and programming should be used as frequent as it is possible in the diversity of technical problems.
