|
Examples of MatBasic calculation system application
MatBasic environment can be used for calculations of a wide range of complexity – from school-level sums to
sophisticated science problems solution. This part contains several examples of the environment application.
- Example: School-level sum "Snowflake"
- Program module of checking an algorithmic metering entry to a set polygonal area
- Program module of a frequency determination sensor
- Simulation model of a synchronous generator
Modeling of revolving electrical machines differs from static electric equipment modeling in a cardinal way
because descriptive and differential equation systems contain elements depending on the rotor position angle and that means depending on time.
A synchronous machine is described by a matrix system of differential equations.
Of the voltage drop in electric machine coils u, Â
(1)
where
– corresponding flux linkage;
L – changing through time internal and mutual inductances of coils;
i – currents in coils;
R – copper resistance of coils.
A model of an electric machine which rotor has vividly expressed poles is presented at pic.1.
Matrices of currents i, voltages u,
resistances R and inductances L are following:




where
RS – stator coils resistances;
Rf – rotor coils resistances;
LA – inductance of a stator phase A coil;
LB – inductance of a stator phase B coil;
LC – inductance of a stator phase C coil;
MAB – mutual inductance of stator phase A and B coils;
MBC – mutual inductance of stator phase B and C coils;
MCA – mutual inductance of stator phase C and A coils;
MAf – mutual inductance of phase A coil and energizing coil
MBf – mutual inductance of phase B coil and energizing coil
MCf – mutual inductance of phase C coil and energizing coil
Lf – energizing coil inductance.
If all the inductances remained unchanged through time then the system (1) would have been consisted
of linear differential equations with constant coefficients and its solution wouldn't have been such a problem.
However it's not true for a revolving machine. Only energizing coil inductance can be considered constant.
All other inductances depend on the rotor position against stator coils and, therefore, are functions of time.
Self inductances of stator phases LA,
LB, LC:



Mutual inductances of stator phases MAB,
MBC, MCA:



Mutual inductances of energizing coil and stator phases MAf,
MBf, MCf:




Pic.1 - Model of a synchronous electric machine
The current rotor position in a discrete time is calculated based upon:

where
k+1 – current moment of time;
k – previous moment of time;
Equations (1) in discrete time will look like that:
(2)
Taking into account that, the equation system (2) is transformed into:
(3)
Then the system (3) is led up to the look:
(4)
where
- required values vector;
- resistances matrix;

The system (4) should be supplemented by the equations describing electrical connection of coils and outer
electric circuit.
(5)
For inner short circuit modeling stator blocks should be divided into two parts (pic.2) and then
self-inductance of each of them and mutual inductances between coil parts of rotor and stator should be found.
Omitting derivation of formulas we state a matrix of inductances which is involved in equation (5):

The matrix of required values will increase accordingly:

Pic.2 - Model of a synchronous electric machine with inner faults
Thus while making up extra matrices P è
Q, we can get a system describing a synchronous generator at any kind of short circuit.
The choice of simulating modeling means is evident due to:
- The convenience of work with matrix and vector values;
- Sufficient set of graphical output commands;
- Convenient debugger (pic.3)

Pic.3 - Simulated generator model at a debugging stage
Let's use an example of synchronous generator model during a two phase A turns short.
Output to a graphical console the current in a shorted turn and the current in the energizing coil (pic.4) using
the following commands of graphical output:
%TA - time sampling array
%Ift - energizing coil current sampling array
%IA2 - short turn current sampling array
clrplot #G_FAULT;
posplot 1,1;
plot2d #G_FAULT (TA,IA2,title="Short turn current");
posplot 1,2;
plot2d #G_FAULT (TA,Ift,title="Energizing coil current"); |

Pic.4 - The result of modeling in the graphical console
As it is seen from the graphs the currents contain continuous higher harmonics.
Let's use discrete Fourier processing in order to verify amplitudes of harmonic components:
%Discrete Furier filter
%h - signal sampling array
%t - time sampling array
%fr - filtered frequency
function [F] Furie(h,t,fr)
N=max(size(h));
F=0;
for(n=1:N)
F=F+h[n]*(1i*cos(2*PI*fr*t[n])+sin(2*PI*fr*t[n]));
end
F=F*2/N;
if(fr == 0)
F=F/2;
end
end |
Let's output the amplitudes of the first harmonic components to the graphic console.
In order to get more real results let's conduct filtering during T=0.02 sec which can be done by creating cyclically shifted
buffers in the program:
if (t < period)
buffer_t[h-1]=t; %time sampling buffer
buffer_Ift[h-1]=Ift[h-1]; %energizing coil current sampling buffer
buffer_IA2[h-1]=IA2[h-1]; %shorted turn current sampling buffer
else
ShiftBuf(buffer_t,t); %ShiftBuf - buffer shift to the left function
ShiftBuf(buffer_Ift,Ift[h-1]);
ShiftBuf(buffer_IA2,IA2[h-1]);
end
% Amplitudes of harmonic components of corresponding currents
IftA0[h]=abs(Furie(buffer_Ift,buffer_t,0));
IftA1[h]=abs(Furie(buffer_Ift,buffer_t,50));
IftA2[h]=abs(Furie(buffer_Ift,buffer_t,100));
IftA3[h]=abs(Furie(buffer_Ift,buffer_t,150));
IftA4[h]=abs(Furie(buffer_Ift,buffer_t,200));
IA2A0[h]=abs(Furie(buffer_IA2,buffer_t,0));
IA2A1[h]=abs(Furie(buffer_IA2,buffer_t,50));
IA2A2[h]=abs(Furie(buffer_IA2,buffer_t,100));
IA2A3[h]=abs(Furie(buffer_IA2,buffer_t,150));
IA2A4[h]=abs(Furie(buffer_IA2,buffer_t,200)); |
Where the ShiftBuf function is defined this way:
%Buffer shift to the left with a final value "value"
function ShiftBuf([Buf],value)
for (k=2:length(Buf))
Buf[k-1]=Buf[k];
end
Buf[k]=value;
end |
Extra code for output to the graphical console:
clrplot #G_FAULT;
posplot 1,1;
plot2d #G_FAULT (TA,IA2,title="Shorted turn current");
plot2d #G_FAULT (TA,IA2A0,linewidth=2,graphcolor="green");
plot2d #G_FAULT (TA,IA2A1,linewidth=2,graphcolor="red");
plot2d #G_FAULT (TA,IA2A2,linewidth=2,graphcolor="black");
plot2d #G_FAULT (TA,IA2A3,linewidth=2,graphcolor="magenta");
plot2d #G_FAULT (TA,IA2A4,linewidth=2,graphcolor="cyan");
posplot 1,2;
plot2d #G_FAULT (TA,Ift,title="Energizing coil current");
plot2d #G_FAULT (TA,IftA0,linewidth=2,graphcolor="green",
legend="Constant component");
plot2d #G_FAULT (TA,IftA1,linewidth=2,graphcolor="red",
legend="1 Harmonics");
plot2d #G_FAULT (TA,IftA2,linewidth=2,graphcolor="black",
legend="2 Harmonics");
plot2d #G_FAULT (TA,IftA3,linewidth=2,graphcolor="magenta",
legend="3 Harmonics");
plot2d #G_FAULT (TA,IftA4,linewidth=2,graphcolor="cyan",
legend="4 Harmonics"); |
After running the program the graphical console will look like it is shown at pic.5.

Pic.5 - Currents in the shorted turn, energizing coil and their harmonic components
As it is seen from the graphs the energizing coil current has a constant continuous
component of a second harmonic and the shorted turn current - continuous components of the first and the third harmonics and that
represents the facts.
<< To the top
|