VS
Software
Toolkits
рус
 

5. A description of the parameters of system elements

The parameters a and b of the transfer function of the dynamic level, the gain K and the value of the external effects of G can be either fixed, constant and independent of the time of the processes and the unsteady change during the simulation.
 
Stationary units coefficients in the block diagram are given numbers and transient - features that are designed or programmed. Furthermore, nonlinear units are nonlinear functions of NE, which are also constructed.
 
There are several ways to set the transient and non-linear functions:
1. Block assembly - by connecting the elementary units (algebraic, Boolean) on the block diagram.
2. Conditional entry - programming with the use of "if" statement to set the value of a function at specific intervals.
3. Logical record - record algebraic formulas in one line using logical operations.
 
It should be noted that depending on the type of element, input quantities for the function of the parameter elements are:
1. For external elements - the simulation time t.
2. For gain elements - the simulation time t, and the input signal level U.
3. For non-linear element - input unit U.
 
Examples describe transient and nonlinear functions are given below.
 
Let the external element of G1(t) is the dependence shown in Figure 8.

Figure 8. The dependence of G1(t)

Then the mathematical relationship G1 (t) can be represented as follows (6):
 (6)

Realization according G1(t) in the system simulation software products can be performed as follows.
 
1. Implementation in SimACS.
On the list of models installed external action, the initial value of the external effects of "1" is removed and in its place is written the name of the symbolic function, for example, "G1". The resulting panel programming "G1" must be programmed in the C language function according to (6), this variable R is necessary to write an expression using variable t and taking into account changes in the function of intervals. There are several options for recording code:
 
a). Conditional entry:
if(t<1.5) R=3;
if((t>=1.5)&&(t<2.5)) R=3-(t-1.5);

if((t>=2.5)&&(t<4.5)) R=2+(t-2.5);
if(t>=4.5) R=4;

b). Conditional recording successive Results:
R=3;
if(t>=1.5) R=3-(t-1.5);

if(t>=2.5) R=2+(t-2.5);
if(t>=4.5) R=4;

c). Logical Record:
R=(3)*(t<1.5) + (3-(t-1.5))*((t>=1.5)*(t<2.5)) + (2+(t-2.5))*((t>=2.5)*(t<4.5)) + (4)*(t>=4.5);

2. Implementation in MATLAB Simulink.
On a sheet generator model fit ramp signal corresponding to the simulation time t, which is represented as a block "Clock". This unit is attached to the programming of user functions "Embedded MATLAB function" or "MATLAB Function", which should be written and a function code. There are several options for recording code:
 
a). Conditional entry:
function R = fcn(t)
R=3;
if((t>=1.5)&&(t<2.5)) R=3-(t-1.5); end;

if((t>=2.5)&&(t<4.5)) R=2+(t-2.5); end;
if(t>=4.5) R=4; end;

b). Conditional recording successive Results:
function R = fcn(t)
R=3;
if(t>=1.5) R=3-(t-1.5); end;

if(t>=2.5) R=2+(t-2.5); end;
if(t>=4.5) R=4; end;

c). Logical Record:
function R = fcn(t)
R=(3)*(t<1.5) + (3-(t-1.5))*((t>=1.5)*(t<2.5)) + (2+(t-2.5))*((t>=2.5)*(t<4.5)) + (4)*(t>=4.5);

Unlike recording MATLAB Simulink the write SimACS is that the body of the operator "if" operator must complete "end;", and in Simulink should determine the initial value of the function, or the compiler will generate an error.
 
3. Implementation in VisSim.
On a sheet generator model fit ramp signal corresponding to the simulation time t, which is represented as a block "Ramp". This unit is attached to the programming of user functions "expression", and wherein the program code should be written in the logical function notation. All input parameters sequentially denoted by $1, $2, $3 and so on. Then the code in VisSim by replacing t by $1 will be:

(3)*($1<1.5) + (3-($1-1.5))*(($1>=1.5)*($1<2.5)) + (2+($1-2.5))*(($1>=2.5)*($1<4.5)) + (4)*($1>=4.5)




Let the gain element K1(t) has a relationship shown in Figure 9.

Figure 9. Dependence of K1 (t)

Then the mathematical relationship K1 (t) can be represented as follows (7):
 (7)

Realization according K1 (t) in the system simulation software products can be performed as follows.
 
1. Implementation in SimACS.
On the model of the sheet set amplifying unit, the initial value of the gain of "1" is removed and in its place is written the name of the symbolic function, for example, "K1". The resulting panel programming "K1" must be programmed in the C language function in accordance with (7), this variable R is necessary to write an expression using variable t and taking into account changes in the function of intervals. There are several options for recording code:
 
a). Conditional entry:
if(t<1) R=3;
if((t>=1)&&(t<3)) R=1;

if(t>=3) R=5;

b). Conditional recording successive Results:
R=3;
if(t>=1) R=1;

if(t>=3) R=5;

c). Logical Record:
R=(3)*(t<1) + (1)*((t>=1)*(t<3)) + (5)*(t>=3);

2. Implementation in MATLAB Simulink.
On a sheet generator model fit ramp signal corresponding to the simulation time t, which is represented as a block "Clock". This unit is attached to the programming of custom functions "Embedded MATLAB function" or "MATLAB Function", which should be written and the code function, which should be multiplied by the impact of the input of the amplifier U level. There are several options for recording code:
 
a). Conditional entry:
function R = fcn(t,U)
R=3;
if((t>=1)&&(t<3)) R=1; end;
if(t>=3) R=5; end;
R = R*U;

b). Conditional recording successive Results:
function R = fcn(t,U)
R=3;
if(t>=1) R=1; end;
if(t>=3) R=5; end;
R = R*U;

c). Logical Record:
function R = fcn(t,U)
R=((3)*(t<1) + (1)*((t>=1)*(t<3)) + (5)*(t>=3))*U;

Unlike entries in MATLAB Simulink to write SimACS it is that the value should be multiplied by the factor K1 transient effects on the input unit U.
 
3. Implementation in VisSim.
On a sheet generator model fit ramp signal corresponding to the simulation time t, which is represented as a block "Ramp". This unit is attached to the programming of user functions "expression", which expands on the two input signals, and wherein the program code should be written in the logical function notation. All input parameters sequentially denoted by $1, $2, $3 and so on. Then the code in VisSim by replacing t by $1 and U $2 will be:

((3)*($1<1) + (1)*(($1>=1)*($1<3)) + (5)*($1>=3))*$2



Let the non-linear element N1(U) has a relationship shown in Figure 10.

Figure 10. Dependence of the N1 (U)

Then the mathematical relationship N1 (U) can be represented as follows (8):
 (8)
Realization according N1 (U) in the system simulation software products can be performed as follows.
 
1. Implementation in SimACS.
On the model of the sheet is set non-linear element, a character is written the name of the function, for example, "N1". The resulting panel programming "N1" must be programmed in the C language function according to (8), this variable R is necessary to write an expression using the input variable U and taking into account changes in the function of intervals. There are several options for recording code:
 
a). Conditional entry:
if(U<-1) R=-4;
if((U>=-1)&&(U<0)) R=0;

if((U>=0)&&(U<3)) R=2*U/3;
if(U>=3) R=2;

b). Conditional recording successive Results:
R=-4;
if(U>=-1) R=0;

if(U>=0) R=2*U/3;
if(U>=3) R=2;

c). Logical Record:
R=(-4)*(U<-1) + (0)*((U>=-1)*(U<0)) + (2*U/3)*((U>=0)*(U<3)) + (2)*(U>=3);
 
2. Implementation in MATLAB Simulink.
On a sheet of model fit block programming custom functions "Embedded MATLAB function" or "MATLAB Function", which should be written code function with respect to the impact of the input U non-linear element. There are several options for recording code:
 
a). Conditional entry:
function R = fcn(U)
R=-4;
if((U>=-1)&&(U<0)) R=0; end;

if((U>=0)&&(U<3)) R=2*U/3; end;
if(U>=3) R=2; end;

b). Conditional recording successive Results:
function R = fcn(U)
R=-4;
if(U>=-1) R=0; end;

if(U>=0) R=2*U/3; end;
if(U>=3) R=2; end;

c). Logical Record:
function R = fcn(U)
R=(-4)*(U<-1) + (0)*((U>=-1)*(U<0)) + (2*U/3)*((U>=0)*(U<3)) + (2)*(U>=3);

3. Implementation in VisSim.
On a sheet of model fit block programming custom functions "expression", in which to write the code functions in a logical notation. All input parameters sequentially denoted by $1, $2, $3 and so on. Then the code in VisSim by replacing U on $1 will be:

(-4)*($1<-1) + (0)*(($1>=-1)*($1<0)) + (2*$1/3)*(($1>=0)*($1<3)) + (2)*($1>=3)


By connecting in series software products G1, K1 and N1, where the model is obtained, the appearance of which is shown in Figure 11 in the product SimACS, the figure 12 in the MATLAB Simulink and the figure 13 in the package VisSim.

Figure 11. Model of the system in the product SimACS


Figure 12. Model of the product in MATLAB Simulink


Figure 13. Model of the product in VisSim
 
Models in SimACS, MATLAB Simulink and VisSim
Size: 17459 bytes
Downloaded: 137
DOWNLOAD
Read more: 6. The matrix mathematical model of the system
Рейтинг@Mail.ru
All materials of site are owned by Vasily Shcherbakov
as well as the respective authors when specifying reference. The website administration does not bear any responsibility for third-party information.
You can report content if he has violated your rights. To do this, please contact the administration by e-mail.
You can use non-commercial or educational purposes with reference to this site.