simsen 2.3 modular simulation software for the analysis of

26
SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002 - 1 - TUTORIAL 4 : DATA STRUCTURE DESCRIPTION Table of contents page 1 Introduction ..................................................................................................................... 2 2 Use and Generation of Data ........................................................................................... 3 2.1 Simulation steps ............................................................................................................ 3 2.2 Description of the data and the flow of data ................................................................. 4 2.3 Initial conditions............................................................................................................ 5 2.4 End of simulation .......................................................................................................... 5 3 Mathematical Expressions.............................................................................................. 6 3.1 Use of mathematical expressions .................................................................................. 6 3.2 Syntax of mathematical expressions ............................................................................. 6 3.3 Available functions ....................................................................................................... 7 4 References X and Y ....................................................................................................... 11 4.1 Regulation part of power systems ............................................................................... 11 4.2 Format of the references X and Y ............................................................................... 11 4.3 Accuracy...................................................................................................................... 12 5 Elements sort and operations sequence....................................................................... 13 6 Simulation’s parameters ............................................................................................... 16 6.1 COMMENT ................................................................................................................ 16 6.2 SIMULATION PARAMETERS................................................................................. 16 6.3 CONSTANT DATA ................................................................................................... 17 6.4 PARAMETERS .......................................................................................................... 18 6.5 INITIAL CONDITIONS ............................................................................................. 18 6.6 DISTURBANCES....................................................................................................... 18 7 Load-Flow calculation: program Inisim ..................................................................... 19 7.1 Electrical rules ............................................................................................................. 19 7.2 Start of Inisim.............................................................................................................. 19 8 Time domain simulation: program Sim ...................................................................... 22 9 Batch processing ............................................................................................................ 24 10 Graphical output and post-processing: program Visual ........................................... 26

Upload: others

Post on 22-Apr-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 1 -

TUTORIAL 4 : DATA STRUCTURE DESCRIPTION

Table of contents page

1 Introduction ..................................................................................................................... 22 Use and Generation of Data ........................................................................................... 3

2.1 Simulation steps ............................................................................................................ 32.2 Description of the data and the flow of data ................................................................. 42.3 Initial conditions............................................................................................................ 52.4 End of simulation .......................................................................................................... 5

3 Mathematical Expressions.............................................................................................. 63.1 Use of mathematical expressions .................................................................................. 63.2 Syntax of mathematical expressions ............................................................................. 63.3 Available functions ....................................................................................................... 7

4 References X and Y....................................................................................................... 114.1 Regulation part of power systems ............................................................................... 114.2 Format of the references X and Y ............................................................................... 114.3 Accuracy...................................................................................................................... 12

5 Elements sort and operations sequence....................................................................... 136 Simulation’s parameters............................................................................................... 16

6.1 COMMENT ................................................................................................................ 166.2 SIMULATION PARAMETERS................................................................................. 166.3 CONSTANT DATA ................................................................................................... 176.4 PARAMETERS .......................................................................................................... 186.5 INITIAL CONDITIONS............................................................................................. 186.6 DISTURBANCES....................................................................................................... 18

7 Load-Flow calculation: program Inisim ..................................................................... 197.1 Electrical rules............................................................................................................. 197.2 Start of Inisim.............................................................................................................. 19

8 Time domain simulation: program Sim...................................................................... 229 Batch processing............................................................................................................ 2410 Graphical output and post-processing: program Visual ........................................... 26

Page 2: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 2 -

1 Introduction

This tutorial shows you:• A description of the data files used and generated by SIMSEN.• Use and specification of mathematical expressions.• How to use the references X and Y to read values and write parameters in the power and

regulation parts.• How the operation’s sequence is realized and how the elements are sorted.• How to use the different sections of the main simulation file.• How to use the different programs: Load-Flow calculation, simulation versus time and

graphical output.

Page 3: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 3 -

2 Use and Generation of Data

2.1 Simulation steps

Through the stages of a simulation session, data are used and generated by the differentmodules of Simsen. We first describe a typical sequence in figure 2.1.1 with the datagenerated at each step.

Figure 2.1.1: Typical sequence of operation

1) Edit the circuit (topology and parameters)2) Save the circuit -> creation of a file *.stm, for example: circuit.stm on the hard disk3) Validate the circuit -> generation of data structures in memory4) Start the simulation:4.1) Edisim writes the files *.dat (one for each element and one main file)4.2) Sim reads the files *.dat and generates its data structures in memory5) At each integration step, Sim writes the results in files *.vis6) Break/Continue: The user may interrupt/continue the simulation anytime7) End7.1) Sim updates the files *.dat7.2) Edisim updates the circuit in the editor with the new values in the files *.dat

Remark: You can apply all the above considerations about Sim to Inisim

During a simulation, the state variables are modified at each integration step and theparameters can be modified by disturbances or the action of other elements.

Page 4: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 4 -

2.2 Description of the data and the flow of data

There are 4 data types:

Drawing data:- Description of the topology of the circuit used by the interface.

Simulation parameters:- General simulation specification: time min, time max, etc...- List of the elements.- Initialization of the state variables.- Initialization of the parameters.- List of disturbances.

Element parameters: (for each element)- Connection to the other elements.- Parameters.- State variables.

Results: (a result file for each element)- Value of the parameters and the state variables of the element.

Through a simulation session, the system data are recorded in 4 different forms:

Figure 2.2.1: Data flow in Simsen

- (1) File on hard disk: *.stm, ex: circuit.stmThis binary file records the circuit drawing and all the system parameters. It is used tosave the user's work as well as the system state after simulations; it contains all thenecessary information to rebuild the system.

- (2) Files on hard disk: *.dat, ex: circuit.dat, T1.dat ...These are text files, one for each element and one defining the whole system and thesimulation specifications (main file).They are used to transfer system data between the interface and the simulator.They store the value of the state variables at the end of simulation. They contain all theinformation for the simulator to run a simulation.

Page 5: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 5 -

- (3) Files on hard disk: *.vis, ex: T1.vis...These are text files, one for each element (user may disable their writing). After eachintegration step, Sim writes the value of the system variables in these files; for example:In a file T1.vis, Sim writes the value of all the variables corresponding to element T1.A post-processing program, Visual uses this data for display or further processing.

- (4) Data in memory created and used by the interface (edisim.exe)

- (5) Data in memory created and used by the simulator (sim.exe)

2.3 Initial conditions

At the beginning of a simulation (step 4.2 in section 2.1), the system initializes the statevariables of the elements. The initialization depends on the value specified in the simulationparameters:If - Initial Conditions from [E/M] = E , the elements read their values from their respective*.dat file.If - Initial Conditions from [E/M] = M , the elements have their state variables set to zeroand may be initialized with the values determined under section - INITIAL CONDITIONS:in the simulation parameters main file.

2.4 End of simulation

At the end of a simulation and also at each user break, the simulator updates all the *.datfiles. The interface only updates the circuit in the editor if the user agrees to do so, otherwise,the values of the previous simulation remain valid, and the state of the system at the end ofsimulation is ignored! Notice that at the beginning of a new simulation, the interfaceoverwrites the *.dat files with the data in the circuit editor.

Page 6: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 6 -

3 Mathematical Expressions

3.1 Use of mathematical expressions

Mathematical expressions may be used in the following places:

• Simulation parameters: definition of constant data, parameters, initial conditions, anddisturbances.

• Element PROG: - DATA section.• Elements with - REFERENCES X or - REFERENCES Y sections:

Expressions are basically of 2 types:

1. y = F(x)2. F(x)

With type 1, the result of F(x) is assigned to the variable y.

With type 2, the result of F(x) is assigned to an implicit variable (which is not available forthe user). Examples in places where you have:

Ele.y K1 K2

K1 and K2 are coefficients that may be a simple number or an expression value as shownbelow:

Ele.y 2*Sin(x) 3*Sqrt(x)

In this example the evaluation of 2*Sin(x) is assigned to the implicit variable K1 and3*Sqrt(x) is assigned to K2

3.2 Syntax of mathematical expressions

An expression should have the following syntax, according to the BNF (Backus Naur Form):

To understand the syntax description, you should know the meaning of the followingsymbols:The symbol '|' is for a choice: 'a'|'b'|'c' means 'a' or 'b' or 'c'The symbol '{' means 0,1 or more occurrences of the expression enclosed ex: {'a'|'b'|'c'} mayrepresent 'a', 'ab', 'aabc', ...The symbol '[' means 0 or 1 occurrence of the expression enclosed ex: ['a'|'b'|'c'] mayrepresent 'a', 'b','c' or nothing (0 occurrence)

Digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'Letter = 'A'|'B'|...|'Z'|'a'|'b'|...|'z'Identifier = Letter {Letter|Digit|'_'|'.'}Example: Mas1.Ia , Rotor_speed ...

Page 7: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 7 -

Number = {Digit}['.'{Digit}]['E'|'e' ['+'|'-']{Digit}]Example: 12 , 2.5, 2e-3 ...

Function = FunctionName '('[Expression] {',' Expression} ')'Example: Cos(20) , Cos(2*Sqrt(5)+2) ...

Factor = Identifier|Number|Function|Parenthese {'*'|'/'|'̂ ' Identifier|Number|Function|Parenthese}Example: Mas1.Ia*2/Sqrt(12), (2+3*a)^(b+c) ...

Parenthese = '(' Expression ')'Example: (5*Cos(20) + 12) ...

Expression = ['+'|'-'] Factor {'+|'-' Factor}Example: - (2*Cos(20+3*a)+12) + 25*Sqrt(32) ...

The name of the functions or variables defined by the system are in small or capital letters,the case is ignored ex: cos(20) is the same as COS(20) or Cos(20). The variables defined bythe user are case sensitive: MyVariable and myvariable are two different variables!

3.3 Available functions

ABS: Absolute value function:Syntax: y=ABS(x)Operation: y Abs x= ( )

AND: Logical AND function of k valuesSyntax: y=AND(x1,x2,x3,..,xk)Operation: If x1 > 0.5 AND x2 > 0.5 AND … AND xk > 0.5 THEN y = 1 ELSE y = 0

ARCCOS: ArcCosine:Syntax: y=ARCCOS(x)Operation: y ArcCos x= ( ) 0 ≤ ≤y π

ARCSIN: ArcSine:Syntax: y=ARCSIN(x)

Operation: y ArcSin x= ( ) − ≤ ≤π π2 2

y

ARCTG: Arctangent:If the number of arguments is equal to 1:Syntax: y=ARCTG(x)

Operation : y ArcTan x= ( ) − ≤ ≤π π2 2

y

If the number of arguments is equal to 2:Syntax: y=ARCTG(x1,x2)

Operation: )21(

xxArcTany =

Advise: To get the result π⋅≤≤ 20 y , add the following function:y=MOD(y,0,2*pi)

Page 8: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 8 -

COS: Cosine:Syntax: y=COS(x)Operation: y Cos x= ( )

EQ: EqualitySyntax: y=EQ(x1,x2)Operation: IF x1 = x2 THEN y = 1 ELSE y = 0

EQ0: Equal to zeroSyntax: y=EQ0(x)Operation: IF x = 0 THEN y = 1 ELSE y = 0

EXP: Exponential function:Syntax: y=EXP(x)Operation: y Exp x= ( )

FRAC: Fractional partSyntax: y=FRAC(x)Operation: y = Frac(x) examples: FRAC(2.3) = 0.3, FRAC(-1.6) = -0.6

GE: Greater or EqualSyntax: y=GE(x1,x2)Operation: IF x1 >= x2 THEN y = 1 ELSE y = 0

GE0: Greater or Equal to ZeroSyntax: y=GE0(x)Operation: IF x >= 0 THEN y = 1 ELSE y = 0

GT: Greater ThanSyntax: y=GT(x1,x2)Operation: IF x1 > x2 THEN y = 1 ELSE y = 0

GT0: Greater Than ZeroSyntax: y=GT0(x)Operation: IF x > 0 THEN y = 1 ELSE y = 0

INT: INT function:Syntax: y=INT(x)Operation: y INT x= ( ) examples: INT(1.5) = 1, INT(-2.9) = -2

LE: Less or EqualSyntax: y=LE(x1,x2)Operation: IF x1 <= x2 THEN y = 1 ELSE y = 0

LE0: Less or Equal to ZeroSyntax: y=LE0(x)Operation: IF x <= 0 THEN y = 1 ELSE y = 0

Page 9: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 9 -

LN: Natural Logarithm function:Syntax: y=LN(x)Operation: y Ln x= ( )Warning: x must be >0

LT: Less ThanSyntax: y=LT(x1,x2)Operation: IF x1 < x2 THEN y = 1 ELSE y = 0

LT0: Less Than ZeroSyntax: y=LT0(x)Operation: IF x < 0 THEN y = 1 ELSE y = 0

MAX: Maximum of k values function:Syntax: y=MAX(x1,x2,x3,..,xk)Operation: y Max x x x xk= ( , , ,....., )1 2 3

MIN: Minimum of k values function:Syntax: y=MIN(x1,x2,x3,..,xk)Operation: y Min x x x xk= ( , , ,....., )1 2 3

MOD: MOD functionIf the number of arguments is equal to 2:Syntax: y=MOD(x,k)Operation: y=x MOD k ky <≤0

If the number of arguments is equal to 3:Syntax: y=MOD(x,k1,k2)Operation: y=x MOD (k1, k2) 21 kyk <≤

NE: Not EqualSyntax: y=NE(x1,x2)Operation: IF x1 <> x2 THEN y = 1 ELSE y = 0

NE0: Not Equal to ZeroSyntax: y=NE0(x)Operation: IF x <> 0 THEN y = 1 ELSE y = 0

NOT: Logical negativeSyntax: y=NOT(x)Operation: IF x > 0.5 THEN y = 0 ELSE y = 1

OR: Logical OR function of k valuesSyntax: y=OR(x1,x2,x3,..,xk)Operation: IF x1 > 0.5 OR x2 > 0.5 OR .. OR xk > 0.5 THEN y = 1 ELSE y = 0

RANDOM: Random functionSyntax: y=RANDOM(x1,x2)Operation: y = random integer value within x1 and x2 21 xyx <≤

Page 10: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 10 -

RMS: Module function:If the number of arguments is equal to 2:Syntax: y=RMS(x1,x2)Operation: y x x= +1 22 2

If the number of arguments is equal to 3:Syntax: y=RMS(x1,x2,x3)

Operation: a x x x= − +1 2 32

( ) b x x= ⋅ −32

2 3( ) y a b=⋅

⋅ +23 2

2 2

ROUND: ROUND function:Syntax: y=ROUND(x)Operation: y ROUND x= ( ) examples: ROUND(2.6) = 3, ROUND(-2.9) = -3

SIGN: SIGN functionSyntax: y=SIGN(x)Operation: IF x > 0 THEN y = 1 ELSE IF x < 0 THEN y = -1 ELSE y = 0

SIN: Sine:Syntax: y=SIN(x)Operation: y Sin x= ( )

SQR: Square functionSyntax: y=SQR(x)Operation: xxy ⋅=

SQRT: Square Root functionSyntax: y=SQRT(x)Operation: xy =

TG: Tangent:Syntax: y=TG(x)Operation: y = Tan(x)

TRUNC: TRUNC function:Syntax: y=TRUNC(x)Operation: y TRUNC x= ( ) examples: TRUNC(2.6) = 2, TRUNC(-2.9) = -2

XOR: Logical XOR functionSyntax: y = XOR(x1,x2)Operation: IF (x1 > 0.5 AND x2 <= 0.5) OR (x1 <= 0.5 AND x2 > 0.5) THEN y = 1 ELSE y = 0

Page 11: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 11 -

4 References X and Y

4.1 Regulation part of power systems

The regulation part of any power system is based on the same principle:

• Measurement devices provide physical values like voltage, current, speed, flux, torque,temperature, etc… These values represent the state of the power system.

• The aim of the regulation part is to keep the power system in a stable state, especiallywhile disturbances or operating point changes.

• The regulation part output is acting on power part control devices like semiconductor gatecontrols, circuit breakers, etc…

SIMSEN has been developed on the following principles:

• It is possible to read all physical values of every element.• During a simulation, it is possible to change the value of all parameters of every element.

Imagine the complexity of the input interface if the above conditions had to be solvedgraphically with a graphical connection for each parameter and for each physical value.

Therefore, the read and write access to every element of the system are using labels whichhave to be written in the sections – REFERENCES X to be read and – REFERENCES Y tobe written. That solution has the great advantage that the user doesn’t have to define thewhole regulation graphically, and also a simple change in these references takes only a fewseconds. Nevertheless, there is one inconvenient: the real regulation part may not correspondto the graphical one. In every case, the user remains responsible for his implementation.

4.2 Format of the references X and Y

To simplify the values exchange, the references format has been defined as described on thefollowing lines:

- REFERENCES X :

Element Quantity coeff1 coeff2 Legend Unit Comment

With:

Element Name of the element where to read a valueQuantity Name of the quantity to be readCoeff1, Coeff2 coefficients

This means that the final value of the input x will be:

21)( coeffcoeffElementQuantityx +⋅= (4.2.1)

The Legend and the Unit are used in the output file (if wished) to represent the input x. TheComment is just information for the user.

Page 12: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 12 -

- REFERENCES Y :

Element Parameter=Quantity Coeff1 Coeff2 Legend Unit Comment

With:

Element Name of the element where to change a parameterParameter Name of the parameter that has to be changedValue Name of the quantity in the present unit that is used to change the

parameter of the selected unitCoeff1, Coeff2 coefficients

This means that the final value of the parameter will be:

21)( CoeffCoeffQuantityElementParameter +⋅= (4.2.2)

The equal sign ‘=’ between Parameter and Quantity is very important. It allows theselection of different output values of the present unit. The Legend, Unit and Comment arejust information for the user.

4.3 Accuracy

To take into account a sample effect with a defined number of bits or to compare exactlyinteger values, the user has the possibility to prescribe the accuracy in both references.Therefore, the user has to enter an additional sign and coefficient as shown below:

- REFERENCES X or Y :

…. Coeff1 Coeff2 #Coeff3 Legend Unit Comment

In that case, the final value of a read quantity is:

33

21 CoeffCoeff

CoeffCoeffQuantityRoundx ⋅

+⋅= (4.3.1)

and the final value of a written value is:

33

21)( CoeffCoeff

CoeffCoeffValueRoundElementParameter ⋅

+⋅= (4.3.2)

Don’t forget the # sign, otherwise the system will not consider the required accuracy.

Page 13: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 13 -

5 Elements sort and operations sequence

SIMSEN is working with units (modular software package). The system defines one unit foreach element. The system allows to read quantities (REFERENCES X) and to modify allparameters (REFERENCES Y) of all units during the simulation. It is nevertheless veryimportant to specify the sequence, especially in the regulation part. The system proceeds inthe following order:

1. The power part is loaded with a sequence that allows each three-phase element to read thevoltages of another one calculated before it.

2. The saturation and mechanical units are added.3. The regulation part is added, according to the following rules:

3.1 All the elements figuring in the REFERENCES X section of another one must becalculated before this one.

3.2 All the elements figuring in the REFERENCES Y section of another one don’tinfluence the sequence. They can be calculated after the present element.

The following example doesn’t cause any problem:

ELEMENT1x y

Parameters

QuantitiesELEMENT2x y

Parameters

QuantitiesELEMENT3x y

Parameters

Quantities

Sequence:

ELEMENT1: Element of the power part

ELEMENT2: Element of the regulation part

REFERENCES X :

ELEMENT1 quantity coeff1 coeff2 legend unit comment

ELEMENT3: Element of the regulation part

REFERENCES X :

ELEMENT2 quantity coeff1 coeff2 legend unit comment

REFERENCES Y :

ELEMENT1 parameter coeff1 coeff2 legend unit comment

Page 14: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 14 -

The next example cannot be solved, using the previous rules. The ELEMENT2 needs aquantity of ELEMENT3, which is calculated after it. The ELEMENT3 also needs a quantityof ELEMENT2. This can appear when the user, for example, defines a PLL (Phase LockedLoop) for example.

ELEMENT1x y

Parameters

QuantitiesELEMENT2x y

Parameters

QuantitiesELEMENT3x y

Parameters

Quantities

In that case, the system displays a warning message. It is nevertheless possible to continue.The system chooses a sequence itself. This one can be partly wrong. To have a bettersolution, SIMSEN proposes a special option to the user. He can define the sequence himself.This works as follows:The user has the possibility to specify that one or more line(s) figuring in the REFERENCESX section of an element don’t have to take part in the definition of the sequence. It is as ifthey didn’t exist. To specify this, the line must begin with %, just before the name of thereferred element.

First possible sequence:

ELEMENT1: Element of the power part

ELEMENT2: Element of the regulation part

REFERENCES X :

ELEMENT1 quantity coeff1 coeff2 legend unit comment%ELEMENT3 quantity coeff1 coeff2 legend unit comment (can be calculated after!!!)

ELEMENT3: Element of the regulation part

REFERENCES X :

ELEMENT2 quantity coeff1 coeff2 legend unit comment

REFERENCES Y :

ELEMENT1 parameter coeff1 coeff2 legend unit comment

Page 15: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 15 -

Second possible sequence:

ELEMENT1: Element of the power part

ELEMENT3: Element of the regulation part

REFERENCES X :

%ELEMENT2 quantity coeff1 coeff2 legend unit comment (can be calculated after!!!)

REFERENCES Y :

ELEMENT1 parameter coeff1 coeff2 legend unit comment

ELEMENT2: Element of the regulation part

REFERENCES X :

ELEMENT1 quantity coeff1 coeff2 legend unit commentELEMENT3 quantity coeff1 coeff2 legend unit comment

With these two solutions, you can see how to change the sequence. If a problem appears withyour sequence, the most important error the system makes is to read a quantity with adelay of one integration step. In many cases, the results will not be strongly affected.

The user can check the chosen sequence in the simulation window, shortly after thebeginning of the simulation.

Page 16: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 16 -

6 Simulation’s parameters

This very important section defines the main simulation parameters. The main simulationwindow contains several sections:

- COMMENT- SIMULATION PARAMETERS- CONSTANT DATA- PARAMETERS- INITIAL CONDITIONS- DISTURBANCES

6.1 COMMENT

In this section, the user may insert any comment about the simulation.

Example:

Synchronous machine with transient disturbances (June 2000)

6.2 SIMULATION PARAMETERS

In this section, the user must define the parameters of the simulation.

Parameter: Unit: Description:Time min [sec] Starting time of the simulation. With a negative or null value

for Time Min, the result files are initialized and the programstarts writing the calculated values only from Time = 0. Thisallows accelerating the simulation of complex systems to reachsteady-state conditions. If Time Min is positive, the result filesare not initialized and the new results are inserted at the end ofthe file. Therefore we can continue a previous simulation thatcame to its end.

Time max [sec] Final time of the simulation.Integration step [sec] Integration step. The user must define this parameter.Precision forimmediate events

[%] Part of the integration step (in %) during which all the detectedevents are considered to be immediate (occurring at thebeginning of the integration step). The default value is 1%

Precision forsimultaneousevents

[%] Part of the integration step (in %) during which all the eventsare considered simultaneous. The default value is 1%

Integrationprocess

[-] Integration algorithm. The present version of SIMSEN allowsRK45 (Runge-Kutta 45), RK23 (Runge-Kutta 23) or EULER.

Write in outputfiles every

[1] Save the results every k calculations. In some case, it is uselessto store all the results. It is possible for example, to save theresults every 5 calculations. With an integration step of 0.0002sec, it amounts to save one point every millisecond. A value of0 will force the system to store all the results for all theelements (even when the parameter Writing = No).

Page 17: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 17 -

Initial conditionsfrom

[E/M] E stands for ElementM stands for Main FileIf M is selected, the program sets all the initial values of thestate variables to zero and the variables defined in the section- INITIAL CONDITIONS will automatically be taken intoaccount.In the general case, it is advised to set this parameter to E,especially if the system can use the load-flow programINISIM to provide initial values.

Disturbancesactivated

[Y/N] If this parameter is set to YES, the user activates thedisturbances defined in section - DISTURBANCES : Thisoption allows to deactivate all the disturbances , by setting theparameter to NO, without having to erase them.

6.3 CONSTANT DATA

In this section, the user may define constant values. On each line, we first write the name ofthe constant followed by a ‘=’ and then its value. The following characters are considered ascomments. If {;} is the first character of a line, the whole line is considered as a comment.Characters following a ‘;’ are considered as comment. If {%} is the first character of a line,the defied operations of the line will be performed, but the line will not be displayed in thesimulation window. The available functions are the ones defined in the section 3.3 of thepresent tutorial. It is also possible to introduce combinations of functions.

Example:

;------------------------------------------------------; Rated values;------------------------------------------------------SN = 3300 [VA] ; Rated powerUN = 400 [V] ; Rated voltageFN = 50 [Hz] ; Rated frequency;------------------------------------------------------; Coefficients and references;------------------------------------------------------alpha=7.5/180*pi;k=cos(alpha)+(sin(alpha)*cos(beta))/sin(beta)n2dn1y=UN20/UN1/k*sqrt(3)L2D=sqr(n2dn1y)*L1Y ; comment 1n2yn2d=sin(alpha)/sqrt(3)/sin(beta) ; comment 2UREF = SQRT(2/3)*UN [V] ; Reference voltageWREF = 2*pi*FN [1/s] ; Reference angular frequencyTREF = SN/WREF [Nm] ; Reference torque

The names of the constants may directly be used in the sections REFERENCES X andREFERENCES Y of the elements.

Page 18: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 18 -

6.4 PARAMETERS

In this section, the user can parameterize some of the elements of the system. This option isadditional to the possibility to edit the parameters in the parameter window of the elements(standard method). On each line we write the name of the element followed by a dot ‘.’, thename of the parameter followed by a ‘=’ and the assigned value. Characters following a ‘;’are considered as a comment. If {;} is the first character on one line, the whole line isconsidered as a comment. If {%} is the first character of a line, the defied operations of theline will be performed, but the line will not be displayed in the simulation window. Theassigned value may be a constant defined in - CONSTANT DATA : this way, one canparameterize all the simulation variables from the main file.

Example:

MAS1.Sn = SN ; Rated powerMAS1.rs = 0.01 ; Stator resistance in p.u.ME1.Text = -tempu*TREF ; Mechanical torque

6.5 INITIAL CONDITIONS

In this section, the user can specify some initial conditions when the option Initial conditionsfrom (under section SIMULATION PARAMETERS) is set to M. On each line we write thename of the element followed by a dot ‘.’, the name of the parameter followed by a ‘=’ andthe assigned value. Characters following a ‘;’ are considered as a comment. If {;} is the firstcharacter on one line, the whole line is considered as a comment. The assigned value may bea constant defined in - CONSTANT DATA.

Example:

SM1.If = Ifd0 [A] ; No-load unsaturated field currentME1.N = n0 [rpm] ; Synchronous speed

6.6 DISTURBANCES

In this section, the user can define disturbances (modification of the value of the parameters)occurring during the simulation. The disturbances become active only if the parameterDisturbances activated (section SIMULATION PARAMETERS) is set to YES. On eachline we write the time of the disturbance followed by ‘:’, the name of the element followedby a dot ‘.’, the name of the parameter followed by a ‘=’ and the assigned value. Charactersfollowing a ‘;’ are considered as comment. If {;} is the first character on one line, the wholeline is considered as a comment. The time of disturbance and the assigned value may be aconstant defined in - CONSTANT DATA.

Example:

time1 : CB1.abc = 0 ; command of circuit breakertime2 : ME1.Text = tempu*TREF ; load change

Page 19: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 19 -

7 Load-Flow calculation: program Inisim

7.1 Electrical rules

The Inisim program has been developed to automatically calculate all the initial conditions ofa power system. The use of Inisim has some restrictions and must follow the followingelectrical rules:

1. All three-phase elements must have the same rated frequency Fn.2. Synchronous machines are directly excited by an ideal single-phase voltage supply.3. Only the voltage regulator VREG is taken into account by the program INISIM. The

other regulator elements (function blocks, aso…) must be initialized by the user.4. The user must select at least one element for reference (reference source or balance

node) with Pc=0, Qc=0, Ulrms=cte and Ths=cte.5. The Load-Flow calculation will still be useful for getting initial conditions for a topology

without semiconductors.6. To accelerate the convergence of the Newton-Raphson algorithm for a large system, it is

advised to proceed step by step, running INISIM first only for a part of the configurationand then adding the rest step by step.

7. Check the state of phases of the circuit breakers.8. If INISIM is first run with a circuit having specified convergence constraints, it is

sensible to introduce all the angular positions Ths of the voltage sources and thesynchronous machines with the same phase taking into account the phase shifting of thetransformers. It is also advised to set Ulrms for these elements at a value close to therated value. The initial speed of the asynchronous machines matches the synchronousspeed. If for the electrical loads Pc and Qc are not equal to zero, it is recommended to setthese values close to Sn.

If these four rules are respected, you won’t have any convergence problem.

7.2 Start of Inisim

To start the Load-Flow program from the Editor mode, go to the Simulation mode selectingthe submenu Simul. Before being in the Simulation mode, the interface realizes severalfunctions:

1. The remaining three-phase connections are added.2. The interface checks all the names of the elements. It establishes a net list including their

sequence (see section 3). The direction of the three-phase elements is also checked(calculation of the line voltages).

3. The whole matrix system with differential equations is defined.4. A Load-Flow Log File is generated5. The Load-Flow calculation starts

If the topology contains any forbidden element, the program displays an error message. Allthe elements of the regulation part are not automatically initialized, except the voltageregulator VREG. This remains a manual user operation. If the three above functions aresuccessfully executed, the system is in the Simulation mode. Otherwise, an error message

Page 20: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 20 -

appears on the screen. Once in the Simulation mode, select the submenu Inisim. The Load-Flow calculation starts. You may see the following figure:

Figure 7.2.1: Load-Flow calculation

The unbalance P and unbalance Q values correspond to the unbalance of all the exchangesof active power and reactive power respectively. Once the user is satisfied with the result, hecan break the calculation by pressing any key. After this, if <e> is pressed as displayed infigure 7.2.2, the Load-Flow is stopped.

Figure 7.2.2: End of Load-Flow calculation

Page 21: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 21 -

Figure 7.2.3: Update with the Load-Flow calculation results

When stopped, if <s> is pressed, the program saves the last calculated point and set all theinitial conditions in each element concerned by the Load-Flow calculation. Any other keydoesn’t save anything and the system keeps its previous state. Once done, the user may returnto the Editor mode to show the result of the Load-Flow calculation by opening someelement’s windows. Be careful: the Load-Flow solution may converge without the assurancethat no element is under over-current or over-voltage conditions. This remains a user check.

Page 22: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 22 -

8 Time domain simulation: program Sim

The Sim program is the simulation program. From the Editor select the submenu Simul andgo to the Simulation mode. The interface provides the same functions as for Inisim. Selectthe submenu Sim click on Yes in the next window. The simulation starts and if you shortlypress any key you can see the following information in the window as shown in figure 8.1.

Figure 8.1: Start of the simulation

The Sim program proceeds as follows:

1. It checks the time parameters, as integration step, simulation duration.2. It defines constant data.3. It establishes an elements list in which you can see your selected elements.4. It checks the disturbances (if any).5. It makes the necessary corrections (calculates automatically state variables indexes for the

mechanical and regulation parts).6. It calculates the initial resolution of the system.7. It opens the result files.8. It generates a simulation Log File9. It starts the simulation.

Press another key to continue the simulation. You can stop and continue your simulation asyou want. The system also indicates all the events specified in the – DISTURBANCESsection.

When the simulation is terminated, the simulation window will appear as shown in figure 8.2.

Page 23: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 23 -

Figure 8.2: End of the simulation

After the simulation, if <s> is pressed, the system updates the parameters in all the concernedfiles with the last simulated point. This feature allows starting a next simulation using the lastpoint of the previous one as initial condition. It is thus possible to split a long simulation or tomodify parameters before continuing a next simulation. If another key is pressed, the systemdoes not update the parameters in the concerned files. This means that the previous initialconditions are kept. In this case, the user may repeat several simulations starting with thesame initial conditions.

Page 24: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 24 -

9 Batch processing

The batch processing function allows one to run a set of simulations automatically. The useredits a text file (with a text editor such as notepad). The batch command file must have thename simbat.txt and has to be located in the same directory as the edisim23.exe andsim23.exe files (..simsen23\exe\simbat.txt). On each line the user specifies the name and fullpath of the circuit to be simulated ex: c:\simsen23\examples\turbo1.stm. Any line beginningwith the character '; ' in first position is ignored by the batch process.

To run a batch processing the user selects the submenu Batch/Start Batch. Each commandline in the batch file can have an optional parameter; there are mainly three cases possible.1. If there is a character ‘s’ at the end of the command line, at the end of the current

simulation the batch will proceed automatically with the next simulation after saving theresults in an *.stm file.

2. If there is a character ‘q’ at the end of the command line, at the end of the currentsimulation the batch will proceed automatically with the next simulation without savingthe results.

3. If there are no parameter character at the end of the command line, the system waits onthe user to close the simulation window (specifying whether or not he wants to save theresults) and then proceeds to the next simulation.

During the batch process a control windows displays the state of the process, showing thecircuits that have already been simulated; do not close this window or SIMSEN will close!

If the system cannot find an *.stm file it writes a warning message an proceeds to the nextsimulation.

Figure 9.1: Illustration of a batch processing

Page 25: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 25 -

c:\simsen\simsen98\temp\1turboa\1turbo.stm sc:\simsen\simsen98\temp\1turbob\1turbo.stmc:\simsen\simsen98\temp\1turboc\1turbo.stm s

Figure 9.2: Example of command lines in the batch file simbat.txt

In the batch example of figure 9.2, the system will run the first simulation (1turboa), thenproceed with the second (1turbob), wait for the user to close the simulation window andfinally run the third simulation (1turboc). The example illustrates the possibility to run asame system but with different values for the parameters.

Page 26: SIMSEN 2.3 Modular SImulation software for the analysis of

SIMSEN 2.3 : Modular SImulation software for the analysis of ENergy conversion Systems 2002

- 26 -

10 Graphical output and post-processing: program Visual

Without any special specifications in its parameter’s window (Writing order), the systemgenerates automatically one result file per element. The name of that file is the same as thename of the element. The extension of all the result files is *.vis. Visual is a program for thedisplay of the results that also includes a few post-processing functions: zoom, Fourieranalysis, graphical features, print, etc… Select the menu Visual. The functions are verysimple. Note that the use of the Visual program is explained in section 4 of thedocumentation folder. The following figure shows some simulation results.

Figure 10.1: Graphical display of results with Visual

End of tutorial