Download as pdf or txt
Download as pdf or txt
You are on page 1of 676

Power Network Simulator

HYPERSIM

Software Release 3.0

Reference Guide Manual

Copyright Notice :
Copyright by Hydro-Qubec, Inc.
All rights reserved. No part of the content of this document may be reproduced or transmitted in any form or by any means
without the written permission of Hydro-Qubec, Inc.
Revision History :
Date

Description of changes

June 2004

Software version 9.0

January 2005

Software version 9.1

June 2006

Software version 9.2

November 2006

Updated DG and Lines models

March 2007

Updated Lines models

August 2007

Change version 9.2 for release 3.0


New LowFlow element.
New Inductance Transformer matrix element.

Trademarks:
The following names are registered trademarks or trade names of their respective owners as listed below.
Name

Company

Relations :
This manual relates to the following objects.
Number

Description

Contents :
The software described in this manual are partially or entirely from licensed Hydro-Qubec software.
The material contained in this manual is partially or entirely from Hydro-Qubec documentation.

ii

Table of
Contents

Part-1
Chapter - 1

Chapter - 2

Chapter - 3

General

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

25

1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

25

1.2 Organization of Hypersim . . . . . . . . . . . . . . . . . . . . . .

25

1.3 Theory of Operation . . . . . . . . . . . . . . . . . . . . . . . . .

31

1.4 Network Simulation Steps . . . . . . . . . . . . . . . . . . . . . .

32

1.4.1 Editing a Diagram . . . . . . . . . . . . . . . . . . . . .

32

1.4.2 Adding Monitoring Devices . . . . . . . . . . . . . . . .

32

1.4.3 Analysis, Simulation and Control . . . . . . . . . . . . .

32

Introduction to the Graphical Interface .

. . . . . . . . . . . .

35

2.1 Starting Hypersim from HyperView . . . . . . . . . . . . . . . . .

35

2.2 Interface Operating Modes . . . . . . . . . . . . . . . . . . . . .

37

2.3 Editing Mode Overview . . . . . . . . . . . . . . . . . . . . . . .

38

2.4 Simulation Mode Overview . . . . . . . . . . . . . . . . . . . . .

39

Editing a Power System Diagram .

. . . . . . . . . . . . . . . .

41

3.1 Background Menus . . . . . . . . . . . . . . . . . . . . . . . . . .

42

3.2 Graphic Tools Palette . . . . . . . . . . . . . . . . . . . . . . . .

44

3.2.1 Power System Components. . . . . . . . . . . . . . . .

44

3.2.2 Control Elements . . . . . . . . . . . . . . . . . . . . . .

45

3.2.3 System Tools . . . . . . . . . . . . . . . . . . . . . . . .

45

3.2.4 User and Site Drawers . . . . . . . . . . . . . . . . . . .

45

3.3 Buses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

47

3.3.1 Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . .

47

3.3.2 Sensor Label and Symbol . . . . . . . . . . . . . . . . .

48

3.3.3 Output Sensors . . . . . . . . . . . . . . . . . . . . . . .

48

iii

Chapter - 4

iv

3.3.4 Base Voltage . . . . . . . . . . . . . . . . . . . . . . . . . .

49

3.3.5 Multiplex Bus . . . . . . . . . . . . . . . . . . . . . . . . . .

49

3.4 Power System Elements . . . . . . . . . . . . . . . . . . . . . . . . .

50

3.4.1 Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

50

3.4.2 Sensor Label and Symbol . . . . . . . . . . . . . . . . . . .

51

3.4.3 Disconnecting Switches and Connectors . . . . . . . . . . .

51

3.4.4 Electrical Parameters . . . . . . . . . . . . . . . . . . . . . .

52

3.4.5 Copying Parameters . . . . . . . . . . . . . . . . . . . . . .

53

3.4.6 Showing Parameters in a Diagram . . . . . . . . . . . . . .

54

3.5 Interconnecting Elements and Buses . . . . . . . . . . . . . . . . . .

55

3.6 Number of Element Phases . . . . . . . . . . . . . . . . . . . . . . .

56

3.7 POW Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

56

3.8 Decoupling Element . . . . . . . . . . . . . . . . . . . . . . . . . . . .

57

Graphic Handling

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

59

4.1 Creating Texts and Graphics . . . . . . . . . . . . . . . . . . . . . . .

59

4.1.1 Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

59

4.1.2 Multibyte Text . . . . . . . . . . . . . . . . . . . . . . . . . .

60

4.1.3 Polylines . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

60

4.1.4 Adding Diversions . . . . . . . . . . . . . . . . . . . . . . . .

60

4.1.5 Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . .

61

4.1.6 Polygon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

61

4.1.7 Straight Line . . . . . . . . . . . . . . . . . . . . . . . . . . .

61

4.1.8 Open Spline Curve . . . . . . . . . . . . . . . . . . . . . . .

61

4.1.9 Ellipse (or circle). . . . . . . . . . . . . . . . . . . . . . . . .

61

4.1.10 Close Spline Curve . . . . . . . . . . . . . . . . . . . . . .

61

4.1.11 Zoom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

61

4.1.12 Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

62

4.2 Selecting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

62

4.2.1 Selecting One Object . . . . . . . . . . . . . . . . . . . . . .

62

4.2.2 Multiple Selection . . . . . . . . . . . . . . . . . . . . . . . .

62

4.2.3 Selecting All Object . . . . . . . . . . . . . . . . . . . . . . .

62

4.3 Changing Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . .

62

4.3.1 Text Attributes . . . . . . . . . . . . . . . . . . . . . . . . . .

63

4.3.2 Graphic Attributes . . . . . . . . . . . . . . . . . . . . . . .

63

4.4 Direct Changes in Position and Form . . . . . . . . . . . . . . . . . .

63

4.4.1 Displacement . . . . . . . . . . . . . . . . . . . . . . . . . .

63

4.4.2 Changing Size . . . . . . . . . . . . . . . . . . . . . . . . .

63

4.5 Changes done from the Menus . . . . . . . . . . . . . . . . . . . . .

64

4.5.1 Group/Ungroup . . . . . . . . . . . . . . . . . . . . . . . . .

64

4.5.2 Front / Back . . . . . . . . . . . . . . . . . . . . . . . . . . .

64

4.5.3 Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . .

64

4.5.4 Vertical/Horizontal flip, Left/Right flip . . . . . . . . . . . . .

65

4.5.5 Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

65

4.5.6 Changing Orientation . . . . . . . . . . . . . . . . . . . . . .

65

4.5.7 Cut, Delete, Copy, Paste, Duplicate . . . . . . . . . . . . .

65

4.6 Global Operations

Chapter - 5

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

66

4.6.1 Searching for an Object . . . . . . . . . . . . . . . . . . . .

66

4.6.2 Cancelling / Restoring Last Operation . . . . . . . . . . . .

66

4.6.3 Grid. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

66

4.6.4 Size of Printed Image . . . . . . . . . . . . . . . . . . . . .

66

4.6.5 Diagram Views . . . . . . . . . . . . . . . . . . . . . . . . .

66

4.7 Handling a Diagram File . . . . . . . . . . . . . . . . . . . . . . . . .

67

Editing Control Systems .

. . . . . . . . . . . . . . . . . . . . . . . . . .

69

5.1 Control Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

69

5.2 Interconnecting Blocks . . . . . . . . . . . . . . . . . . . . . . . . . .

72

5.3 Block Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

73

5.4 Subsystems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

73

5.5 Creating Subsystems before using them . . . . . . . . . . . . . . . .

74

5.5.1 Creating Control Ports . . . . . . . . . . . . . . . . . . . . .

74

5.5.2 Creating Power Terminals . . . . . . . . . . . . . . . . . . .

75

5.5.3 Using a subsystem in a Diagram . . . . . . . . . . . . . . .

75

5.5.4 Changing the Detailed Diagram of a Super-Block. . . . . .

76

5.5.5 Changing the Order of the Input / Output Connectors . . .

76

5.6 Creating subsystem from a selected part in the current diagram . .

77

5.7 Editing in the subsystem content window . . . . . . . . . . . . . . .

77

5.8 Subsystem in Simulation Mode . . . . . . . . . . . . . . . . . . . . .

78

Chapter - 6

Chapter - 7

Chapter - 8

vi

5.8.1 Opening / Closing subsystem content . . . . . . . . . . . .

78

5.8.2 Subsystem Sensors . . . . . . . . . . . . . . . . . . . . . . .

78

5.8.3 Changing Parameters . . . . . . . . . . . . . . . . . . . . .

78

5.9 Bloc Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

79

Interconnecting Control Blocks and


Power System Elements . . . . . . . . .

. . . . . . . . . . . . . . . . .

81

6.1 Interconnecting elements with built-in control


connectors to control blocks . . . . . . . . . . . . . . . . . . . . . .

81

6.2 Interonnecting blocks to elements or bus-bars using sensor signals

83

6.3 Transceiver Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . .

84

6.3.1 Transceiver Blocks . . . . . . . . . . . . . . . . . . . . . . .

84

Monitoring of simulation results .

. . . . . . . . . . . . . . . . . . . .

85

7.1 Monitors in the parameter forms of element or control block . . . . .

85

7.2 Monitors inside the network diagram . . . . . . . . . . . . . . . . . .

86

7.2.1 Monitors associated with element or block . . . . . . . . . .

86

7.2.2 General purpose monitors . . . . . . . . . . . . . . . . . . .

89

7.3 Expression Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

90

7.3.1 Expression with simple functions . . . . . . . . . . . . . . .

90

7.3.2 Expression with advanced functions . . . . . . . . . . . . .

91

7.4 Monitors Operations . . . . . . . . . . . . . . . . . . . . . . . . . . .

92

7.4.1 Monitor controls in HyperView . . . . . . . . . . . . . . . . .

93

7.4.2 Monitor controls inside the network diagram . . . . . . . . .

93

Customizing Hypersim

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

95

8.1 Customizing Hypersim . . . . . . . . . . . . . . . . . . . . . . . . . .

95

8.1.1 Properties Menu . . . . . . . . . . . . . . . . . . . . . . . . .

95

8.1.2 Language Used . . . . . . . . . . . . . . . . . . . . . . . . .

97

8.2 Library Management . . . . . . . . . . . . . . . . . . . . . . . . . . .

98

8.2.1 Library Directories . . . . . . . . . . . . . . . . . . . . . . . .

99

8.2.2 Library of Models Built with Subsystems . . . . . . . . . . .

100

8.2.3 Library of Models Built Using User Code Bloc (UCB) . . . .

104

8.2.4 Library of Models Built from Simulink . . . . . . . . . . . . .

104

8.2.5 Building the Parameter Form . . . . . . . . . . . . . . . . .

104

Chapter - 9

Chapter - 10

Simulation and Control .

. . . . . . . . . . . . . . . . . . . . . . . . . . .

107

9.1 Sensors, Input/Output and Sensor Configuration . . . . . . . . . . .

108

9.1.1 Sensors and Input/Output . . . . . . . . . . . . . . . . . . .

108

9.1.2 Sensor Configuration . . . . . . . . . . . . . . . . . . . . .

110

9.2 Simulation Parameters . . . . . . . . . . . . . . . . . . . . . . . . . .

111

9.3 State of Disconnecting Switches . . . . . . . . . . . . . . . . . . . .

113

9.4 Network Analysis, Task Distribution,


Code Generation and Simulation . . . . . . . . . . . . . . . . . . .

113

9.5 Changing Parameters of Elements and Blocks . . . . . . . . . . . .

114

Setting of initial conditions with Snapshot and Load-Flow


115

10.1 Introduction

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10.2 Introduction to Hyperview

Chapter - 11

115

. . . . . . . . . . . . . . . . . . . . . . .

115

10.3 Snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

116

10.3.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . .

116

10.3.2 Utilization . . . . . . . . . . . . . . . . . . . . . . . . . . . .

116

10.4 Load-Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

119

10.4.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . .

119

10.4.2 Preparation of network parameters . . . . . . . . . . . . .

120

10.4.3 Running load-flow and setting initial conditions . . . . . .

121

10.4.4 Load Flow Bus Elements . . . . . . . . . . . . . . . . . . .

123

List of Tools and Models

. . . . . . . . . . . . . . . . . . . . . . . . . .

129

11.1 SystemTools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

129

11.2 NetworkSources and Machines . . . . . . . . . . . . . . . . . . .

129

11.3 NetworkPassive . . . . . . . . . . . . . . . . . . . . . . . . . . . .

130

11.4 NetworkLines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

131

11.5 NetworkTransformers . . . . . . . . . . . . . . . . . . . . . . . . .

131

11.6 NetworkLoads and Motors . . . . . . . . . . . . . . . . . . . . . .

132

11.7 NetworkControllers and Switches . . . . . . . . . . . . . . . . . .

132

11.8 NetworkMiscellaneous . . . . . . . . . . . . . . . . . . . . . . . .

133

11.9 Control Math and Functions . . . . . . . . . . . . . . . . . . . . .

133

11.10 Control Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . .

134

11.11 Control Non-Linear and Delay . . . . . . . . . . . . . . . . . . .

135

vii

Chapter - 12

11.12 Control Sources . . . . . . . . . . . . . . . . . . . . . . . . . . .

136

11.13 Control Miscellaneous . . . . . . . . . . . . . . . . . . . . . . .

136

Summary of Menus .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

137

12.1 Main Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

137

12.2 Graphics Toolbar

139

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

12.3 Background Menu, Editing Mode

. . . . . . . . . . . . . . . . . . .

139

12.3.1 Without Object Selection . . . . . . . . . . . . . . . . . . .

139

12.3.2 With Object Selection . . . . . . . . . . . . . . . . . . . . .

140

12.4 Background Menu, Simulation Mode . . . . . . . . . . . . . . . . .

141

12.4.1 Pointing to a Label . . . . . . . . . . . . . . . . . . . . . .

141

12.4.2 Pointing to a Blank Space . . . . . . . . . . . . . . . . . .

141

Part-2
Chapter - 1
Chapter - 2

Chapter - 3

Chapter - 4

viii

Hypersim Network Models .

. . . . . . . . . . . . . . . . . . . . . . . .

145

1.1 List of Single-Phase and Three-Phase Models . . . . . . . . . . . .

145

SI or pu system units

. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

163

2.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

163

2.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

163

2.3 P.U. Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

166

System Tools .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

169

3.1 POW Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . .

169

3.2 Single-phase, Three-phase and Multiplex Buses . . . . . . . . . . .

172

3.2.1 Three-Phase Bus . . . . . . . . . . . . . . . . . . . . . . . .

172

3.2.2 Single-Phase Bus . . . . . . . . . . . . . . . . . . . . . . . .

172

3.2.3 Multiplex Bus . . . . . . . . . . . . . . . . . . . . . . . . . .

173

3.3 Simulink Block, User-Coded Block . . . . . . . . . . . . . . . . . . .

174

3.4 Super-Block and Super-Model . . . . . . . . . . . . . . . . . . . . . .

174

Current and Voltage Sources .

. . . . . . . . . . . . . . . . . . . . . .

175

4.1 Current and Voltage Sources . . . . . . . . . . . . . . . . . . . . . .

175

4.2 Programmable Variable Sources . . . . . . . . . . . . . . . . . . . .

180

4.3 Controlled Voltage and Current Sources . . . . . . . . . . . . . . . .

Chapter - 5

Synchronous Turbine Generators .

199

. . . . . . . . . . . . . . . . . .

203

5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

203

5.2 Synchronous Generator Model Overview . . . . . . . . . . . . . . .

204

5.3 Common Generic Subsystem . . . . . . . . . . . . . . . . . . . . . .

206

5.4 Generic Synchronous Generator . . . . . . . . . . . . . . . . . . . .

206

5.4.1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

206

5.4.2 Programmable General Parameters . . . . . . . . . . . . .

208

5.4.3 Load Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . .

210

5.4.4 Programmable Parameters . . . . . . . . . . . . . . . . . .

210

5.5 Generic Excitation system . . . . . . . . . . . . . . . . . . . . . . . .

211

5.5.1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

211

5.5.2 Programmable Parameters . . . . . . . . . . . . . . . . . .

212

5.6 Generic Stabilizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

213

5.6.1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

213

5.6.2 Programmable Parameters . . . . . . . . . . . . . . . . . .

213

5.7 Hydraulic Turbine Generators . . . . . . . . . . . . . . . . . . . . . .

214

5.8 Generic Speed Regulator for Hydraulic Turbine Generators . . . . .

216

5.8.1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

216

5.8.2 Programmable Parameters . . . . . . . . . . . . . . . . . .

217

5.9 Generic Hydraulic Turbine . . . . . . . . . . . . . . . . . . . . . . . .

218

5.9.1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

218

5.9.2 Programmable Parameters . . . . . . . . . . . . . . . . . .

218

5.9.3 List of Available Signals . . . . . . . . . . . . . . . . . . . .

219

5.9.4 Operating Mode . . . . . . . . . . . . . . . . . . . . . . . . .

220

5.9.5 Hydraulic Turbine Generator Control Panel . . . . . . . . .

221

5.10 Tandem Thermal Turbine Generators . . . . . . . . . . . . . . . . .

224

5.11 Generic Boiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

226

5.11.1 Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . .

226

5.11.2 Programmable Parameters . . . . . . . . . . . . . . . . .

226

5.12 Speed Regulator for Tandem Thermal Turbine Generators . . . .

227

5.12.1 Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . .

227

5.12.2 Programmable Parameters . . . . . . . . . . . . . . . . .

227

ix

Chapter - 6

Chapter - 7

5.13 Tandem Steam Turbine . . . . . . . . . . . . . . . . . . . . . . . . .

228

5.13.1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

228

5.13.2 Programmable Parameters . . . . . . . . . . . . . . . . . .

229

5.14 Generic Shaft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

230

5.14.1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

230

5.14.2 Programmable Parameters . . . . . . . . . . . . . . . . . .

232

5.14.3 List of Available Signals . . . . . . . . . . . . . . . . . . . .

233

5.14.4 Thermal Turbine Generator Control Panel . . . . . . . . .

235

5.15 Cross-Compound Thermal Turbine-Generator . . . . . . . . . . . .

239

5.15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .

239

5.15.2 Cross-Compound Thermal Turbine Generator Model . . .

239

5.16 Speed Regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

240

5.16.1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

240

5.16.2 Programmable Parameters . . . . . . . . . . . . . . . . . .

241

5.17 Steam Turbine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

241

5.17.1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

241

5.17.2 Programmable Parameters . . . . . . . . . . . . . . . . . .

242

5.17.3 List of Available Signals . . . . . . . . . . . . . . . . . . . .

242

5.18 Multi-Mass Shafts . . . . . . . . . . . . . . . . . . . . . . . . . . . .

243

5.18.1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

243

5.18.2 Programmable Parameters . . . . . . . . . . . . . . . . . .

244

Passive Elements .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

251

6.1 Shunt and Series R, L, C Elements . . . . . . . . . . . . . . . . . . .

251

6.2 Shunt and Series Non-Linear Resistors

. . . . . . . . . . . . . . . .

255

6.3 Mutual Inductances . . . . . . . . . . . . . . . . . . . . . . . . . . . .

261

6.4 Decoupling Elements . . . . . . . . . . . . . . . . . . . . . . . . . . .

262

6.5 Passive Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

267

Lines and Cables

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

271

7.1 Calculation of electrical parameters . . . . . . . . . . . . . . . . . . .

271

7.1.1 Hyperline Line Data . . . . . . . . . . . . . . . . . . . . . . .

271

7.1.2 Load File (EMTP) . . . . . . . . . . . . . . . . . . . . . . . .

272

7.2 Distributed Parameters Lines - 3, 6, 9 and 12 Phases . . . . . . . .

274

Chapter - 8

Chapter - 9

Chapter - 10

7.2.1 Transmission Lines with Fault . . . . . . . . . . . . . . . . .

282

7.2.2 Coupled Lines . . . . . . . . . . . . . . . . . . . . . . . . . .

285

7.2.3 Triples and Quadruple Lines . . . . . . . . . . . . . . . . .

291

7.2.4 Composed Models: Coupled Lines With Fault


and Quadruple Lines With Fault . . . . . . . . . . . . . .

294

7.3 PI Line Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

300

7.3.1 PI Lines and PI Lines with Fault . . . . . . . . . . . . . . . .

300

7.3.2 Coupled PI Lines and Coupled PI Lines with Fault . . . . .

304

7.3.3 Triple and Quadruple PI Lines. . . . . . . . . . . . . . . . .

307

7.4 Marti Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

313

7.4.1 DC Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . .

332

Transformers .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

339

8.1 Three-Phase Linear and Saturable Transformers with


Two or Three Windings . . . . . . . . . . . . . . . . . . . . . . . .

340

8.2 Single-Phase Linear and Saturable Transformers with


Two or Three Windings . . . . . . . . . . . . . . . . . . . . . . . .

352

8.3 Linear and Saturable Series Transformers . . . . . . . . . . . . . . .

361

8.4 Three-Phase Transformers with Tap Changer

. . . . . . . . . . . .

370

8.5 Measuring Transformers . . . . . . . . . . . . . . . . . . . . . . . .

378

8.6 Inductance Matrix Transformer . . . . . . . . . . . . . . . . . . . . .

392

Load and Motors .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

407

9.1 Dynamic Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

407

9.2 Harmonic Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

413

9.3 D.C. Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

421

9.4 Arc Furnace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

426

9.5 Induction Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

431

9.6 Using the Hypersim Dynamic load model . . . . . . . . . . . . . . .

440

9.6.1 Purpose of the Dynamic Load Model . . . . . . . . . . . . .

440

9.6.2 Description of the Load Model. . . . . . . . . . . . . . . . .

440

Electronic Switches and Bridges .

. . . . . . . . . . . . . . . . . . .

449

10.1 Electronic switches . . . . . . . . . . . . . . . . . . . . . . . . . . .

449

10.1.1 Parameter Description . . . . . . . . . . . . . . . . . . . .

449

10.1.2 Other Parameters . . . . . . . . . . . . . . . . . . . . . . .

451

xi

Chapter - 11

xii

10.1.3 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . .

451

10.1.4 List of Available Signals . . . . . . . . . . . . . . . . . . . .

452

10.2 Serial Breaker and Shunt Fault Breaker . . . . . . . . . . . . . . . .

453

10.2.1 Shunt and Serial Breakers . . . . . . . . . . . . . . . . . .

453

10.2.2 Breaker . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

458

10.3 Triple-Level Converter in H Configuration . . . . . . . . . . . . . . .

460

10.3.1 Icon and Diagram of a 2 Triple-Level Converter in H


Configuration . . . . . . . . . . . . . . . . . . . . . . . . .

460

10.3.2 Parameter Description . . . . . . . . . . . . . . . . . . . .

461

10.3.3 Switch Parameters . . . . . . . . . . . . . . . . . . . . . .

461

10.3.4 Control Order Source . . . . . . . . . . . . . . . . . . . . .

463

10.3.5 List of Available Signals . . . . . . . . . . . . . . . . . . . .

463

10.4 THREE-LEVEL CONVERTER . . . . . . . . . . . . . . . . . . . . .

464

10.4.1 Icon and Diagram of a 2 Triple-Level Converter in H


Configuration . . . . . . . . . . . . . . . . . . . . . . . . .

464

10.4.2 Parameter Description . . . . . . . . . . . . . . . . . . . .

464

10.4.3 Switch Parameters . . . . . . . . . . . . . . . . . . . . . .

465

10.4.4 Control Order Source . . . . . . . . . . . . . . . . . . . . .

466

10.4.5 List of Available Signals . . . . . . . . . . . . . . . . . . . .

467

HVDC and SVC Controllers .

. . . . . . . . . . . . . . . . . . . . . . .

469

11.1 Rectifier/Inverter 6/12 Pulse DC Controllers . . . . . . . . . . . . .

469

11.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .

469

11.1.2 Icons and diagrams . . . . . . . . . . . . . . . . . . . . . .

469

11.1.3 Modelling the converter and its control system . . . . . . .

470

11.1.4 Valve faults and DC fault . . . . . . . . . . . . . . . . . . .

470

11.1.5 Firing and synchronization system . . . . . . . . . . . . . .

470

11.1.6 Band-pass filter . . . . . . . . . . . . . . . . . . . . . . . .

472

11.1.7 Low AC voltage detection . . . . . . . . . . . . . . . . . . .

474

11.1.8 The a angle regulation and limiting system . . . . . . . . .

474

11.1.9 The static characteristic . . . . . . . . . . . . . . . . . . . .

474

11.1.10 The voltage dependent current order limiter (VDCOL) . .

475

11.1.11 Dynamic operation of the controller . . . . . . . . . . . .

476

11.1.12 The PI regulators . . . . . . . . . . . . . . . . . . . . . . .

478

Chapter - 12

11.1.13 Linearization of gain . . . . . . . . . . . . . . . . . . . . .

478

11.1.14 limits . . . . . . . . . . . . . . . . . . . . . . . . . . . .

479

11.1.15 () limitation . . . . . . . . . . . . . . . . . . . . . . . .

480

11.1.16 Protection system . . . . . . . . . . . . . . . . . . . . . .

481

11.1.17 DC fault protection . . . . . . . . . . . . . . . . . . . . . .

481

11.1.18 Protection for commutation failures . . . . . . . . . . . .

482

11.1.19 Unblocking sequence . . . . . . . . . . . . . . . . . . . .

483

11.1.20 Enabling (start-up) . . . . . . . . . . . . . . . . . . . . . .

483

11.1.21 The tap changer . . . . . . . . . . . . . . . . . . . . . . .

483

11.1.22 Description of parameters . . . . . . . . . . . . . . . . .

484

11.1.23 References . . . . . . . . . . . . . . . . . . . . . . . . . .

485

11.1.24 Converter parameters . . . . . . . . . . . . . . . . . . . .

485

11.1.25 Operating modes . . . . . . . . . . . . . . . . . . . . . .

485

11.1.26 Controller parameters . . . . . . . . . . . . . . . . . . . .

486

11.1.27 Measurement filters . . . . . . . . . . . . . . . . . . . . .

487

11.1.28 Band-pass filters (Synchronization) . . . . . . . . . . . .

487

11.1.29 LCDT <<VDCOL>> function . . . . . . . . . . . . . . . .

487

11.1.30 Tap changer control . . . . . . . . . . . . . . . . . . . . .

487

11.1.31 Protection . . . . . . . . . . . . . . . . . . . . . . . . . . .

487

11.1.32 Low AC voltage detection . . . . . . . . . . . . . . . . . .

488

11.1.33 Disturbances . . . . . . . . . . . . . . . . . . . . . . . . .

488

11.1.34 Valve parameters . . . . . . . . . . . . . . . . . . . . . .

489

11.1.35 Control panel for HVDC converters . . . . . . . . . . . .

490

11.1.36 List of available signals . . . . . . . . . . . . . . . . . . .

493

11.2 SVC Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

496

11.2.1 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . .

501

11.2.2 Control System Parameters . . . . . . . . . . . . . . . . .

502

11.2.3 List of Available Signals . . . . . . . . . . . . . . . . . . .

503

11.3 Static Compensator Branches: TCR and TSC . . . . . . . . . . . .

510

Various Network Elements

. . . . . . . . . . . . . . . . . . . . . . . .

519

12.1 Frequency Measure Element . . . . . . . . . . . . . . . . . . . . .

519

12.2 Digital Output Element . . . . . . . . . . . . . . . . . . . . . . . . .

521

12.3 Digital Input Element . . . . . . . . . . . . . . . . . . . . . . . . . .

523

xiii

Chapter - 13

12.4 Analog Input Element . . . . . . . . . . . . . . . . . . . . . . . . . .

524

12.5 Current and Voltage Measure Elements . . . . . . . . . . . . . . .

524

12.6 Disconnection Element . . . . . . . . . . . . . . . . . . . . . . . . .

525

Hypersim Wave Form Playback Model .

. . . . . . . . . . . . . .

527

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

537

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

549

Part-3
Chapter - 1

Control Block List

Chapter - 2

Function Details .

Part-4
Chapter - 1

xiv

Matlab and Simulink Models

. . . . . . . . . . . . . . . . . . . . . . .

567

1.1 Matlab and Simulink Models . . . . . . . . . . . . . . . . . . . . . . .

567

1.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

567

1.3 Main Features of HyperLink . . . . . . . . . . . . . . . . . . . . . . .

568

1.4 Relationship Between HyperLink and


Matlab/Simulink/RTW Versions . . . . . . . . . . . . . . . . . . . .

569

1.5 Preparing Simulink Models . . . . . . . . . . . . . . . . . . . . . . . .

569

1.6 Transformations Required in the Model . . . . . . . . . . . . . . . . .

569

1.7 Adapting Step Sizes of Simulink and Hypersim in Real-Time . . . .

570

1.8 Adapting Step Sizes of Simulink and Hypersim in Differed Time

. .

570

1.9 Code Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

570

1.9.1 Code Generation of a Simulink Model . . . . . . . . . . . .

571

1.10 Adding a Simulink Model to a Hypersim Diagram . . . . . . . . . .

574

1.10.1 Using a Simulink Block . . . . . . . . . . . . . . . . . . . .

574

1.10.2 Using a HyperLink Power System Element . . . . . . . . .

575

1.10.3 Code Generation and S Functions in HyperLink . . . . . .

582

1.11 Changing Simulink Model Parameters During


a Hypersim Simulation . . . . . . . . . . . . . . . . . . . . . . . . .

584

1.12 Limits of Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . .

584

1.13 Procedure Used to Change Parameters . . . . . . . . . . . . . . .

585

1.14 Guidelines for a joint Simulink - Hypersim real-time simulation. . .

587

Chapter - 2

User Coded Blocks .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

591

2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

591

2.2 UCB Icon and Diagram . . . . . . . . . . . . . . . . . . . . . . . . . .

591

2.3 UCB Components

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

591

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

593

2.5 Building Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

593

2.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .

593

2.5.2 Using the ucb Command . . . . . . . . . . . . . . . . . . .

593

2.5.3 ucb Command Operating Modes . . . . . . . . . . . . . .

593

2.5.4 Using the Interactive Mode . . . . . . . . . . . . . . . . . .

593

2.5.5 ucb Prompt . . . . . . . . . . . . . . . . . . . . . . . . . .

594

2.6 UCB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

594

2.7 UCB Program in Batch Mode . . . . . . . . . . . . . . . . . . . . . .

598

2.8 Building a Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

599

2.8.1 Creating a Block . . . . . . . . . . . . . . . . . . . . . . . .

599

2.8.2 Starting the UCB Program . . . . . . . . . . . . . . . . . . .

599

2.8.3 Block Definition File . . . . . . . . . . . . . . . . . . . . . .

599

2.8.4 General Information . . . . . . . . . . . . . . . . . . . . . .

600

2.8.5 Block Documentation . . . . . . . . . . . . . . . . . . . . . .

600

2.8.6 Block Parameters . . . . . . . . . . . . . . . . . . . . . . . .

600

2.8.7 Parameters of the Block Simulation Function . . . . . . . .

601

2.8.8 Inputs and Outputs of the Block Simulation Function . . . .

601

2.8.9 Historical Variables of a Block . . . . . . . . . . . . . . . . .

602

2.8.10 Global Variables of a Block (code C) . . . . . . . . . . . .

602

2.8.11 Initializing a Block (C Code) . . . . . . . . . . . . . . . . .

602

2.8.12 Block Execution Code (C Code) . . . . . . . . . . . . . . .

603

2.8.13 Transforming Parameters (C Code) . . . . . . . . . . . . .

603

2.8.14 Closing the Capture of a Block Definition . . . . . . . . . .

604

2.8.15 Generating the Block Code . . . . . . . . . . . . . . . . .

604

2.8.16 Compiling the Block Code . . . . . . . . . . . . . . . . . .

605

2.9 Including a UCB in a Power System . . . . . . . . . . . . . . . . . .

605

2.9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .

605

2.9.2 Adding a UCB to a Power System . . . . . . . . . . . . . .

606

2.4 UCB Limits

xv

Chapter - 3

2.9.3 Identifying a Block . . . . . . . . . . . . . . . . . . . . . . . .

606

2.9.4 Connecting the Inputs/Outputs of a Block . . . . . . . . . .

607

2.9.5 Specifying the Parameters . . . . . . . . . . . . . . . . . . .

607

2.9.6 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

607

2.10 User Programmable Blocks . . . . . . . . . . . . . . . . . . . . . . .

615

Generation and Importation of EMTP Files

. . . . . . . . . . .

617

3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

617

3.2 Limits of the Current Algorithm . . . . . . . . . . . . . . . . . . . . . .

618

3.3 Recursive Characteristic of Diagrams . . . . . . . . . . . . . . . . . .

618

3.4 Generation of EMTP files . . . . . . . . . . . . . . . . . . . . . . . . .

618

3.5 Importation of EMTP file . . . . . . . . . . . . . . . . . . . . . . . . .

619

3.6 Diagram Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

619

3.7 Configurable X Resources . . . . . . . . . . . . . . . . . . . . . . . .

621

Chapter - 4

Automatic Initialization of Control Panel Parameters

Chapter - 5

User Coded Model (UCM)

xvi

. . .

625

. . . . . . . . . . . . . . . . . . . . . . . . .

629

5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

629

5.2 Solution Method in Hypersim

. . . . . . . . . . . . . . . . . . . . . .

630

5.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .

630

5.2.2 Line model . . . . . . . . . . . . . . . . . . . . . . . . . . . .

630

5.2.3 Substation modelling . . . . . . . . . . . . . . . . . . . . . .

633

5.2.4 Parallel tasks in Hypersim . . . . . . . . . . . . . . . . . . .

641

5.3 User Coded Model . . . . . . . . . . . . . . . . . . . . . . . . . . . .

642

5.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .

642

5.3.2 UCM characteristics . . . . . . . . . . . . . . . . . . . . . .

642

5.3.3 Composition of an UCM . . . . . . . . . . . . . . . . . . . .

643

5.3.4 Building an UCM through an example . . . . . . . . . . . .

644

5.3.5 Using an UCM in Hypersim diagram . . . . . . . . . . . . .

662

5.3.6 Management of library of UCMs . . . . . . . . . . . . . . . .

663

5.4 Progressive practices with UCM . . . . . . . . . . . . . . . . . . . . .

664

5.4.1 Resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

664

5.4.2 Inductor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

666

5.4.3 Series Resistor-Inductor . . . . . . . . . . . . . . . . . . . .

669

5.4.4 Voltage source . . . . . . . . . . . . . . . . . . . . . . . . .

672

5.4.5 Non-linear inductance . . . . . . . . . . . . . . . . . . . . .

676

xvii

xviii

Part 1
Using the Hypersim Interface

2--23

PAGE LEFT INTENTIONALLY BLANK

2--24


Chapter 1
GENERAL

1.1 INTRODUCTION
This chapter provides a functional description of Hypersim. For a better understanding, it is
recommended to read the sections in order. A list of available models and interface menus is
provided at the end of the chapter for easy look up.
Hypersim is a software and hardware package designed to simulate Power System Networks.
Networks can be simulated off-line on workstations with one or many processors, or in realtime with parallel processors. In real-time, the simulated events take place at the speed they
would in a real environment. This allows to connect actual equipment to a network simulated
by Hypersim.
Power network simulation requires a large simulation capability. Hypersim must be able to
represent elements such as:
Power elements, including those for power generation, transmission, distribution and
consumption.
Control systems associated with elements for regulation, control and protection.
To cover the network part, Hypersim has a library offering most of the power elements. Control systems have their own library of basic control blocks. Hypersim also accepts diagrams
drawn with SimulinkTM.
A diagram simulated with Hypersim can contain power elements, control blocks or a combination of both types. In addition to the diagrams entered by the user, Hypersim can import or
export files in EMTP format.

1.2 ORGANIZATION OF HYPERSIM


The Hypersim software consists of different modules, each one having its own function. The
modules are the following:
HYPERSIM, the graphical interface in edition mode (see Figure 1 - 1);
HYPERSIM, the graphical interface in simulation mode (see Figure 1 - 2);
ScopeView, the signal visualization tool (see Figure 1 - 3);
HYPERVIEW, the graphical interface for tools such as Netlist, load flow and snapshot (see Figure 1 - 4);
HyperView, the simulation control centre which allows to launch various applications such as Hypersim, ScopeView, and executes Hypersim related commands such
as Netlist, Load flow, Snapshot and Monitoring (see Figure 1 - 4);

1-1-25

General

Organization of Hypersim

TestView, the graphical interface for batch file testing (see Figure 1 - 5).
HYPERSIM, the graphical interface in Edition Mode is used for:
Building a diagram and entering graphical objects or text comments;
Entering the parameters of each element and sequences of operation;
HYPERSIM, the graphical interface in simulation mode is used for:
Performing the network analysis to see the validity of the entered power system;
Performing the task mapping according to the processors available and their interconnections;
Generating and compiling the simulation code;
Starting the simulation;
Defining the signals to be analysed that will be sent to ScopeView;
Entering the parameters of each element and sequences of operations.
ScopeView, the waveform visualization tool is used for:
Viewing the signals of the current simulation;
Viewing the signals of any previous tests saved in a file or database;
Performing any mathematical operation on any signal;
Saving the signal data in a multitude of format (data or picture).
HYPERVIEW, the graphical interface for tools such as netlist, load flow and snapshot
is used for:
Reading, changing or printing all of the parameters of the network of evidence;
Performing a Load flow on the power system and initializing the real-time situation
from that result;
Taking a snapshot of the network and saving it in a file. Future simulations can then
be re-initialized from that exact moment.
TestView, the graphical interface for batch file testing is used for:
Creating or executing batch files for automatic testing.
These modules intercommunicate via the rpc protocol. They can reside on one or many computers in the network. All those modules can be used either in real-time or off-line mode.The
following illustrations are the graphic captures of all the modules.

1-1-26

General

Organization of Hypersim

Figure 1 - 1 HYPERSIM, the graphical interface in Edition Mode

1-1-27

General

Organization of Hypersim

Figure 1 - 2 HYPERSIM, the graphical interface in Simulation Mode

1-1-28

General

Organization of Hypersim

Figure 1 - 3 ScopeView, the waveform visualization tool

1-1-29

General

Organization of Hypersim

Figure 1 - 4 HyperView, the tool for NetList, Load flow and snapshot

Figure 1 - 5 TestView, the tool for batch file testing

1-1-30

General

Theory of Operation

1.3 THEORY OF OPERATION


A power system network mainly consists of stations interconnected by lines as shown in Figure 1 - 6. Basically, signals travel through lines at the speed of light. However, these lines
have a propagation delay which varies with their length.

STATION

STATION
Machine

Breaker

Breaker
Line
Transformer

(a)

Line
equation

(b)

Sub-station
equation

Line
equation

subsystem

subsystem

subsystem

Sub-station
equation

Load

subsystem

Reactor

Figure 1 - 6 Diagram of a simple network (a) and


of parallel tasks (b) to simulate a network
Due to this propagation delay, it is possible to simulate stations simultaneously (or in parallel)
with a calculation step smaller than the propagation delay. After each step, the stations can
exchange results and then recompute the equation with the latest results from the previous
time step.

1-1-31

General

Network Simulation Steps

The stations contain passive elements, sources, motors and also control systems of which
some have a much slower response time than that of electric transient phenomena. In practice,
the control systems can also be simulated simultaneously with other station elements.
In short, the simulation of a power system network can be executed by a series of parallel
tasks to simulate stations and related subsystems and lines.

1.4 NETWORK SIMULATION STEPS


A simulation consists of two main steps:
Editing the diagram to simulate.
Analysis, simulation and control
This section describes the different actions related to each step. The procedure used to initiate
a step will be detailed progressively.
1.4.1

Editing a
Diagram

With the interface in Edition mode, the diagram of the network to simulate is built by using
the element drawers specified by 12 in Figure 2 - 2 of Chapter . The network can contain
power system elements and control elements. The network can also be saved in a file or read
from a file.

1.4.2

Adding
Monitoring
Devices

Monitoring devices allow to observe the simulation results at slow rate (typically one refresh
per second). Once the network has been drawn and free of errors, user can add the monitoring
devices into the network diagram.

1.4.3

Analysis,
Simulation and
Control

Switching to Simulation mode allows to activate the analysis, simulation and control capabilities of Hypersim. The following operations can be executed in this step:
1 Define General Parameters . These parameters define the simulation step, the type of

simulation (real-time or off-line), the platform where the simulation is executed, etc.
2 Network Analysis. Used to analyse the topology of the diagram; identify lines, stations;
combine elements part of the same station; assign parallel tasks to lines and stations; identify
the control systems that can be executed by the parallel tasks.

The network is automatically analysed when the Simulation mode is activated. However, this
step has to be done manually when Preferences parameters are modified.
3 Task Distribution . Hypersim reads the information on the equipment selected for the sim-

ulation. This information contains the details on the number of processors, their performance
and their communication functions. Hypersim can then distribute to the processors the different parallel tasks established during network analysis based on the time allocated and the
communication functions required. In case of failure, Hypersim asks the user to change the
tasks distribution (for example: modify the simulation step).

1-1-32

General

Network Simulation Steps

4 Define Sensors. Each element (power system element or control block) has a list of sen-

sors allowing to observe signals. The user can select some of these to send them to the Spectrum or ScopeView Display Module. The list of sensors can also be saved in a file to be used
at a later time.
The sensors also allow connecting the signals of the simulated network to the outside world.
For example, it is possible to observe simulation signals with a real oscilloscope or to connect
external equipment to the simulated network.
5 Code Generation . Up to this point, only the required preparatory work was done. The
Simulation Module was not created and no simulation was executed. The Simulation Module
is specific to each network and the related parameters and codes must be generated and recompiled.
6 Simulate the Network/Stop the Simulation. The user then starts the Simulation Module

to simulate his network based on the general parameters defined in step 1. When a network
simulation is requested, Hypersim automatically executes steps 2, 3 and 5. However, these
can be launched manually to correct some abnormalities.
7 Acquire and Display Results. During the execution of the simulation, the user can launch
the ScopeView Module to observe the waveforms.

1-1-33

General

Network Simulation Steps

PAGE LEFT INTENTIONALLY BLANK

1-1-34


Chapter 2
INTRODUCTION TO THE GRAPHICAL INTERFACE

2.1 STARTING HYPERSIM FROM HYPERVIEW


As mentioned in the previous chapter, HyperView is now the simulation control centre. To
keep all simulation applications coherent and connected together, it is a good practice to start
applications from HyperView.
First, HyperView is launched by typing:
hyperview
This will bring up the empty HyperView window shown in Fig.2 - 1a.

1-2-35

Introduction to the Graphical


Interface

Starting Hypersim from HyperView

a) Starting window

b) After launching Hypersim

Figure 2 - 1 HyperView window


Use the menu
Tools->Start Hypersim
to launch Hypersim. When Hypersim is started, HyperView window will change and shows
its Simulation tab as in Fig. 2 - 1b with the following informations (brief descriptions are
given here, more details on these informations will be given later in subsequent chapter):
Network name: At the beginning, no network has been created or loaded, Noname is
filled in this field,
Code directory: directory where the generated code will be kept,
Performance: time scale factor allowing the simulation to be faster, equal or slower
than the real-time.
Type: type of simulation which can be Not real-time or real-type using specific
hardware (SGI computer, PC cluster, etc.)
Calculation step: the simulation results will be calculated at every steps.
1-2-36

Introduction to the Graphical


Interface

Interface Operating Modes

Compilation host: name of the computer used to compile the generated codes.
Simulation host: name of the computer performing the simulation.
Hypersim is launched with an empty diagram as shown in Figure 2 - 2.
IMPORTANT
From Hypersim 9.1, many new features are added and
need HyperView to run correctly. If Hypersim is activated and HyperView is not present, launch HyperView by
clicking on HyperView button located in the upper part
of Hypersim window.

2.2 INTERFACE OPERATING MODES

3
1
12

10

11

Figure 2 - 2 Hypersim GUI at start-up


There are two operating modes for the graphic interface: Editing and Simulation. At start-up,
the interface is in Editing mode. Changing modes is done by the Edition and Simulation buttons 2 .

1-2-37

Introduction to the Graphical


Interface
Editing Mode Overview

Edition mode: This mode is used to draw the network diagram and its control systems
and also to enter element parameters. Cosmetic graphic elements can be added to the
diagram, along with text explanations. In the graphic menus, the following functions
are available for each object: erase, cut, paste, move, rotate, resize, colour, etc.
In Edition mode, the objects in the diagram mainly consist of graphic characteristics
and have very few electrical characteristics.
Simulation mode: In this mode, the editing function is deactivated. The objects in the
diagram mainly have electrical characteristics. The menus in this mode allow to analyse
the network, start or stop a simulation, create disturbances, observe results, etc.
When switching from Edition mode to Simulation mode, the simulation is possible, but
can only be initiated with a user command.

2.3 EDITING MODE OVERVIEW


The following information is displayed in the Hypersim window (see Figure 2 - 2):
1

Drawing Toolbar. Offers tools that are used to add text explanations and cosmetic drawings to the diagrams space (rectangles, polygons, lines, etc.). They have no effect on the
actual simulation).
Two exclusive selection buttons allowing to select one of the two interface modes: Edition mode to prepare the diagram and Simulation mode to simulate the network.The selected mode is displayed with a 3-D effect
Specifies the version of the graphic interface (Interface, version...), the Hypersim software version (HYPERSIM, version...) and the workstation name where the
interface is displayed (Display [workstation_name:1]).
The line at the top of the interface consists of the following menus: File, Edit, Graphics, View, Diagram, Special and Properties. When the user points to one of these
while pressing and holding the left mouse button, a pull-down menu is displayed. The
user can then select the desired command to execute. For a detailed descriptions of those
menus, please refer to section 16.1.

10

1-2-38

The actual zoom rate of the diagram. While pressing and holding the right mouse button
the available percentages of zooming are displayed. The user simply moves the mouse
on the desired percentage and release the left mouse button.
For displacement of the viewing window in both directions simultaneously. Simply click
on the rectangle and move it to the desired location.
8

Horizontal and vertical scroll bars used to move the diagram in the workspace.

Gradual zoom arrows. Used to zoom in on the diagram being edited. The up arrow allows
to zoom in, while the down arrow allows to zoom out. The zoom rate is shown in 5 .
The workspace where the user draws the diagram that will be simulated.

Introduction to the Graphical


Interface
Simulation Mode Overview

11

12

Filename of the diagram, empty if no name is specified (as in the example above). When
editing a diagram, an asterisk (*) before the name specifies that the diagram was modified, but not saved.
Tools palette with many drawers. Each drawer contains elements in one category. To
open a drawer, just click its label. Figure 2 - 2 shows all the drawers closed.
Clicking the small box to the left of a drawer allows to separate the full tools palette and
move it freely on the screen.

2.4 SIMULATION MODE OVERVIEW


In Simulation mode, the interface is displayed as in Figure 2 - 3. Here, the editing menus and
buttons are not available. However, displacement is still possible using the scroll bars 6 , 7 ,
8 and the zoom rate can be changed with 5 or 9 .
Following the action executed by the user, different information is displayed:
13

Filename containing the list of sensors that can be displayed. An asterisk (*) before the
name specifies that the list was modified, but not saved.

14

An oscilloscope
displayed next to an element indicates that sensors related to this
element were selected for display.

15

This area displays a message from the simulations status

1-2-39

Introduction to the Graphical


Interface
Simulation Mode Overview
+

15

14

9
13

Figure 2 - 3 Overview of Hypersims GUI in Simulation Mode

1-2-40


Chapter 3
EDITING A POWER SYSTEM DIAGRAM

Connections
Buses

Power
elements
Workspace

Figure 3 - 1 Diagram with Power System Elements


Editing a diagram is done in Edition mode. To edit a diagram as in Figure 3 - 1, within the
workspace, the user creates the required buses, the power system elements and interconnects
them with connections. Elements cannot be connected directly one to another. They must always be connected using a bus.
The power system elements available are found in drawers whose title begins with NETWORK,
while buses are in the drawer SYSTEM--TOOLS.
For ease of understanding, this section concentrates on the electrical aspect of a diagram, in
other words the creation of buses, power system elements and their interconnections. Each of
these elements is also a graphic object (in addition to being an electrical object). Graphic handling (displacement, zoom in, rotation, copy, paste, etc.) will be described in Chapter .

1-3-41

Editing a Power System Diagram


Background Menus

3.1 BACKGROUND MENUS


Two background menus can be displayed in the workspace: one related to a selected graphic
object and one for general commands.
The following procedure is used to display the menu related to a selected object:
A

Select the required object in the diagram by left clicking it. The object is then marked with
handles.

Figure 3 - 2 Selected element background menu


B

1-3-42

Press the right button and hold. This displays the background menu with the commands that
can be used on the object. The required command is executed by dragging the pointer to it,
then releasing the right button.

Editing a Power System Diagram

Background Menus

Figure 3 - 3 General background menu


To display the general background menu, make sure no object is selected, then press and hold
the right button. The procedure to execute a command is the same as described above.
The execution of most background menus first displays a dialogue box in which the required
parameters must be defined.

1-3-43

Editing a Power System Diagram


Graphic Tools Palette

3.2 GRAPHIC TOOLS PALETTE

Figure 3 - 4 Graphic Tools Palette


The Graphic Tools Palette, specified by 12 in Chapter , is reproduced in Figure 3.3. Inside
these drawers, there are icons of elements to simulate, or tools allowing to interconnect elements. A brief description of these follows. The whole Chapter 1.1 in Part 1 (Hypersim Network Models on page 145) is dedicated to a complete description of each element.
There are two types of elements to simulate: power elements and control elements. There is
also a drawer containing general use elements.
3.2.1

Power System
Components

These elements are found in drawers whose title begins with NETWORK--. The drawers contain passive power system elements (lines, transformers, reactors), active power system elements (sources, machines) or electronically controlled elements (converters, breakers).
1 NETWORK--SOURCES+MACHINES. Power generating elements for a network: voltage

and current sources, hydraulic and thermal machines.


2 NETWORK--PASSIVE. Linear and non-linear R, L, C elements, including passive filters.
3 NETWORK--LINES. Different types of lines, frequency dependent or not.
4 NETWORK--TRANSFORMER. Different types of transformers, saturable or not, including

voltage and current measuring transformers.


5 NETWORK--LOADS+MOTORS. Different types of loads (dynamic, arc furnace, etc.) and

motors (AC and DC).


6 NETWORK--CONTROLLERS+SWITCHES. AC-DC converters, static compensators, different configurations of electronic power switches.
7 NETWORK--MISCELLANEOUS. Elements other than those previously described.

1-3-44

Editing a Power System Diagram


Graphic Tools Palette

3.2.2

Control
Elements

Besides power system elements, Hypersim can also represent control systems by using its
own library of basic blocks. Part 1, Chapter 1, page 567 (describes how Hypersim can use
control diagrams built with SimulinkTM.
The drawers of basic blocks have a title beginning with CONTROL--. These are the following:
8 CONTROL--MATH. Blocks executing algebraic, trigonometric, logarithmic operations and

others.
9 CONTROL--LOGIC. Logical gates (AND, OR,...), comparators, logical delay, multiplex-

ing/demultiplexing.
10 CONTROL--NON-LINEAR. Used to calculate minimum and maximum, non-linear functions, modulators, delay generator, sampler.
11 CONTROL--SOURCES. Waveform and constant generators.
12 CONTROL--MISCELLANEOUS. abc<->dq conversion, integer<->floating conversion,

transceiver and also blocks not part of the preceding categories.


3.2.3

System Tools

These elements have a general application:


Synchronize of data acquisition and operations,
Buses used to interconnect power system elements,
Models whose content is in a file such as sub-systems (see Chapter 10), SimulinkTM
diagram (see Part 1, Chapter 1, page 567) and user-coded blocks (Part 1, Chapter , page
591).

3.2.4

User and Site


Drawers

Hypersim allows user to add his own models and in his personal drawer. User models are
those developed by user for his specific applications. They are stored in the users private library and accessible from user drawers.
Site models are specific for one installation site. They can be developed by site users and put
into library to be shared among users on the same site. Chapter 8, page 95, gives detail descriptions of user and site libraries.

1-3-45

Editing a Power System Diagram


Graphic Tools Palette

1-3-46

Editing a Power System Diagram


Buses

3.3 BUSES

Figure 3 - 5 Drawing Buses


There are three types of buses: single-phase, three-phase and multiplex. These are referred to
respectively in Figure 3 - 5 by BusMono, Bus3ph and BusMpx.
The single-phase bus is used to interconnect single-phase elements, the three-phase bus for
three-phase elements and the multiplex bus to connect three-phase elements to single-phase
elements and vice versa.
3.3.1

Drawing

Figure 3 - 5 shows how to draw a bus:


Select the type of bus by clicking the corresponding icon in the drawer SYSTEM--TOOLS.
For a single-phase bus, move the pointer to the required position and left click.
1-3-47

Editing a Power System Diagram


Buses

For a three-phase bus and a multiplex bus, put the pointer in the start position, press and hold
the left button, drag to the final position, then release. The buses can only be horizontal or
vertical.
3.3.2

Sensor Label
and Symbol

Each bus has a label that must be unique in the network. During network analysis, Hypersim
checks if there are duplicate bus labels. In Simulation mode (described later), it is possible to
install sensors to measure the bus voltages. If at least one sensor is installed, a sensor symbol
resembling an oscilloscope will appear next to the bus label.
The following procedure is used to modify the label and position of the sensor symbol:

Figure 3 - 6 Dialogue for Bus Label and Sensors


A

Select the required bus and display the background menu (see 3.1), to execute Edit label,

A dialogue box as in Figure 3 - 6 is displayed. The following parameters are defined:


1 Label: Name given by the user
2 Visibility: Select Yes or No to show or hide the label on the diagram,
3 Alignment: Define the relative position of the label with respect to the bus,
4 Alignment of sensor with respect to label: Define the relative position of the sensor

symbol with respect to the label.


3.3.3

1-3-48

Output
Sensors

In edition mode, sensors can be used also as entry to the control block world. They
will connect internal signal of elements to be used by the control blocks.

Editing a Power System Diagram


Buses

a) Dialog box to Edit base voltage

b) Dialogue box to Edit base voltages summary

Figure 3 - 7 Base Voltage Dialogue Boxes


3.3.4

Base Voltage

Each network bus has a base voltage that can be used to calculate the voltage in pu (per unit).
This parameter is used by the load flow module. It can be edited as follows:
Select the required bus and display the background menu, used to executeEdit base voltage,

The dialogue box in Figure 3 - 7a) is displayed and the base voltage can be defined in phasephase kV and r.m.s. value.
Instead of defining the base voltages for each bus, they can all be defined together in the same
dialogue box. To do this:

Display the general background menu (see Section 3.1) and select Edit base voltages
summary.

3.3.5

The dialogue box in Figure 3 - 7b) is displayed and the base voltages for all the buses can then
be defined.
Multiplex Bus

The multiplex bus is currently used to connect a three phases sections of the network to one
phase sections. In the future, it will allow to generalize to multiphase utilization. Parameters
can be assigned to the multiplex bus by selecting and using the background menu Edit bus.
The dialogue box in Figure 3 - 8a) is displayed to define the number of phases and the one in
Figure 3 - 8b) to define the phase labels.

1-3-49

Editing a Power System Diagram


Power System Elements

a) Dialogue box to Edit number of


phases in a bus

b) Dialogue box to Edit labels


of a multiplexed bus

Figure 3 - 8 Dialogue Boxes for a Multiplex Bus

3.4 POWER SYSTEM ELEMENTS

Voltage
source

Current
source

Label

Internal
connector
Disconnecting switch
External
connector
Workspace

Figure 3 - 9 Using Power System Elements


3.4.1

Drawing

Power system elements are found in drawers whose title begins with NETWORK. To draw a
power system element, open its drawer and execute the following:
1

Select the required element by clicking on the corresponding icon in the drawer.

In the workspace, position the pointer where the middle of the element is to be, then left
click. The element will then be displayed.
2

Chapter describes how to change the graphic aspect of an element.

1-3-50

Editing a Power System Diagram

Power System Elements

3.4.2

Sensor Label
and Symbol

3.4.3

Disconnecting
Switches and
Connectors

As for the buses, each power system element has a label that must be unique to the network.
When analysing the network, Hypersim will check for any duplicate label. In Simulation
mode (described later), sensors can be installed to measure the specific signals of an element.
If at least one sensor is installed, a sensor symbol is displayed next to the element label. To
change the label and the symbol position of a sensor, follow the same procedure as the one
described for buses (see Section 3.3.2).

Figure 3 - 10 Dialogue box for Connectors and Disconnecting Switches


Power system elements have terminals connected to buses. Each terminal has a disconnecting
switch between two connectors. In Edition mode, the disconnecting switches have no function. In Simulation mode, the user can open or close a disconnecting switch to enable or disable an element.
A disconnecting switch can be added or removed by selecting the corresponding element and
using the background menu to execute the command Edit connectors. This command displays the dialogue box shown in Figure 3 - 10 with the following informations:
1 Type: Select Switch Style to be able of using the disconnecting switch. Select Graphic
connector to do not use the disconnecting switch.
2 Visibility: Yes to show the connector dots, No otherwise.

1-3-51

Editing a Power System Diagram


Power System Elements

4
1

Figure 3 - 11 Example of a Parameters Control Panel


The connectors of all power system elements can be displayed with the global command
Display connectors in the general background menu (no element selected). Similarly,
they can be hidden with the command Erase connectors.
3.4.4

Electrical
Parameters

To edit the electrical parameters of a power system element, the user has to select the element,
display its background menu and then execute the command Edit parameters. Figure 3 11 shows an example of a parameters control panel displayed with this command. The numbers in a circle specify the following:
1 Exclusive Selections parameter type. Defined by clicking on the required selection. The
selected parameter is in colour, while the others are in grey (not selected).
Some elements have an Inclusive Selections parameter type allowing to make many selections simultaneously.
2

1-3-52

Numeric parameter type: Entered by typing the required values.

Editing a Power System Diagram

Power System Elements

3 Dial parameter type. Defined by positioning the pointer at the end of a dial needle, left
clicking and holding to set the needle to the required position. These dials also have a digital
display automatically updated as the needle is positioned. User can also type directly in the
digital display instead of moving the needle.

The displacement range of the needle can also be defined by providing minimum and maximum values.
4

Checkboxes; these are checked by left clicking.

Commands to end editing:

1 Cancel: Cancel the changes and close the control panel.


2 Apply: Confirm the changes without closing the control panel.
3 Close: Confirm the changes and close the control panel.
3.4.5

Copying
Parameters

All the parameters can be copied from one element to another element of the same type (example: from one voltage source to another) as follows:

Select the reference element with the left button, and the destination element with the centre
button.

Use the background menu to execute the command Copy parameters. A dialogue box is
displayed to confirm

Bring the background menu on screen again, select Paste to copy the element having the
same parameters.

1-3-53

Editing a Power System Diagram


Power System Elements

3.4.6

Showing
Parameters in
a Diagram

a) Element with parameters


displayed

c) Dialogue box to Display results


parameters in the diagram
b) Dialogue box to Display parameters
in the diagram

Figure 3 - 12 Showing Element Parameters in a Diagram


It is possible to select parameters and show them next to the corresponding element. To display an element parameter, select the element and use the background menu to execute Display parameters in the diagram. A dialogue box as in Figure 3 - 12b) will be shown.
It contains a list of displayable parameters. The user selects the parameter to show, its alignment relative to the element and the display format which can be one of the following:
1 All: The name, the value and the unit are shown,
2 Value and units: Only the value and units are shown.

In the dialogue box, only one parameter can be selected at a time. To select other parameters,
the user has to re-execute Show parameters in the diagram.
Many parameters are identified with a number. They are for internal use and have no specific
function for the user.
Figure 3 - 12a) shows an example of an element with its parameters shown in the diagram. In
Simulation mode, the parameters shown are automatically updated when changes are made.

1-3-54

Editing a Power System Diagram

Interconnecting Elements and Buses

The user can hide parameters by selecting the corresponding element and executing in the
background menu Display results. The dialogue box for this command is shown in Figure 3 - 12c) which contains the list of parameters currently shown. Only one parameter can
be hidden at a time.

3.5 INTERCONNECTING ELEMENTS AND BUSES

1
A
4

2
1
3
5
4
3

2
Bus
2
1

(a)
Key:

BusMPX

3
1

(b)
Click left button

Click right button

Figure 3 - 13 Making Connections Between an Element


and a Bus
A network (diagram) consists of power system elements interconnected with buses. Figure 3
- 13(a) shows how to make these interconnections. The user draw a connection formed by a
series of straight lines connecting an external connector (see Figure 3 - 9) of a power system
element to a bus. To make a connection:
A

Make sure no object was selected in the diagram (no object is surrounded by handles);

Click the connector to make the connection; the pointer transforms into an index
ifying that a connection is being drawn;

Drag the connection to the bus where to end the connection,

If the connection is ended by clicking the bus with the right button, then the connection consists of one straight line between the connector and the middle of the bus.

spec-

1-3-55

Editing a Power System Diagram


Number of Element Phases

It is also possible to divert the connection by moving the pointer and left clicking at each diversion. The connection is ended when the pointer is positioned on the bus and a right click
is made. The connection segments can be either horizontal or vertical, except when there is
only one segment linking the connector and the middle of a bus.
Usually, the last segment ends at the middle of a bus as shown in Figure 3 - 13(a) with connection A linking Gen to the bus. A connection can be made to appear ending next to the
middle of the bus, such as connection B linking element Res. To do this, left click one
more time on the last segment (point 4) before ending the connection (right click while pointing to the bus).
Multiplex buses are used to connect multiphase elements to single-phase elements and vice
versa. Figure 3 - 13b) shows how to interconnect elements to a multiplex bus. The connection
of the Gen1 multiphase voltage source to the multiphase side of BusMPX bus is done following the steps above. The connections of single-phased R, L, C elements are done in the same
way, except that they are ended by right clicking on the dot representing the phase (a, b or c)
of the bus.

3.6 NUMBER OF ELEMENT PHASES


In most cases, the number of element phases is determined by the type of the element. An AC
line has three phases, a DC cable has one phase, transformers have three phases, except single-phase models.
In some cases, the number of element phases is determined by its connection to a bus. The
element is multiphase if it is connected to a multiphase bus, or if it is connected to the multiphase side of a multiplex bus. It is single-phase if it is connected to a single-phase bus or to
the single-phase side of a multiplex bus. In figure 3 - 13b), element Gen1 has three phases,
while R, L and C elements have one phase.
Hypersim automatically checks if there is a conflict between the number of phases authorized
for an element and the bus connected to this element.

3.7 POW ELEMENT


The simulation of disturbances requires a time reference to clock the disturbance. This reference is determined by an element called POW (point-on-wave) that should be linked to a bus
whose voltage is relatively stable. A POW is compulsory in a network with power system elements. Hypersim warns the user when there is no POW found in the network.
The time reference (t = 0) is established by the level crossing of the Phase a voltage of the
bus to which the POW is connected. This crossover can be during the rise (positive slope) or
fall (negative slope) of the voltage signal. A voltage detection level can also be specified.

1-3-56

Editing a Power System Diagram


Decoupling Element

Level

t
t=0
(a) Positive slope

t=0
(b) Negative slope

Figure 3 - 14 Calculation of the POW Time Reference

3.8 DECOUPLING ELEMENT


As discussed at the beginning of this Part (Chapter 1), Hypersim simulates a network using
parallel tasks. One of the elements serving to separate these tasks is a transmission line.
Some network stations may consist of many elements and one single task cannot simulate all
the passive elements in the time set by the calculation step. In such cases, it is necessary to
divide the task into many parallel tasks. This is done using decoupling elements. Two of these
can be found in the drawer NETWORK--PASSIVE:
Decoupl: decoupling element replacing a reactor;
Dec_XFO: decoupling transformer replacing a transformer.
Figure 3 - 15 shows the use of a decoupling element to divide task 1 which simulates Station P into two parallel tasks: task 1a and task 1b.

1-3-57

Editing a Power System Diagram


Decoupling Element

STATION P

Part 1

L
Part 2
task 1
STATION P
Decpl

Part 1

task 1a

Part 2

task 1b

Use of decoupling element to divide a task in two


Figure 3 - 15 Decoupling element

1-3-58


Chapter 4
GRAPHIC HANDLING

Buses, power system elements and connections are electric elements. These are all objects
that can be handled graphically. Similarly, control blocks to be discussed in Chapter are also
graphic objects in addition to being control elements.
It is also possible to create pure graphic objects such as texts or forms to add information or
improve the visual aspect of a diagram. These objects can be handled just like electric elements.

4.1 CREATING TEXTS AND GRAPHICS


rectangle

open
spline
curve

multibyte
text

text

polylines

closed
spline
curve zoom

straight line
polygon

rotation

ellipse

stroke
color

filling
color

stroke thickness
and type

gravity

font

grid

filling pattern

Figure 4 - 1 Text and Graphics Toolbar


It is also possible to create texts and graphics (other than electric elements) using the text and
graphics tool bar shown in Figure 4 - 1. This bar is just above the workspace and the design
tools are on the left-hand side of the bar. Left click to select a tool.
The tools available are described in the following subsections:
4.1.1

Text

To write lines of text: After selecting the tool Text, position the pointer where to start the
text, left click and start writing. Use Enter to change lines.
Changing text attributes (font, size, colour) will be discussed later.
To edit an existing text, select the text to be changed, select the text tool. You are now in edition mode.

1-4-59

Graphic Handling

Creating Texts and Graphics

4.1.2

Multibyte Text

Creating multibyte texts: these are texts in languages which do not use the latin alphabet (Japanese, Chinese, Arabic,...). To do this, select the tool Multibyte text, put the pointer at
the start position, left click and a dialogue box will be displayed to allow to enter the required
text.
Note : It should be noted that all the environment must first be defined with the required
language. The keyboard corresponding to the language must be used.

4.1.3

Polylines

To create a series of straight lines: select the tool Polyline, put the pointer at the start position, left click, move to next position, left click again, and so on. To end, click the middle
button.
To remove the break point and click the right button. To end, click the middle button.
To edit an existing polyline, select the line and click on the polyline tool. You are now in editing line mode.
Changing graphic attributes will be discussed later.

4.1.4

Adding
Diversions

A polyline or a transmission line module can be diverted. An example is shown in Figure


4 - 2.

Bus A

Line with two


diversions

Straight
line

Bus B

Figure 4 - 2 Example of Adding Diversions to a Transmission Line.


To add a diversion:
A

Select the polyline or transmission line

Select the tool Polyline (see Figure 4 - 3). Point to the selected object at the place where a
diversion is required.
Left click to add a new diversion. The new diversion moves along with the pointer and it is
set using the left button.

1-4-60

Graphic Handling

Creating Texts and Graphics

To end, click the middle button.


Note : Undo the diversion using the right button.

4.1.5

Rectangle

To create a rectangle: select the tool Rectangle, put the pointer on the first rectangle corner,
while pressing and holding the left button, move the pointer to the opposite corner and then
release the button.

4.1.6

Polygon

To create a polygon: select the tool Polygon, put the pointer on the first polygon vertex, left
click, move to next position, left click again and so on. To end, click the middle button.
To remove vertex or edit an existing polygon, follow the same operations as the polylines.

4.1.7

Straight Line

To create a straight line: select the tool Straight line, put the pointer at the start position,
while pressing and holding the left button, move the pointer to the final position and then release the button. If in addition the Shift key is held, the line will be horizontal or vertical.

4.1.8

Open Spline
Curve

To create an open spline curve: select the tool Open spline curve, put the pointer at the
start position, left click, move to the next position, left click again and so on. To end, click
the middle button. A smooth curve is drew between the given points.
To edit an existing open spline curve, select the line and click on the polyline tool. You are
now in line editing mode.

4.1.9

Ellipse (or
circle)

To create an ellipse (or a circle): select the tool Ellipse, put the pointer on the first corner
of the rectangle enclosing the ellipse, while pressing and holding the left button, move the
pointer to the opposite corner, then release the button.
Press and hold the Shift key to draw a circle.

4.1.10 Close Spline


Curve

To create a closed spline curve: select the tool Closed spline curve, put the pointer at
the start position, left click, move to the next position, left click again and so on. To end, click
the middle button. A smooth closed curve is drawn between the polygon vertices.
To edit an existing close spline curve, select the line and click on the polyline tool. You are
now in editing line mode.

4.1.11 Zoom

Click the Zoom icon (see Figure 4 - 1). Press and hold the left button to draw a rectangle around the drawing part you want to enlarge (zoom-in), release the button.
To zoom-out, click the zoom-out arrow at the bottom on the working space

1-4-61

Graphic Handling
Selecting Objects

Zoom-in and zoom-out arrows

4.1.12 Rotation

Select the object you wish to rotate in the drawing, click the Rotation icon (see Figure
4 - 1) then rotate the object at will using the mouse.

4.2 SELECTING OBJECTS


Objects are selected (electric elements, text or graphics) either to modify their attributes (see
Section 4.3) or their shape (see Sections 4.4and 4.5). Objects are selected as follows:
4.2.1

Selecting One
Object

The object is selected by pointing and left clicking, the object will be surrounded by handles
to show that it has been selected.

4.2.2

Multiple
Selection

Multiple objects can be selected in two ways:

Left click the first object and click the following objects using the middle button. This button
can also be used to deselect a previously selected object.
The selected objects are surrounded by handles.

Surround the objects to select with a rectangle as follows: point to the origin of the rectangle,
press and hold the middle button and move the pointer to the final corner of the rectangle.
Release the button.
The selected objects are surrounded by handles.

4.2.3

Selecting All
Object

Select all the objects of a diagram using the menu Edit=>Select all.

4.3 CHANGING ATTRIBUTES


The text and graphics tool bar (Figure 4 - 1) also allows to define the attributes of text and
graphics. These are Stroke thickness and type, Stroke color, Filling pattern, Filling color, Font.

1-4-62

Graphic Handling

Direct Changes in Position and Form

To set an attribute: point to one of the attributes (example: Stroke color), press and hold
the left button to display a list of options. Then, drag the pointer to the required selection and
release the button.
When an object is created (power element, bus, control block, text or graphics), default attribute values are implied.
To change the attributes of existing objects, select them and then change the attributes.
4.3.1

Text Attributes

Text has the following attributes:

Stroke color: colour of text,

Font: type of lettering.

4.3.2

Graphic
Attributes

Graphics have the following attributes:

Stroke color: colour of lines and contours,

Stroke thickness and type: thickness of lines and contours, and also their appearance

(continuous, dots, dash...),


C

Filling pattern: type of crosshatching in the filling area. For a closed form (polygon,

closed spline curve), the filling area corresponds to the inside section. If the form is not closed
(polyline, open spline curve), the filling area is established inside the closed contour by connecting the last point to the first point.
D

Filling color: colour of the filling area.

4.4 DIRECT CHANGES IN POSITION AND FORM


Direct changes in position and form require the use of menus. These changes affect all the
selected objects.
4.4.1

Displacement

When the pointer is on one or many selected objects, it takes the shape of a cross
to specify that the displacement mode was selected. Press and hold the left button and move the objects to their new position, then release the button.

4.4.2

Changing Size

When an object is selected, it is surrounded by a rectangle whose corner and middle points
are marked with handles. When the pointer is on one of the middle points, it takes the following shapes:
,
,
,
specifying that the horizontal or vertical size change
mode is activated. Press and hold the left button and move the pointer until the required size
is obtained, then release the button.
However, if the pointer is on one of the small corner handles, it takes one of the following
shapes
,
,
,
which allows to change the size in both directions using the same
zoom factor. To change the set size, press and hold the left button and move the pointer until
the required size is obtained, then release the button.

1-4-63

Graphic Handling

Changes done from the Menus

4.5 CHANGES DONE FROM THE MENUS

2
polyline/
adding diversions

rotation command

Figure 4 - 3 Main Menus and Graphics Toolbar


Figure 4 - 3 shows the graphics handling menus available. These are found in the main menu
bar 1 and on the graphic tool bar 2 . Each main menu has submenus. To select the graphic
submenu, point to the main menu, press and hold the left button to display submenus, drag
the pointer to the required command and release the button.
4.5.1

4.5.2

Group/
Ungroup

Menu Graphics=>Group: group the selected objects into one object

Front / Back

Menu Graphics=>Front: put the selected objects in the front of others which are
overlapped with it.

Menu Graphics=>Ungroup: separate objects that are grouped.

Menu Graphics=>Back: put the selected objects in the back of others which are overlapped with it.
4.5.3

Alignment

Figure 4 - 4 Dialogue Box for Alignment


Selected objects can be aligned horizontally or vertically. To do this, select the main menu
Graphics => Align...

1-4-64

Graphic Handling

Changes done from the Menus

The dialogue box in Figure 4 - 4 shows a list of different alignment options. Alignment can
be vertical (Top/Bottom) or horizontal (Left/Right). The option As Is means that
there is no alignment for the current direction.
4.5.4

Vertical/
Horizontal flip,
Left/Right flip

On image can be inverted using the main menus:


Graphics => Vertical T/B: top/bottom reflection
Graphics => Horizontal L/R: left/right reflection

4.5.5

Rotation

To make a rotation on one or many objects: select the object(s), select the Rotation tool
on the graphics tool bar. Point to one of the selected objects, the pointer changes into
,
press and hold the left button and make the rotation until the required position is reached, then
release the button.
If you point on the disconnecting switch of a power system element the disconnecting switch
will rotate. Buses and connection can not be rotated.
It is also possible to make 90o clockwise rotations by using the main menu Graphics => Rotate CW.

4.5.6

Changing
Orientation

4.5.7

Cut, Delete,
Copy, Paste,
Duplicate

Menu Graphics=>Orientation: change the orientation of the diagram from landscape to portrait or vice-versa.
These operations are done either using the main menu Edit, or with the background menu.
Menu Edit=>Cut or background menu=>: Cut. Cuts the selected object and put it
on the clipboard.
Menu Edit=>Delete or background menu=>Delete: Cut the selected object without putting it on the clipboard.
Background menu=>Copy: put the objects on the clipboard.
Menu Edit=>Paste or background menu=>Paste: Paste the clipboard objects on the
diagram.
If the paste operation immediately follows the copy, the image is pasted at the exact
same place as the original image. A displacement needs to be done to separate both
images.
A copy of a grouped elements changes the labels of each element in the group (command group).
Edit=>Duplicate or background menu=> Duplicate: duplicate the selected objects.
The duplicate image is slightly off-shift with respect to the original image.
A duplicate of a group of elements does not change the labels in the group (command
group). This is useful a system in a new drawing.

1-4-65

Graphic Handling
Global Operations

4.6 GLOBAL OPERATIONS


4.6.1

Searching for
an Object

This operation is quite useful in a complex diagram to search for an object using its label. To
do this:

Make sure no object is selected;

Using the background menu, execute a Search for a labelled object.


The diagram will be repositioned to show the discovered object in the middle of the visible
part and the object will automatically be selected.

4.6.2

4.6.3

Cancelling /
Restoring Last
Operation

Grid

Menu Edit=>Undo or background menu=>Undo: cancel the last 20 operations (example: put back a cut object) one at a time for each cancellation.
Menu Edit=>Restore or background menu=>Restore: restore the last 20 cancelled
operations one at a time for each restoration.
The menu Graphics=>Options=>Grid... allows to define the grid spacing (in a dialogue
box). The spacing can be in pixels, points, centimetres or inches.
The grid can be made visible or not using the action button Grid on the graphics tool bar (
at the far-right of Figure 4 - 3)

If the button Gravity of the graphics tool bar is pressed, object displacement, rotation or sizing will not be smooth and the objects will move in short bursts from one space to another in
the grid. The changes will be smooth if the button is not pressed.
4.6.4

Size of Printed
Image

The menu Graphics=>Options=>Current scale... defines the zoom factor applied on


the full graphic and on the entry of new elements.

4.6.5

Diagram Views

The diagram view can be moved in the workspace either using the horizontal and vertical
scroll bars, or continuously by pressing the Control key, while pressing and holding the middle button to move the view. During the displacement, the pointer takes the shape of an open
hand. Views can also be changed using View menu:
View=>Normal size: put the diagram in normal size.
View=>Center page: centre the diagram relative to the workspace.
View=>Reduce to fit: optimized view of the diagram in the workspace.
View=>New View Open another window in Hypersim to display the same diagram.
The displacement in this view and the zoom factor do not affect the other views.
View=>Close View Close a view created with View=>New view.

1-4-66

Graphic Handling

Handling a Diagram File

4.7 HANDLING A DIAGRAM FILE

Figure 4 - 5 Dialogue Box for the Menu File=>Open


The menu File on the main menu bar allows to execute different operations on the diagrams:
Menu File=>New: create a new diagram.
Menu File=>Open...: load a diagram saved in a file. The dialogue box in Figure 4 - 5
is displayed to allow to choose the required file. The Filter allows to list only the
files with this suffix.
Menu File=>Save: save a diagram in the same file used with File=>Open.
Menu File=>Save as...: save the diagram in a file chosen by the user. A dialogue
box similar to that in Figure 4 - 5 allows to define the file.
Menu File=>Revert: Ignore all changes ignore changes made and reload the diagram that was saved the last time. A confirmation message is popped-up to let user
make the choice to do it or not.
Menu File=>Library management: Management of model libraries. Details are
presented in Chapter 8.

1-4-67

Graphic Handling

Handling a Diagram File

Figure 4 - 6 Dialogue Box for the Menu File=>Print


Menu File=>Page...: Define the size of the page. The page is limited by a rectangle
bordering the diagram. To display the latter, it may be necessary to reduce the zoom
using the Zoom button or arrows. This command does not control the type of paper in
the printer.
Menu File=>Print...: Print the diagram on a printer or to a PostScript file. The dialogue box in Figure 4 - 6 allows to select the printer / file and to define the print command or the PostScript file.
Menu File=>Import...: Add to the current diagram another diagram kept in a file. A
dialogue box similar to that in Figure 4 - 5 allows to define the file of the diagram to
import.
Menu File=>Quit: quit the current Hypersim session.

1-4-68


Chapter 5
EDITING CONTROL SYSTEMS

Hypersim can also simulate control systems using:


Its basic control blocks library;
SimulinkTMdiagrams;
User Code Blocs (UCB);
Sub-systems;
A combination of those.
Note : The control systems built using SimulinkTM diagrams and User Code Blocs are discussed in Part 4.
Sub-systems are described in Section 5.4.

5.1 CONTROL BLOCKS


Block label

Connector label
Connection (single)

Single connector

Multiplexed connector
3

1
2
Connection
(multiplexed)

Figure 5 - 1 Control Blocks - Terms Used and Interconnections

1-5-69

Editing Control Systems


Control Blocks

The basic control blocks are found in drawers whose title begins with CONTROL--.
SimulinkTM control blocs, User Code Blocs and Sub-systems are accessible through icons
named SimulCtr, UserBloc and SubSyst respectively, all are in SYSTEM--TOOLS drawer.
A control system can be built in a hierarchical way, it means that the control system is composed of basic blocs, Simulink blocs, User Code Blocs and sub-systems. Inside a sub-system,
we will find also the same composition as above and so on.
To create a control block in a diagram:
A

Open the drawer containing the required block, left click the block

In the workspace, point to where the middle of the block will be and left click. If it is a
basic bloc, it is immediately displayed. In the cases of SimulinkTM, User Code Bloc
and Sub-systems, a dialogue box will appear to allow entering their file name before the
bloc is displayed in the diagram.
Since the block is also a graphic object, all the graphic operations discussed in Chapter
can be executed (displacement, rotation, zoom, colour change, etc.).
Figure 5 - 1 shows a simple control block diagram and the related terms:
1 Block Label: Block identifier. It must be unique

for all blocs shown in the main diagram,


for all blocs at a same level of a sub-system.
For example, in Figure 5 - 1, all blocs shown must have different label, but sub-system
SubSys1 can have a bloc of the same label with a bloc inside subsystem SubSys2. Hypersim
warns the user if there is an illegal duplicate. The block label can be modified by selecting
the block and the background menu to execute Edit label.
2 Connector: A connector can be single or multiplexed. A single connector is represented

as an empty arrow, it has only one pin and carries only one signal. A multiplexed connector,
represented as a solid arrow, has many pins and carry as much signals as the number of
pins. In term of direction, there are input connector and output connector.
3 Connector Label: Connector identifier. It cannot be modified by the user.
4 Signal: A signal is a variable (varying with time) generated by each pin of the output con-

nectors of blocks. A single connector has only one signal with one signal label which is the
same as the connector label, a multiplexed has many signals, each has its own signal labels
which is different from the connector label.
To see the signals label of a connector, point at the connector, hold the Control key and click
the left mouse button. A window as shown in Figure 5 - 2 appears to give the list of signal
labels as well as the corresponding signals name

1-5-70

Editing Control Systems

Control Blocks

Figure 5 - 2 Example of signal labels of a connector


and their corresponding signals
Signal label can be understood as the pin indentifier. If a same bloc (adder for example) is
used many times in a diagram, its signal labels (or pin identifiers) will not be changed but
they will carry different signals distinguished by their different signal names. The signals
name is established as follows:
SignalLabel_Blocklabel

Example:
Example: In Figure 5 - 1, The signal generated at the output of the
block Sin is named y_Sin,
Signals generated at the multiplexed connector XA of the block
SubSys1 are named XAr_SubSys1 and XAi_SubSys1
Signal can be of type floating point or integer. A single connector carrying a floating point
signal is in black. If it carries an integer signal, it is in red. A multiplexed connector carries
many signals of different types, it is always in black.
5 Connection: Is a set of straight lines linking an output connector to an input connector.

The control connections are in blue by default to set them apart from the power connections
which are in black by default. User can however change freely these colours.
A single connection which carries only one signal is drawn with thin lines. A multiplexed
connection carries more than one signals, it is drawn in thick lines.

1-5-71

Editing Control Systems


Interconnecting Blocks

5.2 INTERCONNECTING BLOCKS


Figure 5 - 1 also shows how to interconnect blocks. Start the connection by left clicking on
an output connector (point 1), move the mouse, left click at each change of direction (points
2 and 3). Finally point at the input destination connector and right click. If all two connectors
(input and output) are single, the work is done. If at least one connector is multiplexed, then
user has to define which signal is connected to which other one, this is done through a popup window shown in Figure 5 - 3:

Figure 5 - 3 Dialog box allowing to make a connection


involving multiplexed connectors
on the left side of the window, select a signal produced by the output connector,
on the right side, select an input signal label,
click Connect to make the connection or Disconnect to remove an existing connection,
repeat the above steps as needed, then click Close to confirm or Cancel to ignore.
If Close is called at the end, a connection will be made, otherwise if Cancel is clicked, then
nothing will appear.
The blocks can still be moved once they are connected. The connections react as elastic bands
and follow the block displacement.
The diversions points (points 2 and 3 in Figure 5 - 1) of a connection can also be modified
using the method described in Section 4.1.4.
The following rules apply to connections:
A connection connects an output connector to an input connector.

1-5-72

Editing Control Systems

Block Parameters

For single connectors, both connectors linked to a connection must be of the same type
(float with float, integer with integer). Hypersim warns the user when there is conflict.
In such a case, a block F_to_I (conversion of float to integer) or I_to_F (conversion
of integer to float) must be inserted. Both of these blocks can be found in the drawer
CONTROL--MISCELLANEOUS).

5.3 BLOCK PARAMETERS


As is the case for power system elements (see Section 3.4.4), control blocks have parameters
which can be defined using the background menu and the command Edit parameters. A
window of parameter form is displayed to allow to make the necessary changes. The description of the block functionality is also found in this window.
Using the same procedures described for the power system elements, it is also possible to:
Copy the parameters of a block to a second block of the same type.
Show the parameters next to the block.

5.4 SUBSYSTEMS
Subsystems allow to organize a diagram in a hierarchical way: A diagram at its opening in the
main window contains basic power elements (RLC elements, transformers, lines, machines,
loads,...), basic control blocs (adder, gain, transfer function,...) and subsystems which in turn
contains basic power elements, basic blocs and other subsystems, etc.
Subsystems help also to make complex diagram more modular and easier to read. Frequently
used subsystems can be archived in library for easy access and sharing with other users.
Subsystems can be built in two ways:
Create its detailed diagram, save it before using it in another diagram,
Select a part of the current diagram and execute a command to create a subsystem with
the selected part.
Note: Subsystem is the more general form of super-bloc and super-model found in Hypersim
of version prior to 9.0. Subsystem replaces these older forms and is compatible with them.

1-5-73

Editing Control Systems

Creating Subsystems before using


them

5.5 CREATING SUBSYSTEMS BEFORE USING THEM

(a) Subsystem use.

Same label
Same label

Multiplexed
input port

Single
input ports

(b) Subsystem detailed


diagram

Multiplexed
Output port

Power
terminal

Figure 5 - 4 Subsystem use and detailed diagram


The diagram of a subsystem is edited in the same way as any other diagrams. The only difference is that the subsystem contains additionally input ports, output ports and power terminals. These last elements represent connectors that will be connected with the subsystems
outside world.
An example of a subsystem detailed diagram is shown in Figure 5 - 4b. Input and output ports
are control connectors. They can be single (carrying one signal) or multiplexed (carrying
many signals). Power elements to be connected to the outside world are terminated with power terminals.
5.5.1

1-5-74

Creating
Control Ports

To create an input port, output port:


Open the drawer SYSTEM--TOOLS, choose one of the icons InPort or OutPort.

Editing Control Systems

Creating Subsystems before using


them
Point to the required area and left click. A first dialogue box appear allowing to define
the number of signals carrying by the port. Give 1 for a single port or a number greater
than 1 for a multiplexed port. The second dialogue is then brought up to allow defining
signal labels and types (Integer or Double). These parameters can be changed later by
selecting the port and executing the background menu Edit signal labels and types for
bloc connector.
In the case of a single port, the connector will be red if the signal type is Integer or
black if it is Double. The port label is the same as the signal label, therefore if one
label is changed, the other is automatically changed.
If the port is multiplexed, the connector is always black and the port label is independent of the signal labels.
To define a port label, select the port and execute the background menu Edit label.
When a subsystem is inserted in a diagram as in Figure 5 - 4b, it appears as a rectangular box
surrounded by control and power connectors whose labels and multiplexing characteristic are
the same as those of input ports, output ports and power terminals.
5.5.2

5.5.3

Creating
Power
Terminals

Using a
subsystem in a
Diagram

Open the drawer SYSTEM--TOOLS, choose the icon ExtConn, then click on the diagram at the desired location.
The power terminal appears, its connector can then be connected to an power element
or to a bus-bar.
The detailed diagram of a subsystem must be saved in a file before using it.
To put a previously created and saved subsystem in a diagram:
In the drawer SYSTEM--TOOLS, select the icon SubSys;
Point to the desired location and left click. A dialogue box allows to specify the
filename of the subsystems detailed diagram.
A subsystem is then added in the diagram (Block SubSys in Figure 5 - 4a). Its input / output
connectors and power connectors have the same labels as those of input ports, output ports
and power terminals of the detailed diagram.
The connection of this subsystem to other blocs and power elements is done following the
usual method.
The predefined parameters of all blocks and elements within a subsystem will be the its default parameters. Subsystems dont have parameter forms. To change its parameters, user has
to open its content (detailed diagram) by double clicking on it or executing the background
menu SubSystem content. The detailed diagram is then shown in a separated window, parameters of elements and blocs in this window can be changed as usual. To close this window,
execute the command File=>Close subsystem on its main menu bar.
If the same subsystem is used many times in the same diagram, then each has its own series
of parameters. Changing the parameters of one does not affect the parameters of the other.

1-5-75

Editing Control Systems

Creating Subsystems before using


them
5.5.4

5.5.5

Changing the
Detailed
Diagram of a
Super-Block

Changing the
Order of the
Input / Output
Connectors

Once a subsystem is used in diagrams, it is still possible to change its detailed diagram.
Hence, the user can delete or add other blocks. When reading a diagram containing subsystem
Hypersim will update their contents if changes have been made to them.
If all control ports and power terminals are preserved, the connections to the modified subsystems will also be preserved. Otherwise, only connections to unchanged ports and terminals
are preserved and user has to re-establish other connections.
By default, the input/output connectors of a subsystem appear in the order they were created.
To change this order, the user must reopen the detailed diagram file in the main window and
execute the background menu Change Inports/Outports order. The dialogue box
shown in Figure 5 - 5 is displayed to define the new order by changing the numbers in the
column Rank.

Figure 5 - 5 Dialogue box to Define the Order of Subsystem Connectors

1-5-76

Editing Control Systems

Creating subsystem from a selected


part in the current diagram

5.6 CREATING SUBSYSTEM FROM A SELECTED PART IN THE CURRENT DIAGRAM

Create
subsystem
subsystem
created

Selected area

(a)

(b)

Subsystem
content

(a) Original network with a selected area.


(b) Result obtained after executing Create subsystem

(c)

Figure 5 - 6 Creating a subsystem from an existing diagram


In Editing mode, user can select a part of the current diagram and create a subsystem with it.
The procedure is illustrated in Figure 5 - 6:
Select an area in the current working diagram which will be reduced into a subsystem,
Execute the background menu Create subsystem. The selected area is then shrunk into a
subsystem represented as a rectangular surrounded by control and power connectors.
Some elementary graphic operations (flip, changing label position, etc.) may be needed
to get it best view.
To see the subsystem details, double click on it, or select it execute the background
menu Subsystem content. A new window will be opened to show the subsystems content. Control connectors are labelled as In1, In2,..., Out1, Out2,... while power terminals are labelled as T1, T2,...

5.7 EDITING IN THE SUBSYSTEM CONTENT WINDOW


The subsystem content, which is in a separate window popped-up after executing the background menu Subsystem content, can be graphically edited during the Editing mode. But
there are two different situations:
A subsystem created from a selected part of the current diagram is editable without any
command.

1-5-77

Editing Control Systems

Subsystem in Simulation Mode

For a subsystem previously saved in a file before being inserted in a diagram, its content is linked to this file and can not be changed by default. To make the content editable, one must select the subsystem and issue the background menu Disable link. A star
(*) will appear beside the subsystems label to indicate its Disable link status. The subsystems content is not linked any more to the file. Any change to the subsystem content will not affect the file content.
After modifying its content, one may want to update the file content. This is done by
selecting the subsystem and executing the background menu Restore link. A confirm
message will pop up to ask if the user really want to replace the file content with the
new subsystem content. If this is confirmed, the star (*) will be removed from the subsystems label.
The window displaying the subsystem content has no drawing tools neither model drawers.
The only editing functions one can do directly in this window is move, cut, paste and make
connections. To add new drawings or models in this window, one has to do the following little
trick: add it in the main window, then cut it and paste it into the subsystem content window.

5.8 SUBSYSTEM IN SIMULATION MODE


In Simulation mode, it is possible to open/close the subsystem content window, install sensors
and modify the parameters of blocks and elements within the subsystem.
5.8.1

Opening /
Closing
subsystem
content

To open the subsystem content in Simulation mode:


Point to the subsystem label;
Double-click on it or press and hold the right button to display the menu and execute
the command Subsystem content.
The content window allows to install sensors and modify block and element parameters.
To close this window, execute the command File=>Close subsystem on the menu bar.

5.8.2

Subsystem
Sensors

A subsystem has sensors for all signals available at its output ports. The user can also open
its content to access any sensors on blocks or elements in this diagram.

5.8.3

Changing
Parameters

There are no subsystem parameters form. In the Simulation mode, it is however possible to
open its content and change the parameters of blocks and elements in this diagram. If the simulation is in progress, the changes to the parameters will take effect almost immediately. Otherwise, they will take effect when starting the next simulation.

1-5-78

Editing Control Systems

Bloc Array

5.9 BLOC ARRAY

Create
bloc array

(b)

(a)

Subsystem
content

(c)
(a) Bloc to be used to create a block array
(b) Bloc array created, same form as original bloc but shaded
(c) Content of the bloc array

Figure 5 - 7 Creating a bloc array and showing its content


A bloc array is a subsystem composed of a multiplicity of the same block. The procedure to
create a bloc array is shown in Figure 5 - 7:
put a control block in the main window and select it,
execute the background command Create bloc array,
a dialogue appears to allow entering the bloc-arrays multiplicity (number of repetitions of the original block).
A subsystem is then created to replace the original block. Its graphical form is the same as its
original block but shaded to indicate a bloc array. Its content can be opened using the background menu Subsystem content. It is simply a repetition of the original block. Each individual block can have its own parameters. Inputs and outputs of a bloc array are multiplexed to
represent the necessary number of repetitions of the inputs and outputs of the original block.

1-5-79

Editing Control Systems


Bloc Array

PAGE LEFT INTENTIONALLY BLANK

1-5-80


Chapter 6
INTERCONNECTING CONTROL BLOCKS AND
POWER SYSTEM ELEMENTS

Filter

Figure 6 - 1 Interconnections of Control Blocks and Power System Elements


It is possible to simulate a diagram consisting of control blocks, power system elements or a
combination of both. There are two possibilities allowing to interconnect control blocks and
power system elements:
Using elements with built-in control connectors.
Connection via elements sensor signals

6.1 INTERCONNECTING ELEMENTS WITH BUILT-IN CONTROL


CONNECTORS TO CONTROL BLOCKS

Many elements have both power connectors and built-in control connectors. Such elements
allow to interconnect control blocks to the power system network.

1-6-81

Interconnecting Control Blocks and


Power System Elements
Interconnecting elements with built-in
control connectors to control blocks

An example is shown in Figure 6 - 1 where the element Vmes (bus voltage measuring unit) is
connected to bus MTL via its power connector. Its output control connectors generate signals
a, b, c corresponding to the measured voltages. These signals are then directed to other control
blocks.
The controlled voltage source Vsrc receives control signals Va, Vb, Vc to generate power
voltages. These voltages are linked to bus MTL via the power connector Vsrc.
The following elements have both power and built-in control connectors:
Drawer NETWORK--SOURCES+MACHINES
HydCmd: hydraulic synchronous machine with the possibility of having external regulators.
ThermCmd: thermal synchronous machine with the possibility of having external regulators.
CrossCmpc: cross-compound synchronous machine with the possibility of having
external regulators.
AmpV: controlled single-phase voltage source.
AmpV3: controlled three-phase voltage source
AmpI: controlled single-phase current source.
AmpI3: controlled three-phase current source.
Drawer NETWORK--LOADS AND MOTORS
IndMotor: Induction motor.
Drawer NETWORK--CONTROLLERS+SWITCHES
Inv_12: inverter, 12 pulses.
Rect_12: rectifier, 12 pulses.
Inv_6: inverter, 6 pulses.
Rect_6: rectifier, 6 pulses.
TSC: thyristor controlled RLC branch (TCS type).
TCR: thyristor controlled RL branch (TCR type).
Switch: electronic switch.
BrShunt: breaker shunt.
BrSerie: serial breaker.
BrShMono: breaker shunt, single phase.
BrSerMono: serial breaker, single phase.
Br2LMono: triple H-bridge converter, single phase.
Br3Level: 3 level bridge.
drawer NETWORK--MISCELLANEOUS
1-6-82

Interconnecting Control Blocks and


Power System Elements
Interonnecting blocks to elements or
bus-bars using sensor signals

MesI: single-phase current sensor;


MesV: single-phase voltage sensor;
MesI3: three-phase current sensor;
MesV3: three-phase voltage sensor.

6.2 INTERONNECTING BLOCKS TO ELEMENTS OR BUS-BARS USING SENSOR SIGNALS

(a) Dialog allowing to select signals to send


out as control signals.

(b) Example showing the interconnection of


bus-bars and power elementss sensor
signals to control blocks.

Figure 6 - 2 Interconnection example


All signals of bus bars and of any power elements (with and without built-in control connectors) can be sent out and connected to control blocks.
To make these signals available, in Editing mode do the following steps:
click the element to select it,
right click and execute the command Output sensor signals. A pop-up window
as shown in Figure 6 - 2a appears with a list of signals to be selected and sent out. This
list is the same as the list obtained with the command Edit sensor.
Signals can be selected one by one by putting individual check marks, or all of them by
clicking Select all. Then click OK.
1-6-83

Interconnecting Control Blocks and


Power System Elements
Transceiver Blocks

A scope symbol and a control connector will appear beside the element. The connector
is single (empty arrow) if only one signal is selected, otherwise it will be multiplexer
(solid filled arrow).
With this new control connector, user can then connect it to any other control blocks to perform the desired operations. An example is shown in Figure 6 - 2b: The bus bar voltages of
Bus1 and the currents of element Ld are sent out through their sensor signal connectors.
Control blocks are added to perform the multiplication of voltage and current of each phase,
then the summation of 3 phases to produce the total active power.

6.3 TRANSCEIVER BLOCKS

Line
Station A

Station B
Transceiver

Decpl
Station A

Station A

Part 1

Part 2
Transceiver

Transmission of control signal between two tasks sent by a transceiver block


Figure 6 - 3 Transceiver Block
6.3.1

Transceiver
Blocks

In a network with power elements, control blocks are directly or indirectly connected to at
least one power element. These blocks are normally simulated in the task which simulates
also the power element(s).
The organization of Hypersim into parallel tasks does not allow the direct connection of control signals from one task to another. To communicate control signals among tasks, it is necessary to use a transceiver block (transmitter-receiver) between two different tasks, as shown
in Figure 3 - 3. There are two types of transceiver found in the drawer CONTROL--MISCELLANEOUS:
TrcverF: transceiver for float type signal;
TrcverI: transceiver for integer type signal.

1-6-84


Chapter 7
MONITORING OF SIMULATION RESULTS

Hypersim has the possibility of monitoring results. It means displaying results and update
them periodically at moderately slow speed, about once every second. Therefore, results to
be monitored must be slow varying like machine speed, bus r.m.s.voltages, DC voltage, etc.
Various monitoring devices, or simply monitors, are available, some are already in the model
parameter form, others are added by user into the network diagram.
The control of monitoring devices is done via HyperView, therefore HyperView must be active and connected with Hypersim. If it is not the case, click on the HyperView button on
the upper part of Hypersim window to activate it.

7.1 MONITORS IN THE PARAMETER FORMS OF ELEMENT OR CONTROL BLOCK


Some models has already monitors created in their parameter form. This is the case of fixed
voltage source (SrcV), hydraulic machine (MacHydro), thermal machine (MacTherm), etc.
As an example, the parameter form of the hydraulic machine is shown in Fig. 7 - 1 with its
monitors. During the simulation, user can observe the changing of the monitored values if the
parameter form is opened.

1-7-85

Monitoring of simulation results

Monitors inside the network diagram

Monitors

Figure 7 - 1 Monitors already created in the hydraulic machine model parameter form.

7.2 MONITORS INSIDE THE NETWORK DIAGRAM


Monitors are added into the network diagram in Editing mode, but signals are only available
if at least the Simulation mode has been activated once. Therefore, before adding monitors,
pass to Simulation mode and go back to Editing mode.

7.2.1 Monitors
associated
with
element or
block

1-7-86

To create this kind of monitor, select the network element or the control block, right click and
select the menu Display Results, this will bring up the dialogue shown in Fig. 7 - 2 which
allows to define various monitor characteristics and gives the list of monitors already created,
either in the component parameter form or in the network diagram.

Monitoring of simulation results

Monitors inside the network diagram

Title
Value

Units

Scalar form

Digital form

Figure 7 - 2 Dialogue box for monitor creation and forms of monitor.


In the above dialogue box, user defines the following parameters:
Result name: name of the monitored value, more details on this will be described later.
Form of the monitor which can be Scalar (simple text string) or Digital (value shown in
a digital-display-like box). These two forms are also shown in Fig.7 - 2,
Show value and unit only: If this is checked, only the monitored Value and its Unit are
displayed. If it is unchecked, the Title is also displayed.
Alignment which can be Floating with network component (if the associated network
element or control bloc is moved, the monitor is also moved with it to preserve the relative position between them) or Fixed in the network diagram window (the monitor is
not moved with the component, but it can be moved independently).
The lower part of the dialogue box shows the list of monitors already in the parameter form
of the selected network element or control block and those previously created for this element
or block.

1-7-87

Monitoring of simulation results

Monitors inside the network diagram

User can select a monitor from the list, its name will be shown in Result name, click OK and
the dialogue box shown in Fig. 7 - 3a will be brought up to allow to define following additional informations:
Total number of digits: width of the display area.
Number of displayed digits: number of digits used to display the monitored value. If
this value can not fit inside the number of displayed digits, the exponential format will
be used.

a) Characteristics of a monitor already


existing in the parameter form

b) Characteristics of a newly created monitor

Figure 7 - 3 Dialogue boxes allowing to define the monitor characteristics


If the user wants to create a new monitor associated with the selected network element or control block, type in the Result name in the dialogue box in Fig. 7 - 2. Make sure that this same
name does not exist already, then click OK. The dialogue box shown in Fig. 7 - 3b will pop
up allowing to enter parameters for the new monitor:
Title: Title that will be written on the monitor (see Fig. 7 - 2). Title does not need to be
unique like Result name.
Expression: mathematical expression producing the value to be displayed in the monitor. User can type directly the expression or use the button
to bring up the
Expression Editor described below.

...

Result type: the monitored values are calculated with the above expression using samples in the data acquisition window defined in HyperView (described later). The result
of the calculation can be RMS, AVG, MIN, MAX, First, Last which mean respectively
the r.m.s. value, average value, maximum, minimum, First or Last value in the data
acquisition window.
Units: measurement units of value displayed in the monitor (see Fig. 7 - 2).

1-7-88

Monitoring of simulation results

Monitors inside the network diagram

Minimum and Maximum: Range of the monitored value, used for scaling and clipping
purpose when value is displayed in scope format (described later). Entered 0 for both
Minimum and Maximum for automatic scaling/clipping.
Total number of digits and Number of displayed digits have the same meaning as in
Fig. 7 - 2a.
When all parameters are defined, click OK. A monitor is added into the network beside the
selected element or block. User can then move it to a desired location but the relative position
between the monitor and the associated element/block will be preserved. When the element/
block is moved, the monitor will follow.
A monitor is also a graphic component, it means that user can change its size, colour, line
type, font, etc. using graphic tools.
7.2.2

A monitor can also be added into the network diagram without selection of a network
element or a control block.

General
purpose
monitors

Digital
form
Scalar
form

Newly
created
monitors

Monitor
icons

Figure 7 - 4 Creation of general purpose monitor using tools in the System tools
To do this, open the drawer System-tools as shown in Fig. 7 - 4, select one of the two icons
DIGITAL or SCALAR to create a monitor in Digital or Scalar form respectively, then click
a desired location in the network diagram. A monitor is added with default parameters. Double click on the monitor to bring up the dialogue box shown in Fig. 7 - 3b to define its parameters as before.

1-7-89

Monitoring of simulation results


Expression Editor

Monitors created this way are not graphically related to any network element or control block.
They can be moved freely inside the network diagram. Their expression can however contain
signals coming from any element or block.

7.3 EXPRESSION EDITOR


Expression editor is a user-friendly tool allowing to write the monitors expression using
available signals and built-in functions. The following conditions are required in order to be
able of using the Expression editor:
HyperView must be active, if it is not, click the button Hyperview in the upper part of
Hypersim window. HyperView window must also be opened and not minimized in the
tray.
The Expression Editor can be used either in Hypersims Editing mode or in Simulation
mode, but it needs to know all the network signals. Therefore, if Hypersim is currently
in Editing mode, go briefly to the Simulation mode then back to Editing mode to allow
Hypersim to build up the list of signals.
7.3.1

Expression
with simple
functions

...

The Expression Editor is activated by clicking on the button


in the dialogue box of
Fig. 7 - 3b. This will pop up the dialogue box shown in Fig. 7 - 5a. The field Expression at
the bottom will be filled either manually and/or by clicking on appropriated objects presented
in the box. User must keep track of the evolution in the Expression and manually complete it
or make the necessary corrections.

a) Dialogue box showing the signal list


of the current type.

b) The types dropped-down list.

c) Function dropped-down list

Figure 7 - 5 Expression editor dialogue box

1-7-90

Monitoring of simulation results

Expression Editor

Signal section contains the type (or model category) and the list of signals available for
this type. Click on
of the current type will present a dropped-down list (Fig. 7 - 5b)
of all available types of the current network (Breaker, Bus, Line, etc.), select a desired
type to get the list of all signals belonging to it.
Click on a signal to add it into the Expression field (or type it). If a function (see below)
is presented, the selected signal will be used as the function argument.
Function section allows to enter a mathematical function into the expression. f x is the
name of the function that will be applied on the next selected signal. Click on
will
show a dropped down list (Fig. 7 - 5c) of all available functions of single argument. The
Advanced... button will help to use all available functions of one or many arguments.
7.3.2

Expression
with advanced
functions

By clicking on Advanced, the Expression editor will take the form shown in Fig. 7 - 6 with a
section for Advanced Function Editor which containing the following items:

Figure 7 - 6 Expression Editor with Advanced functions


Category: Functions are grouped into categories to make the selection easier. Category
shows the current selection. User chooses the category by using the dropped-down list.
Function name: Current function selected from the Category. Again, use the droppeddown list to make the selection.

1-7-91

Monitoring of simulation results


Monitors Operations

The lower section allows to enter the arguments of the currently selected function. For
instance, the example shown in Fig. 7 - 6 uses Harmonic function to calculate a list of
particular harmonics of a signal. It need a Signal which is selected from the list on the
left side (Signal can also be an expression), a Harmonic list, the Fundamental frequency
and the option telling that the given fundamental frequency is either exact or an approximated value.
This section varies depending of the function arguments.
The Add button will add the function with its defined arguments into the
Expression field.
The Close button closes the Advanced function section.

7.4 MONITORS OPERATIONS


Controls of monitors operations are done mostly with HyperView. Some controls are also
available inside the Hypersim network diagram.
To see the evolution of monitored values, the simulation must be started. Fig. 7 - 7 shows a
network with its monitors together with HyperView with the Monitoring tab opened.

Start monitoring
Stop monitoring
Show a scope for each selected monitor
Show a multi-signal scope for selected
monitors
Edit the selected monitor properties

a) Simulated network and its monitors


Monitors display area

b) HyperView with its Monitoring tab

Figure 7 - 7 Hypersim and Hyperview windows with monitoring controls and displays

1-7-92

Monitoring of simulation results

Monitors Operations

7.4.1

Monitor
controls in
HyperView

The following controls and display functions are available via HyperView.
Start monitoring: when started, value are refreshed at about once every second for all
monitors on the diagram, in opened parameter forms and also in the monitors display
area of HyperView.
Stop monitoring.
Show a scope for each selected monitor: User selects monitors presented in the monitor
display area and clicks this command, a ScopeView-like window will appear as shown
in Fig. 7 - 8a to plot the monitored values. If the window is already opened, the traces
of selected monitors will be added into this window.
Show a multi-signal scope for selected monitors: Same functionality as the previous
command, except that the selected monitors curves will be superimposed.
Edit the selected monitor properties: This command allow to modify the monitor characteristics. It pop up a window with about the same informations to be edited as in Fig.
7 - 3b.
To calculate the monitors values, data acquisition must be performed using these 2
parameters: Duration and Sampling rate. Duration covers normally one or two cycle
(example: 0.03333 s. for 2 cycles of a 60 Hz network). Sampling rate must be chosen
considering the functions used in the monitor expression (to get correct result for harmonic calculation for example).

7.4.2

Monitor
controls inside
the network
diagram

Editing the monitor properties: double click on a monitor in the network diagram. The
same dialogue box as in Fig. 7 - 3b will appear allowing to make necessary modifications.
Showing monitored value in scope form: In Simulation mode, right click on a monitor
and select Show Scope. A simple scope appears as in Fig. 7 - 8b and show a single trace
of the selected monitor.

1-7-93

Monitoring of simulation results


Monitors Operations

Single signal
plots

Multi-signal
plot

b) Plot initiated with Show Scope


command in Hypersim

a) Plots initiated from HyperView

Figure 7 - 8 Plots of monitored values

1-7-94


Chapter 8
CUSTOMIZING HYPERSIM

8.1 CUSTOMIZING HYPERSIM


Hypersim can be customized to the users requirements in several ways using the Properties menu;
8.1.1

Properties
Menu

The Properties menu is found on the main menus bar. By pointing to this menu and pressing and holding the left button, three menus can be executed: Directories, Simulation
and Files.
1 Directories Menu. When executing this menu, the dialogue box in Figure 8 - 1 is displayed
to specify the following directories:

Figure 8 - 1 Dialogue Box of Menu: Properties=>Directory

1-8-95

Customizing Hypersim
Customizing Hypersim

SI database directory.

The SI5 database is used for the acquisition and processing system and
has its own directories, a single one for each test series or study.
The database is used with a post-processing software to execute these
test and produces result tables.
Code generation directory.

To save the codes generated for a simulation.


EMTP directory.

The data exchange with EMTP is described in Part 1. The EMTP files
are kept in this directory.
Diagrams directory.

To keep the network diagrams of the user.


System library directory.

Directory of library containing Hypersims base models. This directory


is set by Hypersim installation and its not recommended for non advanced users to change it.
Site library directory.

Directory of library containing site models (see Section 8.2)


User library directory.

Directory of library containing user models (see Section 8.2)


Sensor configurations directory.

To keep the configurations of sensors.


Subsystems directory.

To keep the super-blocks and super-models of the user.


User code blocks directory.

The blocks coded by the user are described in Part 1. These blocks are
kept in this directory.
Simulink blocks directory.

The Simulink blocks are described in Part 1. These blocks are saved in
this directory.
At the bottom of a dialogue box, there are three buttons allowing to execute the following
commands:

1-8-96

Cancel.

Ignore the changes;

Apply.

Apply the changes;

Customizing Hypersim
Customizing Hypersim

Save.

save the parameters above along with other Hypersims properties in the
file
~/HYPERSIM/Hypersim.res
to use them in the next session.

2 Simulation Menu. This menu opens a dialogue box nearly identical to the one in Figure 9

- 3, Chapter 9 the only exception being that there is an additional Save button at the bottom.
This button serves to save the parameters in the file
~/HYPERSIM/Hypersim.res

and to use them again in the next session.

Figure 8 - 1 Dialogue Box of Menu: Properties=>Files


3 File Menu. This menu opens the dialogue box in Figure 8 - 1 and allows to define the de-

fault suffixes for files of diagrams, parameter forms and sensor configurations. The user just
has to specify the filename and Hypersim will automatically add the suffix. These parameters
can also be saved in the file
~/HYPERSIM/Hypersim.res

to be used in the next session.


8.1.2

Language
Used

Hypersim can be used in French, English or Japanese. The language is chosen with the environment variables LANG and LC_ALL defined by en (English), fr_CA (French Canadian) and
ja (Japanese).

Example:

If
setenv LANG fr_CA
setenv LC_ALL fr_CA

Hypersim will operate in French.


1-8-97

Customizing Hypersim
Library Management

The language informations can be displayed by typing:


locale
in a Unix, Linux window. The system will then display:
LANG=fr_CA
LC_COLLATE=fr_CA
LC_NUMERIC=fr_CA
LC_TIME=fr_CA
LC_COLLATE=fr_CA
LC_MONETARY=fr_CA
LC_MESSAGES=fr_CA
LC_ALL=fr_CA

8.2

LIBRARY MANAGEMENT
Hypersim has its base model library including power elements and control blocs. Beside the
base models, other models can be added:
Site models: those are particular for an installation site and available for users on this
site. They can be delivered in Hypersim package or developed by the site users and then
archived in the library to share with all users in the same site.
User models: They are developed by user and archived in the user library located in his
private directory.
All models are organized as different categories and kept in separated drawers as shown in
Figure 8 - 2. In this figure, there are only one drawer for site models and one for user models
but Hypersim can accept more than one for each. For instance, all site or user models can be
divided in many categories and each one is kept in a separated drawer. Drawers of base models are marked with a red rectangle, those of site models with a blue circle and those of user
models with a yellow triangle.
Once a model has been in the library, inserting it in a diagram is done as with any base model:
open the appropriate drawer, click on the models icon, then click on the desired location of
the diagram, the model will appear at this location.
User can only add models to site library and user library. These models are limited in the following types:
models built using subsystems,
models built with SimulinkTM,
user code bloc (UCB) models.

1-8-98

Customizing Hypersim
Library Management

Figure 8 - 2 Drawers of different categories of models

8.2.1

Library
Directories

Figure 8 - 3 Dialog allowing to define various directories


User must not worry about the location of System Library (base models), this is normally set
at Hypersim installation. Site Library and User Library directories can be defined by user using the menu

1-8-99

Customizing Hypersim
Library Management

Properties -> Directories...


on the top menu bar of Hypersim. This will bring up the dialogue shown in Figure 8 - 3 allowing to define various directories including those for Site Library and User Library. Full
path name is required.
It is worth also to mention the following directories where users models are normally developed before being incorporated into either User Library or Site Library: Subsystem directory,
User code bloc directory and Simulink bloc directory.
8.2.2

Library of
Models Built
with
Subsystems

Subsystem is describe in Chapter 5. Before adding the model in the library, the subsystem
must be already created and saved in a file. There are then two ways to add a subsystem as a
model in the library:
Add/Update a model previously saved in a file,
Add/Update a model with a subsystem selected in current diagram.
1 Add / Update Model Previously Saved in a File. To do this:

Figure 8 - 4 Dialog to add a model to the library from a


subsystem previously saved in a file

1-8-100

Customizing Hypersim
Library Management

make sure that there is no object selected in the current diagram,


execute the menu
File->Library management->Add/Update model.
The dialogue shown in Figure 8 - 4 appears to allow entering necessary informations:
End user can actually add only models built with Subsystem, UCB or
Hyperlink. Network element and Control block are Hypersim base models.

Family.

The model built from a subsystem is described in detail here. Models


from UCB and HyperLink will be presented later in this chapter.
Category.

Choose Site for site library, User for user library.

Drawer.

Define the drawer where the model will be added to. Click on Browse...
to select an existing drawer from a list or type in a drawer name. If the
given drawer doesnt exist, it will be created.

Model name.

Type the new models name or click on Browse... and select an existing
name from a list. Model name must be composed of alphanumeric characters only.

Model diagram file.

File containing the detailed diagram of the subsystem corresponding to


the model to be added/updated in library. The file name can be typed
(full path is required) or selected from the list given by clicking on
Browse...
Model ID number.

not used here (used only for network elements and control blocks).

Graphic
tools bar

Figure 8 - 5 Drawing of a models icon

1-8-101

Customizing Hypersim
Library Management

Label prefix.

Characters that will be put ahead of the models label when the model
will be inserted in a diagram.

Default label visibility.

Indicating if the models label will be shown or hidden when the model
is inserted in a diagram.
Label position.

Position of the models label relatively to model graphic. Click the desired radio button.

Sensor position.

Sensor symbol is a tiny scope symbol beside the models label. The sensor position is defined relatively to the label position. Again, click the
desired radio button.

Build...Model graphic.

Not used for model built from a subsystem.


Build...Model icon.

Click on this button to draw the models icon that will be seen in the
drawer when it is opened. A new Hypersim window as shown in Figure
8 - 5 will appear to allow drawing this icon. The model icon is purely
graphic, use therefore tools in the graphic tools bar to build it. The size
of the icon should not be greater than 1cm x 1cm, the font use should less
than 12 points.
Note: Use the menu Graphic->Option->Grid to define the grid spacing,
then click on Grid button to turn grid on/off.
Name written below icon.

Short name (less than 8 characters) which will appear below the models
icon in its drawer.
Build...Model parameter form.

Not used for model built from a subsystem.


Cancel, OK.

Click Cancel to ignore every thing and close the dialogue. OK to terminate. If OK is chosen, the following message
File XXX
must be MOVED or COPIED to
YYY
lets user choose between moving or copying the subsystem detailed file
into the library directory.

Now, the procedure of adding / updating the model in the library is completed. Open the appropriate drawer, one can see the icon of the new or updated model in it. Click on this icon to
select it, then click on a location in the diagram the model will appear and usable as any other
model.

1-8-102

Customizing Hypersim
Library Management

2 Add / Update Model with a Subsystem selected. If a subsystem exist in the current
working diagram, we can add the model of this subsystem to the library by the following way:

Figure 8 - 6 Dialog to add/update the library with the model of a selected


subsystem
In the Editing mode, select the subsystem in the diagram,
Execute the menu
File->Library management->Add/Update model
The dialogue shown in Figure 8 - 6 appears. It is lightly different from the dialogue of Figure
8 - 4 because some informations related to the selected subsystem are automatically defined
and need not to be entered.
3 Disable link, Restore link. When a subsystem model is taken from the library and inserted

into a diagram, user can ask to display its graphic content by executing the command Subsystem content. This graphic content can not be modified by default (except the components parameters).
To modify locally (for the current diagram only and not in the library), user goes to the Editing mode, selects the subsystem and issues the command Disable link. This command remove
the link between this particular subsystem and the one in the library. A star (*) appears beside
the subsystem label to indicate that it is not linked any more to the library. The user can then
edit freely this content without affecting the library and other subsystems of the same model.

1-8-103

Customizing Hypersim
Library Management

After modifications, one can reconnect the selected subsystem to the library by giving the
command Restore link. A pop-up message will ask the user to select
Ignore change: ignore any modification and get back to the library model.
Update file: update the library model with the modifications.
When the link is restored, the star (*) will be removed from the subsystems label.
When a model in the library has been modified using Restore link, to make sure that the current network uses the latest modifications, the user needs to reread the current network
file (using File->Open). The file reading updates automatically all subsystems taken from the
library in the diagram.
8.2.3

Library of
Models Built
Using User
Code Bloc
(UCB)

UCB is a Hypersim utility which allows the user to build a model using C-like codes. Details
concerning how to build a model using UCB are given in Part 4, Chapter 2.
The procedure to add / update a model built with UCB is about the same as the model built
from a subsystem. The differences are (see Figure 8 - 4):
Family.

Select UCB.

Model diagram file.

Give the UCB file (with extension.ucb)

Build...Model Parameter form.

If nothing is done here, the default parameter form of the UCB will be
used. For most cases, this is satisfactory. If however a customized parameter form is desired, then user can click this button and follow the
procedure describe in Section 8.2.5 below.
8.2.4

Library of
Models Built
from Simulink

The procedure to build a model using Simulink and make it usable in Hypersim is described
in Part 4, Chapter 1. Once the model is tested, it can be put in the Hypersim library in the same
way as a subsystem model. The sole differences in filling the dialogue of Figure 8 - 4 are:
Family.

Select Hyperlink.

Model diagram file.

Give the Simulink file (with extension.mdl).


8.2.5

Building the
Parameter
Form

1-8-104

In the current version of Hypersim, models built with subsystem and Simulink dont have
particular parameter form. Only models built with UCB have it and the default form is quite
satisfactory. If however a customized parameter form is desired, then the user can click the
button Build...Model Parameter form to bring up the form editing window as shown in Figure 8
- 7a which has all the same graphical editing capabilities as the Hypersim main window.
Along its side bar, there are tools to create parameter entries which can have various type
(text, scalar, toggle, etc.), some of them are shown in this figure (a white graphic box has been
added under each entry).

Customizing Hypersim
Library Management

(b)

(a)
Figure 8 - 7 (a) Form editing window, (b) Dialog to define
parameter informations
To add an entry in the parameter form, user processes as follows:
select the desired type from the side bar,
click in the window, a parameter entry appears with default informations,
with the parameter entry selected, execute the background menu Edit parameters, this
will bring up the dialogue shown in Figure 8 - 7b to define the following informations:
- Label: parameter name,
- Default value: default value,
- Unit: measurement unit,
- Identifier: integer number used to identify the parameter. Parameters name and
identifier are obtained using the command formpar of the UCB utility.
- Minimum, Maximum: allowable range of the parameter. Hypersim will check if the
parameter falls inside this range and warn otherwise. By giving 0.0 to these items,
Hypersim will skip this verification.
- Visibility: the parameter can be always shown (Always), always hidden (Never) or
shown only for advanced user of Hypersim (Never for beginner).

1-8-105

Customizing Hypersim
Library Management

- Read only parameter: the change of some parameter needs to regenerate the code.
Change of these parameters must not be allowed (Yes) during the simulation.
Otherwise the change of the parameter is permitted (No).
If Yes is chosen, the parameter entry in the form will become light grey during the
simulation and the user can not type in a new value.

1-8-106


Chapter 9
SIMULATION AND CONTROL

2
1

Figure 9 - 1

Overview of Hypersim Graphic Interface in Simulation Mode

Once a diagram is built, the Simulation mode can be activated by clicking the Simulation
button specified by 2 in Figure 9 - 1. Hypersim then goes into simulation and control mode,
but the actual simulation does not start automatically.
Hypersim quits the Editing mode and analyses the diagram. It warns the user of any mistake.
Some of these can be fatal and force the user to go back to the Editing mode to make corrections.
If there is no mistake, the user can then:
Install sensors to observe the results of the simulation using Spectrum or Scopeview;
Define the general parameters of the simulation;

1-9-107

Simulation and Control

Sensors, Input/Output and Sensor


Configuration
Operate the disconnecting switches of the power system elements;
Start/stop the simulation;
Initiate programmed operations and observe the waveforms in Spectrum or Scopeview;
Change the model parameters.
In Simulation mode, the main menus are reduced. The background menus are different from
those in Edition mode. To display the background menu, point to a blank area of the diagram
and press and hold the right button. However, if the pointer is next to an element, the menu
related to the latter will be displayed.
In Simulation mode, it is not possible to select an object in a diagram.

9.1
9.1.1

SENSORS, INPUT/OUTPUT AND SENSOR CONFIGURATION


Sensors and
Input/Output

Sensors are used to make signals observable. Each bus, power system element and control
block has a list of signals. The user can install sensors on some of these and observe them
with Spectrum or Scopeview.
To display the list of signals, point to the label of a bus, power element or block, then press
and hold the right button. A pop-up menu is displayed. Select Edit sensors. A panel similar
to the one in Figure 9 - 2 is displayed and provides the list of available signals.
To place or remove a signal sensor, click the check box to the left of its name: an X will then
be added or deleted. To place sensors on all of the signals, left click Select all.

1-9-108

Simulation and Control

Sensors, Input/Output and Sensor


Configuration

Figure 9 - 2

Example of a List of Signals and Sensors

The sensor control panel consists of columns with the following information:
Signal.

Generic name of the signal; cannot be changed.

Description.

The generic name is repeated here by default. The user can change it.

Unit and Base. The default values are the following: Unit for voltages is V, Unit for

currents is A and the conversion Base is 1.0. Other units can be used by
changing the conversion base. Example: Unit = kV, Base = 1000.

Input/Output.

The signals can be connected to external equipment via digital or analog


input/output. To do this, the user must define:

Type.

DA (analog output), AD (analog input), DO (digital output), DI (digital input).

No.

Channel number of the input/output

Unit/Volt.

The number of units of the signal corresponding to one Volt of the analog input/output.

1-9-109

Simulation and Control

Sensors, Input/Output and Sensor


Configuration

Example:
If 1000V in the simulated network correspond to 1 V of the analog
output, then Unit/Volt = 1000.
Destination Base.

Database used to save the waveforms (no details in this document)


There are three buttons at the bottom of the control (Figure 9 - 2):
Cancel.

Ignore the changes and close the panel.

Apply.

Confirm the changes and keep the panel open.

OK.

Confirm the changes and close the panel.

When sensors are installed, an oscilloscope symbol will be displayed next to the element label.
9.1.2

Sensor
Configuration

A set of sensors installed on buses, power system elements and control blocks form a sensor
configuration. The background menu can be used to execute different operations on such configurations:
Save sensor configuration: save the actual sensor configuration in a file. A
dialogue box is displayed to allow to define the file.
Load sensor configuration: reread a previously saved configuration. A dialogue box is displayed to define the file to read. The name of this file is displayed at the
bottom of the Hypersim window.
Clear current sensor configuration: remove all the sensors and the
filename with the sensor configuration (if it exists).

1-9-110

Simulation and Control

Simulation Parameters

9.2 SIMULATION PARAMETERS

Figure 9 - 3

Dialogue Box Used to Define Simulation

Before starting the simulation, it is useful to check some parameters. The command Preferences in the background menu is used to do this. The dialogue box in Figure 9 - 3 allows to
specify the following parameters:
Network Name.

The network usually has the same name as the file used to save the diagram. If the diagram has never been saved, the name will be Sansnom.

The user should not change Network Name.

Code Generation Directory.

Before simulation, Hypersim generates a code C specific to each network. This parameter is used to define the directory where the code is
saved.
Performance.

This parameter serves as a slowing down factor in real-time. For example, if the user observes a sine wave on an real oscilloscope, its period
will be
performance * real period.
This is like playing a video in slow motion.
With Performance > 1, the time allocated for each time-step will be
(Performance * real time-step), the CPUs have therefore more time
and more tasks will be packed in each CPU.

1-9-111

Simulation and Control


Simulation Parameters

In off-line simulation (non real-time mode) with single CPU, Hypersim


still emulates the real-time mode, a large number for Performance
could be required to enable the simulation.
Calculation Step.

Specified in seconds. Hypersim uses this parameter to set the simulation


equations. However, in real-time mode, waveform execution is altered
by Performance. The execution is in real-time if Performance =
1, faster than real-time if Performance < 1, slower if Performance
> 1.
Simulation Type.

There are two choices: Real-time or Off-line (or non real-time


mode).
Simulation server.

Computer executing the simulation.


Compiling server. The simulation can be executed by a remote computer that is not

necessarily the same type as the one executing Hypersim. The compiling
server is the computer that will compile the code generated used to simulate the network. The server must be of the same type as the one executing the simulation.
Node Type.

Type of equipment (computer) used to simulate in real-time. Hypersim


currently supports the following hardware: DECalpha 300, 500 and
533MHz, SGI parallel computer and the PC cluster.

Note : All this information can be entered as default setup at start-up using the Properties
form. (See Chapter for more information)

1-9-112

Simulation and Control

State of Disconnecting Switches

9.3 STATE OF DISCONNECTING SWITCHES


Operated disconnecting switches

Change in appearance after


operating the specified disconnecting switches

Figure 9 - 4

Operating Disconnecting Switches

The disconnecting switches allow to include or exclude specific elements in a simulation. If


an element is excluded, it does not exist in the simulation. Hence, its signals cannot be observed.
To operate a disconnecting switch, left click the switch icon of the required element. The latter will change from solid (included) to dotted (excluded) or vice versa, depending on its previous state.(See Figure 9 - 4).
Disconnecting switches can only be operated when the simulation is stopped or has not been
started. Operating disconnecting switches allows to study the impact of certain elements
(present or absent) in a network.

9.4 NETWORK ANALYSIS, TASK DISTRIBUTION,


CODE GENERATION AND SIMULATION
The background menu allows to execute these commands in the following order:
Network Analysis: topological analysis of the network;
Map tasks: distribute tasks to parallel processors;
Generate code: generate the simulation code for the current network;
Simulate network: execute the simulation.
1-9-113

Simulation and Control

Changing Parameters of Elements and


Blocks
The details of these steps can be found in this Chapter and in Part 1, Chapter 1. For any given
command, Hypersim automatically executes, if necessary, the preceding steps. Hence, if
Simulate network is asked, Hypersim also executes Network Analysis, Map tasks
and Generate code, if required.
In practice, the user can:
In Editing mode, edit the network or read a diagram located in a file;
Switch to Simulation mode, install sensors or read a sensor configuration from a file,
Execute the command Simulate the network,
Execute the transient operations and display the waveforms using Spectrum or Scopeview.
The intermediate steps are only executed to detect the causes of abnormal conditions.
The background menu also allows to Stop the simulation.

9.5 CHANGING PARAMETERS OF ELEMENTS AND BLOCKS


To change the parameters of an element or a block in Simulation mode:
Point to the element or block label;
Press and hold the right button to display a menu and execute:
Edit parameters. The parameter panel is then displayed or double click the left button on the element;
Make the required changes, click Apply or Close on the panel.
If the simulation is in progress, the changes to the parameters will take effect almost immediately. This can be seen by observing the waveforms in Spectrum. If the simulation
is stopped, the changes will take effect when the simulation is launched.
Some parameters cannot be modified when the simulation is in progress. In the parameter panels, these parameters are pale when the simulation is running and they are unmodifiable. They become dark and modifiable when the simulation is stopped.

1-9-114


Chapter 10
SETTING OF INITIAL CONDITIONS WITH SNAPSHOT AND LOAD-FLOW

10.1 INTRODUCTION
Snapshot and Load-flow are two tools permitting to set-up the network initial conditions.
Snapshot reads the current conditions of the network and uses it as initial conditions for later
simulations. Load-flow, on the other hand, calculates the initial conditions using an iterative
algorithm. Both Snapshot and Load-flow started from the HyperView panel using on the corresponding tabs.

10.2 INTRODUCTION TO HYPERVIEW

(a)

(b)

Figure 10 - 1 (a) HyperView activation button in Hypersims main window.


Figure 10 - 2 (b) HyperView initial panel.

1-10-115

Setting of initial conditions with


Snapshot and Load-Flow
Snapshot

HyperView is a new Hypersims central control panel. When its development will be completed, it will serve as the central point from where various Hypersim related applications will
be launched.
For the end users, HyperView is actually used for executing Snapshot and Load-Flow commands. Others applications will be gradually added.
HyperView is activated from the Hypersims main window by clicking on the HyperView
button located on the right of the Help button (see Figure 10 - 1a). When activated, HyperView comes up with its panel showing initially the Simulation tab (see Figure 10 - 1b)
with some simulation parameters. The user can change these parameters then click Apply.
If an error is detected because some changed parameters are invalid, a message will appear.
In this case, user must click on Refresh to display the last valid parameters.
From the HyperView panel, the user can select different applications by clicking on the corresponding tabs. This chapter will describe particularly the Snapshot and Load-Flow applications, both are use for the initialization purpose.

10.3 SNAPSHOT
10.3.1 Description

Snapshot is one of Hypersims utility allowing to take a picture of all simulation variables
as well as their histories. The picture, or the snapshot buffer, is kept in local memory of the
simulation computer (which can be the same as the one running the Hypersims user interface
or a parallel computer running the real-time simulation).
The snapshot buffer represents the state of the simulation at a particular moment. It can be
either the steady-state or somewhere during a transient state. The snapshot buffer can be
saved on a file and later reloaded. The user can start the simulation from the snapshot buffer
which is used as the initial conditions.
If the snapshot buffer has been taken during the steady-state, then start the simulation from it
will bring immediately the network to the steady-state condition. This avoid the time of waiting the network to stabilize.
For some particular transients, especially those that last for a long period, the user may want
to repeat the simulation without repeating the whole transient process. Taking a snapshot in
a middle of a transient and restarting the simulation from it will be useful.

10.3.2 Utilization

The snapshot is accessible from HyperView panel by clicking on the Snapshot tab. The
snapshot commands and parameters reside inside Hyperview panel, under Snapshot tab,
they are shown in Figure 10 - 1. Commands are found on the top of the tab. For convenience,
beside the snapshot commands, other commands are also available to control the simulation.
Commands are found on the top of HyperView window, they are visible even the Snapshot
tab is not selected. For convenience, beside the snapshot commands, other commands are also
available to control the simulation.
Startsim the simulation
Start the simulation from scratch.

1-10-116

Setting of initial conditions with


Snapshot and Load-Flow

Snapshot

Stop the simulation


.
Stop the simulation.
Pause/Continue the simulation.

After Pause the simulation is executed, all variables will remain


unchanged and stay at the values they have reached just prior to Pause.
They will continue from these values when Continue the simulation is executed as shown in Figure 10 - 4.
Take a snap-shot
.
It means copy all variables and their histories into the snapshot buffer.
Save the current snap-shot of the simulation
.
Save the snapshot buffer in the file specified by Filename.
Load the current snap-shot in the simulation
.
Restart the simulation using the snapshot buffer as initial conditions. The

snapshot buffer must be filled previously either by taking a snapshot or


loading from a file (with the command below).

1-10-117

Setting of initial conditions with


Snapshot and Load-Flow
Snapshot

Start the simulation


Stop the simulation
Pause/Continue the simulation
Take a snap-shot of the current simulation
Save the current snap-shot of the simulation
Load the current snap-shot in the simulation
Load a snap-shot file in the simulation

Figure 10 - 3 Snapshot commands and parameters in HyperView window


Load a snap-shot file in the simulation.

Load the snapshot buffer with data from a file, restart the simulation with
this buffer as initial conditions.

1-10-118

Setting of initial conditions with


Snapshot and Load-Flow
Load-Flow

Pause simulation

Continue simulation

Figure 10 - 4 Pause and Continue the simulation


The snapshot operations need the two following parameters:
Filename.

Complete path and name of the file served to load and save the snapshot
buffer.

Delay.

Delay in seconds before taking the snapshot. If this delay is 0, the snapshot will be taken as soon as the simulation receives the snap command, this is normally used to store the steady-state conditions. If the
delay is positive, the snapshot will be taken with a delay counted from
the POW detection.
Note that the POW detection is enabled from Spectrum (by clicking on
Acquisition) or from ScopeView (by clicking on Plot Signals).
When the POW is detected, it initiates the transients operations (switching of circuit breakers for example) as well as the data acquisition. By
setting Delay to a positive value, the user can take a snapshot during
the transient conditions.

10.4 LOAD-FLOW
10.4.1 Description

The Load-flow calculation of a network is also accessible from HyperView. This tool calculates:
Powers (active and reactive) of all machines,
Internal voltages (amplitudes and angles) of all machines,
Voltages (amplitudes and angles) of all buses.
1-10-119

Setting of initial conditions with


Snapshot and Load-Flow
Load-Flow

Power flow from each bus to its neighbour buses.


10.4.2 Preparation of
network
parameters

To be able to run the load-flow, the user must provide the following data:
Base voltage of all buses are defined by using the Hypersims background command
Edit base voltage summary. This command is available both in Editing mode
and Simulation mode, it brings up the dialogue show in Figure 10 - 5a in which the user
must give the phase-to-phase base voltages for all buses.

(a)

A Base voltages of all buses


B Load-flow parameters section
of all machines

(b)

Figure 10 - 5 : Network data needed to calculate the Load-Flow.

1-10-120

Setting of initial conditions with


Snapshot and Load-Flow
Load-Flow

The user can also select buses one by one to enter its base voltage using the menu Edit base
voltage.
10.4.3 Running loadflow and
setting initial
conditions

To run the load-flow, HyperView must be already started, if not, click on the HyperView
button on the Hypersims main window. Once the network is read and the required parameters are already entered. Do the following steps:
On the Hypersims main window, pass to the Simulation mode.
On the HyperView window, select Load Flow tab. The informations in this tab are
shown in Figure 10 - 2.

1-10-121

Setting of initial conditions with


Snapshot and Load-Flow
Load-Flow

1
4

Figure 10 - 6 Informations under Load Flow tab in HyperView panel.


Enter load-flow parameters in section

of Figure 10 - 1 which includes:

Frequency: base frequency in Hz,


Power Base: base power in MVA,
Max Iteration: maximum number of iterations allowed,
Tolerance PQ: tolerance in MW or MVAR used to stop the iteration process.

1-10-122

Setting of initial conditions with


Snapshot and Load-Flow
Load-Flow

Click Apply

to make these parameters effective.

Click on Execute

. Hypersim calculates the load-flow and print data and results

in the Load-flow data viewer 5 . This print out is for information purpose only,
user doesnt need to manipulate them. Check boxes on top of Load-flow data
viewer section allow to display data and results in the desired unit. The pull-down
menus allow to display either all data/results or only the selected categories.
Because the print-out is accumulated in this area, user need to clear it as needed before
a new print by right-clicking in the area and execute Clear

Click on Update forms 3 to modify machines parameters corresponding to their


internal voltages (amplitudes and angles) accordingly to results calculated by the loadflow. This operation is optional to make machines parameters reflect their conditions
determined by the load-flow. It is however not sufficient to initialize the whole network
with the state established by the load-flow.
Check the box Use Initial Condition In Simulation
the simulation really with it initial conditions.

to be able to start

Start the simulation by one of two ways:


In HyperView panel, click on start the simulation (see Figure 10 - 3),
In Hypersims main window, execute the background command Simulate network.
10.4.4 Load Flow Bus
Elements
A

Introduction

The Load Flow Bus models a 3-phase load-flow bus constraint. The constraint bus type is
Power and Voltage control (PV). Each Low Flow element represent at each bus an ideal
source behind a Thevenin impedance. The principal information obtained from the pow-

er flow study is the magnitude and phase angle of the voltage at each bus and the real
and reactive power flowing in each line.

1-10-123

Setting of initial conditions with


Snapshot and Load-Flow
Load-Flow

B Load Flow Bus


Icon and Diagram

System Tools

Load Flow Bus

Properties:
- Control Power and Voltage at
local bus Bar
- Used in Load Flow tools in
Hyperview

Features:
- Generator, Swing or slack

bus
Implementation:
- Hypersim standart element

Figure 10 - 1 Load Flow Bus Icon and Diagram


C Parameter
Description

Type of Load-Flow: G: generator, E: for swing or slack bus

For generator bus, the controlled variables are the bus voltage magnitude and
the real power output of the generator. Swing or slack bus, on the other hand, is
treated as a reference bus, thus the voltage magnitude and angle are specified;
Voltage: specified voltage amplitude in pu
Angle: specified angle in deg
P: controlled active power in MW
R: internal Thevenin impedance in ohm
L: internal Thevenin impedance in Henry

D List of Available
Signals

At acquisition, the following signals are made available by the sensors. The value are the signals at the bus bar, internal voltage and angle.
Voltage at the bus bar in kVrmsll.
Angle at the bus bar in deg.
Voltage internal in function of R and L in kVrmsll.
Angle internal in function of R and L in deg.
Power at the bus bar in MW.
Reactive power Q at the bus bar in Mvar.

E Load Flow
Control Panel

1-10-124

Figure 10 - 2 shows the control panel used to enter the Load Flow Bus parameters

Setting of initial conditions with


Snapshot and Load-Flow
Load-Flow

Figure 10 - 2 Load Flow Bus Control Panel

Example:
Load flow bus example with two machines. See the Low Flow output
and scopeview results.

Figure 10 - 3 Load Flow example

1-10-125

Setting of initial conditions with


Snapshot and Load-Flow
Load-Flow

-------------------------------------------------------------------------------Bus summary
Bus bar
Base voltage (kV)
B1
100.0
B2
100.0
B3
100.0
Generation summary
Bus bar
Element
B1
Mac1
B2LoadFlowBus
B3
Mac2

Type
E
G
G

V(kV)
100.0000
99.0000
99.0000

Angle(deg)
0.00
---------

Total:
Shunt impedance summary
Bus bar
Element
B3
R1

P(MW)
----50.00
25.00
-------75.00

Cntl Bus

P (MW)
Q (Mvar)
100.00
-0.00
--------------Total:
100.00
0.00
-------------------------------------------------------------------------------Iteration no 1; max PQ = 0.730100;
Iteration no 2; max PQ = 0.000123;
Generation buses
Bus
Pgen (MW)
B1
23.02
B2
50.00
B3
25.00

Vbase (kV)
100.00

Qgen (Mvar)
26.57
-25.27
1.22

Internal voltages at generation buses


Bus B1 (no 0); Vint = 107.9318 kV @ 3.53 deg
Bus B2 (no 1); Vint = 99.0000 kV @ -0.50 deg
Bus B3 (no 2); Vint = 99.6517 kV @ 2.10 deg
Node B1 (no 0)
V = 100.0000 kV @ 0.00 deg
Pgen (MW)
Qgen(Mvar)
Pload (MW)
23.02
26.57
0.00
P B1-->B2 = 23.02 MW
Q B1-->B2 = 26.57 Mvar
Node B2 (no
V = 99.0000
Pgen (MW)
50.00
P B2-->B1 =
Q B2-->B1 =
P B2-->B3 =
Q B2-->B3 =

1)
kV @ -0.50 deg
Qgen(Mvar)
Pload (MW)
-25.27
0.00
-23.02 MW
-26.10 Mvar
73.02 MW
0.83 Mvar

Qload (Mvar)
0.00

Pshunt (MW)
0.00

Qshunt (Mvar)
0.00

Qload (Mvar)
0.00

Pshunt (MW)
0.00

Qshunt (Mvar)
0.00

Node B3 (no 2)
V = 99.0000 kV @ -2.11 deg
Pgen (MW)
Qgen(Mvar)
Pload (MW)
Qload (Mvar)
Pshunt (MW)
Qshunt (Mvar)
25.00
1.22
0.00
0.00
98.01
0.00
P B3-->B2 = -73.01 MW
Q B3-->B2 = 1.22 Mvar
-------------------------------------------------------------------------------Generation report
Bus bar
Vbase(kV)
V(kV)
Angle(deg)
P(MW)
Q(Mvar)
Vint(kV)
B1
100.00
100.0000
0.00
23.02
26.57
107.9318
B2
100.00
99.0000
-0.50
50.00
-25.27
99.0000
B3
100.00
99.0000
-2.11
25.00
1.22
99.6517
--------------Total:
98.02
2.52
Shunt report
Bus bar
B3
Total:

Vbase(kV)
100.00

V(kV)
99.0000

Angle(deg)
-2.11

P(MW)
98.01
-------98.01

Q(Mvar)
0.00
-------0.00

Figure 10 - 4 Load Flow output

1-10-126

Aint(deg)
3.53
-0.50
2.10

Setting of initial conditions with


Snapshot and Load-Flow
Load-Flow

Figure 10 - 5 Load Flow scopeview results

1-10-127

Setting of initial conditions with


Snapshot and Load-Flow
Load-Flow

PAGE LEFT INTENTIONALLY BLANK

1-10-128


Chapter 11
LIST OF TOOLS AND MODELS

The tools and models are found in the drawers on the left-hand side of the Hypersim window
( 12 in Figure 2 - 2, Chapter ). They are listed here in the actual order of the drawers. The
name given to each model found in a drawer is provided, followed by a short description. The
following chapters in this manual will describe these in detail.

11.1 SYSTEMTOOLS
POW (point-on-wave): Element used for the synchronization of the simulation.
Bus3ph: Three-phase bus.
BusMono: Single-phase bus.
BusMpx: Multiplex Bus.
Connex: Connection (for Hypersim administrator only).
SimulCtr: Simulink block with control connectors.
SimulNet: Simulink block without control connectors.

UserBloc: User code block.


SubSyst: Subsystem.

InPort, OutPort: Control input and output connector of subsystems


ExtConn: Power external connector of subsystems.

11.2 NETWORKSOURCES AND MACHINES


SrcV: Fixed voltage source.
SrcProg: Programmable voltage source (variable with time).
SrcI: Fixed current source.
SrcIPrg: Programmable current source (variable with time).
Hydro: Hydraulic synchronous machine.
HydCmd: Modular hydraulic synchronous machine (reprogrammable).
Therm: Thermal synchronous machine.
ThermCmd: Tandem-compound steam turbine generator

1-11-129

List of Tools and Models


NetworkPassive

CrossCmpd: Modular Cross-compound steam turbine generator.


AmpV: Controlled single-phase voltage source.
AmpV3: Controlled three-phase voltage source.
AmpI: Controlled single-phase current source.
AmpI3: Controlled three-phase current source.

11.3 NETWORKPASSIVE
Ground: Ground connection
R: Series resistor.
L: Series reactor.
C: Series capacitor.
R_Shunt: Shunt resistor.
L_Shunt: Shunt reactor.
C_Shunt: Shunt capacitor.
RL: Series resistor and reactor.
RC: Series resistor and capacitor.
LC: Series reactor and capacitor.
RLC: Series resistor, reactor and capacitor.
RL_Shunt: Shunt resistor and reactor.
RC_Shunt: Shunt resistor and capacitor.
LC_Shunt: Shunt reactor and capacitor.
RLC_Shunt: Shunt resistor, reactor and capacitor.
Mutual: Mutually coupled inductor elements.
RnLinSh: Non-linear shunt resistor. Used normally to simulate ZnO surge arrester.
RnLin: Non-linear series resistor. Used normally to simulate ZnO surge arrester.
Decoupl: Decoupling element (parallelism of tasks).
Dec_XFO: Transformer with decoupling element.
CType: Shunt C type filter.
FiltreDmp: Shunt double damped filter.
FiltRLC: General filter (3 parallel RLC branches in series), shunt
HP: Shunt high-pass filter.

1-11-130

List of Tools and Models

NetworkLines

RLCsp: Series-parallel RLC filter, shunt connection.

CType_ser: series C type filter.


DDmp_ser: series double damped filter.
Gen_ser: Series general RLC filter.
HP_ser: Series high-pass filter
RLCsp_ser: Series-parallel RLC filter, series connection.

11.4 NETWORKLINES
Single: Frequency Constant distributed parameters simple line.
SglFault: Frequency Constant distributed parameters simple line with fault.
Coupled: Frequency Constant distributed parameters coupled double circuit line.
CplFault: Frequency Constant distributed parameters coupled double circuit line with fault.
9phases: Frequency Constant distributed parameters coupled line, 9 phases.
12phases: Frequency Constant distributed parameters coupled line, 12 phases.
Pi: Pi section.
Pi-Flt: Pi section with fault.
Pi-Cpl: Double coupled Pi sections.
PiCplFlt: Double coupled Pi sections with fault.
Pi-9ph: Triple coupled Pi sections.
Pi-12ph: Quadruple coupled Pi sections.
Pi12phFlt: Quadruple coupled Pi sections with fault.
DCcable: DC cable.
Marti: 3 phase Marti line with three-phase connectors.
Marti2P: 2 phase Marti line (for DC network).
Marti3P: 3 phase Marti line with single-phase connectors.
Marti4P: 4 phase Marti line with single-phase connectors.
CplFault (with S symbol on its icon): Frequency Constant distributed parameters coupled
line with fault at different points on different circuits. The model is built using subsystem concept, user can open the subsystem content to see its details.
12phFault: Frequency constant distributed parameters coupled quadruple line with fault at
different points on different circuits. Its built with subsystem concept.

11.5 NETWORKTRANSFORMERS
Lin2: Linear transformer, 2 windings.
1-11-131

List of Tools and Models

NetworkLoads and Motors

Sat2: Saturable transformer, 2 windings.


Lin21: Linear transformer, 2 windings with internal tertiary.
Sat21: Saturable transformer, 2 windings with internal tertiary.
Lin2Ser: Linear transformer, 2 windings, series connection primary
SatSer: Saturable transformer, 2 windings, series connection primary
Lin3: Linear transformer, 3 windings.
Sat3: Saturable transformer, 3 windings.
TapDecpl: Converter transformer with tap changer and decoupling element. Y grounded pri-

mary, floating Y and Delta secondaries.


Sat2Tap: Saturable transformer with tap changer, 2 windings.
Sat3Tap: Saturable transformer with tap changer, 3 windings.
LinSer: Linear series-series transformer, 2 windings.
Lin2Mono: Single-phase linear transformer, 2 windings.
Sat2Mono: Single-phase saturable transformer, 2 windings.
Sat3Mono: Single-phase saturable transformer, 3 windings.
Zig-Zag: Phase-shift transformer.
CVT: Voltage transformer with capacitive coupling.
CT: Current transformer.
PT: Voltage transformer with magnetic coupling.

11.6 NETWORKLOADS AND MOTORS


DynLd: Dynamic load.
HarmLd: Programmable Non-linear load with random active and reactive power and harmonic current.
ArcFurn: Arc furnace.
DCMot: Direct current motor.
IndMot: Induction motor.

11.7 NETWORKCONTROLLERS AND SWITCHES


Inv_12: Inverter and DC control, 12 pulses.
Rect_12: Rectifier and DC control, 12 pulses.
Inv_6: Inverter and DC control, 6 pulses.
Rec_6: Rectifier and DC control, 6 pulses.

1-11-132

List of Tools and Models

NetworkMiscellaneous

SVC: Static compensator.


TSC: RLC branch switched with thyristors.
TCR: RL branch controlled with thyristor.
BrShunt: Fault circuit breaker.
BrSerial: Series breaker.
BrShMulti: Shunt circuit breaker, phase by phase operable.
BrSrMulti: Series breaker, phase by phase operable.
BrShMono: Single-phase shunt breaker.
BrSerMono: Single-phase series breaker.
Switch: Switch (breaker or electronic switch)
SwMono: Single-phase switch (breaker or electronic switch).

Br2LMono: Triple H-bridge converter, single phase


Br3Level: Three-level bridge.

11.8 NETWORKMISCELLANEOUS
Mes_Freq: Frequency measuring unit.
Digital_Out: Digital output.
ConfSw: Disconnecting switch.
A/D: Analog input.
D/D: Digital input
MesI: Single-phase current sensor.
MesV: Single-phase voltage sensor.
MesI3: Three-phase current sensor.
MesV3: Three-phase voltage sensor.

11.9 CONTROL MATH AND FUNCTIONS


Sum_2: 2 input adder with gain.
Sum_3: 3 input adder with gain.
Sum_4: 4 input adder with gain.
X: 2 input multiplier.
/: Divider.
Abs: Calculation of absolute value.

1-11-133

List of Tools and Models


Control Logic

gain: Gain block.


Sin: Calculation of sinus.
Cos: Calculation of cosines.
Tan: Calculation of tangent.
ArcCos: Calculation of arc-cosines.
ArcSin: Calculation of arc-sinus.
ArcTan: Calculation of arc-tangent.
10^n: Calculation of 10n
e^n: Calculation of en.
log10: Calculation of base 10 log.
logn: Calculation of natural log.
MathFct: Calculation module of miscellaneous mathematical functions.

Module: Modulus calculation.


Sqrt: Calculation of square root.
H(s): S transfer function.
H(z): Z transfer function.
H(s)dyn: S transfer function with dynamic limits.

H(s)lim: S transfer function with internal limits


H(s)limR: S transfer function with internal limits, reset and initial conditions.
WindAverg: Averaging data in a sliding window.

11.10 CONTROL LOGIC


And2: AND gate.
Nand2: NAND gate.
Or2: OR gate.
Nor2: NOR gate.
Xor2: EXCLUSIVE OR gate.
Nor2: EXCLUSIVE NOR gate.
Not: Logical inverter.
Compare: Two input comparator.
CmpDlay: Comparator with delay.

1-11-134

List of Tools and Models

Control Non-Linear and Delay

CmpLevel: Level comparator (compare input with a fixed level).


Counter: Counter.
DlyOn: Delay on an ON signal.
EdgeDwn: Falling slope detector.
EdgeUp: Rising slope detector.
ZoneDet: Zone detector.
Pack12: Multiplexer, 12 logical inputs.
Pack6: Multiplexer, 6 logical inputs.

11.11 CONTROL NON-LINEAR AND DELAY


Lim: Limiter with fixed limits.
Max2: Maximum of 2 inputs.
Max3: Maximum of 3 inputs.
Max4: Maximum of 4 inputs.
Min2: Minimum of 2 inputs.
Min3: Minimum of 3 inputs.
Min4: Minimum of 4 inputs.
Delay: Analog delay circuit.
NonLin: Non-linear gain
SinPrg: Sinus with amplitude, frequency and phase inputs (AM-FM-PM modulator).
RampDn: Falling ramp.
RampUp: Rising ramp.
RateLim: Variation speed limiter.
MUX2: Analog multiplexer, 2 inputs
DeadZone: Dead band.
Buffer: Buffer with hysteresis.
StepDly: One calculation step delay.
PWM: Pulse width modulator.
Sample: Sampler.

SmoothFlip: smooth flipper (flip smoothly from one input to the other).

1-11-135

List of Tools and Models


Control Sources

11.12 CONTROL SOURCES


ConstF: Floating point constant.
ConstI: Fixed point constant.
Rand: Random number generator.
Pulses: Pulse train generator.
Square: Square wave generator.
Triang: Triangular wave generator.
Sin: Sinusoidal wave generator.
SinAng: Sinusoidal wave generator with output for angle.
timeStep: Calculation step output.

11.13 CONTROL MISCELLANEOUS


dq_abc: Park transformation (dq -> abc).
abc_dq: Inverse Park transformation (abc -> dq).
F_to_I: Floating point to fixed point conversion.
I_to_F: Fixed point to floating point conversion.
IniVal: Initial value and its duration of a variable.
StateVar: State variable system.
TrcverF: Floating point transceiver.
TrcverI: Fixed point transceiver.

Freq3ph: Frequency measurement of 3 phase signal.


PlayBack: Waveform play back system.

1-11-136


Chapter 12
SUMMARY OF MENUS

This chapter summarizes the menus available in the Hypersim graphic interface. Each command is followed by a section number and the corresponding page which provides its details.
Some menus are not documented in this chapter since they are part of other chapters.

12.1 MAIN MENUS


1 File=>New (4.7, page 67). Create a new diagram
2 File=>Open (4.7, page 67). Load a diagram saved un a file
3 File=>Save (4.7, page 67). save the diagram in the same file used with
File=>Open
4 File=>Save as (4.7, page 67). save the diagram in a file selected by the user
5 File=>Revert (4.7, page 67). Ignore changes made and reload the diagram that was saved

the last time.


6 File=> Library management(4.7, page 67). Hypersim libraries management.
7 File=>Page (4.7, page 67). Define the page size containing the diagram.
8 File=>Print (4.7, page 67). Print the diagram with the printer or to a file.
9 File=>Import (4.7, page 67). Add in the current diagram another diagram that was saved

in a file.
10 File=>Quit (4.7, page 67). Quit Hypersim
11 Edit=>Undo (4.6.2, page 66). Cancel the last operation
12 Edit=>Restore (4.6.2, page 66). Restore the cancelled operation.
13 Edit=>Cut (4.5.7, page 65). Cut the selected objects and put them on the clipboard.
14 Edit=>Copy (4.5.7, page 65). Copy the selected objects to the clipboard.
15 Edit=>Paste (4.5.7, page 65). Paste the objects saved on the clipboard.
16 Edit=>Delete (4.5.7, page 65). Delete the selected objects. These objects are not saved on

the clipboard.
17 Edit=>Duplicate (4.5.7, page 65). Duplicate the selected objects.
18 Edit=>Select All (4.2, page 62). select all the objects in the current diagram.

1-12-137

Summary of Menus
Main Menus

19 Edit=>(Erase (Hide) Connectors (3.4.3, page 51). Hide the connectors of the power el-

ements.
20 Edit=>Display (Show) Connectors (3.4.3, page 51). Show the connectors of the power

elements.
21 Graphics=>Group (4.5.1, page 64). Group the selected objects into one object
22 Graphics=>Ungroup (4.5.1, page 64). Separate the objects that were grouped.
23 Graphics=>Front (4.5.2, page 64). Put the selected objects in the foreground.
24 Graphics=>Back (4.5.2, page 64). Put the selected objects in the background.
25 Graphics=>Align (4.5.3, page 64). Align horizontally/vertically the selected objects.
26 Graphics=> Vertical Flip (4.5.4, page 65). Invert top/bottom the selected objects.
27 Graphics=> Horizontal Flip (4.5.4, page 65). Invert left/right the selected objects.
28 Graphics=>Rotate CW (4.5.5, page 65). Rotate clockwise the selected objects.
29 Graphics=>Orientation (4.5.6, page 65). Turn the whole graphic from landscape to por-

trait and vice-versa.


30 Graphics=>Option=>Grid (4.6.3, page 66). Define the spacing in the grid
31 Graphics=>Option=>Current Scale (4.6.4, page 66). Define the zoom rate of the print-

ed page.
32 View=>New View. Open another window in Hypersim to display the same diagram. The

displacement in this view and the zoom factor do not affect the other views.
33 View=>Close View. Close a view created with View=>New view.
34 View=>Normal Size (4.6.5, page 66). view with a zoom rate of 100%.
35 View=>Reduce to fit (4.6.5, page 66). Optimized view of the diagram in the workspace.
36 View=>Center Page (4.6.5, page 66). Centre the diagram relative to the workspace.
37 Diagram=>. Import an EMTP file. This is described in Part 1, Chapter , page 617.
38 Properties=>Directories (8.1.1, page 95). Specify the directories of the files required by

Hypersim.
39 Properties=>Simulation (8.1.1, page 95). Specify the general parameters of the simula-

tion.
40 Properties=>Files (8.1.1, page 95). Specify the default suffixes of the files.
41 Edition (2.3, page 38). Put Hypersim in Edition mode to prepare the network diagram.
42 Simulation (2.4, page 39). Put Hypersim in Simulation mode and control.
43 Help. Display this Hypersim User Manual in PDF format.
44 HyperView (10.2, page 115). Activate HyperView, Hypersims central control panel.

1-12-138

Summary of Menus

Graphics Toolbar

12.2 GRAPHICS TOOLBAR

1 A (4.1.1, page 59). Add text to the diagram.


2 J (4.1.2, page 60). Add multibyte text to the diagram via a dialogue box.
3

(4.1.3, page 60). Draw a polyline form in the diagram.

(4.1.5, page 61). Draw a rectangle in the diagram.

(4.1.6, page 61). Draw a polygon.

(4.1.7, page 61). Draw a straight line.

(4.1.8, page 61). Draw an open spline curve.

(4.1.9, page 61). Draw an ellipse (or a circle).

(4.1.10, page 61). Draw a closed spline curve.

10

(4.1.12, page 62). Rotate an object.

11 Stroke (B, page 63). Define/Change the thickness and the colour of strokes.
12 Pattern (C, page 63). Define/Change the type and the colour of the shading in the filling

area.
13 Gravity (4.6.3, page 66). Activate/Deactivated the displacement by short burst based on

grid increments.
14 Grid (4.6.3, page 66). Show/Hide the grid

12.3 BACKGROUND MENU, EDITING MODE


12.3.1

Without
Object
Selection

When no objects are selected, the commands have a general application.


1 Undo (4.6.2, page 66). Cancel the last operation.
2 Restore (4.6.2, page 66). Restore the cancelled operation.
3 Refresh. Redraw the diagram (to remove any scribbling).
4 Paste (4.5.7, page 65). Paste the objects that are saved on the clipboard.
5 Select All. select all the objects in the current diagram.
6 Edit Base Voltages Summary (3.3.4, page 49). List and revise the base voltage.

1-12-139

Summary of Menus

Background Menu, Editing Mode

7 Erase connectors ((3.4.3, page 51). 8 Hide the connectors of the power elements.
9 Update Network with New Tool Palette. Update the diagram after changing the palette
(change the appearance of the objects in the network and their parameter control panel).

Note : This command is mainly used to update networks built in a previous version of Hypersim.
10 Search for a Labeled Object (4.6.1, page 66). Search for an object by specifying its la-

bel.
11 Change the Inport/Outport Order (5.5.5, page 76). Change the order of the input/output

ports of a super-block.
12 Update Subsystems (5.5.4, page 76). Update a diagram containing super-blocks/supermodels to apply the last changes made to them.
13 Update User / Simulink Blocks. Update a diagram containing user-coded blocks and
Simulink blocks to apply the last changes made to them.
12.3.2

With Object
Selection

When objects are selected, the commands act only on these objects.
1 Cut (4.5.7, page 65). Cut (or delete) the selected objects and put them on the clipboard.
2 Copy (4.5.7, page 65). Copy the selected objects on the clipboard.
3 Paste (4.5.7, page 65). Paste the objects from the clipboard to the diagram.
4 Delete (4.5.7, page 65). Delete the selected objects. These objects are not saved on the

clipboard.
5 Duplicate (4.5.7, page 65). Duplicate the selected objects.
6 Edit Label (3.3.2, page 48, 3.4.2, page 51, 5.1, page 69). Change the label of an object

(bus, power element, control block)


7 Edit Parameters (3.4.4, page 52). Change the electrical parameters.
8 Edit Connectors (3.4.3, page 51). Specify the type and the visibility of the connectors of

a power element.
9 Edit Bus (3.3.5, page 49). (If a bus is selected) Specify the number and the names of the

phases of a bus.
10 Copy Parameters (3.4.5, page 53, 5.3, page 73). (If two components are selected)

Copy the parameters of an object (power element or control block) to a second object.
11 Display Parameters (3.4.6, page 54, 5.3, page 73). Show the parameters next to a pow-

er element or a control block.


12 Undisplay Parameters (3.4.6, page 54, 5.3, page 73). Hide the parameters next to a

power element or a control block.


13 Create Model in Library with Selected Component (2, page 103). Create a model in

the library from the selected component.


1-12-140

Summary of Menus

Background Menu, Simulation Mode

14 Create Block Array (5.9, page 79). (If a block is selected) Create a subsystem composed

of a multiplicity of a same block.


15 Required Task. (If a subsystem is selected) Determine if the selected subsystem must be

simulated using a separate task or a task in parallel with the other tasks.
16 Subsystem Content (5.5.3, page 75). (If a subsystem is selected) Display the content of

a subsystem in a new window.

12.4 BACKGROUND MENU, SIMULATION MODE


12.4.1

Pointing to a
Label

When a label is pointed, the commands act on the object with this label.
1 Edit Sensors (9.1, page 108). Select the signals to observe in Spectrum or ScopeView.
2 Edit Base Voltage (3.3.4, page 49). Change the base voltage of a bus (by pointing to the

bus label)
3 Edit Parameters (3.4.4, page 52, 5.3, page 73). Change the electrical parameters.
4 Subsystem Content (5.5.3, page 75). Display the content of the selected super-block in a

new window.
12.4.2

Pointing to a
Blank Space

When a blank space is pointed, the commands have a general application.


1 Network Analysis (1.4.3, page 32, 9.4, page 113). Analyse the network topology.
2 Map Tasks (1.4.3, page 32, 9.4, page 113). Distribute the parallel tasks to processors.
3 Generate code (1.4.3, page 32, 9.4, page 113). Generate the code for the current network

simulation.
4 Simulate network (1.4.3, page 32, 9.4, page 113). Start the simulation.
5 Stop simulation (1.4.3, page 32, 9.4, page 113). Stop the simulation.
6 Save sensor configuration (9.1.2, page 110). Save the current sensor configuration in a

file.
7 Load sensor configuration (9.1.2, page 110). Read a previously saved sensor configura-

tion.
8 Clear current configuration (9.1.2, page 110). Remove all the installed sensors.
9 Selected signals summary. List all the selected signals and input/output.
10 Edit base voltages summary. Change the base voltages of all the buses
11 Erase (Hide) Sensors. Hide the sensor symbols. The sensors are not deleted.
12 Show (Display) Sensors. Show the sensor symbols.
13 Preferences (9.2, page 111). Define the general parameters of the simulation.

1-12-141

Summary of Menus

Background Menu, Simulation Mode

PAGE LEFT INTENTIONALLY BLANK

1-12-142

Part 2
Hypersim Network Models

2-143

PAGE LEFT INTENTIONALLY BLANK

2--144


Chapter 1
HYPERSIM NETWORK MODELS

1.1 LIST OF SINGLE-PHASE AND THREE-PHASE MODELS


To access the HYPERSIM control blocks and the network models, click on the tool palette
on the left side of the main window. (See Figure 1 - 1).

Figure 1 - 1 Graphic Tools Palette

2-1-145

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Figure 1 - 2 System Tools Palette

2-1-146

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Network Model

Threephase

Singlephase

Control
block
access

Simulink
Access

System Tools (Figure 1 - 2)


POW

POW element

Link

Connection element

BusMono

Single-phase bus

Bus3ph

Three-phase bus

BusMpx

Multiplex bus

UserBloc

User-coded block

Simukink

Simulink block (with I/O Control)

SimCtrl

Simulink block

SuperBloc

Super-block

Super-model

External connection

ExtConn

X
X

2-1-147

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Figure 1 - 3 Voltage and Current Sources


Synchronous Turbine-Generator

2-1-148

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Network Model

Threephase

Singlephase

Control
block
access

Simulink
Access

Voltage and Current Sources (Figure1 - 3)


SrcV

Voltage source

V_prg

Programmable voltage source

ScrI

Current source

ScrIprg

Programmable current source

SrcV3

Three-phase controlled voltage source

AmpI3

Three-phase controlled current source

AmpV

Single-phase controlled voltage source

AmpI

Single-phase controlled current source

X
X

Synchronous Turbine Generator (Figure1 - 3)


Hydro

Hydraulic turbine generator

HydCmd

Hydraulic turbine generator (with I/O Control)

Therm

Thermal turbine generator, tandem-compound

ThermCmd

Thermal turbine generator, tandem-compound (with I/O Control)

CrossCmpc

Thermal turbine generator, cross-compound (with I/O Control)

2-1-149

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Figure 1 - 4 Network Passive Elements

2-1-150

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Network Model

Threephase

Singlephase

Control
block
access

Simulink
Access

Passive Elements (Figure1 - 4)


R-L-C
RL-RC-LC
RLC

Series R, L, C, RL, RC, LC, RLC elements (7 items)

R_Shunt
L_Shunt
C_Shunt
RL_Shunt
RC_Shunt
LC__Shunt
RLC_Shunt

Shunt R, L, C, RL, RC, LC, RLC elements (3 items)

ZNO

Series ZNO arrester

ZNO_Shunt

Shunt ZNO arrester

Mutual

Mutual reactor

Decoupl

Uncoupling reactor

Dec_XFO

Uncoupling transformer

RLCsp

S-P RLC type passive filter

FiltC

C type passive filter

FiltDMP

Double damping type passive filter

FiltRLC

Generic passive filter

FiltHP

High-pass filter

2-1-151

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Figure 1 - 5 Network Lines and Cables

2-1-152

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Network Model

Threephase

Singlephase

Control
block
access

Simulink
Access

Lines and Cables (Figure1 - 5)


Single

Distributed parameters line, 3 phases

SglFault

Distributed parameters line with fault, 3


phases

Coupled

Coupled distributed parameters line, 6


phases

CplFault

Coupled distributed parameters line with


fault, 6 phases

9phases

Coupled distributed parameters line, 9


phases

12phases

Coupled distributed parameters line, 12


phases

ClpFault

Coupled distributed parameters line with


fault, 6 phases (type s)

12phFlt

Coupled distributed parameters line with


fault, 12 phases (type s)

Pi

PI line, 3 phases

Pi-Flt

PI line with fault, 3 phases

Pi-Cpl

Coupled PI line, 6 phases

PiCplFlt

Coupled PI line with fault, 6 phases

Pi-9ph

Coupled PI line, 9 phases

Pi-12ph

Coupled PI line, 12 phases

Pi12phFlt

Coupled PI line with fault, 12 phases

DCcable

Direct current cable (Marti line, 2 phases)

Marti

Marti line, 3 phases

Marti2P

Marti line, 2 phases

Marti3P

Marti line, 3 phases

Marti4P

Marti line, 4 phases

2-1-153

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Figure 1 - 6 Network Transformers

2-1-154

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Network Model

Threephase

Singlephase

Control
block
access

Simulink
Access

Transformers (Figure1 - 6)
Lin2

Linear transformer, 2 windings

Sat2

Saturable transformer, 2 windings

Lin21

Linear transformer, 2 windings and tertiary winding

Sat21

Saturable transformer, 2 windings and


tertiary winding

Lin2Ser

Saturable series transformer with ground


connection

SatSer

Linear series transformer with floating


connection

Lin3

Linear transformer, 3 windings

Sat3

Saturable transformer, 3 windings

TapDecpl

Transformer with tap changer for DC


converter

Sat2Tap

Saturable transformer with tap changer, 2


windings

Sat3Tap

Saturable transformer with tap changer, 3


windings

LinSer

Linear series transformer with ground


connection

Lin2Mono

Linear transformer, 2 windings, singlephase

Sat2Mono

Saturable transformer, 2 windings, single-phase

Sat3Mono

Saturable transformer, 3 windings, single-phase

Zig-Zag

Zig-zag transformer

CVT

Voltage measuring transformer with


capacitive coupling

CT

Current measuring transformer

PT

Voltage measuring transformer with magnetic coupling

2-1-155

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Figure 1 - 7 Network Loads and Motors

2-1-156

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Network Model

Threephase

Singlephase

Control
block
access

Simulink
Access

Loads and Motors (Figure1 - 7)


DynLd

Dynamic load

HarmLd

Programmable none linear load

DCMot

DC motor

ArcFurn

Arc furnace

IndMot

Three-phase induction motor

2-1-157

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Figure 1 - 8 Controllers and Switches

2-1-158

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Network Model

Threephase

Singlephase

Control
block
access

Simulink
Access

SVC and HVDC Controllers (Figure1 - 8)


Inv_12

Inverter 12-pulse DC controller

Rect_12

Rectifier 12-pulse controller

Inv_6

Inverter 6-pulse DC controller

Rec_6

Rectifier 6-pulse DC controller

SVC

SVC controller

TSC

TSC branch

TCR

TCR branch

1 Electronic Switch and Bridge


Bridge

Diode bridge

Switch
SwitchMono

Electronic switch (2 items)

BrShunt/
BrShMulti

Ground fault breaker (2 items) / 3 fault


breaker

BrSerial/
BrSrMulti

Series fault breaker (2 items)

BrShMono

Monophase fault breaker

BrSerMono

Monophase shunt breaker

2-1-159

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Figure 1 - 9 Miscellaneous Network Elements

2-1-160

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

Network Model

Threephase

Singlephase

Control
block
access

Simulink
Access

Miscellaneous Network Elements (Figure1 - 9)


Mes_Freq

Frequency measuring unit

Digital_out

Digital output

ConfSw

Disconnecting element switch

A/D

Analog input acquisition element

D/D

Digital input acquisition element

MesI

Current measuring unit

MesV

Voltage measuring unit

MesI3

Current measuring unit

MesV3

Voltage measuring unit

2-1-161

Hypersim Network Models

List of Single-Phase and Three-Phase


Models

PAGE LEFT INTENTIONALLY BLANK

2-1-162


Chapter 2
SI OR PU SYSTEM UNITS

2.1 GENERAL
HYPERSIM offers to the users two choices of systems units when inputting parameters. In
fact, it is often useful to enter parameters in the International System of Units (SI) or in Per
Unit (pu) units (See Section 2.3). In addition, some models allow to use parameters in active
and reactive power units (PQ).
The user can choose the system that suits him best from the control panel. The choice is done
from the three Units boxes in the panel: SI, pu or PQ.
Note : Remember that only the passive elements like the RLC, the lines or the transformers
offer the choice of different unit systems.
The three unit choices are:
SI: Input of parameters in International System of Units format (volt, ampere, watt,
ohm, henry, farad);
pu: Input of parameters in pu format; the choice of a reference base voltage, power and
frequency is mandatory;
PQ: Input of parameters in active and reactive power format; the choice of a reference
base voltage is mandatory.
Note : In the transformer model, the base voltage will be determined upon the windings
(primary or secondary).
In addition, neutral impedance of the transformer, since it is not referenced to a
winding, can be specified in SI or amperes, using the symbol A.

2.2 EXAMPLES
As an example, the RLC type load control panel offers three choices. See Figures 2 - 1 to 2 - 3.
With the SI system, the user must provide RLC values in ohms, henry and farad.
The same load can be set in pu, where all the R, L and C values are in pu with reference to
the Base Volt, to the Base MVA, and to the Base frequency.
Finally, it is possible to set that network load value in active (P) and in reactive (Q) power
units. User input MW and MVARS for each R, L and C elements.
Therefore, with the true reference bases of voltage and power, Hypersim will model accurately the various elements with the unit system chosen.

2-2-163

SI or pu system units
Examples

Figure 2 - 1 SI units option

Figure 2 - 2 pu units option


(EQ 1)
3 2

R Base ( per

phase )

2
( 100e )
V
= ---------------------------------------= ---------------------- = 100
6
P Base ( per phase )
100e

(EQ 2)
R = 0 01 = 0 0001pu

(EQ 3)
L Base

per phase

R base ( per phase )


= ----------------------------------------- = 0 265259H
2f ( per phase )
0 1H 0 37699pu

2-2-164

SI or pu system units

Examples

(EQ 4)
C Base

per phase

1
= -------------------------------------------------- = 2 6252 e 5F
R base ( per phase )x 2f
7

1e F = 3 7699e

Figure 2 - 3 PQ units option


(EQ 5)
3 2

R Base ( per

phase )

2
( 100e )
V
= ---------------------------------------= ---------------------- = 100
6
P Base ( per phase )
100e

.1H
37.7

.01

-7F

V
-------------------------------------------------------------- = I = 3 775437A
2
2
0 01 ( 2L 2C ) + R

26.4873e3

1e
26.525

(EQ 6)
2

( 2L 2C ) + R = 26 4873e

(EQ 7)
100kV
( p t ) = 3 775437A
------------------------------3
26 487e

2-2-165

SI or pu system units
P.U. Definition

(EQ 8)
P = ( R ou Z ) I

(EQ 9)
2

7MW
0 01 ( 3 775437A )
P MW = -------------------------------------------------------- = 1 4253e
1e6

(EQ 10)
2

37 7 ( 3 775437A )
P ZL = ------------------------------------------------------------- = 0 0005373MVAR
1e6

(EQ 11)
2

26525 ( 3 775437A )
P ZC = --------------------------------------------------------------- = 0 37806MVAR
1e6

2.3 P.U. DEFINITION


P.U.
Per Unit Quantity
Power transmission lines are operated at voltage levels where the kilovolt is the most convenient unit to express voltage. Because of the large amount of power transmitted, kilowatts or
megawatts and kilovolt amperes or mag a volt amperes are the common terms. However,
these quantities as well as amperes and ohms are often expressed as percent per unit of a base
of reference value specified for each. For instance, if a base voltage of 120 kV is chosen, voltage of 108, 120 and 126 kV become 0.90, 1.00 and 1.05 per unit or 90, 100, and 105% respectively. The per unit value of any quantity is defined as the ratio of the quantity to its base
value expressed as a decimal. The quantity in percent is 100 times the value in per unit. Both
the percent and the per unit methods of calculation are simpler than the use of the actual, amperes, ohms, and volts. The per-unit method has an advantage over the percent method because the product of two quantities is expressed in per unit itself, but the product of two
quantities expressed in percent must be divided by 100 to obtain the result in percent.
Voltage, current, kilo-volt-amperes, and impedance are so related that selection of base values for any two of them determines the base values of the remaining two. If we specified the
base values of the current and voltage, base impedance and base kilo-volt-amperes can be determined.
The base impedance is that impedance which will have a voltage drop across it equal to the
base voltage when the current flowing in the impedance is equal to the base value of the current. The base kilo-volt-ampere in single phase systems is the product of base voltage in kilovolts and base current in amperes. Usually base mega-volt-amperes and base voltage in
kilovolts are the quantities selected to specify the base. For single-phase systems or threephase systems where the term current refers to line current, where the term voltage refers to
voltage to neutral, and where the term kilo-volt-amperes refers to kilo-volt-ampere per phase,
the following formulas relate the various quantities:

2-2-166

SI or pu system units

P.U. Definition

1 - Base current A =

base, kVA, (per phase)


base voltage, kV LN

2 - Base Impedance =

base voltage, VLN


base current, A

3 - Base impedance =

(base voltage kVLN)2 X 1000


base kVA 1

4 - Base impedance =

(base voltage kVLN)2


base MVA 1

5 - Base power kW 1 =

base kVA 1

6 - Base power mW 1 = base mVA 1

7 - Per unit impedance actual impedance


of a circuit element = base impedance

2-2-167

SI or pu system units
P.U. Definition

PAGE LEFT INTENTIONALLY BLANK

2-2-168


Chapter 3
SYSTEM TOOLS

3.1 POW SYNCHRONIZATION


A

Introduction

The POW unit synchronizes the data acquisition and the breaker operations. This unit uses
the phase A as a reference signal at the bus to which it is connected.
All the simulated networks must have a unique POW element. Since the synchronization signal is generated by the crossing of a voltage threshold, it is a good practice to connect the
POW element to a bus where no fault occurs.

B POW
Synchronization
Icon and Diagram

System Tools

POW Synchronization

pow

Properties:

2Data acquisition synchronization

2Timed operations synchronization (breaker, programmable


voltage sources etc.)

Features:
- Positive or negative reference
slope
Implementation:
Palette and icon representation

Figure 3 - 1 POW Synchronization Icon and Diagram


C Parameter
Description

Internal signal detection from a bus or from an external command (not from Hypersim);
Detection of an analog or digital signal;
Reference slope (positive or negative): The positive value specifies that the synchronization is done on the positive slope (rising part) of the reference signal. The negative
value specifies the negative slope (falling part) of the signal.

2-3-169

System Tools

POW Synchronization

Detection level: Value of the reference voltage at which the synchronization is triggered.
Reference phase selection when it reaches 0 (A, B or C);
SyncOut_POW signal length in time step multiple. Ex: If the time step = 1 and the
SyncOut_POW value is 10, the signal length is 10 times the time step.
Time_POW signal out unit in time step: second, minute, hour.
D List of Available
Signals

At acquisition, the following signals are made available by the sensors;


Time_Pow_label: Time elapsed since the beginning of the simulation;
SyncOut_Pow_label: Synchronization signal;
External analog input, signal float command (activated with external mode and analog).
External digital mode complete command signal (activated with external mode and digital).
Entry delay. Signal float. The value is sent directly to ScopeView to create an offset
between signals. Ex: To synchronize an acquisition with another acquisition system
where a delay between the system is required to obtain waveforms at the same time.

E POW

Figure 3 - 2 shows the control panel used to enter the POW synchronization parameters

Synchronization
Control Panel

Figure 3 - 2

POW Synchronization Control Panel

Figure 3 - 3 shows the synchronization trigger threshold when the slope of the POW unit and
the detection level parameters are respectively positive and 0.5 volt.

2-3-170

System Tools

POW Synchronization

KV
1.0

0.8

0.6

Positive

0.4

e
Negativ

Trigger threshold
0.5 volts level

02

0.0

-0.2

-0.4

-0.6

-0.8

-1.0
0.000

0.005

0.010

0.015

0.020

0.025

0.030

0.035

0.040

0.045

Figure 3 - 3 Synchronization with a 0.5 volts Trigger Threshold and a Positive Slope

2-3-171

System Tools

Single-phase, Three-phase and


Multiplex Buses

3.2 SINGLE-PHASE, THREE-PHASE AND MULTIPLEX BUSES


A Introduction

3.2.1

In Hypersim, three types of buses can be used to make network connections. These are threephase, single-phase and multiplex buses.

Three-Phase
Bus

A Description

The three-phase bus is an element used to interconnect three-phase elements in the Hypersim
network. During simulation, the three voltages of this bus can be acquired: Va, Vb and Vc.

B Three-Phase Bus
Icon and
Diagram
Three-Phase Bus

System Tools

Bus
3 ph
Properties:

2Interconnect three-phase elements

BaGD

Features:
- Used to interconnect threephase elements
- Access to the three voltages of
a bus
Implementation:
-

Figure 3 - 4 Three-Phase Bus Icon and Diagram


3.2.2

Single-Phase
Bus

A Description

The single-phase bus is an element used to interconnect single-phase elements in the Hypersim network (ex: DC side of an HVDC element, DC motor).
Also, used for the modellization of an unbalance circuit when creating a special transformer
arrangement model with the monophase transformer element.

2-3-172

System Tools

Single-phase, Three-phase and


Multiplex Buses
B Single-Phase
Icon and
Diagram
Single-Phase Bus

System Tools

Bus
Mono
Properties:

2Interconnect single-phase elements: HVDC, DC motor, etc.

DaGC

Features:
- Used to interconnect singlephase elements
- Access to the voltage of a bus
Implementation:
-

Figure 3 - 5 Single-Phase Bus Icon and Diagram


3.2.3

Multiplex Bus

A Description

The multiplex bus is an element allowing to retrieve the three voltages of the bus and to establish single-phase connection points (A, B, C). This allows to establish a single-phase network connected to a three-phase bus.

2-3-173

System Tools

Simulink Block, User-Coded Block

B Multiplex Bus
Icon and
Diagram
Multiplex Bus

System Tools

Bus
Mpx

Properties:

2Allows to connect a singlephase network to a three-phase


bus

Features:
- Used to retrieve the three voltages of a bus
- Establishes a, b and c singlephase connection points
Implementation:
-

Figure 3 - 6 Multiplex Bus Icon and Diagram

3.3 SIMULINK BLOCK, USER-CODED BLOCK


Refer to Part 4, Chapters 1 to 4 for the following elements: Simulink Block, User-Coded
Block, Super-Block and Super-Model.

3.4 SUPER-BLOCK AND SUPER-MODEL


Refer to Part 4, Chapters 1 to 4 for the following elements: Simulink Block, User-Coded
Block, Super-Block and Super-Model.

2-3-174


Chapter 4
CURRENT AND VOLTAGE SOURCES

4.1 CURRENT AND VOLTAGE SOURCES


A Introduction

The current and voltage sources represent a single or three-phase AC voltage source with a
series or parallel RLC impedance.The value of at least one of the R, L and C elements must
not be zero.

B Icons and
Diagrams of
Current and
Voltage Sources

Current and Voltage Sources

Current and Voltage Sources

Voltage
Properties:

2Represent single or three-phase


A.C. current or voltage sources
with a series or parallel RLC
impedance

Current
Features:
- The voltage source always has
a series connected impedance
- The current source always has
a parallel connected impedance
Implementation:
-

Figure 4 - 1 Icons and Diagrams of Current and Voltage Sources


C Sources
Implementation

In the network, the current and voltage sources are implemented as follows:

2-4-175

Current and Voltage Sources


Current and Voltage Sources

The voltage source always has a series impedance. This impedance consists of series or parallel connected R, L, C elements The current source always has a parallel impedance. This
impedance is made up of series or parallel connected R, L, C elements.
The voltage source has only one network connector as it is always referenced to the ground.
The current source injects a current from one bus to another, without any grounding.

Voltage source behind


a series impedance

Current source behind


a parallel impedance

Figure 4 - 2 Sources Implementation


D Parameter
Description
E General
Parameters

Figures 4 - 3 and 4 - 4 illustrate respectively the control panel of a voltage source and of a
current source. Most of the fields and controls are the same for both control panels.
RLC Connection = Series (series R, L, C) or parallel (parallel R, L, C) see Figure 4 - 2;
SI or pu units:
SI: Specifies the values of the RLC elements, voltage, current or frequency in international units (ohm, henry, farad, volt, ampere and hertz);
pu: Specifies the values of the RLC elements, voltage, current or frequency in pu;

Base values for conversion in pu:


Base MVA: Base power per phase in MVA;
Base volt: Base voltage phase to ground in kilovolt;
Base Freq: Base frequency in hertz;

R: Resistance value in ohms (or pu) for each phase (in order: a b c);
L: Inductance value in henry (or pu) for each phase (in order: a b c);
C: Capacitor value in farad (or pu) for each phase (in order: a b c);
Frequency: Source frequency in hertz (or pu);
Module: Peak value of the amplitude for the source voltage or current in volts (or pu) or
amperes (or pu) for each phase;
Note : For pu, you have to enter 1.4142 pu
2-4-176

Current and Voltage Sources

Current and Voltage Sources

Angle: Angle of each phase in degrees. The value of the angles can be modified either
by directly entering the numerical values in the appropriate fields or by adjusting the
hands on the dial.
The input of the angle varies as a function of the sequence selected in the Source control
section.
Note : The current source is always in positive sequence and, hence, it does not have a sequence selection button.
Here is how to input each phase sequence.
Direct or Inverse (positive or negative): In this mode, a constant differential of 120 de-

grees is maintained between the phases when the phase angle is changed by entering the value
in the field or by adjusting the appropriate hand on the dial. All the fields are reset and all the
hands are repositioned to maintain this 120 degrees differential.
The only difference between the positive and negative sequences is that in the latter, the signs
for phases b and c are inverted.
Zero (homopolar): Here, a, b and c are in phase. Their differential is zero. When a field is

modified or a dial handle is set, the other two phases automatically take the same value and
the same position.
Per phase. The Per phase mode allows to define the same angle for the phases selected us-

ing a checkmark. The other phases are not involved.


If many phases are selected, modifying a field or setting a dial handle for one phase automatically brings the other phases to the same value and position.
F Source Control

Source (Active/Inactive): To activate or deactivate the source.


Starting mode (Slow/Fast): If Fast, the source is immediately activated or disactivated. Figure 4 - 5 (a) shows what happens when the source is activated in Fast mode. If
Slow, when the source is activated, the amplitude of the source increases linearly
from zero to the steady-state value. When the source is deactivate, the amplitude of the
source decreases linearly from the steady-state value to zero. Figure 4 - 5 (b) shows the
behaviour of the source when it is activated in Slow mode.
Sequence (voltage source only: Direct/Inverse/Zero/Per phase): Allows to set the
phases of the three-phase source as a sequence. The positive sequence sets the angles of
phases a, b, c at 0, -120, 120 degrees. The Inverse sequence sets the angles of phases a,
b, c at 0, 120, -120 degrees.The Zero sequence sets the angles of phases a, b, c at 0, 0, 0
degrees (See preceding paragraphs on angle input).

G Control System

(Waveform Generation)
Origin: Origin of the signal for the voltage source: Internal, External and
Simulink for a Simulink model.
Note : Please note that most source controls (amplitude, angle, etc.) are inoperative in external mode or Simulink mode. Refer to 1, Chapter 1, on page 567 concerning the
Simulink models for their use with Hypersim.

2-4-177

Current and Voltage Sources


Current and Voltage Sources

Simulink:
Model name: Name of Simulink model implementing the wave generator;
Model directory path: The full directory path where the model is saved;
Execution time: Model estimated or measured execution time of the Simulink model.
H Load Flow
Parameters

(Voltage Source Only)


These parameters can be used for the steady-state solution of the network.

Figure 4 - 3 Voltage Source Control Panel

2-4-178

Current and Voltage Sources

Current and Voltage Sources

Figure 4 - 4 Current Source Control Panel

2-4-179

Current and Voltage Sources

Programmable Variable Sources

Figure 4 - 5 Activation of voltage source (a): Fast, mode (b): Slow mode
I List of Available
Signals

At acquisition, the following signals are made available by the sensors:


I (a, b, c)_label: Source current (A);
VINT(a, b, c)_label: Source voltage (V). (voltage source only) (before the impedance);
P_label: Active power (voltage source only) (instantaneous);
Q_label: Reactive power (voltage source only) (instantaneous).

4.2 PROGRAMMABLE VARIABLE SOURCES


A Introduction

Programmable variable sources (PVS) allow the user to set his own times and durations in
some models.
There are two types of PVS: a variable voltage source and a variable current source. As with
the other sources discussed previously, the voltage source has a series connected RLC impedance and the current source a parallel connected RLC impedance.
The RLC impedance elements can be connected either in series or parallel, and at least one
of the RLC values must not be null.
Figure 4 - 6 shows the icons and the diagrams used to represent the programmable variable
voltage sources and the programmable variable current sources.

2-4-180

Current and Voltage Sources

Programmable Variable Sources

B Icons and
Diagrams of
Programmable
Variable Sources

Current and Voltage Source

Programmable Variable Sources

Voltage

Current

Properties:

2Represent programmable current or voltage sources

Features:
- The voltage source always has
a series connected impedance
- The current source always has
a parallel connected impedance.
Implementation:

Figure 4 - 6 Icons and Diagrams of Programmable Variable Sources


C Parameter
Description

The control panels for the parameters of both sources each have three pages. The first pages
of both versions have slight differences. Pages 2 and 3 are identical in both versions. Hence,
only the control panel of the voltage source will be shown. Figure 4 - 7 shows the first page
of the control panel for a programmable voltage source. This page contains the definitions of
the general parameters. The load flow parameters, the SI and PU buttons and the base values
(voltage, power and frequency) are not present in the current source control panel.

D General
Parameters

(Control Panel - Page 1)


The general parameters define the steady state of the sources. This is the initial state before a
variation sequence and the state found after the sequence.
RLC connection = Series (series R, L, C) or parallel (parallel R, L, C);
SI or pu units (voltage source only):
SI: Specifies the values of the RLC elements, the voltage and the frequency in international units (Ohm, Henry, Farad, Volt and Hertz);
pu: Specifies the values of the RLC elements, the voltage and the frequency in pu
(per unit);

Base values (voltage source only):


Base MVA: Base power per phase in MVA;

2-4-181

Current and Voltage Sources

Programmable Variable Sources

Base Volt: Base voltage phase to ground in kilovolt;


Base Freq: Base frequency in hertz;
R: Resistance value in ohms (or pu) for each phase (in order: a b c);
L: Inductance value in henry (or pu) for each phase (in order: a b c);
C: Capacitor value in farad (or pu) for each phase (in order: a b c);
Frequency: Source frequency in hertz (or pu);
Module: Peak value of the amplitude for the source voltage or current in volts (or pu) or
amperes (or pu) for each phase you have to specify 1.4142 pu;
Angle: Angle of each phase in degrees. The value of the angles can be modified either
by directly entering the numerical values in the appropriate fields or by adjusting the
hands on the dial. The input of the angle varies as a function of the sequence selected in
the Source Control section.
Note : The current source is always in positive sequence and, hence, it does not have a sequence selection button.
Here is how to input each sequence.
Direct or Inverse (positive or negative): In this mode, a constant differential of 120 de-

grees is maintained between the phases when the phase angle is changed by entering the value
in the field or by adjusting the appropriate hand on the dial. All the fields are reset and all the
hands are repositioned to maintain this 120 degrees differential.
The only difference between the positive and negative sequences is that in the latter, the signs
for phases b and c are inverted.
Zero (homopolar): Here, a, b and c are in phase. Their differential is zero. When a field is
modified or a dial handle is set, the other two phases automatically take the same value and
the same position
Per phase. The Per phase mode allows to define the same angle for the phases selected us-

ing a checkmark. The other phases are not involved. If many phases are selected, modifying
a field or setting a dial handle for one phase automatically brings the other phases to the same
value and position.
Sequence (Direct/Inverse/Zero/Per phase): Allows to set the phases of the three-phase
source in a sequence. The positive sequence sets the angles of phases a, b, c at 0, -120,
120 degrees. The negative sequence sets the angles of phases a, b, c at 0, 120, -120
degrees.The zero sequence sets the angles of phases a, b, c at 0, 0, 0 degrees (See preceding paragraphs on the angle input).
DC offset: direct current superimposed on the source signal.
E Source Control

(Control Panel - General)


Source (Active/Inactive): To activate or deactivate the source;
Starting mode (Slow/ Fast):

2-4-182

Current and Voltage Sources

Programmable Variable Sources

If Fast, the source is immediately activated or deactivate. Figure 4 - 5 (a) shows


what happens when the source is activated in normal mode.
If Slow, when the source is activated, the amplitude of the source increases linearly from zero to the steady-state value. When the source is deactivated, the amplitude of the source decreases linearly from the steady-state value to zero. Figure 4 - 5
(b) shows the behaviour of the source when it is activated in slow mode.

Figure 4 - 7 Control Panel of a Programmable Voltage Source (General)


Synchronization (None/Internal): The synchronization of a source means that a programmed sequence of events will start with the rising front of a synchronizing signal.
The synchronization is linked with the start of programming (Start/Stop) and the repetitive mode. The operations must be initiated in ScopeView (see Figure 4 - 8) for the synchronization signals to take effect. See the paragraph on the repetitive mode (further
down) for a description of the synchronization effects.

2-4-183

Current and Voltage Sources

Programmable Variable Sources

At the time this manual was drawn up, the source could only be synchronized internally (POW)

. The option of synchronizing with an external signal is

planned (External).
Programming (Start/Stop): Allows or prohibits the starting of programmed sequences
of events. The effect depends on the synchronization and repetitive mode. See the paragraph on the repetitive mode for a description of the Start effects.
Repetitive (Enable/Disable): The repetitive mode allows to repeat indefinitely a programmed sequence of events:
Disable: The repetitive mode is not selected and the sequence of events will be
executed only once according to the following conditions (Start button must be
pressed):
Operations
(ScopeView)a
Operation
sequence OFF
Operation
sequence ON

Synchronization OFF

Synchronization ON

Manual mode: The sequence is


initiated as soon as the Start
button is pressed and is executed only once. To restart,
press Stop, followed by
Start.

The sequence is never initiated.


The sequence is initiated with
the rising front of the synchronization signals (the Start button must be pressed) and is
executed only once. A synchronizing signal is required to
repeat.

a. In this table, the modes No switching/Switching and the modes Asynchronized/Synchronized come from the ScopeView Acquisition parameters.

2-4-184

Current and Voltage Sources

Programmable Variable Sources

Enable, the programmed sequence of events will be repeated indefinitely according to the following conditions:
Operations
(ScopeView)
Operation
sequence OFF
Operation
sequence ON

Synchronization OFF

Synchronization ON

Manual Mode: the sequence is


initiated as soon as the Start
button is pressed and is executed until the Stop button is
pressed. To restart, press
Start.

The sequence is never initiated.


The sequence is initiated with
the rising front of the synchronization signal (the Start button must be pressed) and is
executed indefinitely thereafter, until the Stop button is
pressed. The subsequent synchronizing signals are ignored.
To reactivate, press Start
again.

Programming status (Enable/Disable): If Enable, the programmed sequence of


events will be displayed in the windows where Hypersim was launched.

Synchronization and
Operation sequence are ON when
ticked 3.
(From ScopeView Main Window)

Figure 4 - 8 ScopeView Acquisition Parameters

2-4-185

Current and Voltage Sources

Programmable Variable Sources

F Load Flow
Parameters

(Voltage Source Only)

G Timed Variation
Programming

(Control Panel - Timed variation)


Timed variations allow to program sequences of events affecting the steady state of the
source, as defined by the settings for the amplitude, phase, frequency and DC component on
page General of the control panel.
It is possible to vary the amplitude, phase angle, frequency and D.C. component of the source.
These variations can be in modulation form (sinusoidal or random), step, ramp or staircase.
It is possible to execute some variations simultaneously. For example, the amplitude and frequency of a source can be made to vary in the same period of time. It is also possible to apply
simultaneously a modulation and a ramp.
The activation of the variations is controlled by the Enable/Disable buttons on page Timed
variation (top part) of the control panel. Enable allows the execution of the variations,
while Disable prohibits the application of the variations, but the programming values are
saved.

H Modulations

2-4-186

Modulation induces a sine or random variation of the selected parameter. Sinusoidal modulation can be applied to the amplitude, the frequency or the phase angle of a source, but for
only one of these parameters at a time. Random modulation only applies to the amplitude of
the source. It is possible to program other events, such as steps or ramps during a source modulation.

Current and Voltage Sources

Programmable Variable Sources

Figure 4 - 9 Control Panel of a Programmable Voltage Source (Timed variation)


The random modulation periodically adds or subtracts a constant value to the value to be
modulated. The choice of adding or subtracting is random and the probability of each is 50%.
Modulation types: Allows to select the parameter to modulate:
None: No modulation (the parameters already entered are kept);
Amplitude: Sinusoidal modulation of the amplitude;
Frequency: Sinusoidal modulation of the frequency;
Phase: Sinusoidal modulation of the phase angle;
Random: Random modulation of the amplitude;
Parameters for the sinusoidal modulation:
Amplitude: Amplitude of the modulation sine;
Frequency: Frequency of the modulation sine;
Phase: Phase of the modulation sine;

2-4-187

Current and Voltage Sources

Programmable Variable Sources

Operation Timing: Start and end times of a modulation. The steady state applies
before and after the modulation period;
Parameters for the random amplitude modulation:
Amplitude: Value to add to or subtract from the quantity modulated;
Frequency and phase: Not used;
Operation Timing: Start (B) and end (E) times of the modulation and period (t) (multiple of) time step between successive calculations of the random signal. This period
(B/E/I) must be greater than the calculation step selected for simulation.

Example of amplitude modulation.


A

In the General control page (see Figure 4 - 7), enter the parameters as follow:
Module: 1 V peak
Angle: 0 deg.
DC offset: 0V
Frequency: 10Hz
Phase sequence: Zero
Source mode: active
Starting mode: Slow
Synchronization: Internal. (Only mode available for now)
Programming: Start
Repetitive: Disable
Note : This mode, when Enable, leaves the program variation running forever after the
first Synchronization signal received (from Scopeview). To stop it, you have to toggle the parameters Programming from Start to Stop.
Programming: Enable
Note : This parameter displays the timed programming in a table format in the Hypersim
terminal window.
In the Time variations page, enter parameters as follows:
Select the Amplitude modulation type button
Timed variations: Enable
Amplitude: 0.5 Volts (Amplitude of the modulation)
Frequency: 2 Hz (Frequency of the modulation)
Angle: 0.0 deg.

2-4-188

Current and Voltage Sources

Programmable Variable Sources

Operation timing: 0/2 s


B

Using Scopeview, look at the signals Vabc and Iabc at the source.
Use a Time length of 2.5 seconds and a sampling rate associated with the time step of the
simulation.

You will see an amplitude modulation of 0.5 V over a 1 V signal, at a rate of 2 Hz on an initial
frequency of 10 Hz, during a two-second time span.

0.5V

2Hz
2 seconds time span

Figure 4 - 10 Amplitude modulation results

Example of frequency modulation.


A

In the General Control page (see figure 4 - 7), enter the parameters as follows:
Module: 1 V peak
Angle: 0 deg.

2-4-189

Current and Voltage Sources

Programmable Variable Sources

DC offset: 0V
Frequency: 10Hz
Phase sequence: Zero
Source mode: active
Starting mode: Slow
Synchronization: Internal. (Only mode activated for now)
Programming: Start
Repetitive: Disable
Note : This mode, when Enable, leaves the program variation running forever after the
first Synchronization signal received (from Scopeview). To stop it, you have to toggle the parameters Programming from Start to Stop.
Programming: Enable
Note : This parameter displays the timed programming in a table format in the Hypersim
window.
In the Time variations page, enter parameters as follows:
Timed variations: Enable
Select the Frequency modulation type button
Amplitude: 10 Hz (Amplitude of the modulation + and )
Frequency: 1 Hz (Rate of the modulation)
Angle: 0.0 deg.
Operation timing: 0/2 s
B

Using Scopeview, look at the signals Vabc and Iabc of the source.
Use a Time length of 2.5 seconds and a sampling rate associated with the time step of the
simulation.
You will see a frequency modulation of 10 Hz over a 10 Hz signal (meaning a variation from
0 to 20 Hz), at a rate of 1 Hz, during a two-second time span.

2-4-190

Current and Voltage Sources

Programmable Variable Sources

1Hz

2 seconds time span

Figure 4 - 11 frequency modulation results


C Ramp/Step
Generation

Step or ramp variations can be programmed independently for each of the source parameters
(amplitude, phase, frequency, DC component). These variations can coincide with a modulation. Five buttons in the bottom section on Timed variation page of the control panel allow
to select the parameter to be changed. Each selection is independent and has its own list of
parameters on the right side. The operation in steady state precedes and follows each variation, unless an infinite variation (without any end time) was programmed, a case where the
final value of the variation is kept until the interruption of the variations. Here is the list of
types of variations shown in the control panel. (See Figure 4 - 12)
Types:

AC: for a variation of the peak amplitude of the source;


DC: for a variation of the DC component of the source;
Phase: for a variation of the phase angle of source;
Frequency: for a variation of the source frequency;
Sequence: to change a sequence.

2-4-191

Current and Voltage Sources

Programmable Variable Sources

Parameters: These parameters describe how the selected variables by typeset parameter

will change in time. For example, the A.C. amplitude, D.C. component and source phase variations are described in the following fields: Amplitude, Operation Timing and Phase.
Each of these fields is a list of specifications whose elements are separated by commas.
All the lists of a variation type must have the same number of elements. Moreover, each element of a list is linked with the elements in the same position of the other lists. The input format of the values in the lists is described below:
Amplitude: Specifies both the amplitude and the type of variation. Each element of the list

corresponds to a variation and consists of one to three numbers (initial value, final value and
increment), separated by /, following the variation type required. Here is the correspondence:
...B,...Initial value only: step variation
...B/E,...Initial value and final value: ramp
...B/E/I(,...Initial value, final value and increment: staircase.
Each element in the list must have a corresponding element in the Operation Timing and
Phase lists.
Operation timing: Specifies the start and end times to apply the variations. Each element

consists of two numbers separated by a/, depending on the case. The first (B) specifies the
start of the variation in seconds. The second (E) specifies the end of the variation in seconds.
Normally, both times must be entered and this is compulsory for ramps or staircases. It is
possible to specify only the start time (omit the /) for a step that keeps its value indefinitely.
Each element in the list must have a corresponding element in the Amplitude and Phase
lists.
Phase: Specifies to which source phases the variations must be applied. Each element in

the list designates a certain number of phases. These are simply the characters A, B and
C, juxtaposed, if one wants to apply the variation to phases A, B or C. To set only phase
A, the element in the list will be...,A,.... To set all the phases, the element will be...,ABC,...
Each element in the list must have a corresponding element in the Amplitude and Operation Timing lists.
Frequency: The value of the frequency is specified in the same way as the Amplitude.
However, the frequency variation always apply to all the phases of the source.
Sequence: List of types of sequences.

2-4-192

Current and Voltage Sources

Programmable Variable Sources

Example of Ramp and Step generation.


First example: The peak voltage in steady state of a source is 100 kV and the user wants to
increase it progressively to 125 kV over a period of 0.3 second after a delay of 0.1 second.
The delay is calculated from a starting point which depends on the synchronization mode of
the source (refer to paragraph paragraph F in Source Control). The variation applies to all
phases.
Click on the AC button to enter in the fields the following variation parameters:
Amplitude: 100000/125000
Operation timing: 0.1/0.3
Phase: ABC
Suppose that the user wants to change the base voltage source according to the following
model:
A ramp applied to the source amplitude with the following parameters:
Start time: 0.1 s
End time: 0.3 s
Initial amplitude: 0.0 s
Final amplitude: 600 000 volts
Another ramp applied to the source amplitude with the following parameters:
Start time: 0.35 s
End time: 0.45 s
Initial amplitude: 1 000 000 volts
For a DC components step with the following parameters:
Start time: 0.2 s
End time: 0.3 S
Amplitude: 200 000 volts
These events are programmed as follows (assuming that all the phases are active):
Click on AC and DC buttons and fill the fields with the corresponding parameters:
AC
Amplitude:
Operation timing:
Phase:

0.0/600000, 1000000/100
0.1/0.3,0.35/0.45
ABC

2-4-193

Current and Voltage Sources

Programmable Variable Sources

DC
Amplitude:
Operation timing:
Phase:

200000
0.2/0.3
ABC

Note : The values in the fields to program the wave amplitude (AC) were aligned vertically
to set apart both events occurring at times that do not coincide. Events affecting the
same object cannot coincide. However, two events affecting different parameters of
a source, such as the wave and DC components amplitude, can coincide without
any problem.
Figure 4 - 12 shows a section on the second page of the programmable voltage sources control
panel describing the preceding programming.
:

Figure 4 - 12 Example of Ramp/Step Generation Programming

2-4-194

Current and Voltage Sources

Programmable Variable Sources

Figure 4 - 13 Ramp/Step generation results


D Programming
Harmonics

(Control Panel - Harmonics)


This function allows to add harmonics to the waveform of the source. Programming harmonics consists in defining the harmonic content, specifying the times at which the harmonics
will be added and the general activation of the harmonics.
The fields of the parameters allowing to define the harmonic content are identified in the
General parameters section with the following labels (See figure 4 - 12):
Harmonic Numbers: This is the list of the numbers for the required harmonics.

The harmonics are numbered from 1 (the fundamental) to 50. It is not necessary to specify
the fundamental (1). The list consists of elements separated by commas. Each element can be
an integer or a compact notation B/E/I allowing to specify a succession of harmonics, starting with the first (B) to the last (E) with increments I. It is possible to repeat the same harmonic number.
Amplitude: The list of amplitudes relative to each harmonic.

2-4-195

Current and Voltage Sources

Programmable Variable Sources

The amplitude of each harmonic is relative to the fundamental (amplitude 1). It is specified
by a number Ar so that 0.0 < Ar <= 1.0. The list must contain the same number of elements
as the list of harmonic numbers. The elements are separated by commas and each can be a
number between 0.0 and 1.0 or the compact notation B/E/I allowing to specify a succession
of equidistant amplitudes.
Angle: List of the phase angles for each harmonic.

Enter here the required phase angle displacement (outphasing) relative to the fundamental.
This outphasing must be specified in degrees. The list must contain the same number of elements as the list of harmonic numbers. The elements are separated by commas and each element can be an angle or the compact notation B/E/I allowing to specify a succession of
equidistant angles.
Sequence: List of specifications of the sequences (positive, negative, zero and per phase)

for each harmonic.


Each harmonic must be specified in positive, negative, zero sequence or per phase. The list
provides the sequence to use for each harmonic. It can be empty if all the harmonics are in
positive sequence (the most common case). If not, it must contain the same number of elements as in the list of harmonic numbers. The elements are separated by commas. Each element can be one of the following letters:
D

Harmonic is in positive sequence (0, -120, +120 degrees)

Harmonic is in negative sequence (0, +120, -120 degrees)

Harmonic is in zero sequence (0, 0, 0 degrees)

Harmonic applies only to some phases

Phase: List of phases to which apply the parameters per phase (list Sequence)

The Phase list must contain as many elements as there are parameters per phase (P) in
the Sequence list. It can be empty if there are no parameters per phase. The elements are
separated by commas. Each element can be formed by a concatenation of the letters A, B
and C corresponding to the selected phases. The case ABC is programmed more simply
by using the positive sequence (D).
The fields allowing to program the injection of harmonics are at the beginning of the page.
There are two such fields:
Operation timing: List of enable/disable times - activation/deactivation.

This is a list of the time values whose elements are separated by commas. Each element can
be a numerical value or a compact notation B/E/I for a series of equidistant values. The list
must contain at least one element in order to generate harmonics.

2-4-196

Current and Voltage Sources

Programmable Variable Sources

Operating activation: List of activations. This list specifies whether there is or not activa-

tion of harmonics. It is linked with the list of times and must contain the same number of elements. The elements are separated by commas. Each element can have the value 1 to
activate harmonics or 0 to deactivate. The minimum list must contain the value 1 in order
to generate harmonics. In this case, the generation of harmonics will begin at the time entered
in the Operation Timing list and will remain active until the events programming is stopped
by clicking the Stop button on the first page of the control panel.
The global activation of harmonic injection is done by clicking the Enable button on page
3. When Disable is selected, the source operates without harmonics. However, the programming of harmonics is saved and can be reactivated at any time.

Example of harmonic voltage source programming:


Synthesize an harmonic voltage source with the following parameters:
A

In the General Control page, enter the parameters as follows:


Module: 1 Vpeak
Angle: 0
DC offset: 0 V
Frequency: 10 Hz
Phase sequence: Zero
Source mode: active
Starting mode: slow
Synchronization: Internal.(Only mode activate for now)
Programming: Start
Repetitive: Disable
Note : This mode when Enable, leave the program variation running forever after the first
Synchronization trig received (from Scopeview). To stop it, you have to toggle the
parameters Programming from start to stop
Programming: Enable
Note : This parameters print the timed programming in a table format in the Hypersim
window.
In the Harmonics page, enter the following parameters:
Operation timing: 0.1, 1, 1.1, 2 sec
Operating activation: 1, 0, 1, 0
Harmonic number: 10

2-4-197

Current and Voltage Sources

Programmable Variable Sources

Amplitude: 0.25pu
Angle: 0
Sequence: D
B

Using Scopeview, look at the signals Vabc and Iabc of the source.
Use a Time length of 2.5 seconds and a sampling rate associated with the time step of the
simulation.

You will get a generation of 0.25 pu of the 10th harmonic in direct sequence overimpose with
the main signal of 10 Hz, and so between 0.1 and 1 second and also between 1.1 and 2 seconds.

Figure 4 - 14 Control Panel of the Programmable Voltage Source (Harmonics)


2-4-198

Current and Voltage Sources

Controlled Voltage and Current


Sources

D List of Available
Signals

At acquisition, the following signals are made available by the sensors:


I (a, b, c)_label: Source current (A).
VINT (a, b, c)_label: Voltage source (V).

4.3 CONTROLLED VOLTAGE AND CURRENT SOURCES


A Introduction

The controlled voltage and current sources represent a single or three-phase A.C. source with
a series or parallel RLC impedance. In the network, these sources only generate the signal
received on the control connectors. Hence, this process serves only to amplify or inject a signal in the network.

2-4-199

Current and Voltage Sources


Controlled Voltage and Current
Sources

The following icons and diagram are used to represent controlled sources.
Current and Voltage Controlled Sources

Current and Voltage controlled Sources

B Controlled
Sources Icons
and Diagrams

Properties:

2Single or three phase A.C.


sources with series or parallel
RLC impedance

Main features:
Amplify or inject a signal
in the network from control block world.
Implementation:
Voltage Sources has series
impedance only that can
be series or parallel RLC
elements;
Same for the Current
Sources;
Voltage Sources always
reference to the ground;
Current Sources injects current
between buses without grounding.

Figure 4 - 15 Icons and Diagrams Voltage and Current controlled Sources


C Sources
Implementation

The voltage and current sources are implemented in the network as follows:
The voltage source always has a series impedance. However, this impedance can be a collection of series or parallel RLC elements. The same applies to the current source, always having
a parallel RLC impedance, parallel or series type. The voltage source has only one network
connector, since is always referenced to the ground. The current source injects a current from
one bus to another, without grounding.
The single or three-phase signal applied to the control connectors as input will be the signal
sent to the network, single or three-phased.

2-4-200

Current and Voltage Sources

Controlled Voltage and Current


Sources

Controlled voltage source


behind a series impedance

Controlled current source


behind a parallel impedance

Series RLC connections

Parallel RLC connections


Figure 4 - 16 Controlled Voltage and Current Sources Implementation
D Parameter
Description
E General
Parameters

Figures 4 - 17 and 4 - 18 show respectively the control panels for voltage and current sources.
RLC connection = Series (series R, L, C) or parallel (parallel R, L, C);

R: Resistance value in ohms for each phase;

L: Inductance value in henry for each phase;


C: Capacitor value in farad for each phase;
F Control
Connector for
Controlled
Source

V input (voltage source): The voltage amplitude signal.


I input (current source): The current amplitude signal.
I output (voltage source): The current signal flowing from the source.

2-4-201

Current and Voltage Sources


Controlled Voltage and Current
Sources
.

Figure 4 - 17 Control Panel of a Controlled Voltage Source (3 phases)


.

Figure 4 - 18 Control Panel of a Controlled Current Source (3 phases)


G List of Available
Signals

At acquisition, the following signals are made available by the sensors:


I(a, b, c)_label: Current signal (current source) or measured current (voltage source)
(A).
V(a, b, c)_label: Source voltage (V). Voltage source only.

2-4-202


Chapter 5
SYNCHRONOUS TURBINE GENERATORS

5.1 INTRODUCTION
HYPERSIM provides three different models of synchronous turbine generators: a hydraulic
turbine generator, a tandem steam turbine generator and a cross-compound steam turbine
generator.
Each synchronous generator model is fully complete and functional by itself. Each model integrates various subsystem such as turbine, excitation system, stabilizer, shaft, etc. Any of
those built-in subsystem can be by-passed and replaced by a custom user-defined subsystem,
giving a great flexibility on the modelling aspect.
The icons and diagrams of the hydraulic and thermal turbine generator models are illustrated
respectively in Figure 5 - 1.
Only the modular model is provided for the thermal cross-compound turbine generator. However, this modularity is very limited because only the speed regulator can be modelled externally to the turbine generator block. The icon and diagram of the cross-compound turbine
generator are shown in Figure 5 - 1.

2-5-203

Synchronous Turbine Generators


Synchronous Generator Model
Overview

Turbines / Generators Groups

Turbines / Generators Groups

Properties:
7 Three models:
Hydraulic turbine/generator
Tandem steam turbine/generator
Cross-compound steam turbine/
generator

Main features:
The hydraulic and thermal models
each have two versions
Implementation:
Generic models
Modular model that can be modelled externally (except synchronous machine)

Figure 5 - 1 Icons and Diagrams of Turbine/Generator groups

5.2 SYNCHRONOUS GENERATOR MODEL OVERVIEW

Water

Stabilizer

Volt. Reg

Speed Reg

Exi
Gen

Figure 5 - 2 About Hydraulic turbine Generator

2-5-204

Synchronous Turbine Generators

Synchronous Generator Model


Overview

Speed Reg

Stabilizer

Volt. Reg

Reheater

to condenser...

Boiler

Exi

Gen

Heat
Boiler Reg

Figure 5 - 3 About Tandem Steam Turbine Generator

Speed Reg

Stabilizer

Volt. Reg

Boiler

Gen

Exi

Gen

Exi

Heat
Boiler Reg

Reheater

to condenser...
Stabilizer

Volt. Reg

Figure 5 - 4 About Cross-Compound Steam Turbine Generator


The following table described the available subsystem and how they are integrated in machine models. Some subsystem are common to all type of machine models, so they are described here as generic models.

2-5-205

Synchronous Turbine Generators


Common Generic Subsystem

Hydraulic
turbine
generator

Subsystem

CrossCompound
Steam Turbine
generator

Tandem Steam
turbine
generator

Synchronous Generator

Excitation system

Stabilizer

Boiler

Shaft

1 mass

10 masses

2x 5masses

Hydraulic Turbine

Tandem Steam Turbine

Cross-Compound Steam Turbine

Speed Regulator
& Governor
(Hydraulic turbine)

Speed Regulator
& Governor
(steam turbine)

Speed Regulator
& Governor
(cross-compound turbine)

As seen in the previous table, the synchronous alternator, the exciter and the stabilizer subsystem are the same for all three turbine generator models. These common generic subsystems are described first, followed by the features of each turbine generator group.

5.3 COMMON GENERIC SUBSYSTEM


5.4 GENERIC SYNCHRONOUS GENERATOR
5.4.1

Operation

The generic synchronous generator model implements the equations of the synchronous alternator in the Park axis (DQ), using Shutlz methods. Since two sets of equations are necessary for D and Q axis, Figure 5 - 5 and 5 - 6 illustrate those sets of equations.
In addition, Figure 5 - 7 presents voltage, power and electromagnetic torque calculations to
be used in the entire machine model.

2-5-206

Synchronous Turbine Generators


Generic Synchronous Generator

Xd - XI
Xd - XI

Efd
+

1
Tdo*s

Xd - Xd

1
1 + Tdo*s

Xd - XI

+ ge_phid
-

Vt
(Xd - Xd)(Xd - Xd)
(Xd - XI)2

Xd - Xext

Ifd

ge_XadIfd

Xd - XI

Xad*Ifdmax

SatOn
off

Xad*Ifdmin

ge_Ifd

1 / Xad

on

(Xd - Xd)(Xd - Xd)


(Xd - XI)2

(Xd - XI)(Xd - Xd)


(Xd - XI)

Id

Figure 5 - 5 Generator Block Diagram, D Axis

Xq - XI
Xq - XI
1

Tqo*s

1+

Xdq - Xq

1 + Tqo*s

Xq - XI

(Xq - XI)2
-

+ ge_phiq
-

Xq - Xext

(Xq - Xq)(Xq - Xq)

Iq

Xq - XI
(Xq - Xq)(Xq - Xq)

(Xq - XI)2
(Xq - XI)(Xq - Xq)
(Xq - XI)

Figure 5 - 6 Generator Block Diagram, Q Axis

2-5-207

Synchronous Turbine Generators


Generic Synchronous Generator

ge_phid
ge_phiq
Id
Iq

Internal Voltage behind impedance (Xext+Ra)


ge_phid*s
Ed = -------------------------- ge_phiq*w
omb
ge_phiq*s
Eq = -------------------------- + ge_phid*w
omb
The terminal voltage
Vt =

Vtd
Vtq

2
2
Vtd + Vtq

Voltage to be regulated by excitation


Edreg = Vtd + w*Xtfo*Iq - Rtfo*Id
Eqreg = Vtq - w*Xtfo*Id - Rtfo*Iq

Active and reactive electrical power output

Ed
Eq
Edreg
Eqreg
Pe
Qe
Te

Pe = Vtd*Id + Vtq*Iq
Qe = Vtq*Id - Vtd*Iq
Electromagnetic torque applied on rotor, on turbine base
Te = (ge_phid*Iq - ge_phiq*Id) *baseMVA/baseMW
Filtering of Power reference
Peo
Peof = -----------------------------1+TfilPeo*s
Voltage reference for excitation.
If "Voltage reference selection" is set to "Vref"
Vreff = Vref
If "Voltage reference selection" is set to "Vref=Vt"
Vreff = Vreff is calculated in order to have a
terminal voltage of Vref.
This calculation is done at code generation only,
and it is function of parameters
(Peo, Qeo, Vref, Saturation)

Figure 5 - 7 Generator Block Diagram, Various Machine Calculations


5.4.2

Programmable
General
Parameters

BaseMVA: Base nominal electrical power of generator (MVA);


BaseMW: Base nominal mechanical power of turbine (MW);
BaseVolt: Base nominal voltage (kV);
Omb: Base nominal angular frequency (elec. rad/s);
Vref: Voltage reference (pu);
W0: Frequency reference (pu);
Peo: Active power reference (MW);
Qeo: Reactive power reference (Mvar).
(Used only when Voltage Reference Selection is Vref=Vt).

2-5-208

Synchronous Turbine Generators


Generic Synchronous Generator

Voltage reference selection: Selection of reference signal for excitation.


(Hypersim can automatically calculate the value of Vref to supply to the excitation system in order to have a terminal voltage that correspond to the Vref parameter. See Figure 5.5 for more details).
TFilPeo: Power reference filter (s);
DYN key: Key to access Dynedit database.
The HYPERSIM Synchronous Machine control panel

Voltage Reference Selection


If Vref is selected (as above),
the reference signal to the excitation (Vref_sig)
is directly the Vref parameters available on the control
panel.(Although terminal voltage will be lower than Vref)
If Vref=Vt is selected,
the reference signal to the excitation (Vref_sig)
is calculated to have Vt at the machine terminal
that is equal to Vref specified on the control panel.
(Although this automatic calculation needs the
operation point of the machine, Peo and Qeo)

Graphically, we can explain as follow....


Vref
Vref_sig
Vref
Peo
Qeo

Automatic
calculation
of reference

Saturation

(signal reference to
excitation system)
Note: Automatic calculation is done
at code generation only.
Peo and Qeo must be supplied for an exact
calculation at this operating point.

Figure 5 - 8 Voltage Reference Section of Control Panel

2-5-209

Synchronous Turbine Generators


Generic Synchronous Generator

5.4.3

Load Flow

These parameters are provided by the steady-state solution of the network. They can be used
to initialize the machines.
Type: Type of bus (E = swing bus; G = generation bus);
Voltage: Load flow voltage (pu);
Angle: Load flow angle (Deg);
P: Active power (MW);
Q Min: Minimal reactive power (Mvar);
Q Max: Maximum reactive power (Mvar).

5.4.4

Programmable
Parameters

ge_Xtfo, ge_Rtfo: These parameters are null when the output voltage of the generator is
regulated; they represent the leakage reactance and the copper losses of the transformer
when the voltage on the high-voltage side of the step-up transformer is regulated.
ge_Xl: Armature leakage reactance (Xl) (pu);
ge_Ra: Armature resistance (Ra) (pu);
ge_Xd: Direct synchronous reactance (Xd) (pu);
ge_Xd1: Direct transient reactance (Xd') (pu);
ge_Xd2: Direct sub-transient reactance (Xd) (pu);
ge_Xq: Quadrature synchronous reactance (Xq) (pu);
ge_Xq1: Quadrature transient reactance (Xq') (pu);
ge_Xq2: Quadrature sub-transient reactance (Xq) (pu);
ge_Td01: Direct axis transient time constant (Tdo') (s);
ge_Td02: Direct axis sub-transient time constant (Tdo) (s);
ge_Tq01: Quadrature axis transient time constant (Tqo') (s);
ge_Tq02: Quadrature axis sub-transient time constant (Tqo) (s);
ge_Tdif: Differentiation time constant (default value = 0.0001s)
ge_SatOn: Saturation (1 = yes / 0 = no);
ge_Ifdmin: Lower limit of Ifd. To prevent Ifd from taking a negative value, set
ge_Ifdmin= 0 (pu);
ge_Ifdmax: Upper limit of Ifd (pu);
ge_eu, ge_el, ge_sgu, ge_sgl: Parameters used to generate saturation curve as follows:
See Figure 5 - 9 (pu).

2-5-210

Synchronous Turbine Generators

Generic Excitation system

The saturation is considered linear from


0 to 0.8 pu of Vt (terminal voltage).

Vt
EU
1.0
EL

If Vt < 0.8

I fd = V t

0.8

If Vt > 0.8

I fd = V t + e i

where:

e i = a ( e

Iag IL

IU

b ( V t 0, 8 )

1)

E L S GL
a = --------------------------------b ( E 0, 8 )
e L
1

Ifd

ln [ ( E U S GU + a ) ( E L S GL + a ) ]
b = --------------------------------------------------------------------------EU EL

(Field current, pu)

a and b are found with some iteration,


and are:

( I U I AG ) E U
S GU = ----------------------------------EU
( I L I AG ) E L
S GL = --------------------------------EL
Figure 5 - 9 Generator Saturation Curve
ge_Two: Frequency setting time (in seconds, typically = 4s);
ge_Ango: Initial angle of voltage behind ge_Xext;

5.5 GENERIC EXCITATION SYSTEM


5.5.1

Operation

The excitation system regulates the terminal voltage of the synchronous machine. It allows
to regulate the voltage at the terminals of the machine, or on the high-voltage side of the stepup transformer. This regulation is done by varying the field voltage Efd based on the difference between the desired user reference voltage Vref and the actual voltage ex_Vtreg. The
signal Vstab from the stabilizer can be added to this regulation loop.
The excitation system is composed of two systems, a voltage regulator and the exciter.
The field voltage Efd is limited between ex_Vrmin and ex_Vrmax, based on the voltage to
be regulated.

2-5-211

Synchronous Turbine Generators


Generic Excitation system

Vtmax
Kp
Vtmin

Vreff

ex_Vrmax

Edreg
Edreg2+Eqreg2

ex_Vtreg

1 + Tr*s

Exci_on

1
-

Eqreg

Ka
1 + Ta*s

Exci_mod

on

internal

off

external

Efd

ex_Vrmin
ex_Efdfix
Vstab

Kf*s
1 + Tf*s

Efd_i

Signal form a users defined excitation system.


Field voltage from the external model
must be supplied to inplut connector "Efd_i".

Figure 5 - 10 Generic Exciter Block Diagram


5.5.2

Programmable
Parameters

The parameters are shown in the block diagram of the excitation system (ex_Tr, ex_Ka,
ex_Ta, ex_Kf, ex_Tf, ex_Vtmax, ex_Vtmin, ex_Vrmin, ex_Vrmax, ex_Efdfix, Exci_on). In
addition, the excitation system can be off and set to a constant value. Moreover, the excitation
system can be modelized externally by a user-defined model, depending on the state of
exci_mod switch.
exci_on: Selection of excitation system operation. (On=Normal regulation; Off=constant excitation);
exci_mod: Selection of excitation system model. (Internal = actual model;
External = model supply by user);
ex_Tr: Voltage measurement time constant, (sec);
ex_Ka: Voltage regulator gain;
ex_Ta: Voltage regulator time constant (sec);
ex_Kf: Damping filter feedback gain;
ex_Tf: Damping filter feedback time constant (sec);
ex_Kp: Proportional gain on voltage limit;
ex_Vtmin: Minimum static limit on voltage measurement (pu);
ex_Vtmax: Maximum static limit on voltage measurement (pu);
ex_Vrmin: Minimum static limit of excitation voltage (pu);

2-5-212

Synchronous Turbine Generators

Generic Stabilizer

ex_Vrmax: Maximum static limit of excitation voltage;


The maximum limit applied to the regulator transfer function is always the minimal
value between the output of the Kp gain and the ex_Vrmax value.
ex_Efdfix: Constant excitation voltage. Used when Exci_on is off.

5.6 GENERIC STABILIZER


5.6.1

The stabilizer system is designed to damp most electromechanical oscillations. The stabilizer
output is supplied to the excitation system, so it has an effect on the field voltage during transients. The block diagram of the stabilizer is shown in Figure 5 - 11. The stabilizer inputs are
Pe or Pef (filtered electric power) and x (gate opening). For Hydraulic machine, the filtered
electrical power Pef is used, calculated in the speed regulator. For steam turbine machine, the
electrical power Pe is used with no filtering.

Operation

.
Pe or
Pef ***

Kap
1 + Tap*s

Kag

1-Tw1*s

1 + Tag*s

1 + Tw2*s

Vstab_i

Stab_on

Vsmax

s*(1 + T1*s)

1 + T3*s

Ks*T5

1 + T2*s

1 + T4*s

1 + T6*s

Signal form a users defined stabilizer.


Stabilizer signal from the external model
must be supplied to inplut connector "Vstab_i".

Vsmin

Stab_mod

on

internal

off

external

Vstab

0
*** For hydraulic model, the
filtered electrical power (Pef) is used by stabilizer
(see Speed regulator.)

Figure 5 - 11 Generic Stabilizer Block Diagram


5.6.2

Programmable
Parameters

The parameters are shown in the block diagram of the stabilizer diagram (st_Kag, st_Kap,
st_Tag, st_Tap, st_Ks, st_Tw1, st_Tw2, st_T1, st_T2, st_T3, st_T4, st_T5, st_T6, st_Vsmin,
st_Vsmax). In addition, the stabilizer can be off via parameter stab_on. Moreover, the stabilizer can be modelized externally by a user-defined model, depending on the state of
stab_mod switch.
Stab_on: Selection of stabilizer operation. (On=Normal operation; Off=no stabilizer);
Stab_mod: Selection of stabilizer model. (Internal: actual model; External: model supply by user);
st_Kag: Gain on gate opening;
st_Kap: Gain on electric power;
st_Tag: Time constant on gate opening (s);
st_Tap: Time constant on electric power (s);
st_Ks: Stabilizer gain;
st_Tw1: Stabilizer time constant (s);
2-5-213

Synchronous Turbine Generators


Hydraulic Turbine Generators

st_Tw2: Stabilizer time constant (s);

st_T1: Stabilizer time constant (s);

st_T2: Stabilizer time constant (s);


st_T3: Stabilizer time constant (s);
st_T4: Stabilizer time constant (s);
st_T5: Stabilizer time constant (s);
st_T6: Stabilizer time constant (s);
st_Vsmin: Minimum limit of stabilizer voltage (pu);
st_Vsmax: Maximum limit of stabilizer voltage (pu).

5.7 HYDRAULIC TURBINE GENERATORS


Table 51 : HYPERSIM QUICK REFERENCE

Hydraulic Turbine Generator

Hydraulic Turbine Generator

3
Hydro

Properties:
The:
Speed regulator;
Turbine;
Stabilizer;
Excitation.
can be modified.

HydCmd

Main features:
This machine includes:
A generic speed regulator
for hydraulic generating
plants;
A generic hydraulic turbine and;
A shaft model.
Implementation:
-

Figure 5 - 12 Icon and Diagram Hydraulic Turbine Generator


Figure 5 - 13 shows the schematic diagram of a hydraulic turbine generator. The shaded
blocks in Figure 5 - 14 can be modelled externally to the turbine generator block using the
CSI. A description of the speed regulator, the hydraulic turbine and a shaft model follows.

2-5-214

Synchronous Turbine Generators

Hydraulic Turbine Generators

Dam
Speed regulator

Reservoir

Generator
Control gate

Turbine

Figure 5 - 13 Schematic Diagram of a Hydraulic Turbine Generator

wo
Speed
Regulator

Peo

Hydraulic
Turbine

Pmec

Stabilizer

Shaft

Vstab
Pe

Vreff

Excitation
& voltage

Efd
Edreg, Eqreg

Park
Conversion

Ia
Ib
Ic

Te

Synchronous
Generator

Id, Iq

Va
Vb
Vc

Vtd, Vqt
Ed, Eq

Figure 5 - 14 General Diagram of a Hydraulic Turbine Generator

2-5-215

Synchronous Turbine Generators

Generic Speed Regulator for Hydraulic


Turbine Generators

5.8 GENERIC SPEED REGULATOR FOR HYDRAULIC TURBINE GENERATORS


5.8.1

The speed regulator, is responsible to produce the gate opening signal x depending on actual
electric power Pe and speed w. In fact, this type of regulator is a speed and power regulator,
because it achieves a specific characteristic of regulation, called permanent droop between Pe
and w. So, this regulator needs two different users reference, Peo and wo.

Operation

The regulation characteristic is illustrated in Figure 5 - 15 It represents a line with a slope re_sigma (permanent droop) on which the speed w is equal to the rated speed wo when the
electric power required is equal to the reference power Peof. So, if the machine delivers more
than its reference, the machines speed will tend to decrease, depending on the permanent
droop value.
The speed regulator has two different operating modes. The first operation mode, based on
electrical power regulation, is achieved when re_iop=1. In that mode, the regulator will adjust
x in order to have an electrical power output to be the same as the power reference (Peo).
The second speed regulator operation mode, based on gate opening regulation, will adjust the
gate opening to have mechanical power output be the same as the electrical power reference.
In that case, the friction losses (Tgo) are not considered in the regulation.
The block diagram of the power and speed regulator is illustrated in Figure 5 - 16.

w
-re_sigma
wo

Peof

The power and speed regulation


of hydraulic machine are based on this
permanent droop characteristics

re_Pe

Figure 5 - 15 Speed and Power Regulation Characteristic

2-5-216

Synchronous Turbine Generators

Generic Speed Regulator for Hydraulic


Turbine Generators

1 + Ta1*s
1 + Ta2*s

o
Pe

1
1 + Twatt*s

ge_mva
tb_mw

Operation mode
re_iop

Peof

ge_mva
tb_mw
-

sigma
1 + Tp*s

Servo-valve

vxmax

Kg(1 + T1*s)

1
s

Ts(1 + T2*s)

delta*Tt*s
1 + Tt*s

vxmin

xmin

Regvi_mod

Signal from a users defined speed regulator system.


Gate opening signal from the external model
must be supplied to inplut connector "x_i".

external

Regvi_mod
internal

Pef_i

internal

+
x_i

xmax

Signal from a users defined speed regulator system.


Filtered Electrical Power signal from the external model
must be supplied to inplut connector "Pef_i".

Pef

external

Figure 5 - 16 Speed and Power Regulator Block Diagram


5.8.2

Programmable
Parameters

Regvi_mod: Selection of speed regulator model. (Internal: actual model; External:


model supply by user);
re_Ta1: Time constant on speed measurements;
re_Ta2: Time constant on speed measurements;
re_Twatt: Time constant for power measurement;
re_iop: Regulation mode (1 = Electrical power; 0 = Gate opening);
re_sigma: Permanent droop;
re_delta: Transient droop;
re_Tp: Time constant for permanent droop;
re_Tt: Time constant for transient droop;
re_Kg: Regulator gain;
re_Ts: Time constant for servo-valve;
re_T1: Time constant for speed regulator;
re_T1: Time constant for speed regulator;
re_xmin: Lower limit of gate opening;
re_xmax: Upper limit of gate opening;

2-5-217

Synchronous Turbine Generators


Generic Hydraulic Turbine

re_vxmin: Lower limit of gate speed at closing, (negative value);


re_vxmax: Upper limit of gate speed at opening, (positive value).

5.9 GENERIC HYDRAULIC TURBINE


5.9.1

The actual model of hydraulic turbine also includes the shaft system, that is represented as
single mass.

Operation

The hydraulic turbine model is responsible to produce the mechanical power to be applied to
the shaft system. The shaft system then applies the swing equations, in order to produce the
speed of the machine.
The block diagram of the turbine model, including the shaft, is shown in Figure 5 - 17.

dw
Beta

penstock
x

q/x

Hydraulic turbine

Turb_on
q

-1

Peo

1.0

tb_gPm

Pm

on

Tw*s

off

BaseMW

Tm

Pm / w

Shaft_on
on
Tm

wo -1.0
wmax -1.0

Te

dw

1-mass shaft model

Tgo
w_i

1
2Hmec*s +Kd

off

Shaft_on
+

wmin -1.0
1.0

Turb_mod

on

internal

off

external

wo

Signal from a users defined turbine & shaft model.


Speed signal from the external model
must be supplied to inplut connector "w_i".

Note
**all signals are refered to pu on the turbine base (baseMW)
***The value Hmec is the inertia constant converted to turbine base.
Hmec = H * BaseMVA/BaseMW.
****tb_gpm is now obsolete, kept for compatibility.

Figure 5 - 17 Hydraulic Turbine Block Diagram


5.9.2

Programmable
Parameters

Turb_mod: Selection of turbine and shaft model. (Internal: actual model; External:
model supply by user)
Turb_on: Selection of turbine operation. (On=Normal operation; Off=constant power
equal to power reference Peo/baseMW)

2-5-218

Synchronous Turbine Generators

Generic Hydraulic Turbine

Shaft_on: Selection of shaft operation. (On=Normal operation; Off=constant speed


equal to speed reference wo)
tb_Beta: Effect of speed variation on the water height h;
tb_Tw: Water time response in penstock;
tb_H: Inertia constant (pu/MVA);
tb_Kd: The damping coefficient;
tb_Kdstart: Damping coefficient of turbine at start-up time. This value helps to reach
synchronism. (typically = 5);
tb_TStart: Duration of turbine start-up (in seconds, typically 5 s);
tb_wmax: Maximum limit of machines speed (pu);
tb_wmin: Minimum limit of machines speed (pu);
tb_Tg0: Torque representing total mechanical losses (pu/MW*s);
tb_gPm: Operation mode of machine (1 = turbine generator; 0 = synchronous compensator). Obsolete, please use Turb_on.
5.9.3

List of
Available
Signals

At acquisition, the following signals are made available by the sensors:


V_label_a, b, c: Three-phase voltage of power system (pu);
I_label_a, b, c: Three-phase current of generator (pu);
Id_label: Current of machine, D axis (pu);
Iq_label: Current of machine, Q axis (pu);
Ed_label: D axis voltage in front of Xext (pu);
Eq_label: Q axis voltage in front of Xext (pu);
Vt_label: Terminal voltage (pu);
Efdgen_label: Field voltage (pu), now obsolete, replaced by Efd_label;
Efd_label: Field voltage (pu);
Efd_i_label: Field voltage provided by an external module (pu);
Ifd_label: Field current (pu);
Vstab_label: Output voltage of stabilizer (pu);
w_label: Angular speed (pu);
w_i_label:Angular speed provided by an external module (pu);
Te_label: Electrical torque (pu/MW*s);
Te_i_label: Electrical torque (pu/MW*s) provided by an external module;
Tm_label: Mechanical torque (pu/MW*s);
Pe_label: Active power (pu/MVA);

2-5-219

Synchronous Turbine Generators


Generic Hydraulic Turbine

Qe_label: Reactive power (pu/MVA);


Pef_label: Filtered measured electrical power (pu/MVA);
Pef_i_label: Filtered measured electrical power (pu/MVA) provided by an external
module;
Pm_label: Turbine mechanical power (pu/MW);
x_label: Gate opening (pu);
x_i_label: Gate opening provided by an external module (pu).
5.9.4

Operating
Mode

Using hydraulic synchronous machine, various operating modes are available. These modes
are valid for both the hydraulic and thermal models, since they mainly concern the generic
parts (generator-excitation):
Generating Mode This is the most common mode. A positive mechanical torque is ap-

plied to the shaft of the machine, thereby inducing its rotation. This mechanical torque originates from a hydraulic or thermal turbine. The generator offers an equivalent electrical
torque, but of opposite sign, thereby providing electric power to the network. Any imbalance
between the electrical and mechanical couple translates into a speed variation of the turbine
generator. The excitation circuit is used to regulate the output voltage of the machine and the
speed regulator to control the water or steam input (thermal or hydraulic), thus ensuring a balance between the mechanical and the electrical couple.
Synchronous Compensator Mode Any turbine generator can be used in the synchro-

nous compensator mode by removing the turbine (hydraulic or thermal) and using the machine with no load. By adjusting the excitation circuit, it is possible to control the network
voltage, and to provide or absorb the required reactive power.
Synchronous Motor Mode The same machine can also be used as a motor, in other

words with a reverse mechanical couple, allowing, for example, to pump water upstream to
the dam.
Type 1 Machine Mode In some cases, stability programs require a Type 1" machine or a
constant voltage source behind an impedance, but with a frequency varying as a true machine.
Such a behaviour can also be emulated.

2-5-220

Synchronous Turbine Generators

Generic Hydraulic Turbine

5.9.5

Hydraulic
Turbine
Generator
Control Panel

Figure 5 - 18 shows the control panel of a hydraulic turbine generator.

Figure 5 - 18 Hydraulic Turbine Generator Control Panel (General)

2-5-221

Synchronous Turbine Generators


Generic Hydraulic Turbine

Figure 5 - 19 Hydraulic Turbine Generator Control Panel (Speed/Turbine)

2-5-222

Synchronous Turbine Generators

Generic Hydraulic Turbine

Figure 5 - 20 Hydraulic Turbine Generator Control Panel (Excitation/Stabilizer)

2-5-223

Synchronous Turbine Generators

Tandem Thermal Turbine Generators

5.10 TANDEM THERMAL TURBINE GENERATORS


Table 52 : HYPERSIM QUICK REFERENCE
Thermal Turbine Generator

CC

Thermal Turbine Generator

CrossCmpd

Properties:
The:
Speed regulator;
Turbine;
Stabilizer;
Excitation;
Boiler;
5-10 mass shaft.
can be modified.

T
Therm

10

ThermCmd

Main features:
This machine includes:
A low-pass filter for the
power reference Peo;
A block that automatically
calculates the voltage reference Vreff when the
parameter Vref_select=1;
A generic models of a
speed regulator for thermal
plants;
A multi-mass shaft;
A boiler and;
A steam turbine.
Implementation:
-

Figure 5 - 21 Icon and Diagram Thermal Turbine Generator


Figure 5 - 22 shows the schematic diagram of a thermal turbine generator (tandem-compound). The blocks described in Section 5.4, on page 206.The shaded blocks can be modelled
externally to the turbine generator block.

2-5-224

Synchronous Turbine Generators

Tandem Thermal Turbine Generators

Chimney
Superheater

Speed
regulator
Turbines

Boiler

Superheater
Control
valve

Generator

Gas

To the network

Condenser
Cooling water

Figure 5 - 22 Schematic Diagram of a Thermal Tandem Turbine Generator


.

Boiler
wo
Peo

Ia
Ib

psih
mhuh

Speed and
power
regulator

Ic
Thermal
turbine
Pe

Pmec

Park
ConversionP

5-10 mass
shaft

Stabilizer

Va

Vstab

Vb
Vc

Vreff

Excitation and
voltage
regulator

Efd

Eqreg

Synchromous
alternator

Edreg

Id, Iq

Ed, Eq

Figure 5 - 23 General Diagram of a Thermal Turbine Generator

2-5-225

Synchronous Turbine Generators


Generic Boiler

5.11 GENERIC BOILER


The boiler subsystem is responsible to generate the steam pressure used in steam turbines.
The actual boiler is used for both tandem and cross-compound machine.

5.11.1 Operation

The boiler block diagram is shown in Figure 5 - 24. The upper part of this figure presents the
boiler pressure regulator, as well as the lower part presents the boiler itself. The boiler input
is the high pressure steam flow mhuh and the output is the boiler pressure psih. As mentioned
earlier, the boiler subsystem includes a PI type pressure regulator that controls the steam pressure output. Since the boiler has slow dynamics with respect to the other model, this subsystem is often neglected and set as a constant pressure source.

press

Boiler pressure regulator

ki
s

bmax

t9s+1

kpc

(t9/10)*s+1

1
t8*s+1

td

mhub

0
k4

press ***
-

mhuh

boiler_on

k3
s

k2
Boiler model

boiler_mod
internal

on

psih

1
off

external

press

psih_i
Signal from a users defined boiler system.
Boiler pressure from the external system
must be supplied to inplut connector "psih_i".

*** With this initial value, the boiler is ready to


supply the pressure reference value (press).

Figure 5 - 24 Boiler Block Diagram


5.11.2 Programmable
Parameters

boiler_on: Selection of boiler operation. (On=Normal operation; Off=no boiler, constant pressure);
boiler_mod: Selection of boiler model. (Internal: actual model; External: model supply
by user);
ch_press: Boiler pressure output reference (pu);
ch_bmax: Upper limit of boiler pressure (pu);
ch_kpc: Proportional gain of boiler regulator (pu);
ch_ki: Integral gain of boiler regulator (pu);

2-5-226

Synchronous Turbine Generators

Speed Regulator for Tandem Thermal


Turbine Generators
ch_k2: Load loss coefficient (pu);
ch_k3: Heat capacity coefficient (pu);
ch_k4: High pressure effect (pu);
ch_t8: Boiler constant (s);
ch_t9: Boiler setting constant (s);
ch_td: Boiler delay setting (s).

5.12 SPEED REGULATOR FOR TANDEM THERMAL TURBINE GENERATORS


The speed regulator is responsible to produce the gate opening signal x, based on the measurement of speed w signal. The regulation characteristic is slightly different from the hydraulic model, since it does not depends on electric power Pe.

5.12.1 Operation

The block diagram of the speed regulator, including the servo-valve, is illustrated in Figure 5
- 25.

w
+
wo
-

1/r

Peof

db

Servo-valve

k1

mhuh

x_i

ahlim

pah1

1/BaseMW

1
t1*s+1

1
s

1
t2

- pah2

Regvi_mod
internal

external

k1 - 1

Signal form a users defined speed regulator system.


Gate opening signal from the external model
must be supplied to inplut connector "x_i".

*** The speed signal w is the generator speed.


It can be mass #1 or #2.
See shaft model for details.

Figure 5 - 25 Speed Regulator Block Diagram


5.12.2 Programmable
Parameters

Regvi_mod: Selection of speed regulator model. (Internal: actual model; External:


model supply by user)
tb_r: Permanent droop (pu);
tb_db: Dead band of speed regulator (pu);
tb_k1: Regulator gain (pu);
tb_t1: Time constant of speed relay (s);
tb_t2: Time constant os servo-valve (s).
2-5-227

Synchronous Turbine Generators


Tandem Steam Turbine

tb_pah1: Upper limit of valve speed at opening, (absolute value) (pu);


tb_pah2: Lower limit of valve speed at closing, (absolute value) (pu);
tb_ahlim: Upper limit of valve opening (pu);

5.13 TANDEM STEAM TURBINE


The steam turbine subsystem is responsible to produce the required mechanical torque. In this
typical configuration of turbines, 3 pressure stages are implemented. The name Tandem turbine comes form this installation, where the steam flow has to pass through different turbine
stages, all mounted on the same shaft. Between each turbine stage, various equipment, like
reheater or crossover, can be modelized via their response time constants.

5.13.1 Operation

As inputs, this subsystem receive the steam pressure psih and the gate opening x. As a result,
three mechanical torque th, ti, tl, are produced.
The physical modelling of the tandem steam turbine is presented in Figure 5 - 27. It describes
most common configuration of tandem steam turbine, with single reheat, double reheat, and
steam crossover.

Steam flow

Steam flow

2 turbine stages
single reheat
(fl=0; fh+fi=1.0)

3 turbine stages
single reheat
(sw1=0; fh+fi_fl=1.0)

Steam flow

3 turbine stages
double reheat
(sw1=1; fh+fi+fl=1.0)

Figure 5 - 26 Typical configuration of tandem steam turbine


On the modelling aspect, the block diagram of the steam turbine is shown in Figure 5 - 27,
describing the steam chest, the three turbine stages and the available reheaters. About parameter settings, it is important that the sum of power fraction factor, fh, fi, fl, must always be
equal to 1.0. Also, the parameter Tr1 and Tr2 can represents reheaters or crossover, depending of turbine configuration. Third, the parameter sw1 allow to by-pass the second reheater.

2-5-228

Synchronous Turbine Generators

Tandem Steam Turbine

Turbine
configuration
sw1=0

al

Reheater
x

psih

1 + T3*s

Steam chest

Fh

1+T4*s
1 + T5*s

1
Tr1*s

ai

1
Tr2*s

Turbine
configuration
sw1=1

al

Fi

High
pressure
turbine

1+T6*s
1 + T7*s

Fl

Intermediate
pressure
turbine

1+T11*s Low
1 + T12*s pressure
turbine

Turb_on
on
th_i
ti_i
tl_l

(Peo/baseMW)* Fh
(Peo/baseMW)* Fi
(Peo/baseMW)* Fl

off

Turb_mod
internal

th, ti, tl

external

Signal form a users defined turbine.


Turbine torque signal from the external model
must be supplied to inplut connector "th_i","ti_i","tl_i".

Turb_mod
internal

mhuh_i

Signal form a users defined turbine.


Turbine steam flow signal from the external model
must be supplied to inplut connector "mhuh_i".

mhuh

external

Figure 5 - 27 Steam Turbine Block Diagrams


5.13.2 Programmable
Parameters

tb_t3: Time constant of steam chest (s);


tb_Tr1: Time constant of reheater 1 (s);
tb_Tr2: Time constant of reheater 2 (s);
tb_fh: Fraction of mechanical power provided by HP turbine (pu);
tb_fi: Fraction of mechanical power provided by IP turbine (pu);
tb_fl: Fraction of mechanical power provided by LP turbine (pu);

2-5-229

Synchronous Turbine Generators


Generic Shaft

tb_t4: High pressure turbine time constant (s);


tb_t5: High pressure turbine time constant (s);
tb_t6: Intermediate pressure turbine time constant (s);
tb_t7: Intermediate pressure turbine time constant (s);
tb_t11: Low pressure turbine time constant (pu);
tb_t12: Low pressure turbine time constant (pu);
tb_ai: IP valve opening (pu);
tb_al: LP valve opening (pu);
tb_swl: By-pass of second reheater;
turb_on: Selection of turbine operation. (On=Normal operation; Off=no turbine, constant mechanical power equal to Peo);
turb_mod: Selection of turbine model. (Internal: actual model; External: model supply
by user).

5.14 GENERIC SHAFT


5.14.1 Operation

The shaft model offers a multi-mass implementation. Thus, it can be used to study sub-synchronous resonance phenomena. The objective of this model is to modelize the mechanical
distortion and oscillation occurring in the shaft. First, a shaft model receives as inputs the
three mechanical torque signal (th,ti,tl) coming from each steam turbine stage. As a results,
the shaft model produces speed signal for each individual masses in the system.
Such a shaft model is represented physically in Figure 5 - 28. It can be observed that the different stages of the turbines are located on the same shaft, thus explaining possible torsional
oscillations between different stages. The actual shaft model allows to represent the behaviour using 1, 5 or 10 masses.

2-5-230

Synchronous Turbine Generators

Generic Shaft

te tgo

th ti tl
Shaft
1-mass-model

Torque applied
on shaft

1
th

te tgo

tl

ti

Shaft
5-mass-model
5

th

3
tl

ti

te tgo

Shaft
10-mass-model
10 9

kij

Physical
hi
representation

di

dij

k23
h3

d23

Generator
mass (#1 or 2)

k12
h2

d3

Generator
mass (#1 or 2)

h1
d2

d12

d1

Figure 5 - 28 Representation of shaft model

2-5-231

Synchronous Turbine Generators


Generic Shaft

2 0

th

2 0

1 0

T12
T23

T34

ti

T23

+
T34
tl

h3
Tl 2d

T12
T23

h2
2d

T45

T12
2

h1

Generator

Te 1d 1
Tgo

Processing equations for 1, 5 or 10 masses...

d
( ) = ( )
j 0
dt j

w_i

w2
2

w3

2h d ( ) = Tm + ( Te ) + k ( ) k ( )
jdt
j
j
j
j ij j
i
jk k

dj ( j ) + djk ( k j ) dij ( j i )

w1

w4
w5

shaft_on

Signal from a users defined shaft system.


Generator speed signal from the external model
must be supplied to inplut connector "w_i".

shaft_mod

on

internal

off

external

*** The speed signal w is the generator speed.


It can be mass #1 or #2.
*** A friction torque Tgo is applied on generator.
***Each masses are submitted to a speed limiter,
using parameter wmin, wmax.

Figure 5 - 29 Implementation of shaft model


5.14.2 Programmable
Parameters

Shaft_on: Selection of shaft operation. (On=Normal operation; Off=constant speed


equal to reference speed wo);
Shaft_mod: Selection of shaft model. (Internal: actual model; External: model supply
by user);
Number of masses: Number of masses in shaft model, 1, 5 or 10 masses.
This value must be 1 if there is no need for detailed shaft modelling. In this case, all the
parameters (hi, di) must be concentrated in mass no 1.
If detailed shaft modelling is necessary, you may select 5 or 10 masses. By selecting
appropriate data for inertia and stiffness, it is possible to modelize any number of masses between 1 and 10. Using and infinite value for stiffness will result in grouping 2
masses together.
If a 5 masses model is selected, all parameter related to the 5 first masses must be established.
ar_d1Start: Value of ar_d1 during start-up time; This value helps to reach synchronism.
(typically = 10);
ar_tStart: Duration of startup time. (typically = 10s) (s);
ar_tg0: Mechanical friction losses, applied on generator mass (pu);

2-5-232

Synchronous Turbine Generators

Generic Shaft

ar_h1, ar_h2,...: Mass inertia in second, based on generator BaseMVA (pu);


ar_k12, ar_k23,...: Shaft stiffness coefficients in (pu/rad) based on turbine BaseMW
(pu);
ar_d1, ar_d2,...: Mass self-damping factors in (pu torque/pu speed) based on turbine
BaseMW; This parameter is also called steam damping, will help to damp torsional
oscillation. Typical value is 25% of inertia (pu).
ar_d12, ar_d23,...: Shaft mutual-damping factors in (pu torque/pu speed) based on turbine BaseMW; This parameter is also called steam damping, will help to damp torsional
oscillation. Typical value is 25% of inertia.
Generator mass: Selection of mass number that represents the generator. This mass will
receive the electrical torque signal.(Mass #1 or #2). Since the signal w is generator
speed, w is then speed of mass #1 or #2 depending on this parameter. (Typically, 2 configurations are possible; First: Mass #1 is generator, and mass #2 is a gearbox. Second:
Mass #1 is exciter, mass #2 is generator.
Low pressure turbine: Selection of mass number that represents the low pressure turbine. Those masses will receive the mechanical torque tl, spitted in 50-50% on two
masses.(Mass #3-4 or #4-5). Valid for 10-masses only.
Intermediate pressure turbine: Selection of mass number that represents the intermediate pressure turbine. Those masses will receive the mechanical torque ti, spitted in 5050% on two masses.(Mass #6-7 or #7-8). Valid for 10-masses only.
5.14.3 List of
Available
Signals

At acquisition, the following signals are made available by the sensors:


V_label_a,b,c: Voltages at the breaker terminals (V);
I_label_a,b,c: Currents from the generator (A);
Id_label: Machine current, D axis (pu);
Iq_label: Machine current, Q axis (pu);
Ed_label: Voltage behind inductance (pu);
Eq_label: External, direct axis and quadrature (pu);
Vt_label: Output voltage (pu);
Efdgen_label: Field voltage (pu);
Efd_i_label: Field voltage (pu) provided by an external module;
Ifd_label: Field current (pu);
Vstab_label: Stabilizer output signal (pu);
Vstab_i_label:Stabilizer output signal provided by an external module;
w_label: Angular speed (pu);
w_i_label: Angular speed (pu) provided by an external module;
Te_label: Electrical torque based on generator rating (pu / MW*s);

2-5-233

Synchronous Turbine Generators


Generic Shaft

Pe_label: Active power (pu / MVA);


Qe_label: Reactive power (pu / MVA);
Pef_label: Filtered electric power (pu / MVA);
psih_label: Steam pressure at high pressure stage (pu);
psih_i_label: Steam pressure at high pressure stage (pu) provided by an external module;
mhuh_label: Flow of high pressure steam (pu);
mhuh_i_label: Flow of high pressure steam (pu) provided by an external module;
Th_label: Mechanical torque of high pressure turbine (pu / MW*s);
Th_i_label: Mechanical torque of high pressure turbine (pu / MW*s) provided by an
external module;
Ti_label: Mechanical torque of intermediate pressure turbine (pu / MW*s);
Ti_i_label: Mechanical torque of intermediate pressure turbine (pu / MW*s) provided
by an external module;
Tl_label: Mechanical torque of low pressure turbine (pu / MW*s);
Tl_i_label: Mechanical torque of low pressure turbine (pu / MW*s) provided by an
external module;
x_label: valve opening (pu);
wxxx1.n_label: Angular speed of mass n (pu);
T12.nm_label: Mechanical torque applied by mass n to mass m (pu).

2-5-234

Synchronous Turbine Generators

Generic Shaft

5.14.4 Thermal
Turbine
Generator
Control Panel

Figure 5 - 30 shows the control panel of a thermal turbine generator.

Figure 5 - 30 Thermal Turbine Generator Control Panel (General)

2-5-235

Synchronous Turbine Generators


Generic Shaft

Figure 5 - 31 Thermal Turbine Generator Control Panel (Speed/Turbine)

2-5-236

Synchronous Turbine Generators

Generic Shaft

Figure 5 - 32 Thermal Turbine Generator Control Panel (Shaft/Boiler)

2-5-237

Synchronous Turbine Generators


Generic Shaft

Figure 5 - 33 Thermal Turbine Generator Control Panel (Excitation/Stabilizer)

2-5-238

Synchronous Turbine Generators

Cross-Compound Thermal TurbineGenerator

5.15 CROSS-COMPOUND THERMAL TURBINE-GENERATOR


5.15.1 Introduction

The cross-compound thermal turbine generator has two generating units (primary and secondary) and only one boiler. Many components of this model are similar to those of the ordinary thermal turbine generator. Only the turbines, the speed regulator and the shaft are
different. The list of parameters and available signals is the same for both generating units of
the cross-compound thermal plant. An _s suffix is added to the names of parameters and
available signals of the second generator.

5.15.2 CrossCompound
Thermal
Turbine
Generator
Model

Figure 5 - 35 shows the general diagram of a cross-compound thermal turbine generator. In


this model, only the speed regulator can be modelled externally with the control system interface (CSI).

Speed
gov.
Superheater

To Network
Gen Primary
group

Boiler
Condenser

Gen

Secondary
group

Figure 5 - 34 Schematic Diagram of a Cross-Compound Turbine Generator

2-5-239

Synchronous Turbine Generators


Speed Regulator

Ed,Eq

Vref

SECONDARY GROUP

Ed, Eq

Id,Iq

Wo
Peo

Park
Conversion

Pe

Edreg,Eqreg

Vref

Excitation
W

Synchronous
Alternator

Efd

Vstab

Stabilizer
Shaft

Tmec

mhuh

PRIMARY GROUP

Efd

Excitation

Vstab

Stabilizer
Cross-compound Turbine

psih

Boiler
X

Speed
and

Edreg,Eqreg

Alternator

Synchronous

Tmec

Shaft

Pe

Id,Iq

Park
Conversion

Ia
Ib
Ic

Va
Vb
Vc

Figure 5 - 35 General Diagram of a Cross-Compound Thermal Turbine Generator

5.16 SPEED REGULATOR


5.16.1 Operation

2-5-240

The block diagram of the speed regulator is shown in Figure 5 - 36. It is similar to the tandem
turbine generator, except that the latter regulates a signal originating from one of both generators.

Synchronous Turbine Generators

Steam Turbine

w_s
w

wsensor

1
twfils+1

1/r
wo

1/r

err2

+
db

+
Peof

k1
Servovalve with speed
limits -position.

1/BaseMW
+ err4

mhuh

k1 - 1

1
tsr*s+1

ahlim

pah1

1
s

1/ tcv
-

- pah2

Figure 5 - 36 Speed Regulator Block Diagram


5.16.2 Programmable
Parameters

Speed regulator: Selector for internal or external speed regulator;

tb_wsensor: Selection of the generator whose speed is to be regulated;


tb_wfil: Time constant of the speed sensor (s);
tb_r: Permanent droop (pu);
tb_db: Dead-band of regulator (pu);
tb_pah1: Valve speed (absolute) upper limit when opening (pu);
tb_pah2: Valve speed (absolute) upper limit when closing (pu);
tb_ahlim: Valve opening upper limit (pu);
tb_k1: Regulator gain (pu);
tb_tsr: Time constant of speed valve relay (s);
tb_tcv: Inverse of valve speed (speed = 1 / tb_tcv) (s).

5.17 STEAM TURBINE


5.17.1 Operation

Figure 5 - 37shows the block diagram of the steam turbine model.This diagram represents the
steam tank, the three stages of the turbine and the heaters.

2-5-241

Synchronous Turbine Generators


Steam Turbine

psih

mhuh

Tmec1

Tmec3

k1

k3

1
t1s+1

Tmec5

k5

k2

k4

Tmec2

Tmec4

k7

1
t4s+1

1
t3s+1

1
t2s+1

Tmec7

k6

Tmec6

k8

Tmec8

Figure 5 - 37 Steam Turbine Block Diagram


5.17.2 Programmable
Parameters

tb_t1: Turbine time constant (separator or superheater) (s);


tb_t2: Turbine time constant (separator or superheater) (s);
tb_t3: Turbine time constant (separator or superheater) (s);
tb_t4: Turbine time constant (separator or superheater) (s);
tb_k1,...,8: Mechanical power part provided by the turbine.

5.17.3 List of
Available
Signals

At acquisition, the following signals are made available by the sensors. Only signals from
subsystems common to both turbine generators and signals from the primary turbine generator are listed. The names of signals from the secondary turbine generator are obtained by adding a suffix _s to the names of signals from the primary turbine generator.
V_label_a,b,c: Voltages at the breaker terminals (V);
I_label_a,b,c: Currents from the generator (A);
Id_label: D axis generator current (pu);
Iq_label: Q axis generator current (pu);
Ed_label: Voltage behind inductance (pu);
Eq_label: External, D and Q axes (pu);
Vt_label: Output voltage (pu);
Efd_label: Field voltage, general (pu);
Vstab_label: Stabilizer output voltage (pu);

2-5-242

Synchronous Turbine Generators

Multi-Mass Shafts

w_label: Angular speed (pu);


Te_label: Electrical torque based on generator rating (pu / MW*s);
Pe_label: Active power (pu / MVA);
Qe_label: Reactive power (pu / MVA);
Pef_label: Filtered electric power (pu / MVA);
psih_label: Vapor pressure at high pressure level (pu);
mhuh_label: Flow of high pressure vapor (pu);
Tmec1,...,8_label: Mechanical couple flow of high pressure steam (pu);
x_label: Valve opening (pu);
x_i_label: Valve opening when the speed regulator is modelled externally (pu);
Ifd_label: Field current (pu);
w2,...,n_label: Angular velocity of mass n (pu);
T12,...,nm_label: Mechanical torque applied by mass n to mass m (pu);
Edreg_label: Mechanical torque applied by mass n to mass m (pu);
Eqreg_label: Mechanical torque applied by mass n to mass m (pu).

5.18 MULTI-MASS SHAFTS


5.18.1 Operation

Figure 5 - 38 illustrates the physical layout of the two shafts. It can be observed that different
stages of the turbines are supported by the same shaft. This layout can potentially induce torsional oscillations between different masses on the same shaft.
The model of the thermal turbine generator has two shafts, each with either one or five masses. In addition, the cross-compound turbine generator model allows the application of a mechanical torque to each turbine mass. Since the masses are hard-coded, shaft models with a
mass number other than 1 or 5 will be simulated by setting the inertia of non-existent masses
to very small values and the rigidity factors adjacent to the shafts to a very high value.

2-5-243

Synchronous Turbine Generators


Multi-Mass Shafts

.
Turbine Stages
Numbering of
masses

#5

#4

Primary Generator

#3

#2

#1

Selection of masses. (from 2 to 5)

Tmec1

Tmec3

Tmec5

Tmec7

Tmec2

Tmec4

Tmec6

Tmec8

Selection of masses. (from 2 to 5)

Numbering of
masses

#5

#4

#3

#1

#2

Turbine Stages

Secondary Generator

Figure 5 - 38 Shaft Model with Spring-Masses


5.18.2 Programmable
Parameters

ar_tg0: Torque representing mechanical losses;


ar_nbmasse: Number of masses on a shaft, 1 to 5;
ar_h1, ar_h2,...: Inertia (in seconds) of masses based on the generator BaseMVA;
ar_d1, ar_d2,...: Damping factors of masses based on the turbine BaseMW (in pu
torque/pu speed);
ar_k12, ar_k23,...: Rigidity factors between masses based on the turbine BaseMW for a
3600 rpm machine (in pu/rad);
ar_d1Start: Value of ar_d1 at starting;
ar_tStart: Time (in seconds) during which ar_d1 = ar_d1Start;
Mass_Tmec1: Mass to which torque Tmec1 is applied;
Mass_Tmec2: Mass to which torque Tmec2 is applied (Secondary shaft);
Mass_Tmec3: Mass to which torque Tmec3 is applied;
Mass_Tmec4: Mass to which torque Tmec4 is applied (Secondary shaft);
Mass_Tmec5: Mass to which torque Tmec5 is applied;
Mass_Tmec6: Mass to which torque Tmec6 is applied (Secondary shaft);
Mass_Tmec7: Mass to which torque Tmec7 is applied;
Mass_Tmec8: Mass to which torque Tmec8 is applied (Secondary shaft).

2-5-244

Synchronous Turbine Generators

Multi-Mass Shafts

Figure 5 - 39 Cross-Compound Thermal Turbine Generator Control Panel (General)

2-5-245

Synchronous Turbine Generators


Multi-Mass Shafts

Figure 5 - 40 Cross-Compound Thermal Turbine Generator Control Panel (Generators)

2-5-246

Synchronous Turbine Generators

Multi-Mass Shafts

Figure 5 - 41 Cross-Compound Thermal Turbine Generator


Control Panel (Turbine/Speed/Boiler)

2-5-247

Synchronous Turbine Generators


Multi-Mass Shafts

Figure 5 - 42 Cross-Compound Thermal Turbine Generator


Control Panel (Mechanical Torque/Shaft)

2-5-248

Synchronous Turbine Generators

Multi-Mass Shafts

Figure 5 - 43 Cross-Compound Thermal Turbine Generator


Control Panel (Excitation/Stabilizer)

2-5-249

Synchronous Turbine Generators


Multi-Mass Shafts

PAGE LEFT INTENTIONALLY BLANK

2-5-250


Chapter 6
PASSIVE ELEMENTS

6.1 SHUNT AND SERIES R, L, C ELEMENTS


A Introduction

An RLC element is a single-phase, two-phase or three-phase element consisting of RLC


branches where each branch can have a resistance (R), an inductance (L) and a capacitor (C)
connected in series. The value of at least one of the three components in series must not be
zero.There are two types of RLC elements: series RLC elements and shunt RLC elements.
An element set to zero means no element is activated and it can not take a value during a simulation.
The element automatically adjusts from single-phase to three-phase according to the type of
bus it is connected to.

B RLC Elements
Icons and
Diagrams

Tables 61 and 62 show respectively the icons and diagrams used to represent series and
shunt RLC elements.
One end of a shunt RLC element must be connected to a bus while the other end can be
ground connected or not, based on the type of connection. The series element must be connected between two buses in the network.
The palette of models allows to select from 14 icons and diagrams.

Table 61 : Series Elements


R

LC

RC

RL

RLC

Icon

Element

2-6-251

Passive Elements

Shunt and Series R, L, C Elements

Table 62 : Shunt Elements


R

LC

RC

RL

RLC

Icon

Element

For shunt elements, three types of connections are available for three-phase connections:
Ground Y Connection: one end of the shunt RL element is connected to a bus and the
other end to the ground (see Figure 6 - 1).

2-6-252

Floating Y Connection: one end of each RLC branch of the RLC element is connected
to a phase at the end of the bus, while the other ends are connected together, but not to
the ground. Figure 6 - 2 shows a floating Y connected shunt RL element.

Delta Connection (or triangle). In the case of a Delta connection, the three RL branches
of a three-phase element are Delta connected, and each top of the Delta is connected to
a phase of the bus. Figure 6 - 2 shows a shunt RL element Delta connected. It can be
seen that Figures 6 - 2 and 6 - 3 do not really represent the actual connections of a shunt
RL element. This is a small inconvenience and there are many ways to go around it. For
example, the user can put a Y sign next to the diagrams of a Y connected shunt RLC
element and a Delta sign next to the diagram of a Delta connected shunt RLC element.

Passive Elements

Shunt and Series R, L, C Elements

B1_a

B1

B1_b B1_c

(a)

(b)

Figure 6 - 1 Y Ground Connection of a shunt RL Element,


as Shown in a Diagram (a) and in Reality (b).

B1

B1_a

B1_b B1_c

(b)

(a)

Figure 6 - 2 Floating Y Connection of a shunt RL Element,


as Shown in a Diagram (a) and in Reality (b).

B1

B1_a

B1_b

B1_c

(a)

(b)

Figure 6 - 3 Delta Connection of a shunt RL Element,


as Shown in a Diagram (a) and in Reality (b).
C General
Parameters

(See Figure 6 - 4).

Base Values
Base MVA: Base power;

2-6-253

Passive Elements

Shunt and Series R, L, C Elements

Base Volt: Base voltage;


Base Freq: Base frequency.
Connection:
For series RLC elements, Series only;
For single-phase shunt RLC elements, only a Y ground connection is allowed;
For three-phase shunt RLC elements, Y ground, Y floating) or Delta;
Units: SI, pu or PQ
SI: Specifies the values of the components in international system units (ohm, henry
and farad);
pu: Specifies the values of the components in pu, according to the voltage and power
bases;
PQ: To specify the values of the components in active and reactive powers, (MW,
Mvar).
D RLC Parameters

R: Resistance value for each phase;


L: Inductance value for each phase;
C: Capacitor value for each phase.

E List of Available
Signals

At acquisition, the following signals are made available by the sensors:


I(a,b,c)_label: Current for each phase (A) in a three-phase element, and I_label in a
single-phase element.

F Control Panel of
Series RLC
Elements

Figure 6 - 4 Control Panel of Series RLC Elements


2-6-254

Passive Elements

Shunt and Series Non-Linear Resistors

G Control Panel of
Shunt RLC
Elements
.

Figure 6 - 5 Control Panel of Shunt RLC Elements

6.2 SHUNT AND SERIES NON-LINEAR RESISTORS


A Introduction

The non-linear resistor model was developed to represent the different surge arresters found
in the network. This model is similar to the one found in EMTP. It allows to represent, in addition to the typical behaviour of surge arresters, any form of non-linear current-voltage relation. The model has two implementations: parallel or series connection.

2-6-255

Passive Elements

Shunt and Series Non-Linear Resistors

B Non-Linear
Resistors Icons
and Diagrams
Table 63 : HYPERSIM QUICK REFERENCE
Series and Parallel Non-linear Resistors

ZNO

ZNO_Shunt

Series and Parallel Non-linear Resistors

2
RnLin

Properties:
7 Instant description of the voltage behaviour with respect to
the current.

RnLin

Main features:
Dissipate a greater quantity of current if an over
voltage or surge occurs,
since its resistance
decreases
Implementation:
Series connection

Figure 6 - 6 Icons and Diagrams of Series and Parallel Non-Linear Resistors


C Non-Linear
Resistor Model

The non-linear resistor model consists mainly of a compiled curve that describes, instantaneously, the behaviour of V with respect to I. It is known that the voltage curve with respect to
the current in a resistor is a line whose slope is equal to the value of the resistance.
To represent a surge arrester, this line bends as the voltage increases. Hence, a surge arrester
allows to dissipate a greater quantity of current if an over voltage or surge occurs, since its
resistance decreases.
The resistor can be characterized as follows:

2-6-256

Passive Elements

Shunt and Series Non-Linear Resistors

V
Vmin[2]
I = P[2] * (V / Vref) ** Q[2]

Vmin[1]
Vmin[0]

I = P[1] * (V / Vref) ** Q[1]


I = P[0] * (V / Vref) ** Q[0]

Figure 6 - 7 Non-linear resistors characterization


The relation of V must be translated with respect to I (voltage versus current). The user has
two options to translate this characteristic. Either the EMTP method, that describes sections
in the form of exponential expressions, or using a matrix.
In the first case, the user must provide the information for a number of sections.
For example, the curve drawn in Figure 6 - 7 expresses the I-V relationship in four distinct
sections. Three exponential sections (omit section 1 which is linear.) Section 2, delimited by
Vmin(0) to Vmin(1) is described with the parameters P(0) and Q(0).
The exponential number i selected will force the user to provide the values of Vmin, P and Q
for coefficient 0 to coefficient i-1.
A more simple method consists in describing the curve in a compiled way. For each value of
V, the associated current value is entered.
D General
Parameters

Connection:

E Parameter Input

Input data format: Select the parameter input type, either using the EMTP method
(exponential section) or with a matrix.
EMTP format
Number of exponentials: Number of exponential sections of the curve (does not
include the first linear section);
Vref: Base voltage on which the value of Vmin is evaluated (V);
Vmin: Value of the voltage for each section change. There are as many Vmin values
to provide as there are exponential sections (pu);
P: Value characterizing the exponential section. There are as many P values to provide as there are exponential sections (A);
Q: Value characterizing the exponential section. There are as many Q values to provide as there are exponential sections

2-6-257

Passive Elements

Shunt and Series Non-Linear Resistors

F Matrix Format

Positive part versus negative part:


Symmetry: The user defines the curve from 0 to +Vmax, and this curve is duplicated
for the negative section.
Asymmetry: The user defines a curve from -Vmax to +Vmax. The negative part can
differ from the positive part.
Number of points on the curve: Specifies the number of points characterizing the voltage curve with respect to the current.(From 1 to 30)
V: Vector of voltage points based on the number of points specified by the user. Each
point corresponds to a location on the curve. (V)
I: Vector of current points based on the number of points specified by the user. Each
point corresponds to a location on the curve. (A)

G List of Available
Signals

At acquisition, the following signals are made available by the sensors:


I(a,b,c)_label: Current per phase in the non-linear resistor;
SEG(a,b,c)_label: Exponential section being used.

H Control Panels

2-6-258

The following figures show the control panels of non-linear resistors.

Passive Elements

Shunt and Series Non-Linear Resistors

Figure 6 - 8 Control Panel of a Non-Linear Shunt Resistor (General)

2-6-259

Passive Elements

Shunt and Series Non-Linear Resistors

Figure 6 - 9 Control Panel of a Non-Linear Shunt Resistor (Table)

2-6-260

Passive Elements

Mutual Inductances

6.3 MUTUAL INDUCTANCES


A Introduction

In the model of a three-phase coupled reactor, the R and L elements are coupled. This model
is equivalent to a PI line without capacitors.

Figure 6 - 10 Icon and Diagram of a Three-Phase Coupled Reactor


B General
Parameters

Units: SI or pu
SI: Specifies the values of the components in international system units (ohm, henry
and farad);
pu: Specifies the values of the components in p.u. units (Ohm, Henry and Farad p.u.
(per unit).
Base Values
Base MVA: Base power;
Base Volt: Base voltage;
Base Freq: Base frequency.

C RL Parameters

Matrix/Sequence: Selects the type of parameters to use:


Matrix for RL matrix input;
Sequence for zero and positive sequences;
Matrix R: Resistive value of the impedance matrix;
Matrix L: Inductive value of the impedance matrix;
Sequence 0: Zero sequence resistance - Zero sequence inductance
Sequence 1: Positive sequence resistance - Positive sequence inductance

D List of Available
Signals

As is the case with EMTP, the model of the three-phase coupled reactors does not provide
any signal to the user.

E Control Panel of
Three-Phase
Coupled
Reactors

Figure 6 - 11 shows the control panel of three-phase coupled reactors.

2-6-261

Passive Elements

Decoupling Elements

Figure 6 - 11 Control Panel of Three-Phase Coupled Reactors

6.4 DECOUPLING ELEMENTS


A Introduction

In order to decrease the calculation load, the task of a complex station can be divided into two
sub-tasks using a decoupling element. There are two types of decoupling elements: with and
without an isolation transformer. The first type is a single or three-phase element, while the
second type is strictly three-phase. The decoupling element replaces a reactor between two
power systems to be decoupled.
In the decoupling element diagram, the dot specifies side two of the element. It is important
not to leave another series reactor with the decoupling element on side 1.

2-6-262

Passive Elements

Decoupling Elements

B Decoupling
element Icon and
Diagram
Table 64 : HYPERSIM QUICK REFERENCE
Decoupling Elements

Decoupling

Dec_XFO

Properties:
7 Decrease calculation load;
7 Divide in two subtracts a complex station

Main features:
The decoupling element is
either single and/or three
phase type;

Decoupling Elements

The decoupling element


with isolation xfo is only a
three phase type.
Implementation:
Replaces a reactor
between two power systems to be coupled.

Figure 6 - 12 Icon and Diagram Decoupling Element


C General
parameters

Number of phases (1 or 3).


Grounded phase (A, B, C): Grounded phase (leave blank if no phase is grounded).
Series RL element (specify only one value if the decoupling element is used in a single
phase or specify three values if used in a three-phase power system).
R: Resistance (ohms)
L: Inductance (H)
Gain: Transformation ratio (V2/V1) of isolation transformer.

D List of available
signals

No signal is available.

2-6-263

Passive Elements

Decoupling Elements

E Applications

1 Applications of decoupling element without isolation transformer. Figures 6 - 13 and


6 - 14 show two uses of the decoupling element without isolation transformer in a three-phase
power system.

.
After decoupling
2 simulation tasks with
one time step delay solution

Before decoupling
1simulation task

Decoupling
Element
System 1

System 2

System 1

System 2

No grounded phase

Figure 6 - 13 Decoupling of two grounded power systems

Before decoupling

After decoupling
Decoupling
Element

System 1
- floating

System 2
- floating

System 1
- floating

System 2
- floating

One grounded phase

Figure 6 - 14 Decoupling of two floating power systems


2 Applications of decoupling element with isolation transformer. Figure 6 - 16 shows
the use of a decoupling element with isolation transformer. This element is especially used
when the grounding of a phase in both power systems by a simple decoupling element (without isolation transformer) is harmful to the operation of the entire power system. The decoupling element connects one phase of side 1 to the ground. Side 2 of the element remains
floating because of its isolation transformer. A converter station is a good example of using
such an element. In order to separate the thyristor bridge from the converter transformer, a
decoupling element with an isolation transformer must be used. In this case, the leakage from
the floating Y winding is used to execute the decoupling.

A delay of one time step is created using those elements. So it can create divergence of the
simulation and may or may not be used on a case by case basis.

2-6-264

Passive Elements

Decoupling Elements

HINT. A good way for decoupling a sub-station is by replacing the leakage impedance of the
sub-station transformer by a decoupling element in series with the primary winding of the
transformer and to transfer the parameters from one to the other. But again, depending on the
short-circuit power of the simulated network, it may or may not work.

L1

L2
To other sub-stations

Decoupling
L3

RL=Xfo leak
LS=Xfo leak

Transformer
leak
R1 and L1 = 1e-6

Figure 6 - 15 Decoupling example for a large sub-station

Before decoupling

After decoupling
Decoupling
Element

System 1
- floating

System 2
- grounded

System 1
- floating

System 2
- grounded

Only the power system on side 1 of the


decoupling element is grounded by this element

Figure 6 - 16 Use of a decoupling element with isolation transformer


2-6-265

Passive Elements

Decoupling Elements

Before decoupling

After decoupling
Decoupling
Element

L leakage

1D

3D

5D

1D

L leakage = 0

c
4D

6D

5D

a
L leakage

3D

2D

c
4D

6D

2D

Figure 6 - 17 Decoupling of a converter station


F Examples of
forms used for
decoupling
elements

Figures 6 - 18 and 6 - 19 show forms used for decoupling elements with and without an isolation transformer.

Figure 6 - 18 Example of a form for decoupling element without isolation transformer

2-6-266

Passive Elements

Passive Filters

Figure 6 - 19 Example of a form for decoupling element with isolation transformer

6.5 PASSIVE FILTERS


A Introduction

Passive filters are elements showing an identical impedance in different resistance-inductance-capacitor combinations series or parallel connected. Even though these can be represented with simple passive elements, using filters has the advantage of eliminating nodes
between components, thereby decreasing the number of nodes or the size of the Z matrix in
the station where they are found. Meaning that the station simulation time is also decreased.
There are five types of filters available in Hypersim:
Series-parallel RLC filter;
Type C filter;
High-pass filter;
Double-tuning filter;
General filter.
The configuration for each filter is shown in Figure 6 - 20. As for shunt RLC elements, passive filters can be Y, Y Ground and Delta connected. There are no filters with series elements.

2-6-267

Passive Elements
Passive Filters

Figure 6 - 20 Passive Filters Icons and Diagrams


B General
Parameters

Filters only have several general parameters. To specify the parameters of a filter, SI units are
always used. The function allowing to change units is not available for all filter models.
Hence, the only general parameter is the filter connection:
For a three-phase filter Y ground, Y floating or Delta.

C RLC Parameters

Filters consist of specific RLC combinations and each has a fixed number of elements. As can
be seen in Figures 6 - 21to 6 - 24, the configuration of each filter is shown in their respective
control panel. This allows to associate the parameter to the element whose value the user
wants to set.
Rx: x resistance value for each phase;
Lx: x inductance value for each phase;
Cx: x capacitor value for each phase.

D List of Available
Signals

Since the filters are simulated as elements forming a whole and not as individual elements,
the following signals are made available by the sensors at acquisition:
I(a,b,c)_label: Current for each phase (A).
Hence, the currents flowing in the individual elements are not available.

2-6-268

Passive Elements

Passive Filters

E Passive Filters
Control Panels

Figure 6 - 21 Control Panel of a Series-Parallel RLC Filter

Figure 6 - 22 Control Panel of a Type C Filter

2-6-269

Passive Elements
Passive Filters

Figure 6 - 23 Control Panel of a High-Pass Filter

Figure 6 - 24 Control Panel of a Double-Tuning Filter

2-6-270


Chapter 7
LINES AND CABLES

7.1 CALCULATION OF ELECTRICAL PARAMETERS


There are two way to enter electrical parameters in the line model in Hypersim. You can use
Hyperline Line Data module in Hyperview or the load file function with EMTP files. All examples in this chapter are based on the Hyperline tools, except Marti line examples.
7.1.1

Hyperline Line
Data

The Hypersim Hyperline Line Data tools compute the RLC parameters of an overhead transmission line from its conductor characteristics and tower geometry. See the help file in the
Hyperline Line Data GUI.

Figure 7 - 1 Hyperline Line Data Gui

2-7-271

Lines and Cables

Calculation of electrical parameters

7.1.2

Load File
(EMTP)

An EMTP file that contains the physical parameters of the lines (Fig 7 - 6, 7 - 7 and 7 - 8) or
the resolve matrix by the external software of EMTP (Fig 7 - 2) can be loaded automatically
in the parameter form.
Hypersim allows the user to directly transfer data originating from files in three types of format.
Transfer of Parameters from a EMTP .PUN file.
The EMTP AUX routine allows to use a line parameter file to generate a file in .pun
format. When the user clicks on the control panel fichier button, Hypersim transfers
the data in the specified .pun file to the line control panel. It is not possible to read the
data contained in the .PUN file in the case of PI lines.
Calculation of parameters from a Inpurdue type input file.
Historically, Purdue University has developed a TRANS2 program allowing to calculate line parameters using the geometric data of conductors. This program was repatriated by IREQ, improved and is now known as MOLIPAR. The main advantage of the
program is to allow to input geometric data of lines using a graphic interface. However,
MOLIPAR still allows to input data from TRANS2 readable files.This type of file is
known as Inpurdue.
Hypersim calls a modified version of MOLIPAR to calculate the R, L and C matrices
of the lines. Then, the functions of the CLAPACK users guide, third edition, SIAM,
1999, library are used to transform the R, L and C phase parameters into mode parameters and Ti transformation matrix used by Hypersim.
When the user clicks on the control panel file button, Hypersim executes the calculations using the data contained in the file (Figures 7 - 3) displayed in the line control panel. The data will then be transferred in the control panel.
Calculation of parameters using an EMTP type input file.
Hypersim can also use an EMTP input file (Figures 7 - 2) to execute calculations. In
fact, the data are extracted from the EMTP file and the parameters calculated using the
same routine as for an Inpurdue file. The parameters thus calculated are not identical to
those calculated by EMTP with the same input file. However, the electrical behaviours
in both cases are nearly identical.

2-7-272

Lines and Cables

Calculation of electrical parameters

C Transposed ligne
BEGIN NEW DATA CASE
LINE CONSTANTS
C 345678901234567890123456789012345678901234567890123456789012345678901234567890
C Module
Model---->Matrix--->Scale----><-----Fmin<----NPdec<-----Ndec
ligne-MODEL
CP-ligne QREAL
METRIC
2
C Conductor cards
CI
I
V
CP
RX
R
H
T
S A
N
Ch S
eT
e
D
o
o
V
e l NB
C a<---k<------s<y<------a<------i<------r<------w<------M<------p<----p<----a<u
10.375 0.0450 4
3.556 -12.80
20.73
20.73
45.72 45.0
4
20.375 0.0450 4
3.556
0.00
20.73
20.73
45.72 45.0
4
30.375 0.0450 4
3.556
12.80
20.73
20.73
45.72 45.0
4
00.500 3.6050 4
1.111
-8.99
32.92
32.92
00.500 3.6050 4
1.111
8.99
32.92
32.92
BLANK card terminates conductor cards
C 345678901234567890123456789012345678901234567890123456789012345678901234567890
C RHO ><FREQUENC>< FCAR > <ICPR> <IZPR> I<DISTKM> <IZ>IM<I><I><I><>
100.
60.
11 11
200.0
1
C TRANSP><-nspan--><-span11-><-span12-><-span13-><-span14-><-span15-><-span16->
.TRANSP 3
66.666666 66.666666 66.666666
123
312
231
BLANK card terminates frequency card
BLANK
BLANK

Figure 7 - 2 EMTP Input File to Calculate the Parameters of a Transposed


Three Phase Line with the Geometric Data Shown in Figures 7 - 6 to 7 - 8
1.0
FREQMX FREQPR FREQPR FREQPR FREQPR
I--------II--------II--------II--------II--------II--------II--------I
1.0
15360. 60.
480.
960.
TEST CASE manic-quebec
LIGNE 735kV; 3 phases
RO TERRE = 100 OHMS-M
$$$
NCON REARTH FREQ.
3 3
10 10
I---II--------II--------I I I II II II II
3 100.0 60.0
3 3
10 10

FREQPR

R(OH/MI) XD(OH/MI) DIA(IN) X(FT) YTOW(FT) YMSPN(FT) (0-9)(1,-1)


I--------II--------II--------II--------II--------II--------II---II---I
0.07240 0.37820 0.11517 -49.25 70.75 70.75
0 1
0.07240 0.37820 0.11517 0.75 70.75 70.75
0 1
0.07240 0.37820 0.11517 50.75 70.75 70.75
0 1
5.80000 1.70000 0.03646 -35.00 110.0 110.0
0 -1
5.80000 1.70000 0.03646 35.00 110.0 110.0
0 -1

Figure 7 - 3 Inpurdue Input File to Calculate the Parameters of a Frequency


Constant Parameter Untransposed Line with the
Geometric Data Shown in Figures 7 - 6 to 7 - 8
2-7-273

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

7.2 DISTRIBUTED PARAMETERS LINES - 3, 6, 9 AND 12 PHASES


A Frequency
Constant
Distributed
Parameters
Lines Icons and
Diagrams

The following icons and diagrams are used to represent lines with or without fault.

Table 71 : HYPERSIM QUICK REFERENCE


Lines and cables

Properties:
Frequency Constant Distributed Parameters Lines.

Main features:
A transposed or untransposed, frequency constant distributed
parameters lines is represented by
Its sequences or;

Lines and Cables

By its propagation modes


and the transformation
matrix (Ti) between mode
currents and phase currents.
A model of a line with fault is also
provided.
Figure 7 - 4 Icon and Diagram Lines and Cables

B Parameter
Description

1 General Parameters . (See Figures 7 - 11 and 7 - 12)

Base MVA: Base power in MVA;


Base Volt: Line base voltage - phase to ground in kV;
Base Freq: Base frequency (Hz);
Length: Line length (km);
Data base key name: Key to access the line data base (optional package).

2-7-274

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
2 Other Parameters.

Transposition (Untransposed/Transposed): Untransposed or Transposed;


Ti: transformation matrix between mode current and phase current ([Iphase] = [Ti] x
[Imode]); not used in the case of transposed line;
R: Per unit length resistance (ohm/km) for each sequence;
L: Per unit length inductance (henry/km) for each sequence;
C: Per unit length capacitor (farad/km) for each sequence.
3 Fault Parameters.

Distance of fault (side 1): Distance of fault from side 1 (see Figure
7 - 5);
Rdef= (Ra, Rb, Rc, Rg): Fault resistance for phase breakers and ground breaker.
4 Fault Breaker Parameters.

The fault breakers are shown in Figure 7 - 5; Table 72shows the types of faults according to
the state of the breakers.
Open state resistances
Phase A, B, C and ground: Resistances of phase and ground breakers in open state.
Closed state resistances
Phase A, B, and ground: Resistances of phase and ground breakers in closed state.
Steady state (Grey = Open, Coloured = Closed)
Phase A, B, C and ground: State of phase and ground breakers in steady state.
Programming of operations (from steady state) (Enable/Disable)
Phase A, B, C and ground: Enable activates this change.
T1 Operation time
Phase A, B, C and ground: Time when the state of the breakers is changed from the
steady state.
T2 Operation time
Phase A, B, C and ground: Time when the state of the breakers changed from the
T1, T3 and T4 operation state.
Note : For a phase to ground fault, we strongly recommend to use the ground in steady
state instead of programming a time of operation in transient state.
P or C
Specifies if the switching of the breaker three phases is controlled by a command
(C) or related to the individual switching timings of each phase (P).

2-7-275

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
The phase (P) operation is mandatory if a Uniform/Gaussian distribution ug/t1/t2/
t3 is used. In all other cases the command (C) option is used.

RbDef
VaDef

VbDef

IaDef

RcDef
VcDef

IbDef
Ropen/close

IcDef
Ropen/close

InDef
RDef

Ropen/close

Ground
Ropen/close

Distance of fault

Figure 7 - 5 Fault Breakers

Table 72 : Types of Fault According to State of Breakers


State of Breaker

2-7-276

Ground

No fault

Fault between phase C and Ground

Fault between phase B and Ground

Fault between phases B and C

Fault between phases B, C and Ground

Fault between phase A and Ground

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
Table 72 : Types of Fault According to State of Breakers
Fault between phases A and C

Fault between phases A, C and Ground

Fault between phases A and B

Fault between phases A, B and Ground

Fault between phases A, B and C

Fault between phases A, B, C and Ground

C List of Available
Signals
D Line Signals

At acquisition, the following signals are made available by the sensors:


V(a, b, c)_line label_bus label: Voltage of each phase on bus label bus (volt);
I(a, b, c,n)_line label_bus label: Currents of each phase and ground on bus label bus
(ampere).
P_line label_bus label: Active power on bus label bus (watt)
Q_line label_bus label: Reactive power on bus label bus (var)

E Fault Signals

Va_FLT_line label: Voltage of phase A on fault bus (volt);


Vb_FLT_line label: Voltage of phase B on fault bus (volt);
Vc_FLT_line label: Voltage of phase C on fault bus (volt)
Ia_FLT_line label: Phase A fault current (ampere);
Ib_FLT_line label: Phase B fault current (ampere);
Ic_FLT_line label: Phase C fault current (ampere);
In_FLT_line label: Ground fault current (ampere);
CMD(a, b, c, n)_FLT_line label: Command for states of phase and ground breakers.

F Transmission
Lines Control
Panels

This section shows how to enter data in the control panels of Frequency Constant Parameters
Three Phase Transmission Lines. The example shows an untransposed line without fault.

G Line Data

Figures 7 - 6, 7 - 7 and 7 - 8 show respectively the geometric data of a 735kV Hydro-Quebec


line.

H Load File

An EMTP file that contains the physical parameters of the lines (Fig 7 - 2 and 7 - 3) or the
resolve matrix by the external software of EMTP can be loaded automatically in the parameter form.Calculation of Electrical Parameters and Corresponding Control Panel

2-7-277

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
I Calculation of
Electrical
Parameters

The calculation of electrical parameters of frequency constant parameter lines with their geometric parameters is done by using Hyperline Line Data module in Hyperview. Figure 7 - 9
shows the relevant part of the Hyperline geometrical parameters.
Load a file into the Line Data GUI or enter your geometrical line parameters.
Select the transpositions options.
Run the program.
The electrical parameters are displayed in the Line Data report.

J Transfert
Electrical
Parameters to
Hypersim Lines

The transfert of electrical parameters to Hypersim is very simple.


In Hypersim GUI, edition mode, draw a network with lines.
Go to simulation mode.
Go to the Line Data GUI, you will see all the names of the lines in you network at the
bottom of the page.
To transfert electrical parameters, choose the name of the line and them apply parameters.
See the parameters in the forms of the line.

2-7-278

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

Example:

Example of a 735-kV three-phase line. Three bundles of 4.


Bersfort ACSR 1355 MCM conductors.
Two 1/2 inch-diameter steel ground wires.
Figures 7 - 6, 7 - 7 and 7 - 8 show respectively the geometrical data.

-8.99m

8.99m

-12.80m

phase A

Overhead ground wire

12.80m

phase B

phase C

32,92m
20,73m

= 100-m
Figure 7 - 6 Layout of Conductors for a 735 kV Line

45,72cm
3,556 cm

45

Figure 7 - 7 Details of a bundle conductor

2-7-279

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

Sag

Y m ea n= Ytower (2/3) sag

Ytower Y m ea n

Figure 7 - 8 Line Height


Example of a 735-kV three-phase line
Three bundles of 4 Bersfort ACSR 1355 MCM conductors
Two 1/2 inch-diameter steel ground wires
Ytower and Ymin are the average heights of conductors
LINE GEOMETRY:
Frequency (Hz): 60.0
Ground resistivity (ohmm): 100.0
Number of phase conductors (bundles): 3
Number of ground wires (bundles): 2
-----------------------------------------------------------------------Conductor
Phase
X
Y Tower
Y Min
Conductor
(bundle)
Number
(meters)
(meters)
(meters)
Type
-----------------------------------------------------------------------p1
1
-12.80160
20.72640
20.72640
1
p2
2
0.00000
20.72640
20.72640
1
p3
3
12.80160
20.72640
20.72640
1
g1
0
-8.99160
32.91840
32.91840
2
g2
0
8.99160
32.91840
32.91840
2
-----------------------------------------------------------------------CONDUCTOR AND BUNDLE CHARACTERISTICS:
Number of conductor types or bundle types: 2
Transposition Options: Untransposed
Conductor internal inductance evaluated from: T/D Ratio
Include conductor skin effect: true
-----------------------------------------------------------------------------------------------------------Conductor
Outside
DC
Relative
Conductors
Bundle
Angle
Type
Diameter
T/D Ratio
GMR
Resistance Permeability Per Bundle
Diameter Conductor 1
(cm)
(cm)
(Ohms/km)
(cm)
(degrees)
-----------------------------------------------------------------------------------------------------------1
3.55600
0.37500 0.00000000 0.04304860
1.00000
4
64.65824
45.00
2
1.27000
0.50000 0.00000000 3.10685596
1.00000
1
0.00000
0.00
------------------------------------------------------------------------------------------------------------

Figure 7 - 9 Hyperline Line Data geometrical parameters of a constant parameter line shown in figures
7 - 6 to 7 - 8

2-7-280

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

LINE PARAMETERS:
Resistance matrix (ohm/km):
107.0972E-03 97.288142E-03 94.985601E-03
97.288142E-03 110.49444E-03 97.288142E-03
94.985601E-03 97.288142E-03 107.0972E-03
Inductance matrix (H/km):
1.5767213E-03 751.60911E-06
751.60911E-06 1.5708151E-03
616.27982E-06 751.60911E-06

616.27982E-06
751.60911E-06
1.5767213E-03

Capacitance matrix (F/km):


11.661265E-09 -2.1268277E-09 -583.62337E-12
-2.1268277E-09 12.117397E-09 -2.1268277E-09
-583.62337E-12 -2.1268277E-09 11.661265E-09
Modal parameters for: Untransposed
Transformation matrix:
595.18362E-03 -707.10678E-03 -413.16241E-03
539.91787E-03 -11.397316E-15 811.53746E-03
595.18362E-03 707.10678E-03 -413.16241E-03
Modal resistances [0 1 2 3 ... N] (ohm/km)
300.43789E-03 12.111597E-03 11.281739E-03
Modal inductances [0 1 2 3 ... N] (H/km)
2.977745E-03 960.44144E-06 775.18526E-06
Modal capacitances [0 1 2 3 ... N] (F/km)
8.5801475E-09 12.244888E-09 14.548121E-09
Self impedance (Zero-sequence & Positive-sequence):
Line 1
[R0 R1] =
301.27087E-03
11.708982E-03 (ohm/km)
[L0 L1] =
2.9877512E-03
868.25318E-06 (H/km)
[C0 C1] =
8.5884565E-09
13.425735E-09 (F/km)
--------------------------------------------------------------------------------

Figure 7 - 10 Hyperline electrical parameters for an untransposed line with the geometric data shown
in figure 7 - 6 to 7 - 8

2-7-281

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

Figure 7 - 11 Control Panel of an unTransposed Line with the Geometric


Data Shown in Figures 7 - 6 to 7 - 8
7.2.1

Transmission
Lines with
Fault

2-7-282

A control panel is provided for transmission lines with fault. The calculation of the parameters is identical to lines without fault. The difference is that the control panel for lines includes
the fault parameters. Figures 7 - 12 to 7 - 13 show the control panel of a line with fault and
the geometric data shown in Figures 7 - 6 to 7 - 8.

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
.

Figure 7 - 12 Control Panel of a unTransposed Line with Fault (General)

2-7-283

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

Figure 7 - 13 Control Panel of a unTransposed Line with Fault (Timing)

2-7-284

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
7.2.2

Coupled Lines

A Coupled Lines
Icons and
Diagrams

The model for coupled lines is used to simulate a double-circuit line or two lines with the
same right of way.
In the model palette, two icons and two diagrams used to represent coupled lines.

1.1

1.2

2.1

2.2

C
Figure 7 - 14 Coupled Line Icon and Diagram
B Parameter
Description

The parameters for coupled transmission lines are the same as for uncoupled lines. The only
difference is that the modal transformation matrix of coupled transmission lines is a 6x6 matrix because each bundle of conductors is considered as a separate phase.

C List of Available
Signals

At acquisition, the following signals are made available by the sensors:

D Line Signals

V(a, b, c)_line label_bus label: Voltage of each phase on bus label bus (volt);
I(a, b, c,n)_line label_bus label: Currents of each phase and ground on bus label bus
(ampere). When 2 are connected to the same bus, the inductors of phase d, e and f are
used to differentiate the signals. Also, the n1 and n2 neutral indicators will appear.
P_line label_bus label: Active power on bus label bus (watt)
Q_line label_bus label: Reactive power on bus label bus (var)

E Coupled Lines
Control Panels

This section shows how to enter data in the control panels of Coupled Lines.

F Line Data

Figures 7 - 15 7 - 16 show the layout of two coupled lines.

G Load File

An EMTP file that contains the physical parameters of the lines (Fig 7 - 2 and 7 - 3) or the
resolve matrix by the external software of EMTP can be loaded automatically in the parameter form.Calculation of Electrical Parameters and Corresponding Control Panel

H Calculation of
Electrical
Parameters

The calculation of electrical parameters of frequency constant parameter lines with their geometric parameters is done by using Hyperline Line Data module in Hyperview. Figure 7 - 9
shows the relevant part of the Hyperline geometrical parameters.
Load a file into the Line Data GUI or enter your geometrical line parameters.
Select the transpositions options.
Run the program.
2-7-285

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
The electrical parameters are displayed in the Line Data report.
I Transfert
Electrical
Parameters to
Hypersim Lines

The transfert of electrical parameters to Hypersim is very simple.


In Hypersim GUI, edition mode, draw a network with lines.
Go to simulation mode.
Go to the Line Data GUI, you will see all the names of the lines in you network at the
bottom of the page.
To transfert electrical parameters, choose the name of the line and them apply parameters.
See the parameters in the forms of the line.

2-7-286

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

Example:

Example of a 500-kV three-phase, double-cicruit line.


6 bundles of 3 ACSR 1355 MCM conductors, 2 steel ground wire.
The Phase numbering is set to obtain the (6x6) RLC matrices and sequence parameters of the two individual circuits.
-14,40m
Overhead ground wire

-11,60m
-8,5m

A
58,2m
46,4m

35,2m
24m

= 100-m
Figure 7 - 15 Geometric Layout of Two Coupled Lines

2-7-287

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

50.0cm

30o

= 3.129cm
Figure 7 - 16 Details of a Conductor Bundle for Lines in Figure 7 - 15

Sag

Ytower Y m ea n

Y m ea n= Ytower (2/3) sag

Figure 7 - 17 Line Height

2-7-288

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

COMMENTS:
Example of a 500-kV three-phase, double-cicruit line
6 bundles of 3 ACSR 1355 MCM conductors, 2 steel ground wire
LINE GEOMETRY:
Frequency (Hz): 60.0
Ground resistivity (ohmm): 100.0
Number of phase conductors (bundles): 6
Number of ground wires (bundles): 2
-----------------------------------------------------------------------Conductor
Phase
X
Y Tower
Y Min
Conductor
(bundle)
Number
(meters)
(meters)
(meters)
Type
-----------------------------------------------------------------------p1
1
-8.50000
46.40000
34.60000
1
p2
2
-14.40000
35.20000
23.40000
1
p3
3
-8.50000
24.00000
12.20000
1
p4
6
8.50000
46.40000
34.60000
1
p5
5
14.40000
35.20000
23.40000
1
p6
4
8.50000
24.00000
12.20000
1
g1
0
-11.60000
58.20000
46.40000
2
g2
0
11.60000
58.20000
46.40000
2
-----------------------------------------------------------------------CONDUCTOR AND BUNDLE CHARACTERISTICS:
Number of conductor types or bundle types: 2
Transposition Options: Untransposed
Conductor internal inductance evaluated from: Geometric Mean Radius (GMR)
Include conductor skin effect: true
-----------------------------------------------------------------------------------------------------------Conductor
Outside
DC
Relative
Conductors
Bundle
Angle
Type
Diameter
T/D Ratio
GMR
Resistance Permeability Per Bundle
Diameter Conductor 1
(cm)
(cm)
(Ohms/km)
(cm)
(degrees)
-----------------------------------------------------------------------------------------------------------1
3.12930
0.37500 1.25600000 0.05208000
1.00000
3
57.73500
30.00
2
0.95250
0.50000 0.37090000 4.10200000
1.00000
1
0.00000
0.00
------------------------------------------------------------------------------------------------------------

Figure 7 - 18 Hyperline Line Data geometrical parameters of a double circuit lines hown in figures 7 15 to 7 - 17

2-7-289

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

LINE PARAMETERS:
Resistance matrix (ohm/km):
107.06173E-03 84.639908E-03
84.639908E-03 98.801628E-03
82.566286E-03 79.254713E-03
82.414725E-03 79.124767E-03
84.244289E-03 80.599614E-03
88.571231E-03 84.244289E-03

82.566286E-03
79.254713E-03
95.785116E-03
77.821153E-03
79.124767E-03
82.414725E-03

82.414725E-03
79.124767E-03
77.821153E-03
95.785116E-03
79.254713E-03
82.566286E-03

84.244289E-03
80.599614E-03
79.124767E-03
79.254713E-03
98.801628E-03
84.639908E-03

88.571231E-03
84.244289E-03
82.414725E-03
82.566286E-03
84.639908E-03
107.06173E-03

Inductance matrix (H/km):


1.6815945E-03 793.83125E-06 680.66615E-06 635.23225E-06 654.02613E-06
793.83125E-06 1.6892843E-03 798.1073E-06 658.18462E-06 633.18174E-06
680.66615E-06 798.1073E-06 1.6905131E-03 739.69329E-06 658.18462E-06
635.23225E-06 658.18462E-06 739.69329E-06 1.6905131E-03 798.1073E-06
654.02613E-06 633.18174E-06 658.18462E-06 798.1073E-06 1.6892843E-03
731.00435E-06 654.02613E-06 635.23225E-06 680.66615E-06 793.83125E-06

731.00435E-06
654.02613E-06
635.23225E-06
680.66615E-06
793.83125E-06
1.6815945E-03

Capacitance matrix (F/km):


10.785129E-09 -2.1084603E-09 -725.71953E-12 -445.46558E-12
-2.1084603E-09 10.885838E-09 -1.8810997E-09 -492.02897E-12
-725.71953E-12 -1.8810997E-09 11.326109E-09 -1.0694998E-09
-445.46558E-12 -492.02897E-12 -1.0694998E-09 11.326109E-09
-637.94412E-12 -425.08373E-12 -492.02897E-12 -1.8810997E-09
-1.4877263E-09 -637.94412E-12 -445.46558E-12 -725.71953E-12

-637.94412E-12
-425.08373E-12
-492.02897E-12
-1.8810997E-09
10.885838E-09
-2.1084603E-09

-1.4877263E-09
-637.94412E-12
-445.46558E-12
-725.71953E-12
-2.1084603E-09
10.785129E-09

Modal parameters for: Untransposed


Transformation matrix:
351.82786E-03 502.16609E-03
357.11159E-03 29.570239E-03
497.39974E-03 -496.61678E-03
497.39974E-03 -496.61678E-03
357.11159E-03 29.570239E-03
351.82786E-03 502.16609E-03

-248.22699E-03 -546.27181E-03 -355.77792E-03 -297.7989E-03


-445.0405E-03 -95.876821E-03 504.13737E-03 580.78391E-03
-483.19732E-03 425.83203E-03 -334.32912E-03 -272.02404E-03
483.19732E-03 -425.83203E-03 334.32912E-03 -272.02404E-03
445.0405E-03 95.876821E-03 -504.13737E-03 580.78391E-03
248.22699E-03 546.27181E-03 355.77792E-03 -297.7989E-03

Modal resistances [0 1 2 3 ... N] (ohm/km)


493.79905E-03 20.976121E-03 18.489695E-03 18.201966E-03 17.92674E-03 17.952914E-03
Modal inductances [0 1 2 3 ... N] (H/km)
5.0845077E-03 1.1097985E-03 1.1989381E-03 914.81044E-06 831.23138E-06 858.80321E-06
Modal capacitances [0 1 2 3 ... N] (F/km)
5.8550193E-09 10.674702E-09 9.808374E-09 12.411521E-09 13.608731E-09 13.161354E-09
Self impedance (Zero-sequence & Positive-sequence):
Line 1
[R0 R1] =
[L0 L1] =
[C0 C1] =

264.85676E-03
3.2022004E-03
7.8555058E-09

18.395855E-03 (ohm/km)
929.59574E-06 (H/km)
12.570785E-09 (F/km)

Line 2
[R0 R1] =
[L0 L1] =
[C0 C1] =

264.85676E-03
3.2022004E-03
7.8555058E-09

18.395855E-03 (ohm/km)
929.59574E-06 (H/km)
12.570785E-09 (F/km)

Mutual impedance (Zero-sequence):


Line 1 - Line 2
R0m =
246.18652E-03 (ohm/km)
L0m =
1.9995885E-03 (H/km)
C0m = -2.0443957E-09 (F/km)
--------------------------------------------------------------------------------

Figure 7 - 19 Hyperline Electrical Parameters of a untransposed Double Circuit Line with the Geometric
Data Shown in Figures 7 - 15 to 7 - 17

2-7-290

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

Figure 7 - 20 Control Panel of an unTransposed Double Circuit Line with the Geometric
Data Shown in Figures 7 - 15 to 7 - 17
Note : In the control panel, the modes are not presented in the same order as that of an
EMTP input file. For Hypersim, this order is 2G, 2IL, 2L, 2L, 2L, 2L.
7.2.3

Triples and
Quadruple
Lines

The triple line model is used to simulate a triple circuit or three lines in the same path. The
same reasoning applies to a quadruple line. These two models are a general case of the coupled line model.

A Icons and
Diagrams

2-7-291

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

C3

1.1

1.2

2.1

2.2

3.1

3.2

Figure 7 - 21 Triple Line Icon and Diagram

1.1

1.2

2.1

2.2

3.1

3.2

4.1

4.2

C4

Figure 7 - 22 Quadruple Line Icon and Diagram


A Parameter
Description

B Signal
description

2-7-292

The parameters for coupled transmission lines are the same as for uncoupled lines. The only
difference is that the modal transformation matrix is 9x9 for triple lines and 12x12 for quadruple lines. This can be explained by the fact that each conductor bundle can be considered
as a separate phase.
V(a, b, c)_line label_bus label: Voltage of each phase on bus label bus (volts);
I(a, b, c,n)_line label_bus label: Currents of each phase and ground on bus label bus
(amperes). When the circuits are connected to the same bus, the inductors of phase d, e,
f, g, h, i, j, k, and l are used to differentiate the signals. Also, the n1, n2, n3 and n4 neutral indicators will appear.

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
C Triple and
Quadruple Lines
Control Panels

Figure 7 - 23 Triple Line Control Panel

2-7-293

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

Figure 7 - 24 Quadruple Line Control Panel


7.2.4

Composed
Models:
Coupled Lines
With Fault
and Quadruple
Lines With
Fault

A Introduction

The user may sometimes need to simulate a fault applied at any place on a transmission line.
The user can then insert a fictitious bus at the desired place and simulate the line in two distinct segments. However, if the user needs to simulate many faults on a multiple line, this procedure becomes tedious and the network diagram is cluttered. Composed models were
developed to circumvent this.

B Description of
Composed
Models

Composed models are models made up of many sub-models already available in the element
palette. The parameters of the composed model are available in a unique control panel. They
are then transferred by Hypersim to the different elements making up the model.

2-7-294

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
C Icons and
Diagrams

1.1

1.2

2.1

2.2

Figure 7 - 25 Coupled Line With Fault Icon and Diagram

1.1

1.2

2.1

2.2

3.1

3.2

4.1

4.2

C4

Figure 7 - 26 Quadruple Line With Fault Icon and Diagram


D Parameter
Description

The parameters of composed models are the same as those of the different elements which
make them up. In the present case, this includes all the line parameters and the fault element
parameters. However, the number of operations allowed in this case is four (4) per fault element, instead of ten (10) in normal cases.
Some parameters have been added. In order to specify to Hypersim which line configuration
he requires, the user must choose it in the parameter control panel.
In the case of a coupled line with fault. six configurations are available to the user:
1 line section - no fault
2 line sections - fault on line 1
2 line sections - fault on line 2
2 line sections - faults on lines 1 and 2

2-7-295

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
3 line sections - fault on line 1 closer than fault on line 2
3 line sections - fault on line 2 closer than fault on line 1
With the graphical interface, the user can visualize the sub-network making up the composed
model, along with all the parameters of each sub-element. However, these parameters are
readable only. To change them, the user must access the control panel of the composed model.
In an all cases, the Model Configuration parameter must agree with the parameters specifying
the fault distance on each line. This distance must be calculated from side 1 of the line. For
example, if the user wants to simulate a fault on line 1 of a coupled line at a distance of 125
km and a fault on line 2 at 75 km, he must use the last configuration (3 line sections - dfaut
sur la ligne 2 plus prs que dfaut sur la ligne 1"), in addition to entering the values correctly
in the fault distance fields. If the user does not want to use one of the fault elements, he must
set the value of the fault distance to 0 for the fault in question. Obviously, the fault distance
must be lower than the line length.
In the case of a quadruple line with fault, there are five configurations available:
1 section
2 sections
3 sections
4 sections
5 sections
Given the great number of fault location combinations possible with this model, the latter has
been given a general representation, that is the fault breakers are positioned at each fault distance on each of the 4 lines making up the model. Considering the case with 4 sections (Figure
7 - 27), there are three locations on each line where fault breakers have been positioned.

2-7-296

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases

Figure 7 - 27 Quadruple Line with Fault - Case with 4 Sections


As shown in the figure, 12 fault elements are available, but only 3 or 4 (and not more than 1
per line) can be operated. The breakers that will be operated are those set by the fault distance
parameters.
For example, given the following parameters:
Fault distance - line 1: 85 km

2-7-297

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
Fault distance - line 2: 40 km
Fault distance - ligne 3: 140 km
Fault distance - line 4: 40 km
The following elements will be operated: Flt1_2 (line 1), Flt2_1 (line 2), Flt3_3 (line 3) and
Flt4_1 (line 4). Here again, if the number of sections asked does not correspond to the fault
distances entered by the user, Hypersim would give an error and stop the study.
E Signal
Description

For both models, only the signals concerning the faults are available. For the coupled line
with fault, these are the following:
I(a, b, c, n)_Flt1\line label: Currents in line 1 fault (ampere);
V(a, b, c)_Flt1\line label: Voltages on the fault bus of line 1(volt);
I(a, b, c, n)_Flt2\line label: Currents in the line 2 fault (ampere);
V(a, b, c)_Flt2\line label: Voltages on the fault bus of line 2 (volt);
For the quadruple line with fault, the following signals are available:
I(a, b, c, n)_fault label\line label: Current in the given fault element (ampere)
V(a, b, c)_bus fault label\line label: Voltages on the given bus fault (volt)
In all the cases, the number of signals available is related to the number of faults asked by the
user. Hence, if no fault is specified (case with 1section), no signal will be available.
As for the other signals usually available in each of the sub-elements making up the combined
model, the user can see them when he displays the combined model content.

2-7-298

Lines and Cables

Distributed Parameters Lines - 3, 6, 9


and 12 Phases
F Control Panels

Figure 7 - 28 Coupled Line with Fault Control Panel

2-7-299

Lines and Cables


PI Line Sections

7.3 PI LINE SECTIONS1


7.3.1

PI Lines and PI
Lines with
Fault

A Introduction

The PI line model is mainly used for short transmission lines. See equivalent diagram on Figure 7 - 29.

XL
XC

R
XC

Figure 7 - 29 PI section equivalent diagram


B PI Line Icon and
Diagram

PI
Figure 7 - 30 PI Line Icon and Diagram

PI
Figure 7 - 31 PI Line with Fault Icon and Diagram

1.IOn order to simplify the text, the PI line sections are called PI lines in this Chapter.

2-7-300

Lines and Cables

PI Line Sections

C Parameter
Description
D General
Parameters

Base MVA: Base power in MVA


Base Volt: Line base voltage - phase to ground kV
Base Freq: Base frequency (Hz)
Length: Line length (km);
Data base key name: Key to access the line data base (optional package).

E EMTP Geometric
parameters

F RLC Parameters

Fault/file: to reset values / calculation of parameters


File name: EMTP or Inpurdue format file containing the geometric parameters of the
lines. The EMTP .pun format is not allowed with this model.
Matrix/Sequences:
Matrix (untransposed line; fill in the matrices);
Sequences (transposed line; fill in the sequences);
R, L, C: R, L, C matrices (ohm/km, henry/km, farad/km);
Sequence 0: Zero sequence;
Sequence 1: Positive sequence.

G Fault Parameters

The fault parameters are exactly the same as those for constant parameters lines. For more
details, see 3 on page 275.

H List of Available
Signals

At acquisition, the following signals are made available by the sensors:

I Line Signals

I1(a,b,c)_bus label: Current in each phase at end 1


I2(a,b,c)_bus label: Current in each phase at end 2

J Fault Signals

V(a, b, c)_FLT_line label: Voltage on fault bus (volt);


I(a, b, c, n)_FLT_line label: Fault current (ampere);
CMD(a, b, c, n)_FLT_line label: Command for states of phase and ground breakers.

2-7-301

Lines and Cables


PI Line Sections

K PI Lines Control
Panels

Figure 7 - 32 PI Line Control Panel

2-7-302

Lines and Cables

PI Line Sections

Figure 7 - 33 PI Line with Fault Control Panel


L Line Data

The geometric data shown in Figures 7 - 6 to 7 - 7 are used to calculated a PI line.

M Load File

An EMTP file that contains the physical parameters of the lines (Fig 7 - 2 and 7 - 3) or the
resolve matrix by the external software of EMTP can be loaded automatically in the parameter form.Calculation of Electrical Parameters and Corresponding Control Panel

N Calculation of
Electrical
Parameters

The calculation of electrical parameters of frequency constant parameter lines with their geometric parameters is done by using Hyperline Line Data module in Hyperview. Figure 7 - 9
shows the relevant part of the Hyperline geometrical parameters.
Load a file into the Line Data GUI or enter your geometrical line parameters.
Select the transpositions options.

2-7-303

Lines and Cables


PI Line Sections

Run the program.


The electrical parameters are displayed in the Line Data report.
O Transfert
Electrical
Parameters to
Hypersim Lines

The transfert of electrical parameters to Hypersim is very simple.


In Hypersim GUI, edition mode, draw a network with lines.
Go to simulation mode.
Go to the Line Data GUI, you will see all the names of the lines in you network at the
bottom of the page.
To transfert electrical parameters, choose the name of the line and them apply parameters.
See the parameters in the forms of the line.

7.3.2

Coupled PI
Lines and
Coupled PI
Lines with
Fault

As for the PI line model, the coupled PI line model is mainly used for short transmission lines.

A Coupled PI Line
Icon and
Diagram

1.1

1.2

2.1

2.2

PI C
Figure 7 - 34 Coupled PI Line Icon and Diagram

1.1

1.2

2.1

2.2

PI C

Figure 7 - 35 Coupled PI Line with Fault Icon and Diagram

2-7-304

Lines and Cables

PI Line Sections

B Parameter
Description

The parameters for Coupled PI lines are the same as for those for simple PI lines, except that
the dimension of the R, L and C matrices representing the impedances and admittances of the
conductors is 6x6, instead of 3x3. The reason is that this model represents a line with six conductors.
There is a new parameter for sequences. As for the simple PI model, the positive sequence
and zero sequence parameters for each circuit are present. Moreover, the neutral coupling between both circuits must be represented. This is referred to as mutual impedance and is represented only in zero sequence. The user must remember that if he uses the parameter input
by sequences, the simulation will only be an approximation of the reality, the coupling between the phases of both circuits not being represented.

C List of Available
Signals
D Fault Signals

No line signal is available for coupled PI lines. The reason is that the calculations required to
obtain the signals would slow down considerably the time required to simulate the model.
Hence, only the fault signals are available.

V(a, b, c)_FLT1_line label: Voltage on fault bus of line 1 (volt);

V(a, b, c)_FLT2_line label: Voltage on fault bus of line 2 (volt);

I(a, b, c, n)_FLT1_line label: Fault current of line 1 (ampere);


I(a, b, c, n)_FLT2_line label: Fault current of line 2 (ampere);
CMD(a, b, c, n)_FLT1_line label: Command for states of phase and ground breakers of
line 1.
CMD(a, b, c, n)_FLT2_line label: Command for states of phase and ground breakers of
line 2.

2-7-305

Lines and Cables


PI Line Sections

E Coupled PI Lines
and Coupled PI
Lines with Fault
Control Panels

Figure 7 - 36 Coupled PI Line Control Panel

2-7-306

Lines and Cables

PI Line Sections

Figure 7 - 37 Coupled PI Line with Fault Control Panel


F Line Data

The geometric data of a coupled PI line are the exactly the same as those for a constant parameters coupled line. Figures 7 - 15 7 - 16 show the geometric parameters required to calculate the electrical parameters.

7.3.3

The models of triple and quadruple PI lines are a generalization of the coupled PI line model.
They represent respectively 3 and 4 three phase circuits. The quadruple model with fault is
also available.

Triple and
Quadruple PI
Lines

A Triple and
Quadruple PI
Lines Icons and
Diagrams

PI 3

1.1

1.2

2.1

2.2

3.1

3.2

Figure 7 - 38 Triple PI Line Icon and Diagram

2-7-307

Lines and Cables


PI Line Sections

1.1

1.2

2.1

2.2

3.1

3.2

4.1

4.2

PI 4

Figure 7 - 39 Quadruple PI Line Icon and Diagram

1.1

1.2

2.1

2.2

3.1

3.2

4.1

4.2

PI 4

Figure 7 - 40 Quadruple PI Line with Fault Icon and Diagram


B Parameter
Description

2-7-308

The parameters for triple and quadruple PI lines are the same as for those for simple PI lines,
except that the dimensions of the R, L and C matrices representing the impedances and admittances of the conductors are 9x9 and 12x12. Since these matrices are large, the option allowing to calculate the values of the parameters from EMTP or Inpurdue files is quite
interesting. It allows to avoid the tedious task of re-transcribing the values and possible resulting errors.

Lines and Cables

PI Line Sections

C List of Available
Signals
D Fault Signals

As for a coupled PI line, there is no line signal available for triple and quadruple PI lines. Only
the fault signals are available.
V(a, b, c)_FLT1_line label: Voltage on fault bus of line 1 (volt);
V(a, b, c)_FLT2_line label: Voltage on fault bus of line 2 (volt);
V(a, b, c)_FLT3_line label: Voltage on fault bus of line 3 (volt);
V(a, b, c)_FLT4_line label: Voltage on fault bus of line 4 (volt);
I(a, b, c, n)_FLT1_line label: Fault current of line 1 (ampere);
I(a, b, c, n)_FLT2_line label: Fault current of line 2 (ampere);
I(a, b, c, n)_FLT3_line label: Fault current of line 3 (ampere);
I(a, b, c, n)_FLT4_line label: Fault current of line 4 (ampere);
CMD(a, b, c, n)_FLT1_line label: Command for states of phase and ground breakers of
line 1.
CMD(a, b, c, n)_FLT2_line label: Command for states of phase and ground breakers of
line 2.
CMD(a, b, c, n)_FLT3_line label: Command for states of phase and ground breakers of
line 3.
CMD(a, b, c, n)_FLT4_line label: Command for states of phase and ground breakers of
line 4.

2-7-309

Lines and Cables


PI Line Sections

E Control Panels
for PI Lines Triple,
Quadruple and
Quadruple with
Fault

Figure 7 - 41 Triple PI Line Control Panel

2-7-310

Lines and Cables

PI Line Sections

Figure 7 - 42 Quadruple PI Line Control Panel

2-7-311

Lines and Cables


PI Line Sections

Figure 7 - 43 Quadruple PI Line with Fault Control Panel


F Line Data

2-7-312

Since these models are a generalization of the coupled PI line, the data are calculated in the
same way. See section F on page 307 for more details.

Lines and Cables

Marti Lines

7.4 MARTI LINES


The Marti line model is used to represent transmission lines with frequency dependent distributed parameters.

Is

Vs

Ir
Zeq

+
bs

Zeq

+
br

Vr

Figure 7 - 44 Marti model of a line with frequency dependent parameters


A Icons and
diagrams of
Marti models of
lines

The following icons and diagrams are used to represent respectively the Marti model of a 2phase, 3-phase and 4-phase lines and the Marti model of a 4-phase line.

M2
Figure 7 - 45 Icon and diagram of a 2-phase Marti model

M3
Figure 7 - 46 Icon and diagram of a 3-phase Marti model

2-7-313

Lines and Cables


Marti Lines

M4
Figure 7 - 47 Icon and diagram of a 4-phase Marti model
B Parameter
description

1 General parameters.

Length: The length of the line (km);


Data base key name: Key to access the line data base (optional package).
2 Mode parameters.

Source of parameters (control panel, EMTP file): Specifies the source of the parameters;
EMTP file: The name of the EMTP file containing the line parameters;
R0: Modal resistances for infinite frequency;
T0: Delay for modal propagation;
nZ: Number of poles for impedance functions and maximum number of poles;
nA: Number of poles for propagation functions and maximum number of poles;
Ti: Transformation matrix;
KZ: Residues of impedance function;
PZ: Pole of modal impedance function;
KA: Residues of modal propagation function;
PA: Pole of modal propagation function.
C List of available
signals

At acquisition, the signals made available by the sensors are the following:
V_bus label: Bus voltage (volt);
I (1, 2, 3)_bus label_(a, b, c): Current for each phase (ampere);
Bhist_line label_bus label: Voltage of the equivalent source (volt).

D The parameter
control panel of
the 2-phase Marti
model

This section presents the data for Marti Lines and shows how to fill in the parameter control
panels.

E Data of a 2phase Marti line

Figures 7 - 48 and 7 - 49 show the geometrical data of a cable to be modelled by a 2-phase


Marti model.

2-7-314

Lines and Cables

Marti Lines

R = 94.0 mm

Insulation

R = 89.25 mm
R = 73.60 mm
R = 66.0 mm

Shielding

Sheath

R = 60.0 mm

R = 37.5 mm
R = 12.5 mm

Core

Figure 7 - 48 Geometrical parameters of a single cable

40 m
0

150 m

300 m

450 m

Figure 7 - 49 Cable arrangement


F Calculation of
electrical
parameters and
related
parameter form

The calculation of the electrical parameters of a cable line from its geometrical parameters is
done by the CABLE CONSTANTS auxiliary module of EMTP. Figure 7 - 50 shows the
EMTP input file for the calculation of parameters of a cable line with geometrical parameters
in Figures 7 - 48 and 7 - 49.

2-7-315

Lines and Cables


Marti Lines

BEGIN NEW DATA CASE


C JMARTI SETUP
C HVDC DC CABLE CONSTANT
C
CABLE CONSTANTS JMARTI SETUP
C
REVISION DATE 1996.06.13 (CA-3) TYPE: PROTO-3
C
(E=2.80)
CABLE CONSTANTS
1
C --+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
2 -1 1 0 1 1 1
2
3
C NO.1
12.50E-3 37.50E-3 60.00E-3 66.00E-3 73.60E-3 89.25E-3 94.00E-3
2.16E-8
1.0
1.0
2.80 22.00E-8
1.0
1.0
2.3
14.00E-8
10.0
1.0
4.0
0.21
0.1
50700.0
.NODES
BUS1A BUS2A BUS1B BUS2B
C
.FIT-S
30
C ---RHO------><-----FREQ---->IDEC>IPNT><length>
0.21
0.0001 8 20 50700.0
BLANK ENDING FREQUENCY CARDS
BLANK
BLANK

Figure 7 - 50 The EMTP input file for the transmission line in Figure 7 - 48
The resulting EMTP output file (*.pun) contains the electrical cable parameters required by
Hypersim. The user can fill in manually the parameter form using the data from this file.
However, it is much more convenient to provide the parameters of a Marti line by specifying
where this file is located. The data form used for a 2-phase Marti model is shown in Figures
7 - 51 and 7 - 52.

2-7-316

Lines and Cables

Marti Lines

Figure 7 - 51 The data form for a 2-phase Marti model (Page 1)

2-7-317

Lines and Cables


Marti Lines

Figure 7 - 52 The data form for a 2-phase Marti line (Page 2)

2-7-318

Lines and Cables

Marti Lines

Figure 7 - 53 The data form for a 2-phase Marti line (Page 3)


G The data form of
the 4-phase Marti
model

The figures 7 - 54, 7 - 55 and 7 - 56 show the geometrical data of a D.C. line to simulated by
a 4-phase Marti model.

2-7-319

Lines and Cables


Marti Lines

-10.20 m

Neutral

10.20 m

N1

N2

Pole 1

Pole 2
58.0 m

45.00 m

= 300-m
Figure 7 - 54 Arrangement of the conductors for a D.C. line to be
modelled by a 4-phase Marti model

50 cm
3,84 cm

45

Figure 7 - 55 Details of a conductor bundle

2-7-320

Lines and Cables

Marti Lines

Sag

Ytower Y m ea n

Y m ea n= Ytower (2/3) sag

Figure 7 - 56 Line heights


H Calculation of
electrical
parameters and
related
parameter form

The calculation of the electrical parameters of a line from its geometrical parameters can be
done with the LINE CONSTANTS auxiliary module of EMTP. The EMTP input file for calculation of parameter of the Marti model of the line with geometric data in Figures 7 - 54 to
7 - 56 is shown in Figure 7 - 57.

BEGIN NEW DATA CASE


C JMARTI SETUP
C HVDC DC LINE CONSTANT
C REVISION DATE 1996.06.13 (OH-3) TYPE: PROTO-3
C BRANCH
LINE CONSTANTS
C 345678901234567890123456789012345678901234567890123456789012345678901234567890
LINE-MODEL
FD-LINE QREAL LOG
0.0001 20
8
METRIC
C ><SKN><RESIS ><><REACT >< DIAM >< HORIZ><YTOWER><YMID ><SPEAK ><ALPH><NAME><>
10.375 0.0353 4
3.84 10.2 45.0 25.73 50.0 45.0
4
20.333 0.0458 4
3.42 10.2 58.0 39.22 50.0
2
30.333 0.0458 4
3.42 -10.2 58.0 39.22 50.0
2
40.375 0.0353 4
3.84 -10.2 45.0 25.73 50.0 45.0
4
BLANK card terminates conductor cards
C FREQUENCY CARD
C 345678901234567890123456789012345678901234567890123456789012345678901234567890
C
1
2
3
4
5
6
7
8
C RHO ><FREQUENC>< FCAR > <ICPR> <IZPR> I<DISTKM> <IZ>IM<I><I><I><>
300.
0.1
50.9
.NODES
BUSP1K BUSP1M BUSN1K BUSN1M BUSN2K BUSN2M
BUSP2K BUSP2M
.FIT-S
30
BLANK ENDING FREQUENCY CARDS
BLANK
BLANK

Figure 7 - 57 The EMTP input file for calculation of the Marti model of
the line in Figures 7 - 54 to 7 - 56
The resulting EMTP output file (*.pun) contains the electrical line parameters required by
Hypersim. The .pun file corresponding to the data in Figure 7 - 57 is shown in Figures 7 58 and 7 - 59.

2-7-321

Lines and Cables


Marti Lines

C
C LINE-MODEL
FD-LINE QREAL LOG
0.0001 20
8
C METRIC
C 10.375 0.0353 4
3.84 10.2 45.0 25.73 50.0 45.0
4
C 20.333 0.0458 4
3.42 10.2 58.0 39.22 50.0
2
C 30.333 0.0458 4
3.42 -10.2 58.0 39.22 50.0
2
C 40.375 0.0353 4
3.84 -10.2 45.0 25.73 50.0 45.0
4
C LINE LENGTH = 5.0900E+01 KM
C TRANSFORMATION MATRIX AT F = 1.0000E-01 HZ
-1BUSP1KBUSP1M
1.
-2 4
R0
6
6.437860366261666e+02
1.214563368916744e+05 8.994441071796258e+03 9.878533416150984e+02
5.218688145700812e+02 2.430827370035715e+02 7.811462924772060e+00
1.573655176109663e+03 1.326129090933324e+02 1.033929558222937e+01
4.720148714239056e-01 5.986097456300203e-02 1.579806414525393e-02
T0
nA 36 1.80603943883336581040E-04
4.662533059105316032D-11 6.821937376811354945D-11 2.036425921631951910D-10
5.782581397886991044D-10 1.687971007582514476D-09 4.983484329520763705D-09
1.440602361633273348D-08 4.492392323440471920D-08 1.390729687723402390D-07
4.708724021562232745D-07 1.092178475607250470D-06 8.919761717110231665D-06
8.686525464437772686D-06 2.771537571914321074D-05 4.018241196287703572D-05
1.636814650944065305D-04 2.892839786758156693D-04 1.004748201698990161D-03
3.573004008256362458D-03 1.250239166968926396D-02 1.088917224526830541D-01
2.124338189429190171D-01 1.924036334921463531D+00 5.028884404205944847D+00
2.270839272506772488D+01 1.005120632103304530D+02 1.728685079097975006D+02
3.260014906770318817D+02 9.230572847123396514D+02 1.039769622449470944D+03
1.104436574501146879D+03 2.317426161133841561D+03 4.642998362234140586D+03
3.169056986486492860D+03 2.328272207020388669D+04 -3.911681296616907730D+03
2.223404209406260133D-03 3.158973565128211838D-03 4.620224846946283971D-03
6.553228186189036762D-03 9.359945697033484474D-03 1.367597714546365216D-02
1.967682124234779867D-02 2.984507701838491969D-02 4.679117422496081174D-02
7.842264240354916705D-02 9.052468308324533586D-02 1.855867115050435778D-01
3.615974033037598345D-01 5.763849865435555220D-01 8.356366705416022889D-01
3.421543779670204177D+00 6.041710511465915090D+00 1.039910214779839137D+01
1.858317266760856157D+01 6.389692526674280515D+01 1.331847429808593120D+02
1.379898712321664505D+02 5.845725360525605083D+02 7.777991820967040439D+02
1.685455106787059549D+03 3.509811211668321448D+03 5.820471132514062447D+03
9.183896296573060681D+03 1.248690908732375465D+04 1.580547218124728533D+04
1.951304167973025324D+04 2.671587666179315056D+04 3.268633661035108526D+04
4.007253813554433145D+04 6.087350060935598594D+04 5.646628840528698638D+05

nZ

MODE1
MODE2

-2BUSN1KBUSN1M
1.
-2 4
5
2.731482551204742e+02
-9.617788099334194e-01 6.308605919641434e+02 4.331193406334487e+02
1.724221434755087e+02 8.328710114501270e+01
7.559048915655471e+01 4.372324142004216e+00 6.989164008294293e-01
9.952942517690895e-02 2.165210789595314e-02
30
1.68507017024313034918E-04
2.976288939736678219D-10 4.166278000269748347D-10 1.270207088772429399D-09
3.625107712087353094D-09 1.084682154673342536D-08 3.225016998561776654D-08
...
3.141638984294353122D+03 8.032413459861278170D+03 9.454125255094317254D+03
3.057435910389564015D+04 2.660536798970897798D+05 4.383186793487734976D+05

Figure 7 - 58 The EMTP .pun file corresponding to


the input file in Figure 7 - 57 (Part 1)

2-7-322

Kz
Pz

KA

PA

Lines and Cables

Marti Lines

-3BUSN2KBUSN2M
1.
-2 4
6
3.050308162611487e+02
3.348479781276822e+03 -8.095005363236048e+02 2.165881690405804e+03
1.021488796061139e+03 3.300304498698357e+02 7.434504231273161e+01
1.215446694638670e+03 1.531321007648782e+02 9.956339486126524e+00
8.199131063720786e-01 7.613337629023763e-02 1.725658009724277e-02
29 1.68268284460645992659E-04
2.940908085311805092D-10 4.241857409919830185D-10 1.223717587528708384D-09
3.622523167819298245D-09 1.040767747621782059D-08 3.212008378378164443D-08
...
2.399997252062681582D+03 2.484756152845921406D+03 2.839204597131427818D+03
1.029824746473909363D+04 1.315159405848341703D+04 3.675498740932818328D+04
3.830146072292901954D+04 5.352312728653086815D+05
-4BUSP2KBUSP2M
1.
-2 4
6
3.148580196898951e+02
1.009782611454571e+04 9.700705592854584e+02 1.785164564229039e+03
8.121117397051178e+02 2.481248068072373e+02 4.560548074649877e+01
1.909990749687859e+03 2.720098953443171e+02 7.710005439073262e+00
5.659886003231129e-01 5.428203874133661e-02 1.839846721795406e-02
34 1.67201687672315210328E-04
2.822129163856696038D-10 3.950236865850007068D-10 1.157316865913351826D-09
3.364203251730297467D-09 1.019612468842755876D-08 2.882580002984790444D-08
...
3.982991262883984018D+04 4.737342066570757015D+04 2.624315996852944372D+05
6.068675499114637496D+05
C Q MATRIX BY ROWS (IMAGINARY PART = 0)
0.68441637 -0.70411243 -0.16484151 0.39686270
0.00000000 0.00000000 0.00000000 0.00000000
0.17651442 -0.06497253 0.68760390 -0.58521579
0.00000000 0.00000000 0.00000000 0.00000000
0.17651443 0.06497253 -0.68760391 -0.58521578
0.00000000 0.00000000 0.00000000 0.00000000
0.68441638 0.70411242 0.16484153 0.39686270
0.00000000 0.00000000 0.00000000 0.00000000

Figure 7 - 59 The EMTP .pun file corresponding to


the input file in Figure 7 - 57 (Part 2)
From the results in Figures 7 - 58 and 7 - 59, the user can manually fill in the data form shown
in Figures 7 - 60 and 7 - 61. However, it is much more convenient to provide the parameters
of a Marti line by specifying where this file is located.

2-7-323

Lines and Cables


Marti Lines

Figure 7 - 60 The control panel for a 4-phase Marti line (Page 1)

2-7-324

Lines and Cables

Marti Lines

Figure 7 - 61 The control panel for a 4-phase Marti line (Page 2)

2-7-325

Lines and Cables


Marti Lines

Figure 7 - 62 The control panel for a 4-phase Marti line (Page 3)


I Data of a 3phase line

2-7-326

Figures 7 - 63 and 7 - 64 show the geometrical data of a line to be simulated by a 3 phase


Marti line model.

Lines and Cables

Marti Lines

-8.99m

-12.80m

phase A

8.99m

ground bundles

12.80m

phase B

phase C

32.92m
20.73m

= 100-m

Figure 7 - 63 Arrangement of the 735kV line conductors in the example

45,72cm
3,556 cm

45

Figure 7 - 64 Details of a conductor bundle


J Calculation of
electrical
parameters and
related
parameter form

The calculation of electrical parameters of the line from the geometrical parameters in Figures 7 - 63 and 7 - 64 is done by the LINE CONSTANTS auxiliary EMTP module. The EMTP
input file for parameter calculation is shown in Figure 7 - 65.

2-7-327

Lines and Cables


Marti Lines

C
LINE CONSTANTS
C 345678901234567890123456789012345678901234567890123456789012345678901234567890
C
1
2
3
4
5
6
7
8
LINE-MODEL
FD-LINE QREAL LOG
0.1
20
5
METRIC
C ><SKN><RESIS ><><REACT >< DIAM >< HORIZ><VTOWER><VMID ><SEPAR ><ALPH><NAME><>
10.375 0.0450 4
3.556 -12.80 20.73 20.73 45.72 45.0
4
20.375 0.0450 4
3.556 0.00 20.73 20.73 45.72 45.0
4
30.375 0.0450 4
3.556 12.80 20.73 20.73 45.72 45.0
4
00.500 3.605 4
1.111 -8.99 32.92 32.92
00.500 3.605 4
1.111 8.99 32.92 32.92
BLANK card terminates conductor cards
C FREQUENCY CARD
C 345678901234567890123456789012345678901234567890123456789012345678901234567890
C
1
2
3
4
5
6
7
8
C RHO ><FREQUENC>< FCAR > <ICPR> <IZPR> I<DISTKM> <IZ>IM<I><I><I><>
100.
60.
200.0
1
.NODES
BUSP1K BUSP1M BUSN1K BUSN1M BUSN2K BUSN2M
BUSP2K BUSP2M
.FIT-S
36
BLANK ENDING FREQUENCY CARDS
BLANK
BLANK

Figure 7 - 65 The EMTP input file for calculation of the Marti model
of the line in Figures 7 - 63 and 7 - 64
The resulting EMTP output file (*.pun) contains the electrical line parameters required by
Hypersim. The .pun file corresponding to the data in Figure 7 - 65 is shown in Figure 7 - 66.

2-7-328

Lines and Cables

Marti Lines

C LINE-MODEL
FD-LINE QREAL LOG
0.1
20
5
C METRIC
C 10.375 0.0450 4
3.556 -12.80 20.73 20.73 45.72 45.0
4
C 20.375 0.0450 4
3.556 0.00 20.73 20.73 45.72 45.0
4
C 30.375 0.0450 4
3.556 12.80 20.73 20.73 45.72 45.0
4
C 00.500 3.605 4
1.111 -8.99 32.92 32.92
C 00.500 3.605 4
1.111 8.99 32.92 32.92
C LINE LENGTH = 2.0000E+02 KM
C TRANSFORMATION MATRIX AT F = 6.0000E+01 HZ
C
-1WED7_aESD7_a
1.
-2 3
16
4.34653586960114296289E+02
1.851419703226241325D+02 2.590514312325236460D+03 -3.127957343905229209D+03
...
4.483556445570410142D+04 6.308395833257218328D+04 1.153384636619750963D+05
5.251121673719295068D+05
...
1.171430098321246533D+03 1.991595784569215539D+03 6.894394054349084399D+03
3.159058128914844201D+04
21
7.06384946825246249485E-04
1.904258889256747349D-05 3.524754126773281711D-04 3.625569758395469073D-04
...
4.910483664067133213D+04 5.673099278531855816D+04 5.678719061525723373D+04
-2WED7_bESD7_b
1.
-2 3
15
2.29021065423786012616E+02
1.631088231880090405D+02 5.113431558652671924D+02 1.446861730977163461D+04
...
3.214491323468353556D+01 5.052372264795839385D+01 3.620791801335191394D+03
18
6.65071879890839485865E-04
2.747596429699603377D-05 1.188730150254640149D-03 1.367079163808397179D-03
...
2.117885737552492355D+04 6.931031794019443623D+04 3.128498942513289512D+05
-3WED7_cESD7_c
1.
-2 3
11
2.76565769130997750835E+02
1.701832497454142583D+02 5.024925533556538539D+03 -5.873665913459929470D+03
...
2.961376653035809170D+01 4.023101487974561678D+03
20
6.70364152859894779982E-04
2.503675227104941751D-05 1.053032514606297865D-03 1.074039267770130878D-03
...
2.322205218597832572D+04 3.185514435311620400D+04 4.446687261054346163D+04
1.485183292621208820D+05 2.191337673961671826D+05
C Q MATRIX BY ROWS (IMAGINARY PART = 0)
0.59520424 -0.41318575 -0.70710678
0.00000000 0.00000000 0.00000000
0.53987156 0.81151353 -0.00000001
0.00000000 0.00000000 0.00000000
0.59520425 -0.41318573 0.70710679
0.00000000 0.00000000 0.00000000

Figure 7 - 66 The EMTP .pun file corresponding to


the input file in Figure 7 - 65
From the results in Figure 7 - 66, the user can fill in manually the data form shown in Figures
7 - 67 and 7 - 67. However, it is much more convenient to provide the parameters of a Marti
line by specifying where this file is located.

2-7-329

Lines and Cables


Marti Lines

Figure 7 - 67 The data form for a 3-phase Marti model (General)

2-7-330

Lines and Cables

Marti Lines

Figure 7 - 68 The data form for a 3-phase Marti line (Impedance)

2-7-331

Lines and Cables


Marti Lines

Figure 7 - 69 The data form for a 3-phase Marti line (Weighting)


7.4.1

DC Cable

This model was designed to better represent a DC cable. In this model, the user only has access to the core of the cable, the shield is grounded through impedances.

Figure 7 - 70 DC cable model

2-7-332

Lines and Cables

Marti Lines

A Icon and
diagram of a DC
cable

The following icon and diagram are used to represent a DC cable.

CC
Figure 7 - 71 DC cable: Icon and Diagram
B Description of
parameters

1 General parameters.

Length: Length of cable (km);


Data base key name: Access key to the line database (Optional Package).
2 Impedance of grounded shield .

Z1 (side 1): Impedance for shield grounding, side 1;


Z2: Impedance for shield grounding, side 2.
C Mode
parameters

Source of parameters Form (control panel)/ EMTP File);


EMTP File: Name of EMTP file with the cable parameters;
R0: Modal resistances for infinite frequency;
T0: Delay of modal propagation;
nZ: Number of poles for impedance functions and maximum number of poles;
nA: Number of poles for propagation functions and maximum number of poles;
Ti: Transform matrix;
KZ: Residues of impedance function;
PZ: Pole for modal impedance function;
KA: Residues of modal propagation function;
PA: Pole for modal propagation function;

D List of available
signals

At acquisition, the following signals are made available by the sensors:

E The data form of


a DC cable form

This example uses the same cable data in Figure 7 - 48 and the calculation of parameters is
done in a similar way. Figures 7 - 72 and 7 - 73 show the data form used for DC cable.

V_label of bus: Bus voltage (volt)

2-7-333

Lines and Cables


Marti Lines

Figure 7 - 72 The data form for a DC cable (Page 1)

2-7-334

Lines and Cables

Marti Lines

Figure 7 - 73 The data form for a DC cable (Page 2)

2-7-335

Lines and Cables


Marti Lines

Figure 7 - 74 The data form for a DC cable (Page 3)

2-7-336

Lines and Cables

Marti Lines

PAGE LEFT INTENTIONALLY BLANK

2-7-337

Lines and Cables


Marti Lines

2-7-338


Chapter 8
TRANSFORMERS

A General
Introduction

The three-phase transformer library contains models of linear, saturable and tap changer
transformers. These models are built using a combination of single-phase transformers with
two or three windings.
The connections available are the most common found. These are:

Y connection with or without neutral grounding

Delta connection which can prevent the flow of the zero-sequence current in the other
winding.

Zigzag connection in which the windings belonging to two phases are interconnected.

The saturation of the magnetic core can be represented if the user is interested in this aspect
of the study.
The tap changer characteristic is also available and is quite useful to setup power converters.
The hysteresis phenomena can be modelled with saturation1.
The main hysteresis cycle is characterized by four parameters. It is measured in DC so as not
to include the Foucault losses, which are taken into account by the parallel resistance (Rm).
The initial trajectory is characterized by only one parameter, the initial flux. Two other special parameters serve to minimize the generation of internal nested loops, and their corresponding trajectories, saved in memory (ex.: the loops that are too small will be ignored and
their trajectories modelized by a straight line segment). This is useful since their number must
be limited (100). Generally, the default sizes suffice in most cases simulated. Above this cycle (limited to Is), we enter into the saturation zone. The saturation is then characterized
either by a series of points on the curve or by an inductance the curve approaches asymptotically. In this last case, the model generates automatically segments (in the positive and negative saturation zone) of equal length (Is).
The characteristic Tap changer is also available and is very useful in setups with power converters.
1. The model then represents minor loops, internal to the main cycle, present in transient state.
The main rule dictating the generation of an internal loop is that the magnetization trajectory
depends on the last two inversion points (when the magnetization current changes sign) and each
curve tends to return to the second to last inversion point. To obtain a detailed description of the
model, consult the following reference: Silvano Casoria, Patrice Brunelle, Gilbert Sybille, Hysteresis Modeling in the Matlab/Power System Blockset, Mathematics and Computers in Simulation, Volume 63, Issues 3-5, Pages 237-248.

2-8-339

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings
In transmission and distribution networks, the three-phase transformers can be built either
with three single-phase transformers or with one three-phase unit called shell-type or coretype transformer.

8.1 THREE-PHASE LINEAR AND SATURABLE TRANSFORMERS WITH


TWO OR THREE WINDINGS
A Icons and
Diagrams of
Three-Phase
Transformers

The following icons and diagrams are used to represent the different three-phase transformers
available with Hypersim. The number of windings is specified directly on the diagram representing the selected transformer.

Three-Phase Linear Transformer with 2 Windings

Three-Phase Saturable Transformer with 2 Windings

Three-Phase Linear Transformer with 3 Windings and Internal


Tertiary

Three-Phase Saturable Transformer with 3 Windings and Internal


Tertiary

Three-Phase Linear Tans former with 3 Windings

Three-Phase Saturable Transformer with 3 Windings


1
TrF3
2

Three-Phase Zigzag Transformer (Linear) with 3 Windings

Figure 8 - 1 Icons and Diagrams of Three-Phase Transformers

2-8-340

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings
B Parameter
Description

Single phase representations of three-phase linear and saturable transformers, with three
windings, are shown in Figure 8 - 2and 8 - 3.

R1

L2

R2

L3

R3

L1

Rm

Lm

Figure 8 - 2 Single-Phase Representation of a Linear Transformer

R1

L2

R2

L3

R3

L1

Rm

Lsat

Figure 8 - 3 Single-Phase Representation of a Saturable Transformer


C General
Parameters

Base MVA: Base power per phase in MVA;


Base Freq: Base frequency in hertz;
Vbase primary: Bbase voltage on the primary of the transformer in kV rms;
Vbase secondary: Effective base voltage on the secondary in kV rms.

D Magnetization
Impedance
Parameters

Rm: Equivalent resistance of iron losses of the magnetic circuit. Expressed in ohm;
Lm: Magnetization inductance in henry (for linear transformers only).

2-8-341

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings
E Winding
Parameters

Connections:
Y ground: Grounded Y connection;
Y floating: Floating Y connection;
Delta lead: Delta connection with lead of 30
Delta lag: Delta connection with lag of 30
Delta ground: Grounded delta connection;
Vnom.: Rated voltage of winding (kV rms);
R1, L1: Leakage resistance (ohm) and inductance (henry) of winding 1;
R2, L2: Leakage resistance (ohm) and inductance (henry) of winding 2;
R3, L3: Leakage resistance (ohm) and inductance (henry) of winding 3;
Note : To simplify the representation, the leakage inductances of the secondary windings
are used to highlight the decoupling element. This element is internal to the transformer model and the user cannot access it.
Znxx: Neutral impedance where the first x specifies the winding and the second x specifies the impedance number for a given winding (only applies to a Yg winding).
Note : Only applies to a zigzag transformer. In such a case, the primary and tertiary windings are connected to form a zigzag. The user specifies the phase shift with respect
to the reference winding. The only model in this category does not show any saturation.
Default, Lagging and Leading: Selection of the type of phase shift with respect to
the reference winding.
Vnom (zigzag)/winding: Rated voltage of the zigzag winding.

F Saturation
Parameters

The saturation is characteristic of the core, hence of the winding and not the type of threephase connection (Y, delta or zigzag). It is represented only for the magnetization branch
(schematically using line segments).
Number of points: Represents the number of segments of the current-flux saturation
curve. Only the positive part of the curve is specified; the negative part is completed by
symmetry;
Residual flux: Only used for inrush current phenomena;
Isat: The value of the current (in ampere) for each segment of the saturation curve. The
origin (0.0,0.0) is implied. The number of segments must be equal to the parameter
number of points;
Flux: The value of the flux (in volts-second) for each segment of the saturation curve.
The origin (0.0,0.0) is implied. The number of segments must be equal to the parameter
number of points.

2-8-342

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings
Flux

3
2
1

Isat

Figure 8 - 4 Saturation Curve of a Saturable Transformer


G Hystereris
Parameters with
Saturation

Hysteresis:
PHIr: Positive remanent flux (in volts-second) at null current;
Ic: Positive coercive current (in Amperes) at null flux;
Slope @ Ic: Flux slope (in Henry) at coercive current;
Initial flux: Initial flux (in volts-second) determining initial trajectory. The initial trajectory
is calculated by supposing that it has an inversion point on the main cycle;
Tolerance (Flux): Special parameter limiting the generation of minor nested loops. When the
fluxes at the last inversion point and the preceding inversion point are closer than the specified tolerance (in PHIs%, it is assumed that there is displacement on the current loop).
Tolerance (Current): Special parameter limiting the generation of minor nested loops. When
the magnetizing current at the last inversion point and the preceding inversion point are closer
than the specified tolerance (in Ic%), it is assumed that there is displacement on a trajectory
represented by a straight line segment.
Saturation:
Saturation Type: Determines if the parameters are calculated by the model or defined by a
series of segments.
Is: Current value (in Amperes) of the first point in the saturation zone;
PhIs: Flux value (in volts-second) of the first point in the saturation zone;
Ls: Value of saturation inductance (in Henrys) which the curve approaches asymptotically;
Number of points: Represents the number of segments in the current-flux saturation zone.
Only the positive part of the curve is specified; the negative part is completed by symmetry;

2-8-343

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings
Isat: Current value (in Amperes) for each segment of the saturation curve. The first value
must be equal to Is. The number of segments must be equal to the number of points parameter.
Flux: Flux value (in volts-second) for each segment of the saturation curve. The first value
must be equal to PHIs. The number of segments must be equal to the number of points parameter.
H List of Available
Signals

The following signals are made available after an acquisition for analysis or processing.
These signals vary from one transformer to another.
IMAGa,b,c_Trllabel: Magnetization current for each phase of a saturable transformer;
ILMAGa,b,c_Trlabel: Magnetization current for each phase of a linear transformer;
SEGa,b,c_Trlabel: Segment number of the saturation curve. -The numbering is positive
starting at 1 for the last segment in the negative saturation zone.
-In the hystereris model, the numbering is positive/negative starting at 1/-1 in the positive/negative saturation zone. In the hysteresis zone, it takes a null value.
Traject: Number identifying the trajectory of the operating point in the hysteresis
model. The trajectories making up the main cycle take the value of 1. The initial trajectory for which it is assumed that it has an inversion point on the main cycle takes the
value of 2 and so on. The number increases when the trajectories form nested loops;
and decreases when the loop is not nested. The upper limit accepted by the model is
100. Above this number, the simulation results are erroneous;
FLUXa,b,c_Trlabel: Magnetization flux for each phase for a saturable transformer
(volt-second);
IPRIMa,b,c_Trlabel: Current in the primary for each phase (ampere)

I Control Panels
of Three-Phase
Transformers

2-8-344

Figures 8 - 5 and 8 - 6 show respectively the control panels allowing the user to enter the parameters for a three-phase linear transformer with two windings.

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 5 Control Panel of a Linear Transformer


with Two Windings (General)

2-8-345

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 6 Control Panel of a Linear Transformer


with Two Windings (Neutral Impedance)
Figures 8 - 7, 8 - 8 and 8 - 9 show the control panel of a three-phase saturable transformer
with two windings per phase.

2-8-346

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 7 Control Panel of a Saturable Transformer


with Two Windings (General)

2-8-347

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 8 Control Panel of a Saturable Transformer


with Two Windings (Neutral Impedance)

2-8-348

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 9 Control Panel of a Saturable Transformer


with Two Windings (Saturation)

2-8-349

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 10 Control Panel for a Saturable Transformer


with 2 Windings (Hysteresis and Saturation)
Figures 10 and 11 show the control panels related to a three-phase zigzag transformer.

2-8-350

Transformers

Three-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 11 Control Panel of a Zigzag Transformer with


3 Windings (General)

2-8-351

Transformers

Single-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 12 Control Panel of a Zigzag Transformer with


3 Windings (Neutral Impedance)

8.2 SINGLE-PHASE LINEAR AND SATURABLE TRANSFORMERS WITH


TWO OR THREE WINDINGS
A Introduction

These transformers are mainly used to simulate single-phase networks or circuits. They can
be linear or saturable. Their characteristics are identical to those of three-phase transformers.

B Icons and
Diagrams of
Single-Phase
Transformers

The following icons and diagrams are used to represent the different single-phase transformers available with Hypersim. The number of windings is specified directly on the diagram
representing the selected transformer.

2-8-352

Transformers

Single-Phase Linear and Saturable


Transformers with Two or Three
Windings

2
TrP9
4

2
TrV8

1
3

2
Tr9Z
4 5

Single-Phase Series Linear Transformer with 2 windings

Single-Phase Series Saturable Transformer with 2 windings

Single-Phase Series Saturable Transformer with 3 windings

Figure 8 - 13 Icons and Diagrams of Single-Phase Transformers


C General
Parameters

Base MVA: Base power per phase in MVA


Base Freq: Base frequency in hertz
Vbase primary: Effective base voltage on the primary of the transformer in kV rms
Vbase secondary: Effective base voltage on the secondary in kV rms

D Magnetization
Impedance
Parameters

Rm: Equivalent resistance of iron losses of the magnetic circuit. Expressed in ohm;

E Winding
Parameters

Vnom1, Vnom2: Rated voltage of winding (kV rms);

Lm: Magnetization inductance in henry (for linear transformer only).

R1, L1: Leakage resistance (ohm) and inductance (henry) of winding 1;


R2, L2: Leakage resistance (ohm) and inductance (henry) of winding 2;
R3, L3: Leakage resistance (ohm) and inductance (henry) of winding 3;
Note : To simplify the representation, the leakage inductances of the secondary windings
are used to highlight the decoupling element. This element is internal to the transformer model and the user cannot access it.
Znxx: Neutral impedance where the first x specifies the winding and the second x specifies the impedance number for a given winding (only applies to a Yg winding).

F Saturation
Parameters

Note : The saturation is characteristic of the core, hence of the winding. It is represented
(schematically with line segments) only for the magnetization branch.
Number of points: Represents the number of segments of the current-flux saturation
curve. Only the positive part of the curve is specified; the negative part is completed by
symmetry;

2-8-353

Transformers

Single-Phase Linear and Saturable


Transformers with Two or Three
Windings
Residual flux: Only used for inrush current phenomena;
Isat: The value of the current (in ampere) for each segment of the saturation curve. The
origin (0.0,0.0) is implied. The number of segments must be equal to the parameter
number of points;
Flux: The value of the flux (in volt-second) for each segment of the saturation curve.
The origin (0.0,0.0) is implied. The number of segments must be equal to the parameter
number of points.
Flux

3
2
1

Isat

Figure 8 - 14 Saturation Curve of a Saturable Transformer


G Hysteresis
parameters with
saturation

Parameters are identical to the saturable three-phase transformers. (see Section 8.1).

H List of Available
Signals

The following signals are made available after an acquisition for analysis or processing.
These signals vary from one transformer to another.
IMAG_Trllabel: Magnetization current for a saturable transformer (ampere);
ILMAG_Trlabel: Magnetization current for a linear transformer (ampere);
SEG_TRlabel: Segment number of the saturation curve.
- The numbering is positive starting from 1 for the last segment in the negative saturation curve.
- With the hysteresis model, is positive/negative starting from 1/-1 in the positive/negative saturation zone. In the hysteresis zone the value in nil.
Traject: Number identifying the trajectory of the operating point in the hysteresis model
(see three-phase transformer for more details).
FLUX_Trlabel: Magnetization flux for a saturable transformer (volts-second);
IPRIMa,b,c_Trlablelabel: Current on primary (A) in the linear transformer.

2-8-354

Transformers

Single-Phase Linear and Saturable


Transformers with Two or Three
Windings
Figure 8 - 15 shows the control panel of a single-phase linear transformer with two windings.

Figure 8 - 15 Single-Phase Linear Transformer with 2 Windings:


General Parameters
Figures 8 - 16 and 8 - 17 show both control panels required to enter the parameters of a singlephase saturable transformer with 2 windings.

2-8-355

Transformers

Single-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 16 Single-Phase Saturable Transformer with 2 Windings:


General Parameters

2-8-356

Transformers

Single-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 17 Single-Phase Saturable Transformer with 2 Windings:


Saturation Characteristic

2-8-357

Transformers

Single-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 18 Single-Phase Saturable Transformer with 2 Windings:


(Hysteresis and Saturation)
Figures 8 - 19 and 8 - 20 show the control panel to fill in for a single-phase saturable transformer with three windings

2-8-358

Transformers

Single-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 19 Single-Phase Saturable Transformer with 3 Windings:


General Parameters

2-8-359

Transformers

Single-Phase Linear and Saturable


Transformers with Two or Three
Windings

Figure 8 - 20 Single-Phase Saturable Transformer with 3 Windings:


Saturation Characteristic

2-8-360

Transformers

Linear and Saturable Series


Transformers

Figure 8 - 21 Single-Phase Saturable Transformer with 3 Windings:


Hysteresis parameters

8.3 LINEAR AND SATURABLE SERIES TRANSFORMERS


A Introduction

These transformers could have been included in the first section dealing with three-phase
transformers. However, because of their particular connection (series), they were set apart.
They follow the same principle as current transformers. They are mainly used for series devices such as DVR, active filter, UPFC, etc.

2-8-361

Transformers

Linear and Saturable Series


Transformers
B Icons and
Diagrams of
Series
Transformers

The following icons and diagrams are used to represent the three different types of threephase series transformers available with Hypersim. The number of windings is specified directly on the diagram representing the selected transformer.

Three-Phase Linear Series Transformer with 2 Windings

Three-Phase Linear Series Connection Primary


Transformer with 2 Windings

Three-Phase Saturable Series Connection Primary


Transformer with 2 Windings
Figure 8 - 22 Icons and Diagrams of Series Transformers
C General
Parameters

Base MVA: Base power per phase in MVA;


Base Freq: Base frequency in hertz;
Vbase primary: Effective base voltage on the primary of the transformer in kV rms;
Vbase secondary: Effective base voltage on the secondary in kV rms.

D Magnetization
Impedance
Parameters

Rm: Equivalent resistance of iron losses of the magnetic circuit. Expressed in ohms;

E Winding
Parameters

Connections:

Lm: Magnetization inductance in henry (for linear transformer only).

Y ground: Grounded Y connection;


Y floating: Floating Y connection;
Delta lead: Delta connection with lead of 30
Delta lag: Delta connection with lag of 30
Delta ground: Grounded delta connection;
Vnom.: Rated voltage of winding (kV rms);
R1, L1: Leakage resistance (ohm) and inductance (henry) of winding 1;
R2, L2: Leakage resistance (ohm) and inductance (henry) of winding 2;

2-8-362

Transformers

Linear and Saturable Series


Transformers
Note : To simplify the representation, the leakage inductances of the secondary windings
are used to highlight the decoupling element. This element is internal to the transformer model and the user cannot access it.
Znxx: Neutral impedance where the first x specifies the winding and the second x specifies the impedance number for a given winding (only applies to a Yg winding).
F Saturation
Parameters

Note : The saturation is characteristic of the core, hence of the winding and not the type
of three-phase connection (Y or delta). It is represented (schematically with line
segments) only for the magnetization branch. See Figure 8 - 23.
Number of points: Represents the number of segments of the current-flux saturation
curve. Only the positive part of the curve is specified; the negative part is completed by
symmetry;
Residual flux: Only used for inrush current phenomena;
Isat: The value of the current (in ampere) for each segment of the saturation curve. The
origin (0.0,0.0) is implied. The number of segments must be equal to the parameter
number of points;
Flux: The value of the flux (in volt-second) for each segment of the saturation curve.
The origin (0.0,0.0) is implied. The number of segments must be equal to the parameter
number of points.
Flux

3
2
1

Isat

Figure 8 - 23 Saturation Curve of a Saturable Transformer


G Parameters for
Hysteresis with
Saturation

The parameters are identical to those of three-phase saturable transformers (See Section 8.1).

H List of Available
Signals

The following signals are made available after an acquisition for analysis or processing.

2-8-363

Transformers

Linear and Saturable Series


Transformers
IMAGa,b,c_Trllabel: Magnetization current for each phase of a saturable transformer
(ampere);
ILMAGa,b,c_Trlabel: Magnetization current for each phase for linear series transformer (ampere);
SEGa,b,c_Trlabel: Segment number of saturation curve.
-The numbering is positive starting at 1 for the last segment in the negative saturation
zone.
-In the hysteresis model, the numbering is positive/negative starting at 1/-1 in the positive/negative saturation zone. In the hysteresis zone, it takes a null value.
Traject: Number identifying the trajectory of the operating point in the hysteresis model
(see the three-phase transformer for more details).
FLUXa,b,c_Trlabel: Magnetization flux for each phase of a series saturable transformer (V-s);
IPRIMa,b,c_Trlabel: Primary current for each phase of a serial saturable transformer
(A).
Figure 8 - 24 shows the control panel of a linear series transformer with two windings.

2-8-364

Transformers

Linear and Saturable Series


Transformers

Figure 8 - 24 Linear Series Connection Primary Transformer


with 2 Windings: General Parameters

2-8-365

Transformers

Linear and Saturable Series


Transformers

Figure 8 - 25 Linear Series Connection Primary Transformer


with 2 Windings: Neutral Impedance

2-8-366

Transformers

Linear and Saturable Series


Transformers

Figure 8 - 26 Saturable Series Connection Primary Transformer


with 2 Windings: General Parameters

2-8-367

Transformers

Linear and Saturable Series


Transformers

Figure 8 - 27 Saturable Series Connection Primary Transformer


with 2 Windings: Neutral Impedance

2-8-368

Transformers

Linear and Saturable Series


Transformers

Figure 8 - 28 Saturable Series Connection Primary Transformer


with 2 Windings: Saturation Characteristic

2-8-369

Transformers

Three-Phase Transformers with Tap


Changer

Figure 8 - 29 Series Saturable Transformer with Branch Joint on the


Primary with 2 Windings (Hysteresis and Saturation)

8.4 THREE-PHASE TRANSFORMERS WITH TAP CHANGER


A Introduction

2-8-370

The transformer models with tap changer (including converter transformers) are designed to
be used when the voltage needs to be set. This is often the case with electronic power converters (rectifier, inverter, etc.). The first type of converter transformer has three windings per
phase: a Y primary with grounding impedance, a floating Y secondary and a delta tertiary.
The grounding of the primary can be done using a series RLC impedance. To set the voltage,
these transformers are often equipped with taps on the primary. All of these transformers have
saturation

Transformers

Three-Phase Transformers with Tap


Changer
B Icons and
Diagrams of Tap
Changer
Transformers

The following icons and diagrams are used to represent tap changer transformers.

g
TrA8

Converter transformer with tap changer and decoupling element

1
U
U
D

Tap

Tap

TrOY

Saturable transformer with tap changer, 2 windings

2
1
U
D

U
Tap

Tap

TrOD

Saturable transformer with tap changer, 3 windings

Figure 8 - 30 Icons and Diagrams of Transformers with Tap Changer


C General
Parameters

Base MVA: Base power per phase in MVA;


Base Freq: Base frequency in hertz;
Vbase primary: Base voltage on the primary of the transformer in kV rms
Vbase secondary: Base voltage on the secondary in kV rms
Rm: Magnetization losses equivalent resistance of iron losses for the magnetic circuit
(ohm);

D Winding
Parameters Per
Phase

V nom.: Rated voltage in kV rms;


R1: Leakage resistance (ohm) of winding 1 (primary);
R2, L2: Leakage resistance (ohm) and inductance (henry) of winding 2 (Y secondary);
R3, L3: Leakage resistance (ohm) and inductance (henry) of winding 3 ( secondary);
Zn: Neutral impedance (ohm, H, F).

E Saturation
Parameters

Number of points: Represents the number of segments of the current-flux saturation


curve. Only the positive part of the curve is specified; the negative part is completed by
symmetry;
Residual flux: Only used for inrush current phenomena;

2-8-371

Transformers

Three-Phase Transformers with Tap


Changer
The residual flux option is not installed yet;
Isat: The value of the current (in ampere) for each segment of the saturation curve. The
origin (0.0,0.0) is implied. The number of segments must be equal to the parameter
number of points;
Flux: The value of the flux (in volt-second) for each segment of the saturation curve.
The origin (0.0,0.0) is implied. The number of segments must be equal to the parameter
number of points.
F Tap Changer

The tap changer effect is simulated by changing the transformer ratio. Figure 8 - 31 shows the
tap changing sequence and some related parameters.
Vmin: Primary voltage (kV rms) linked with position 1 to generate the rated voltage on
the secondary winding;
Vmax: Primary voltage (kV rms) linked with the last position of the tap changer to generate the rated voltage on the secondary winding;
V rated: Rated voltage of the primary winding (kV rms);
Timing rate: Minimum time duration required for a signal order to start changing tap(s);
Operating time: Time to change tap(s);
Number of taps: Number of tap(s);
Source of control (internal, external, manual): Specifies the source of the command
(internal, external or manual DC command);
Manual position: Manual position required (can be changed during the simulation).

G List of Available
Signals

At acquisition, the following signals are made available by the sensors:


IMAGa,b,c_Trlabel: Magnetization current for each phase (Amperes);
FLUXa,b,c_Trlabel: Magnetization flux for each phase (volts-second);
SEGa,b,c_Trlabel: Segment number of the saturation curve.
IPRIMa,b,c_Trlabel: Primary winding current a, b, and c phases.
TapPosition_Trlabel: Tap position.
Tap_Trlabel:
Up_Trlabel: Up order from an internal DC command;
UpEXT_Trlabel: Up order from an external DC command;
UpBuf_Trlabel: Signal specifying the beginning of a change issued by an up order;
Down_Trlabel: Down order from an internal DC command;
DownEXT_Trlabel: Down order of one position from an external DC command;
DownBuf_Trlabel: Signal specifying the start of a change issued by a down order;
Pos_Trlabel: Tap position;
PosSign_Trlabel: Specifies that the tap is above or below the rated position;

2-8-372

Transformers

Three-Phase Transformers with Tap


Changer
Pos0x%_Trlabel: Specifies by how much the tap is above or below the rated position.

Tap change order


(up or down)
Timing
rate

Start tap change

Operating time

Effective change

Figure 8 - 31 Tap Changing Sequence


H Control Panel of
Tap Changer
Transformers

Figures 8 - 32 to 8 - 32 show the control panel of a converter transformer.

2-8-373

Transformers

Three-Phase Transformers with Tap


Changer

Figure 8 - 32 Tap Changer Transformer with Decoupling Element (General)

2-8-374

Transformers

Three-Phase Transformers with Tap


Changer

Figure 8 - 33 Tap Changer Transformer with Decoupling Element (Control)

2-8-375

Transformers

Three-Phase Transformers with Tap


Changer

Figure 8 - 34 Tap Changer Transformer with Decoupling Element (Saturation)

2-8-376

Transformers

Three-Phase Transformers with Tap


Changer

Figure 8 - 35 Tap Changer Transformer with Decoupling Element (Hysteresis)

2-8-377

Transformers

Measuring Transformers

8.5

MEASURING TRANSFORMERS

A Introduction

There are three models of measuring transformers in Hypersim. These are voltage transformers with capacitive coupling, current transformers and finally voltage transformers with magnetic coupling.

B Icons and
Diagrams

Voltage Transformer with Capacitive Coupling

CTYI

PT

PTYN

Current Transformer

Voltage Transformer with Magnetic Coupling

Figure 8 - 36 Icons and Diagrams of Voltage and Current Transformers


C Capacitive
Divider

C1, C2: Capacitances of voltage divider (farad);

D Primary Winding
Parameters

Number of turns: (default: np = 18240);

Rc, Lc, Cc: Respectively resistance (ohm), capacitance (farad) and inductance (henry)
of the tuning circuit. The values of these parameters are chosen so that the resonance
frequency of the series impedance on the secondary side is 60 Hz.

Rp, Lp: Leakage resistance (ohm) and inductance (henry);


Rm: Resistance (ohm) representing magnetization losses;
Cp: Stray capacitance (farad);
Saturation parameters:
Number of points: Represents the number of segments of the current-flux saturation
curve. Only the positive part of the curve is specified; the negative part is completed by
symmetry;
Isat: The value of the current (in ampere) for each segment of the saturation curve. The
origin (0.0,0.0) is implied. The number of segments must be equal to the parameter
number of points;

2-8-378

Transformers

Measuring Transformers

Flux: The value of the flux (in volt-second) for each segment of the saturation curve.
The origin (0.0,0.0) is implied. The number of segments must be equal to the parameter
number of points.
E Secondary
Winding
Parameters
F List of Available
Signals

Number of turns: (default: ns = 100);


Rs, Ls: Leakage resistance (ohm) and inductance (henry);
R, RL, LL: Resistances (ohm) and load inductance (henry).
At acquisition, the following signals are made available by the sensors:
VOUT(a, b, c)_label: Output voltage (V);
VMAG(a,b,c)_label: Voltage in magnetization branch (V);
IMAG(a,b,c)_ label: Magnetization current (A);
FLUX(a,b,c)_label: Mutual flux in the transformer (V.s).
VLOADSEC(a,b,c,n)_label: Load voltage on the secondary
VLOADTERT(a,b,c,n)_label: Load voltage on the tertiary
ILOADSEC(a,b,c,n)_label: Load current on the secondary
ILOAD TERT(a,b,c,n)_label: Load current on the tertiary
ILOAD TERT(0)_label: Ground current on the tertiary

G Control Panel of
Measuring
Transformers

Figures 8 - 37 and 8 - 38 show the control panel of voltage transformers with capacitive voltage divider;
Figures 8 - 39,8 - 40and 8 - 40show the control panel of the current transformer and;
Figures 8 - 41, 8 - 43and 8 - 46show the control panel of the voltage transformer with magnetic coupling.

2-8-379

Transformers

Measuring Transformers

Figure 8 - 37 Control Panel of a Voltage Transformer


with Capacitive Voltage Divider (General)

2-8-380

Transformers

Measuring Transformers

Figure 8 - 38 Control Panel of a Voltage Transformer


with Capacitive Coupling (Saturation)

2-8-381

Transformers

Measuring Transformers

Figure 8 - 39 General Parameters of a Current Transformer (General)

2-8-382

Transformers

Measuring Transformers

Figure 8 - 40 Winding Connection in a Current Transformer (Configuration)

2-8-383

Transformers

Measuring Transformers

Figure 8 - 41 Saturation Characteristic of a Current Transformer (Saturation)

2-8-384

Transformers

Measuring Transformers

Figure 8 - 42 Saturation Characteristic of a Current Transformer (Hysteresis)

2-8-385

Transformers

Measuring Transformers

Figure 8 - 43 Voltage Transformer with Magnetic Coupling (General)

2-8-386

Transformers

Measuring Transformers

Figure 8 - 44 Voltage Transformer with Magnetic Coupling (Saturation)

2-8-387

Transformers

Measuring Transformers

Figure 8 - 45 Voltage Transformer with Magnetic Coupling (General)

2-8-388

Transformers

Measuring Transformers

Figure 8 - 46 Voltage Transformer with Magnetic Coupling (Configuration)

2-8-389

Transformers

Measuring Transformers

Figure 8 - 47 Voltage Transformer with Magnetic Coupling (Saturation)

2-8-390

Transformers

Measuring Transformers

Figure 8 - 48 Voltage Transformer with Magnetic Coupling (Hysteresis)

2-8-391

Transformers

Inductance Matrix Transformer

8.6 INDUCTANCE MATRIX TRANSFORMER


A Introduction

The inductance matrix transformer (IMT) model reproduces the behavior of a three-phase, 2
or 3-winding linear transformer at power frequency. This model work with the Hyper-

Transfo tool in the Hyperview panel. Based on excitation and short-circuit test in positive and zero sequences, the HyperTransfo tool computes two matrices [R] and [L]
modeling the transformer. The Ri and Li are the resistance and the self inductances. Mij is the
mutual inductances between coils i and j. Hypersim simulate the transformer as a mutuallycoupled R, L branches. This model represent only a three-limb or five limb core. The

three single-phase cores is not supported actually. All the compute details of matrix
[R] and [L] are in the HyperTransfo documentation.

There are two models available in Hypersim, a two windings and a three windings
transformer. Also, this model can be use to study fault in linear transformer. See the
fault modeling explanation, section E. This transformer model does not support saturation.
Secondary

Primary

R1
0
[R] = 0
0
0
0

0
R2
0
0
0
0

0
0
R3
0
0
0

0
0
0
R4
0
0

0
0
0
0
R5
0

0
0
0
0
0
R6

Phases: A

Figure 8 - 49

L1
M21
[ L ] = M31
M41
M51
M61

M12
L2
M32
M42
M52
M62

M13
M23
L3
M43
M53
M63

Matrix [R]

M14
M24
M34
L4
M54
M64

M15
M25
M35
M45
L5
M65

Figure 8 - 50 Matrix [L]

2-8-392

M16
M26
M36
M46
M56
L6

Transformers

Inductance Matrix Transformer

B Icon and
Diagram

System Tools

Inductance Matrix Transformer

Properties:
- Representing transformer with
inductance matrix [L] and [R].
- Modeling internal faults in a
power transformer.

Features:
- Fault turn to ground or turn

to turn option.
Implementation:
- Hypersim standart element

Figure 8 - 51 > Inductance Transformer Matrix Icon and Diagram


C Parameter
Description

Matrix R in ohms
Matrix L in henry
Positive sequence parameters in ohms
Zero sequence parameters in ohms
The matrix [L] and [R], Positive and Zero sequence parameters are computed by HyperTransfo. See the HyperTransfo tool in Hyperview.
Winding Connections:
Y ground: Grounded Y connection;
Y floating: Floating Y connection;
Delta lead: Delta connection with lead of 30;
Delta lag: Delta connection with lag of 30;
Delta ground: Grounded delta connection.
Fault type:
Turn to earth (ground);

2-8-393

Transformers

Inductance Matrix Transformer

Turn to turn.
When the fault is enable, a new matrix [L] and [R] is computed but this matrix is
not displayed actually in Hypersim.
Leg of faulted winding:
A, B or C
Faulted winding:
Primary, secondary or tertiary
For two windings, the tertiary is not used
Fault turn position:
FaultPositionA, available for turn to earth (ground)
FaultPositionB, available for turn to turn only.
Specify on which turn the fault is apply.
FaultPosition = nb / (na + nb)
na = number of turns of sub-coil a
nb = number of turns of sub-coil b
Coil
Phase A

1
na

Fault
Connexion

nf
nb
2

Figure 8 - 52 > Faulted coil representation


Sigma_AB:
Leakage factor between the two parts a and b of faulted
Sigma_ab = 1 - Mab^2 / (La*Lb)
Epsilon:
Ration of leakage factors between faulted winding an others windings.
Epsilon = Sigma_ai / Sigma_fi
Sigma_ai: leakage factor between subwinding a and i.
Sigma_fi: leakage factor between faulted winding (a+b) and i.
D Fault
Connectors

The model support two connectors for fault. Both are single phase.
To use the model as a simple Inductance matrix transformer, dont use the Tg and Tt connector. Just connect the Tg and Tt at a single-phase bus.
Tg is used for fault to ground, use a breaker single phase connected to gound.
Tt is used to apply a fault turn to turn, use a breaker between Tg and Tt connector.

2-8-394

Transformers

Inductance Matrix Transformer

E Fault modeling

The developpment and the validation of the method is based on the article A transformer
model for winding fault studies, See references 2. We dont explain all of the details of the
method. Read the paper for more details.
The principle used to model a fault between a coil turn and the earth or between any two turns
is to divide the faulty coil. See the figure 1-2. The faulted winding nf is splitted into two subwindings a and b connected in series:
a: from top to nf to fault location
b: from fault location to bottom of nf

For a 3-leg 2-winding transformer (6 coupled windings) matrix [L] and [R] is 6 x 6.
When the turn to earth fault is apply the matrix [L] and [R] will be 7 x 7 and for a turn to
turn, the new matrix [L] and [R] is 8 x 8. This matrix is not displayed actually in Hypersim.
Only the matrix 6 x 6 in the forms.
Primary

Secondary

R1a 0 0 0 0 0 0
0 R1b 0 0 0 0 0
0
0 R2 0 0 0 0
[R] =
0
0 0 R3 0 0 0
0
0 0 0 R4 0 0
0
0 0 0 0 R5 0
0
0 0 0 0 0 R6
Phases:
Figure 8 - 53

Matrix [R] 7 x 7 for a primary fault to ground phase A

Where R1, R2 and R3 are for primary parameters and R4, R5 and R6 are for secondary parameters. The columns are respectively the phase A, B and C.

2-8-395

Transformers

Inductance Matrix Transformer

La
Mba
M2a
[ L ] = M3a
M4a
M5a
M6a

Mab
Lb
M2b
M3b
M4b
M5b
M6b

Ma2
Mb2
L2
M32
M42
M52
M62

Ma3
Mb3
M23
L3
M43
M53
M63

Ma4
Mb4
M24
M34
L4
M54
M64

Ma5
Mb5
M25
M35
M45
L5
M65

Ma6
Mb6
M26
M36
M46
M56
L6

Figure 8 - 54 Matrix [L] 7 x 7 for a primary fault to ground phase A


This is the same application for the 3-leg 3-winding transformer (9 coupled windings) 9
x 9 matrix [L] and [R]. When the turn to earth fault is apply the matrix [L] and [R] will be
10 x 10 and for a turn to turn, the new matrix [L] and [R] is 11 x 11.

F References

[1] Dommel, H., et al., Electromagnetic Transients Program Reference Manual (EMTP Theory Book), 1986.
[2] A transformer model for winding fault studies, Partrick Bastard, Pierre Bertrand, Michel
Meunier, IEEE, Vol 9, No 2, April 1994.

G List of Available
Signals

There is no signal available in this model.

H Control Panel

Figure 8 - 51 shows the control panel used to enter the parameters

2-8-396

Transformers

Inductance Matrix Transformer

Figure 8 - 55 > Inductance matrix transformer 2-windings Control Panel

2-8-397

Transformers

Inductance Matrix Transformer

Figure 8 - 56 > Inductance matrix transformer fault Control Panel

2-8-398

Transformers

Inductance Matrix Transformer

Figure 8 - 57 > Inductance matrix transformer 3-windings Control Panel

2-8-399

Transformers

Inductance Matrix Transformer

Example:
This example will compare EMTP BcTran model and Hypersim
Inductance matrix transformer model. We compare a 3 windings
transformer and make a fault at the secondary for 6 cycles.

Figure 8 - 58 > EMTP BcTran model

2-8-400

Transformers

Inductance Matrix Transformer

Figure 8 - 59 > Hypersim Inductance matrix transformer network

2-8-401

Transformers

Inductance Matrix Transformer

Figure 8 - 60 > EMTP vs Hypersim simulation results

2-8-402

Transformers

Inductance Matrix Transformer

Example:
This example will present an inductance matrix transformer 2windings with a fault turn to ground phase A at 0.1sec for 6 cycles.

Figure 8 - 61 > Inductance matrix transformer 2-windings with a fault to ground

2-8-403

Transformers

Inductance Matrix Transformer

Figure 8 - 62 > Results for a fault to ground Phase A at 0.1 for 6 cycles

2-8-404

Transformers

Inductance Matrix Transformer

PAGE LEFT INTENTIONALLY BLANK

2-8-405

Transformers

Inductance Matrix Transformer

2-8-406


Chapter 9
LOAD AND MOTORS

9.1 DYNAMIC LOAD

Dynamic Loads

Dynamic Loads

Properties:
The dynamic loads are
used to simulate sub-systems at a port which is to
be represented by the variations of the active and
reactive powers as a function of the fundamental
voltage and frequency.

Main features:
The dynamic load models correctly reproduce the behaviour of
a load for the slow modulations of
the fundamental voltage imposed
by the power system dynamics
and for fast transient phenomena
resulting from the switchings.

Figure 9 - 1 Icon and Diagram Dynamic Loads


A Dynamic Load
Model
Introduction

The block diagram of the dynamic load model implementation is shown in Figure 9 - 2. A
voltage source is connected to a series impedance (Rs. Ls) and a parallel impedance (Rp Lp
or Rp Cp). The value of the internal voltage for this source allows to inject adequate power
into the network.
In the network, the dynamic load acts as a load that absorbs an active power and a reactive
power as a function of the voltage and frequency levels. Equations (EQ 1) to (EQ 4) describe
the complete behavior of the dynamic load. It can be observed that the dynamic load will vary
according to the level of the threshold voltage Vmin.
Hence, if the voltage at the load terminals U > Vmin

2-9-407

Load and Motors


Dynamic Load

(EQ 1)
U-
P = P 0 -----

1 + T p1 s
ff
-------------------- + kp -----------0
1 + T p2 s
f0

np

U0

(EQ 2)
U-
Q = Q 0 -----U 0

nq

ff
1 + T q1 s
------------------- + kq -----------0
1 + T q2 s
f0

and if the voltage at the load terminals V < Vmin


(EQ 3)

P = P 0 ( V min )

2
f f0
U - 1 + T p1 s
,
------------------------------+
kp
---------- np 1 + T s
f0
p2
U0

np 2

(EQ 4)

Q = Q 0 ( V min )

2
f , f 0
U 1 + T q1 s
-------------- -------------------- + kq ----------f0
U nq 1 + T q2 s

nq 2

where:
U is the direct sequence voltage at the fundamental frequency;
f is the fundamental frequency;
P0,Q0 are respectively the active and reactive power for a voltage with amplitude U0
and frequency f0
np is the active power variation coefficient as a function of the voltage (generally
between 1 and 2)
nq s the reactive power variation coefficient as a function of the voltage (generally
between 1 and 3)
kp is the active power variation coefficient as a function of the fundamental frequency
(generally between 0 and 2)
kq s the reactive power variation coefficient as a function of the fundamental frequency
(generally between 0 and -3)

2-9-408

Load and Motors

Dynamic Load

The Vmin voltage level allows to change the behavior of the load. Below Vmin, the dynamic
load is said to have a constant impedance, since the exponent of the voltage is 2 (np=2, nq=2).
An additional term is present in (EQ 3) and (EQ 4) to cancel any discontinuity relative to the
threshold Vmin.
The operation of the dynamic load is shown in Figure 9 - 2. Using equations (EQ 1), (EQ 2),
(EQ 3) and (EQ 4), the digital model of the dynamic load can calculate the P and Q powers
to be absorbed by or delivered from the network. Since the model knows the value of the passive parallel components, it can calculate the part of the P1 power to be delivered by the
source. Accordingly, part of the power (P) originates from the parallel impedance (P2) and
part of the power (P1) originates from the internal voltage source.(P=P1+P2)

P 1 ,Q 1

P,Q
If U > Vmin

LS

RS
OR

U np 1 + Tp1,s
f f0
P = P0 -------
----------------------- + kp -----------U0
1 + Tp2,s
f0

P 2 ,Q 2

U- nq 1---------------------+ Tq1,s- + kq ----------f f0PQ = Q0 ----- U0


1 + Tq2,s
f0
Rp

Lp

Cp

Figure 9 - 2 Block Diagram of Dynamic Load


This model is only valid for a fundamental frequency between 50 Hz and 70 Hz.
B General
Parameters

Base MVA: Rated power (MVA);


Base Volt: Base voltage (kV);
Base Frequency: Base frequency Hz;
ON/OFF Dynamic load (Enable/Disable): If Enable, the load is ON; if Disable, the
load is OFF;
ON/OFF Measuring filters (Enable/Disable): If Enable, the measuring filters are ON,
and if Disable, the filters are OFF;

P 0 : Reference active power (MW) for the reference voltage of the load U;

Q 0 : Reference reactive power (Mvar) of the load for the reference voltage of the load
U;

C Load Parameters

: Reference voltage of the load (pu);

V min : Voltage threshold below which the load behaves as a constant impedance (pu);

Rs: Series resistance (ohm);


2-9-409

Load and Motors


Dynamic Load

Ls: Series inductance (H);


Rp: Shunt resistance (ohm);
Lp or Cp: Shunt inductance or capacitance;
np: Active power variation coefficient as a function of the voltage (generally between 1
and 2);
nq: Reactive power variation coefficient as a function of the voltage (generally between
1 and 3);
kp: Active power variation coefficient as a function of the frequency (generally
between 0 and 2);
kq: Reactive power variation coefficient as a function of the frequency (generally
between 0 and -3).
Tp1: Time constant to calculate the active power of the load.
Tp2: Time constant to calculate the active power of the load.
Tq1: Time constant to calculate the reactive power of the load.
Tq2: Time constant to calculate the reactive power of the load.
D List of Available
Signals

At acquisition, the following signals are made available by the sensors:


Freq_label: Network frequency (Hertz);
Period_label: Inverse of the frequency (seconds);
Vd_label: Direct (D) axis voltage (pu);
Vq_label: Quadrature (Q) axis voltage (pu);
Vrms_label: Average value of the direct sequence voltage (pu);
E(a,b,c)_label: Output voltage of the dynamic load (volt);
Ed_label: Direct (D) axis output voltage (pu);
Eq_label: Quadrature (Q) axis output voltage (pu);
I(a,b,c)_label: Dynamic load current (ampere);
P_label: Total active power of the load (pu);
Q_label: Total reactive power of the load (pu);
Pcomp_label: Compensating active power, originating from the internal voltage source
(pu);
Qcomp_label: Compensating reactive power, originating from the internal voltage
source (pu);

E Dynamic Load
Control Panel

2-9-410

Figure 9 - 3 shows the dynamic load control panel.

Load and Motors

Dynamic Load

Figure 9 - 3 Dynamic Load Control Panel

Dynamic Load example


Figure 9 - 4 shows a typical example of a Dynamic Load scenario.

2-9-411

Load and Motors


Dynamic Load

Figure 9 - 4 Example using the Dynamic Load


2-9-412

Load and Motors

Harmonic Load

9.2 HARMONIC LOAD

Harmonic Load

Harmonic Load

Properties:
The harmonic load model
represents the different
types of industrial loads.

Main features:
The harmonic load model consists
of three elements:
Dynamic load;

This flexible model allows


to accurately characterize
loads with a high harmonic content and to add
random power variations.

Random load;
Harmonic current source.

Figure 9 - 5 Icon and Diagram Harmonic Load


A

Harmonic Load
Introduction

The harmonic load model consists of three elements: a dynamic load, a random load and a
harmonic current source. The block diagram for the implementation of a harmonic load model is shown in Figure 9 - 6. This implementation is the same as for a dynamic load, except that
the internal voltage source can also generate harmonics. The value of the internal voltage for
this voltage source allows to inject the adequate power and dynamic loads into the network.
In the network, the harmonic load acts as a load that absorbs a reactive power and an active
power as a function of the voltage and frequency levels. Equations (EQ 5) to (EQ 8) describe
the complete behavior of the harmonic load. It can be observed that the harmonic load will
vary according to the level of the threshold voltage Vmin.
Hence, if the voltage at the load terminals U > Vmin
(EQ 5)
U-
P = P 0 -----

1 + T p1 s
ff
-------------------- + kp -----------0
1 + T p2 s
f0

np

U0

(EQ 6)
U- nq
Q = Q 0 -----U
0

1 + T q1 s
ff
------------------- + kq -----------0
1 + T q2 s
f0

2-9-413

Load and Motors


Harmonic Load

And, if the voltage at the load terminals V < Vmin


(EQ 7)

P = P 0 ( V min )

2
f f0
U - 1 + T p1 s
,
------------------------------kp
+
---------- np 1 + T s
f
p2
0
U0

np 2

(EQ 8)

Q = Q 0 ( V min )

2
f , f 0
U - 1 + T q1 s
------------
-------------------- + kq ----------f0
U nq 1 + T q2 s
0

nq 2

where:
U is the direct sequence voltage at the fundamental frequency;
f is the fundamental frequency;
P0,Q0 are respectively the active and reactive power for a voltage with amplitude U0
and a frequency f0
np is the active power variation coefficient as a function of the voltage (generally
between 1 and 2)
nq is the reactive power variation coefficient as a function of the voltage (generally
between 1 and 3)
kp is the active power variation coefficient as a function of the fundamental frequency
(generally between 0 and 2)
kq is reactive power variation coefficient as a function of the fundamental frequency
(generally between 0 and -3)
The Vmin voltage level allows to change the behavior of the load. Below Vmin, the dynamic
load is said to have a constant impedance, since the exponent of the voltage is 2 (np=2, nq=2).
An additional term is present in equations (EQ 7) and (EQ 8) to cancel any discontinuity relative to the threshold Vmin.
The operation of the harmonic load is shown in Figure 9 - 6. Using equations (EQ 5),(EQ
6),(EQ 7) and (EQ 8), the digital model of the dynamic load can calculate the P and Q powers
to be absorbed by or delivered from the network. Since the model knows the value of the passive parallel components, it can calculate the part of the P1 power to be delivered by the
source. Accordingly, part of the power (P) originates from the parallel impedance (P2) and
part of the power (P1) originates from the internal voltage source (P=P1+P2).

2-9-414

Load and Motors

Harmonic Load

The two main differences between the dynamic and the harmonic loads are the following.
Firstly, a programmable random variation part can be added to the P1,Q1 power component
provided by the internal source. Secondly, the same load calculates a percentage of harmonics, based on the fundamental, and can then reinject these harmonics as current.

Harmonic injection

P1,Q1

P,Q
If U > Vmin

LS
RS
OR

P2,Q2

Rp

Lp

Cp

U-
P = P0 -----U0

np

1---------------------+ Tp1,s- + kp f---------- f0f0


1 + Tp2,s

U nq 1 + Tq1,s
f f0
PQ = Q0 -------
----------------------- + kq -----------U0
1 + Tq2,s
f0

Figure 9 - 6 Block Diagram of Harmonic Load Model


This model is only valid for a fundamental frequency between 50 Hz and 70 Hz.
B General
Parameters

Base MVA: Rated power (MVA);


Base Volt: Base voltage (kV);
Base frequency: Rated frequency (Hz);
Dynamic Load ON/OFF (Enable/Disable): If Enable, the load is ON; if Disable,
the load is OFF;
Measuring Filter ON/OFF (Enable/Disable): If Enable, the measuring filters are ON;
if Disable, the filters are OFF;

P 0 : The reference active power of the load (MW) for the reference voltage of the
load U;

Q 0 : The reference reactive power of the load (Mvar) for the U; value;

U 0 : The reference voltage of the load (pu);

C Load Parameters

V min : Threshold below which the load behaves as a constant impedance (pu);

Rs: Series resistance (ohm);


Ls: Series inductance (H);
Rp: Shunt resistance (ohm);
Lp or Cp: Shunt inductance or capacitance (H);

2-9-415

Load and Motors


Harmonic Load

np: Active power variation coefficient as a function of the voltage (generally between 1
and 2);
nq: Reactive power variation coefficient as a function of the voltage (generally between
1 and 3);
kp: Active power variation coefficient as a function of the frequency (generally
between 0 and 2);
kq: Reactive power variation coefficient as a function of the frequency (generally
between 0 and -3).
Tp1: Time constant to calculate the active power of the load.
Tp2: Time constant to calculate the active power of the load.
Tq1: Time constant to calculate the reactive power of the load.
Tq2: Time constant to calculate the reactive power of the load.
D Random
Variation
Parameters

SeedPQ: Root for the random generation of P and Q.


Seedt: Root for the random generation of each interval.
P distribution (Uniform / Gaussian): Distribution choice for P
Pmin: In the case of a uniform distribution, minimum value of P.
Pmax: In the case of a uniform distribution, maximum value of P.
Pmoy: In the case of a gaussian distribution, average value of P.
Pvar: In the case of a gaussian distribution, variance value of P.
Q distribution (Uniform / Gaussian): Distribution choice for Q
Qmin: In the case of a uniform distribution, minimum value of Q.
Qmax: In the case of a uniform distribution, maximum value of Q.
Qmoy: In the case of a gaussian distribution, average value of Q.
Qvar: In the case of a gaussian distribution, variance value of Q.
Tmin: Minimum time interval between two changes of P and Q. The distribution is
always uniform between Tmin and Tmax.
Tmax: Maximum time interval between two changes of P and Q. The distribution is
always uniform between Tmin and Tmax.

E Harmonic
Parameters

Harmonic numbers: The number of each harmonic to inject as current.


Harmonic current amplitude: Current amplitude for each harmonic. In percentage relative to the current of the fundamental.
Harmonic current phase: Current phase for each harmonic. In degrees relative to the
phase of the fundamental.

2-9-416

Load and Motors

Harmonic Load

F List of Available
SIgnals

At acquisition, the following signals are made available by the sensors:


Freq_label: Network frequency (Hertz);
Period_label: Inverse of the frequency (seconds);
Vd_label: Direct (D) axis voltage (pu);
Vq_label: Quadrature (Q) axis voltage (pu);
Vrms_label: Average value of the direct sequence voltage (pu);
E(a,b,c)_label: Output voltage of the dynamic load (volts);
Ed_label: Direct (D) axis output voltage (pu);
Eq_label: Quadrature (Q) axis output voltage (pu);
P_label: Total active power of the load (pu);
Q_label: Total reactive power of the load (pu);
Pcomp_label: Compensating active power, originating from the internal voltage source
(pu);
Qcomp_label: Compensating reactive power, originating from the internal voltage
source (pu);
Po_label: Reference value for active power of the load, including random variations
(pu)
Qo_label: Reference value for reactive power of the load, including random variations,
including random variations (pu)
V(a,b,c)_label: Value of the internal voltage of the source allowing to inject the desired
power (V)
I(a,b,c)Fund_label: Value of the current of the fundamental (A)
I(a,b,c)Total_label: Total current of the harmonic load. This current includes the
dynamic and random part, along with the injected harmonic current (A);
I(a,b,c)_label_label: Current of the dynamic and random load only. This does not
include the harmonic current (A);
I(a,b,c)Harm_label: Harmonic current to be injected only (A);
FundAng_a_label: Angle value of the fundamental of the current for the load, phase a
(degrees)

G Harmonic Load
Control Panels

Figure 9 - 7 shows the control panels for the harmonic load.

2-9-417

Load and Motors


Harmonic Load

Figure 9 - 7 Harmonic Load Control Panel (General)

Figure 9 - 8 Harmonic Load Control Panel (Random)

2-9-418

Load and Motors

Harmonic Load

Figure 9 - 9 Harmonic Load Control Panel (Harmonic)

Harmonic Load Example


Figure 9 - 10 shows a typical example of an Harmonic Load scenario.
Enter the following parameters in the Parameters for Harmonic Current Source in the control
panel (Harmonic Tab).
Note : Model of a 6 pulse D.C. motor drive.

2-9-419

Load and Motors


Harmonic Load

Figure 9 - 10 Example using the Harmonic Load

2-9-420

Load and Motors

D.C. Motor

9.3 D.C. MOTOR

DC Motor

DC Motor

Properties:
The D.C.motor model represents both the static and
dynamic behaviours of
two types of industrial
D.C. motors: shunt and
separately excited

Main features:
Two common types of industrial
motors.
Type of connections of either
rotoric and statoric circuits:
Parallel connection (shunt)
or;
Two distinct circuits

Figure 9 - 11 Icon and Diagram DC Motor


A

DC Motor
Introduction

The following equations govern the voltages of the motor as a function of the currents:
vf = rfif + df/dt
va = raia + da/dt
where
vf: voltage at the terminals of the stator winding
if: current in the stator
rf: resistance of stator winding
f: flux in the stator
va: voltage at the terminals of the rotor winding
ia: current in the rotor
ra: resistance of the rotor winding
a: flux in the rotor
The fluxes can be expressed as follows:
f = Lffif + Lfaia

2-9-421

Load and Motors


D.C. Motor

a = Lafif + Laaia
where

Lff: inductance in the stator winding

Laa: inductance in the rotor winding


Laf et Lfa: mutual inductances between the rotor and the stator
Also, the mutual inductances can be estimated by a sinusoidal function of the angular speed
of the motor c:
Laf = Lfa = -Lcosc
where

L is a constant

The action of the switch allows the rotor winding to be perceived as a stationary winding with
a magnetic axis perpendicular to the axis of the winding field. There is no induced voltage in
one of the windings because of the variation of the current crossing the other winding. Consequently, the voltage equations can be reduced to a matrix in a Laplace domain, as follows:
vf(s) rf + sLffif(s)
va(s)rLafra + sLaaia(s)
It is useful to represent the electromagnetic torque equation that follows:
Te = Lafifia
And finally, using an equation linking the angular speed r, a complete relation can be set
and allows to form the representative block diagram:
Te = Jdr/dt + Bmr + TL
where
J: moment of inertia of rotor
Bm: damping coefficient associated to the mechanical rotation movement
TL: load torque
Usually, the damping coefficient Bm is not considered.
The D.C. motor is often represented by Figure 9 - 12. According to the type of motor, the rotoric circuit can be connected in parallel with the statoric circuit, thus Vf=Va, in the case of
a shunt motor.
A motor that uses two distinct circuits is referred to as a separately excited motor. The stator
has to be supplied with another circuit, since the rotor is connected to the power network. The
stator can be supplied using different methods, either using a constant source or with Simulink.

2-9-422

Load and Motors

D.C. Motor

Laa
if
Stator
circuit

Vf

ia

rf
Lff

ra

Laf.if.wr

Va

Rotor
circuit

Figure 9 - 12 Simplified Diagram of D.C. Shunt Motor


B Motor
Parameters

R rotor: (ra) resistance of rotoric winding (ohm)


L rotor: (Laa) inductance of rotoric winding (henry)
R stator: (rf) resistance of statoric winding (ohm)
L stator: (Lff) inductance of statoric winding (henry)
L mutual: (Laf) mutual inductance between the stator and the rotor (henry)

C Mechanical Load
Parameters

Load Torque: mechanical torque of the load driven by the motor (N.m)
Moment of inertia: value of total inertia driven by the motor. This value consists of the
inertia of the motor and the inertia of the driven mechanical load (kg.m2)
Viscous friction: value of viscous friction or damping. This corresponds to a friction
loss varying with the speed (N.m.s)
Dry friction: value of dry friction. This corresponds to constant friction loss (N.m)

D D.C. Motor Type

Allows to specify the origin of the statoric circuit power supply:


Shunt connection: the stator voltage is the same as the rotor voltage, since both are
connected in parallel.
Internal: separately excited motor, the stator is supplied by a constant internal source.
External: separately excited motor, the stator is supplied by an external source originating from an A/D.
Simulink: separately excited motor, the stator is supplied by a source originating
from Simulink.

E List of Available
Signals

At acquisition, the following signals are made available by the sensors:


I_label: total current of the D.C. motor (A)
E_label: voltage generated by the armature circuit as a counter electromotive force (V)
wr_label: speed of the D.C. motor rotor (rad/s)

2-9-423

Load and Motors


D.C. Motor

Vp_label: voltage at the positive terminal of the motor with respect to the ground (V)
Vn_label: voltage at the negative terminal of the motor with respect to the ground (V)
V_ext_label: voltage of the D.C. motor, or voltage of armature Va (V)
Vf_label: excitation voltage at the terminals of stator (rf+Lff) (V)
Vlink_label: voltage originating from Simulink to supply the stator, in the case of a
separately excited motor supplied by a Simulink circuit (V)
Tm_label: mechanical torque of the motor load (N.m)
If_label: current in the stator circuit or field current.
F D.C. Motor
Control Panel

Figure 9 - 13 shows the control panel of a D.C. motor.

Figure 9 - 13 DC Motor Control Panel

Figure 9 - 14 shows typical example using a DC Motor.

2-9-424

Load and Motors

D.C. Motor

Figure 9 - 14 Example using a D.C. motor

2-9-425

Load and Motors


Arc Furnace

9.4 ARC FURNACE


A

Arc Furnace
Introduction

The A.C. arc furnace model represents both the static and the dynamic behavior of the arc
resistance. The characteristic of the furnace depends on the active power consumption which
varies with the different operating conditions.This model is used to study the harmonics returned to the network and also to study the wave quality, particularly the voltage flicker.

Figure 9 - 15 A.C. Arc Furnace Icon and Diagram


B A.C. Arc Furnace
Model

The block diagram of the arc furnace implementation is shown in Figure 9 - 16. The V-I characteristic consists of three regions and is calculated using the arc furnace parameters and operating conditions. The R2 resistance, or the arc furnace resistance when the ignition
threshold voltage is reached, depends only on the extinction and ignition firing voltages and
their respective currents. As for the resistance prior to ignition firing, it is also dependent on
the previously discussed parameters, in addition to the average operating power. To this last
resistance, it is possible to add a sinusoidal or random variation, depending on the characteristics defined by the user. Hence, the model takes into account and includes the periodic and
stochastic changes in the arc resistance. The variables used in the block diagram are defined
as follow:
Vall: Furnace ignition voltage;
Vex: Furnace extinction voltage;
I2-I1: Difference between ignition and extinction currents;
Pmoy: Average operating power;
Amp_sin: Amplitude of sinusoidal variation;
Freq_sin: Frequency of sinusoidal variation;
Pha_sin: Phase of sinusoidal variation;
Amp_al: Amplitude of random variation;
Germe: Random sequence seed for white noise;
Type: Characteristic type of arc resistance;
R1: Resistance of furnace static characteristic before ignition;
R1: Final furnace resistance before ignition;
R2: Furnace resistance once ignited;
Hence:

2-9-426

Load and Motors

Arc Furnace

Vall
Vex

Vex

Vall

I2 - I1

I2 - I1

R2
Vall
Vall2

Vex
Pmoy

( Pmoy

R2

R2

+ Vall Vex

R1
)

R2

Amp_sin
Freq_sin

Pha_sin

OR

Caracteristicts V - I
V

R1'
I

Type
To network

Amp_al
Germe

Band-pass
filter

Controlled voltage
source

Figure 9 - 16 Block Diagram of Arc Furnace


C General
Parameters

Phase: number of phases (3)

D Static
Parameters of
Arc Furnace

Ignition voltage: voltage to be reached to ignite the furnace, hence for the electric arc to
strike (V)

Characteristics: characteristics of arc resistance. 1 Static: no variation of furnace resistance value before ignition. 2 Sinusoidal: modulation, following a low frequency sinus,
of the furnace resistance value before ignition. 3 White noise: random variation, following a low frequency white noise, of the furnace resistance value before ignition.
Only one type can be selected at a time.

Extinction voltage: voltage at which the furnace extinguishes (this voltage must be
lower than the ignition voltage) (V)
Average operating power: average power representing the operating conditions of the
furnace. (This parameter is used to calculate the characteristic of the furnace before its
ignition, irrespective of the mode, static or dynamic) (kW)
Extinction current - Ignition current: difference between the ignition and extinction currents (A)
Note : This value should be greater than zero; the extinction current must be greater than the ignition current (kA)

2-9-427

Load and Motors


Arc Furnace

E Sinusoidal
Variation
Parameters of
Arc Resistance

Sinus frequency: vector of respective frequencies for the sinusoidal modulation of the
furnace dynamic characteristic for the three phases (Hz)
Sinus amplitude: vector of respective amplitudes for the sinusoidal modulation of the
dynamic characteristic for the three phases. The calculated sinus is multiplied by the
amplitude specified by the user and by the resistance value. The result is then added to
the furnace resistance before its ignition (ohm)
Sinus phase: vector of respective phases for the sinusoidal modulation of the dynamic
characteristic for the three phases with respect to the initial time of 0 second (degrees)

F Random
Variation
Parameters of
Arc Resistance

Noise amplitude: vector of respective amplitudes for the random variation of the
dynamic characteristic for the three phases. The amplitude specified by the user is used
to multiply the random number which is then added to the resistance value before arc
ignition.

G List of Available
Signals

Random sequence seed: vector of initialization seeds for random functions generating
white noise respectively for each phase. This number must be in the interval [0,1].

At acquisition, the following signals are made available by the sensors:


Va_F_label: Arc furnace voltage for phase A (V);
Vb_F_label: Arc furnace voltage for phase B (V);
Vc_F_label: Arc furnace voltage for phase C (V);
Ia_F_label: Arc furnace current for phase A (A);
Ib_F_label: Arc furnace current for phase B (A);
Ic_F_label: Arc furnace current for phase C (A);
WhiteNoise_F_label: Random variation added to the arc furnace resistance when the
selected characteristic is dynamic with white noise, before pass-band filtering (ohm);
WhiteNoiseFilt_F_label: Random variation added to the arc furnace resistance when
the selected characteristic is dynamic with white noise, after pass-band filtering (ohm);

H A.C. Arc Furnace


Control Panel

2-9-428

Figure 9 - 17 shows the arc furnace control panel.

Load and Motors

Arc Furnace

Figure 9 - 17 Arc Furnace Control Panel

Example using an arc furnace

2-9-429

Load and Motors


Arc Furnace

Figure 9 - 18 Arc Furnace example

2-9-430

Load and Motors

Induction Motor

9.5 INDUCTION MOTOR

Induction Motor

Induction Motor

Properties:
This model is general
enough to represent most
industrial three-phase
induction motors with 1 or
2 squirrel cage rotors or
with wound rotors

Main features:
The model is equipped
with connectors to the control module in order to
facilitate modelling of the
mechanical load.

Figure 9 - 19 Icon and Diagram Induction Motor


A

Induction Motor
Model

The induction motor model can be represented by four pairs of equations.


The electrical equations convert the voltage signals into electrical fluxes in a DQ Park representation. A saturation relation introduces the non-linearity of mutual inductance in the motor. The current equations convert the fluxes for both rotor and stator into currents on the DQ
axes. Finally, the mechanical equations represent the rotor speed, using mechanical and electrical torques and taking into account inertia and friction.
Electrical flux equations:
(EQ 9)

rs
- + ----- qs = -----b- v qs ----- ( qs )
ds
s
b
X ls mq
(EQ 10)

rs
- + ----- ds = -----b- v ds + ----- ( ds )
qs
s
b
X ls md
(EQ 11)

r r1
qr1 = -----b- v qr1 ----------------r dr1 + -------- ( qr1 )
s
X lr1 mq
b

2-9-431

Load and Motors


Induction Motor

(EQ 12)

dr1

r r1
= -----b- v dr1 + ----------------r qr1 + -------- ( dr1 )

s
X lr1 md
b
(EQ 13)

r r2
qr2 = -----b- v qr2 ----------------r dr2 + -------- ( qr2 )

s
b
X lr2 mq
(EQ 14)

r r2
dr2 = -----b- v dr2 + ----------------r qr2 + -------- ( dr2 )

s
X lr2 md
b

mq

qs qr1 qr2
= X aq ------- + ----------- + ----------X
X lr1 X lr2
ls

md

ds dr1 dr2
= X ad ------- + ----------- + ----------X
X lr1 X lr2
ls

(EQ 15)

(EQ 16)

In the preceding equation, the Vdr and Vqr rotor voltages are set at zero for the squirrel cage
rotor.
Current equations:
(EQ 17)

i qs

1- ( )
= -----mq
X ls qs
(EQ 18)

1- ( )
i ds = -----md
X ls ds
(EQ 19)

1
i qr1 = --------- ( qr1 mq )
X lr1
(EQ 20)

i dr1

2-9-432

1 -( )
= -------md
X lr1 dr1

Load and Motors

Induction Motor

(EQ 21)

1 - + -----1- + -------1 - + -------1 - 1


X aq = X ad = -----X

M X ls X lr1 X lr2

Saturation equations:
(EQ 22)

X aq f ( m )
mqsat = mq ------- --------------
X M m mq

(EQ 23)
Mechanical equations:
(EQ 24)

X ad f ( m )
mdsat = md ------- --------------
X M m md
T e = ds I qs qs I ds
b
r = --------- ( T TL )
2Hs e

(EQ 25)
(EQ 26)

Generally, the steady-state representation of the model is presented as a transformer with a


rotating secondary. Figure 9 - 20 shows the model for the D and Q Park axes. Both rotor circuits are depicted.

2-9-433

Load and Motors


Induction Motor

Llr2

D Axis

Rs

( - 0) ds
-

+
Vqs

Lls

Llr2
Lm

Ids

Stator

Idr1

( - r) qr1
+

Rr1

( - r) qr2
+

Rr2

Rotor 2
+

Idr2

Llr2
Rs

( - 0) ds
-

+
Vqs

Stator

Vdr1

Vqr2

Q Axis

Rotor 1

Lls

Iqr1
Llr2
( - r) dr2
+

Iqs

( - r) dr1
+

Lm

Rr1

Rotor 1
+

Rr2

Rotor 2
+

Iqr2
Vqr2

Vqr1

Figure 9 - 20 Steady-State Representation of Induction Motor Model


Hence, depending on the selected motor configuration, the rotoric circuit will be simple or
double. The values for Vdr and Vqr are zero since a squirrel cage rotor is being modeled. In
the case of a coiled rotor, a startup resistance value can be set on the rotor and is added to Rr1.
B General
Parameters

Number of cages: number of squirrel cages per rotor, one or two;


Number of poles: number of poles in the machine;
Base power: rated power (kVA);
Base voltage: rated voltage (kV);
0: rated angular speed (electrical radians/second);
R start: startup resistance for a motor with coiled rotor. This value allows to increase
the resistance value of the squirrel no 1. (ohm);
T start: application delay of mechanical load, since starting the simulation (s);

C DQ Speed
Reference

2-9-434

Reference selection for the conversion in the DQ axis system: (Rotor, Stator, Stator
rotating field)

Load and Motors

Induction Motor

D Motor
Parameters

R Stator: stator resistance (ohm);


Xl Stator: stator reactance (ohm);
R Rotor 1: no 1 rotor resistance (ohm);
Xl Rotor 1: no 1 rotor reactance (ohm);
R Rotor 2: no 2 rotor resistance (ohm);
Xl Rotor 2: no 2 rotor reactance (ohm);
Xm: mutual reactance (ohm).

E Connectors to
Control Module
Interface
F Mechanical Load
Parameters

Mechanical torque (Internal/External): internal or external mechanical torque (Interne = internal, from parameters Wmec Tmec, Externe = external, from connector to the control module).
H: inertia constant (second);
Friction: viscous friction (pu).
The internal mechanical load can be characterized by a five point search table. The user provides the mechanical torque value Tmec for each rotor speed (Wmec). The Wmec five point
vector is in electrical radians/second. The Tmec vector allows to modelize any type of nonlinear mechanical load according to the speed signal.
Wmec: Speed vector (electrical radians/s);
Tmec: Mechanical torque vector (N.m).

G Saturation
Parameters

It is possible to add a no-load saturation characteristic. The saturation characteristic is given


by two 10 point vectors representing the voltage and the r.m.s. current of the no-load machine.
Saturation (Enable/Disable): saturation ON (Enable) or OFF (Disable);
Irms: r.m.s. power line of current (A);
Vrms: phase-ground r.m.s. voltage given to the machine (V).

H List of Available
Signals

At acquisition, the following signals are made available by the sensors:


Vds_label: Direct axis stator voltage (V);
Vqs_label: Quadrature axis stator voltage (V);
Ids_label: Direct axis stator current (A);
Iqs_label: Quadrature axis stator current (A);
V(a,b,c)r_label: Stator Voltages (V)
Vdr_label: Direct axis voltage of rotor no 1 (V)
Vqr_label: Quadrature axis voltage of rotor no 1 (V)
I(a,b,c)s_label: Stator currents (A);
Idr_label: Direct axis current of rotor no 1 (A);

2-9-435

Load and Motors


Induction Motor

Iqr_label: Quadrature axis current of rotor no 1 (A);


I(a,b,c)r_label: Rotor no 1 currents (A);
Tmec_label: Mechanical torque (N.m);
Te_label: Electrical torque (N.m);
wr_label: Rotor speed (electrical rad/s);
w_label: Reference speed for DQ conversion (electrical rad/s;
PHIds_label: Direct axis stator flux (V);
PHIqs_label: Quadrature axis stator flux (V);
PHIdr_label: Direct axis rotor flux (V);
PHIqr_label: Quadrature axis rotor flux (V);
Tmec_i_label: Mechanical torque signal from control module (N.m)
I Induction Motor
Control Panels

Figure 9 - 21shows the induction motor control panels.

Figure 9 - 21 Induction Motor Control Panel (General)

2-9-436

Load and Motors

Induction Motor

Figure 9 - 22 Induction Motor Control Panel (Torque/load)

2-9-437

Load and Motors


Induction Motor

Figure 9 - 23 Induction Motor Control Panel (Saturation)

2-9-438

Load and Motors

Induction Motor

Example using an induction motor

Figure 9 - 24 Example using an induction motor

2-9-439

Load and Motors

Using the Hypersim Dynamic load


model

9.6 USING THE HYPERSIM DYNAMIC LOAD MODEL


The present document explains the Hypersim dynamic load model, its applications and how
to determine its parameters.
9.6.1

Purpose of the
Dynamic Load
Model

The purpose of the dynamic load is to model a portion of a power system including a combination of loads (motor loads, constant impedance RLC loads) distribution lines, transformers
and generators, as a simple equivalent representing the dynamic behavior of this subnetwork.
As Hypersim is used to model both the low frequency electromechanical oscillations (typically 0.01 Hz to 2 Hz) and the high frequency electromagnetic transients resulting from faults
and switchings (typically a few kHz), the load model must fulfill the following two requirements:
The load must represent the variations of load active power P and reactive power Q as
function of variable positive-sequence voltage V and fundamental frequency.
The load impedance must represent the subnetwork impedance as function of frequency for an acceptable frequency range. The network impedance will determine the
frequency content of transient voltages and currents, especially for switchings and
faults occurring in the vicinity of the dynamic load. The critical parameters are, the
impedance at fundamental frequency, the position of impedances poles (parallel resonances) and zeros (series resonances) as well as damping (amplitude of poles).

9.6.2

Description of
the Load
Model

The single-line diagram of the dynamic load model is presented on Figure 9 - 25.

Rs

Ls
Cp

P, Q
Rp V 0

Figure 9 - 25 Single-line diagram of the dynamic load


The series impedance (Rs, Ls) together with the internal voltage E model the motor part of
the load and the system series impedance due to lines and leakage reactances of transformers.
The shunt impedances Rp, Cp represent the resistive load as well as line capacitances and capacitor banks.
The dynamic load topology shown on Figure 9 - 25 allows modelling the first pole of the positive-sequence impedance versus frequency curve. The Hypersim dynamic load model also
includes a parallel shunt inductance Lp that can be used instead of Cp .This Rp/Lp shunt topology is rarely used. It would allows fitting of a combination of circuits presenting no shunt
resonance (RL loads and motor loads). In this document we consider only using Rp and Cp.

2-9-440

Load and Motors

Using the Hypersim Dynamic load


model
The positive-sequence voltage V is measured at the load terminals and the internal voltage E
magnitude and phase angle with respect to voltage V is automatically varied in the load
model so that the net power P and Q entering the load terminals follow the variation laws given below.
Traditionally, the voltage dependency of load characteristics is represented by an exponential
model as given below.
(EQ 27)

f 0
V- np 1 + k f----------P = P 0 ----p

V 0
f0

if V>Vmin

(EQ 28)

V-
Q = Q 0 ----V
0

nq

ff
1 + k q -----------0

if V>Vmin

where:
P, Q
P0, Q0

= active and reactive powers at voltage V and frequency f


= reference active and reactive powers at reference voltage V0 and frequency f0

f0

= nominal frequency (50 Hz or 60 Hz)

f
V0
V

= frequency of fundamental component (near 50 Hz or 60 Hz)


= reference positive-sequence voltage at nominal frequency
= positive-sequence voltage at fundamental frequency f

Vmin
np, nq

= minimum voltage for which np and nq exponents are used (note 1)


= exponents defining the variation law of P, Q as function of voltage (note 1)

kp, kq

= coefficients defining the variations of P, Q


as function of fundamental frequency.

Note : The P, Q variations follow the above equations as long as voltage is above a minimum value Vmin. When voltage falls below Vmin, the load varies as a constant impedance (np=2 and nq=2). The variation laws then follows the following parabolic
law:
(EQ 29)

V min np 2 2
ff
V 1 + k p -----------0
P = P 0 ---------np
f0
V0

if V<Vmin

2-9-441

Load and Motors

Using the Hypersim Dynamic load


model
(EQ 30)

V min nq 2 2
ff
Q = Q 0 --------- V 1 + k q -----------0

nq
f0
V0

if V<Vmin

Exponents np and nq depend on the nature of loads which are lumped in the dynamic load. In
particular, np and nq= 0, 1, 2 represent respectively constant power, constant current and constant impedance loads. According to reference [1] np usually ranges between 0.5 and 1.8,
whereas nq is typically between 1.5 and 6. Reference [2] also gives examples for residential
and commercial loads.
The following table taken from reference [1] summarizes sample characteristics of different
load classes in north america.

Load class

Power
factor

np

nq

kp

kq

Residential
Summer
Winter

0.9
0.99

1.2
1.5

2.9
3.2

0.8
1.0

-2.2
-1.5

Commercial
Summer
Winter

0.85
0.9

0.99
1.3

3.5
3.1

1.2
1.5

-1.6
-1.1

Industrial

0.85

0.18

6.0

2.6

1.6

In the absence of information on the load composition, the most commonly accepted load
model is to represent active power as constant current (np=1) and reactive power as constant
impedance (nq=2).

Figure 9 - 26 shows variations of active power and reactive power as function of positivesequence voltage for a dynamic load with the following parameters. Frequency is kept constant at nominal frequency.
P0= 50 MW Q0= 25 Mvar
V0= 0.96 pu

2-9-442

Load and Motors

Using the Hypersim Dynamic load


model
Vmin=0.7 pu
The figure shows P(V) and Q(V) curves for three different exponents np and nq.

Figure 9 - 26 Variation of P and Q as function of voltage


(50-MW 25-Mvar load at V0=0.96 pu; Vmin=0.7 pu)

Determination of load parameters


In order to determine the four parameters Rs, Ls, Rp, Cp, the load impedance Z(f) as function
of frequency, must be known. It is quite rare that utilities have field measurements available.
Therefore, the only practical method is to perform a detailed simulation of the system to be
reduced, including resistive loads, motor loads, lines, transformers.... The model can be built
with any electromagnetic transient (EMT) program such as Hypersim, EMTP, SimPowerSystems...). This can be a complex task requiring extensive modelling of the distribution network
and some parts of the high voltage network to be reduced. The load is usually known from a
load flow program but the nature of the load is not necessarily known. Some approximations
can then be used.
In the following sections we assume a 25 kV distribution voltage. The method used to obtain
dynamic load models representing the distribution system (25 kV) and, eventually, part of the
transmission network (161 kV, 240 kV...) is explained below and it is illustrated by an example.

2-9-443

Load and Motors

Using the Hypersim Dynamic load


model
From a load flow output, the active and reactive powers Pi, Qi flowing into each individual
feeder or group of feeders (25 kV) is known. The detailed model used for each individual load
Pi, Qi is shown on Figure 3. The load is assumed to have a resistive part R which contributes
to damping of transients, and a motor part which practically does not contribute to damping.
This motor load is modelled as a voltage source Em behind a series impedance Rm, Lm. (Figure 3). If capacitor banks are used for power factor correction at low voltage level (600V and
below) they should be lumped on the distribution level (25kV).The sharing factor km between
resistive load and motor load varies widely according to the country, the season and the nature
of load (residential, commercial...). For example, for the Hypersim model of the Hydro-Quebec system, the following typical load sharing has been used for determining dynamic load
models:
winter: 70% resistive; 30% motor (km=0.3)
summer: 50% resistive; 50% motor (km=0.5)

Em

Rm

Lm

km*Pi, Qi

Pi, Qi

(1-km)*Pi

Figure 9 - 27 Individual load model to be used in the detailed model


The series impedance Rm, Lm represents the motor impedance (leakage reactance of induction motor, or subtransient reactance of synchronous motors and generators) in series with
distribution transformers. A reasonable approximation of motor and associated transformer
impedance could be Lm ~ 0.25 p.u. based on motor load power (km*Pi) and Rm=Xm/8
(0.03p.u)
Once the complete system including all individual loads system has been modelled, its impedance is measured by performing a frequency scan for the desired frequency range (typically 0 to 2 kHz).

Let us assume that the load flow program gives the following values:
V= 25 kV
P= 80 MW
Q= 15 Mvar

2-9-444

Load and Motors

Using the Hypersim Dynamic load


model
The net active and reactive powers to be programmed in the Hypersim load are therefore +80
MW and +15 Mvar. The 80 MW active power is the total power absorbed by a mix of motor
loads, resistive loads, plus line and transformer losses. The15 Mvar reactive power is the net
reactive power consumed by the subnetwork (lets say +25 Mvar absorbed by motors and series inductances - 10 Mvar generated by power factor correction capacitor banks).
The positive-sequence magnitude and phase of Z(f) are as shown on Figure 9 - 28.This impedance curve corresponds to a sharing of 40 MW resistive loads and 40 MW motor loads.
The magnitude curve shows a resonance at 240 Hz. This parallel resonance is mainly due to
the interaction of the distributed 10 Mvar capacitor banks used for power factor correction
and motor+transformer inductances. From 0 Hz to 240 Hz the system is inductive. At resonance the impedance is resistive (15.2 ohms). The R value corresponds approximately to the
resistive load (P=25e3^2/15.2= 41.1 MW). Above 240 Hz the system is capacitive.

Figure 9 - 28 Example of impedance vs frequency curve


25 kV, 80 MW load (50% R, 50% motor)
The four parameters of the dynamic load Rs, Ls, Rp and Cp can be determined from the following four parameters selected on the impedance curve:
The resistance and reactance at fundamental frequency f0
(R0= 1.47 ohms; X0=3.64 ohms)
The resonance frequency (fmax= 240 Hz).
The impedance magnitude at resonance frequency (Zmax=15.2 ohms).

2-9-445

Load and Motors

Using the Hypersim Dynamic load


model
Solution of this problem is not trivial. The easiest way to get the exact solution is to use an
iterative solution. However, the iteration process can usually be simplified by using the five
equations given below. Because the impedance magnitude Zmax, at resonance, is practically
equal to the resistance Rp, the computation of Xs and Xp is first performed by neglecting the
resistance Rs . Under these conditions, one can show that the inductive reactance Xs of the
series branch and the capacitive reactance Xp of the shunt branch are given by:
(EQ 31)

Series branch (Ls):

1
X s = X 0 -------------------------2
f
0
1 --------f
max

(EQ 32)

R p1 = Z max

Shunt branch (Rp/Cp):

(EQ 33)

f max 2
X p = X s -------- f
0
From the example given in Figure 9 - 28 with:
f0= 60 Hz; fmax=240 Hz; R0= 1.47 ; X0= 3.64 ; Zmax= 15.2
The following values are obtained:
Series branch: Inductive reactance Xs= 3.88
Shunt branch: Rp1= 15.2 ; Capacitive reactance Xp= 62.1
Once Xs and Xp are known, the resistance Rs is computed as follows:
(EQ 34)

1
R s + jX s = ------------------------------------------------1
1 - ----j-------------------- --------R 0 + jX o Rp1 X p

Equation (4) gives the following results:


Rs= 0.459 ; Xs=3.88
2-9-446

Load and Motors

Using the Hypersim Dynamic load


model
Note that the new Xs value remained the same as the one computed by equation (1), indicating
that the computation process has converged.
Finally, the initial value of Rp (Rp1) must be corrected to take into account the resistive losses
introduced by Rs at resonance:
(EQ 35)

1
R p = ------------------------------------------R
f0 2
1
-------- ------s --------R p1 X 2 f max
s

From equation (5), the Rp value is 15.6 .


If we summarize, the four parameters computed from equations (1) to (5) are:
Series branch: Rs= 0.459 ; Xs= 3.90 ; (Ls=0.0103 H)
Shunt branch: Rp= 15.6 ;

Xp= 62.1 ; (Cp= 42.7 F)

Those values are very close to the exact values found from an iterative solution:
Series branch: Rs= 0.488 ; Xs= 3.90 ; (Ls=0.0103 H)
Shunt branch: Rp= 15.6 ;

Xp= 62.5 ; (Cp= 42.4 F)

References
[1] Power System Stability and Control by P. Kundur, Mc Graw Hill book, 1993
[2] Load Representation For Dynamic Performance Analysis by IEEE task force on Load
Representation for Dynamic Performance, IEEE paper 1992 WM 126-3 PWRS

2-9-447

Load and Motors

Using the Hypersim Dynamic load


model

PAGE LEFT INTENTIONALLY BLANK

2-9-448


Chapter 10
ELECTRONIC SWITCHES AND BRIDGES

10.1 ELECTRONIC SWITCHES


A Introduction

In Hypersim, a switch is modelled as a variable resistance, very low if the switch is closed
and very high if the switch is open. The control signal of the switch may be provided by: an
internal source, by an external source through digital inputs, or the control system module or
by Simulink. In addition to the switch control signal, the opening and the closing of the switch
depends on the voltage across the switch and the current through the switch.

B Icon and
Diagram of
Electronic
Switches

The following icon and diagram are used to represent electronic switches:

1
Ia
I

SwMono

SwYR

Ib
Ic

SWITCH

Sw94

Figure 10 - 1 Icons and Diagrams of electronic switches


10.1.1 Parameter
Description

A General
Parameters

Connection (Series = S Delta = D) If S (serial), each member of the switch is in series

with one phase of the network. If D (delta), each member of the switch is connected between two phases of the network;
Note : The Delta connection is not functional at this time.

2-10-449

Electronic Switches and Bridges


Electronic switches

B Switch
Parameters

Type: Set the type of the switch used. Each phase may use a different type of switch. Some
type requires two command signals per phase because they are designed from two distinct elements.

Available types are:


Ideal switch:
The conduction and blocking depend on the command signal.
Breaker:
The command signal set the blocking. The conduction depends on the command signal
and the current intensity.
Thyristor:
The blocking is set by the command signal and the current intensity. The firing is set by
the command signal and the voltage at the thyristor terminals.
Back-to-back thyristor:
The blocking of each thyristor is set by its own command signal and current intensity.
The firing is set by its own command signal and the voltage at each thyristor terminals.Two command signals per phase are required.
Back-to-back thyristor and diode:
The thyristor blocking is set by the command signal and the current intensity. The firing
is set by the command signal and the voltage at the thyristor terminals.
The diode blocking is set only by the current intensity through the diode and the firing
by the voltage at the diode terminals only
Note : Using a diode command signal will force the diode to fire. Sometimes, this technique is used to ease the simulation.
Diode:
The diode blocking is set only by the current intensity through the diode and the firing
by the voltage at the diode terminals only.
GTO:
The GTO blocking is set by the command signal if the current is acceptable. The GTO
firing is set by the command signal and the voltage at the GTO terminals.
Back-to-back GTO and diode:
The GTO blocking is set by the command signal if the current is acceptable. The GTO
firing is set by the command signal and the voltage at the GTO terminals.
The diode blocking is set only by the current intensity through the diode and the firing
by the voltage at the diode terminals only.
Note : Using a diode command signal will force the diode to fire. Sometimes, this technique is used to ease the simulation.
C Fail signal reset

Default zero reset. If the ENABLE button is grey, the FailSig_label is reset to zero. This
signal is produce if the switch (diode, thyristor or GTO) has reach its normal or reverse breakdown voltage or if an untimely firing had happened.

D Steady state
condition

State of the switches in steady state on a per phase basis. 0 if the switch is open and 1 if
the switch is to be closed.

2-10-450

Electronic Switches and Bridges

Electronic switches

E Precision Valve

Commissioning of the high precision switching (diode, thyristor or GTO). Compensate the
digital error as a result of the switch state change accordingly to the calculation time step.

10.1.2 Other
Parameters

A Open State
Resistances

Resistances of phases A, B and C of the switch in open state (ohm);

B Closed State
Resistances

Resistances of phases A, B and C of the switch in closed state (ohm);

C Holding Current

Current threshold value below which the valve is automatically blocked. Not relevant for the
ideal switch (A);

D Snubber
Capacitance

Capacitance of the RC snubber branch in parallel with the valve (F);

E Snubber
Resistance

Resistance of the RC snubber branch in parallel with the valve (ohm);

F Forward Break
Overvoltage

Highest value of overvoltage across a blocked valve. Relevant only for the diode, the GTO
and the thyristor (V);

G Reverse Break
Overvoltage

Highest value of overvoltage across a valve. Relevant only for the diode, the thyristor and the
GTO (V);

H Turn-off Time.

Lowest time interval during which the voltage across the valve must stay negative to avoid
the valve being fired again when the forward voltage turns positive. Relevant only for thyristor (s);

I GTO Maximum
Breakable
Current

Maximal value of the GTO current that can be turned off by the GTO turn off command. Relevant only for the GTO (A);

J Forward Voltage
Drop

Minimal forward voltage for which valve firing is possible. Relevant only for the diode, the
thyristor and the GTO (V);

10.1.3 Commands

Establishes the control order origin; external, control block or from Simulink.

A External

The command signals are from the digital inputs.

B Block of
Commands

The command signals are from the Control Block input placed on the switch icon.

2-10-451

Electronic Switches and Bridges


Electronic switches

The P connector, on the icon (see Figure 10 - 1), allows to send 0 or 1 command to all
the switches. You must send to this connector a whole value where each bit corresponds
to the command signal from each switch. The less significant bits (1, 2, 3) correspond
to the phases A, B, and C switches in their forward breakdown voltage condition. The
4, 5, and 6 bits correspond to the phases A, B, and C switches in their reverse condition.
Therefore, the whole value of bit 5 on the P connector is 000101 in binary value and
commands the firing of the A and C phases in the forward breakdown voltage condition
of the switch.
The D connector on the icon (see Figure 10 - 1), allows to set a delay to each switching. This function is available only if the High precision switch has been selected. A
decimal value between 0.0 and 1.0 must be applied to this connector for each transition
of one of the switches. The 0.0 value means no delay and a 0.5 value means a 50%
delay accordingly to the actual calculation time step used.
C Simulink

The command signals are from an HyperLink block. The following information must be supplied:
Directory: the full path of the directory where the Simulink model is stored;
Model name: the name of the Simulink model;
Execution time: estimated or calculated execution time of the Simulink model.

10.1.4 List of
Available
Signals

At acquisition, the following signals are made available by sensors:


Ia,b,c_label: Current through the switch (pu);
cmd12,a,b,c_label: Firing command for the 1 to 2 component of the switch;
cmd21,a,b,c_label: Firing command for the 2 to 1 component of the switch;
state12,a,b,c_label: State of the 1 to 2 component of the switch;
state21,a,b,c_label: State of the 2 to 1 component of the switch;
FailSig,a,b,c_label: Alarm signal from the switch whose meanings are the following:
1: Violation of the extinction time limit Tq for Thyristor12.
(Automatically reset to zero after 1 calculation time step)
-1 :Violation of the extinction time limit Tq for Thyristor21.
(Automatically reset to zero after 1 calculation time step)
2:Thyristor12 reverse voltage higher than Rbov. (Reset only by Fail Reset=1)
-2:Thyristor21 reverse voltage higher than Rbov. (Reset only by Fail Reset=1)
3:Thyristor12 forward voltage higher than Fbov. (Reset only by Fail Reset=1)
-3: Thyristor21 forward voltage higher than Fbov. (Reset only by Fail Reset=1)
P_label: Control signal from the Control System module.

2-10-452

Electronic Switches and Bridges

Serial Breaker and Shunt Fault


Breaker

A Electronic
Switches
Command Panel
.

Figure 10 - 2 Electronic switches command panel

10.2 SERIAL BREAKER AND SHUNT FAULT BREAKER


10.2.1 Shunt and
Serial
Breakers

A Introduction

The breaker is simulated as a variable resistance, very low if the breaker is closed and very
high if the breaker is open. The control signals of the breaker may be provided by an internal
timing control, by an external source through control block digital inputs or by Simulink.
2-10-453

Electronic Switches and Bridges

Serial Breaker and Shunt Fault Breaker

B Icons and
Diagrams
Representing
Breakers

There are two types of breakers: the serial breaker and the fault breaker. The icon and the diagram of serial breakers are shown in Figure 10 - 3 while those of fault breakers are shown
in Figure 10 - 3

Figure 10 - 3 Icon and Diagram of a serial breaker

Figure 10 - 4 Icon and Diagram of a fault breaker


C Parameter
Description
D General
Parameters

The data forms of a serial breaker and of a fault breaker are shown in Figures 10 - 5, 10 - 6
and Figures 10 - 7, 10 - 8 respectively.
SI or pu units.
SI for international units of elements (ohms, farad, henry etc.);
pu to set the values in pu.
Base units:
Base MVA: base power (MVA);
Base Volt: base voltage (kV);
Base Freq: base frequency (Hz).
Connection:
for the serial breaker (Serial=S): Only series connection is valid. In this case each
branch of the serial breaker is in series with one phase of the network;
for the fault breaker (Yg): Only Yg connection is valid. In this case the connection
of the three phase fault breaker is as shown in Figure 10 - 9;
Note : The Delta connection options (D) in the data forms of the serial breaker and of the
fault breaker are not functional at this time.
Type (Breaker = 0, Switch = 1):

2-10-454

Electronic Switches and Bridges

Serial Breaker and Shunt Fault


Breaker

if 0, the breaker opens as soon as the current in the breaker is lower than the I margin current after the command to open is issued;
if 1, the breaker behaves like an ordinary switch and opens immediately after the
command to open is issued.

Figure 10 - 5 Data form for serial breakers (General)

2-10-455

Electronic Switches and Bridges

Serial Breaker and Shunt Fault Breaker

Figure 10 - 6 Data form for serial breakers (Timing)

2-10-456

Electronic Switches and Bridges

Serial Breaker and Shunt Fault


Breaker

Figure 10 - 7 Data form for fault breakers (General)

2-10-457

Electronic Switches and Bridges

Serial Breaker and Shunt Fault Breaker

Figure 10 - 8 Data form for fault breakers (Timing)


10.2.2 Breaker

A Open State
Resistor

Resistances of phase breakers A, B, C and ground breaker in open state (ohm).

B Closed State
Resistor

Resistances of phase breakers A, B, C and ground breaker in closed state (ohm).

C I margin

Current absolute value below which the breaker is allowed to open (A).

D Steady State
Condition

State of phase breakers A, B, C and ground breaker in steady state. Colored if the breaker
is open and Grey, if the breaker is closed.

2-10-458

Electronic Switches and Bridges

Serial Breaker and Shunt Fault


Breaker

E Switching Time
Programming

Enable or disable the time of operation programed.

F Time Units

Second, millisecond or cycle is available. (For cycle the frequency is mandatory)

G Phase Operated

Specify which among the phase breakers A, B, C and ground breaker can change state if data
acquisition is made with the switching enabled in Spectrum. For changes of state to happen,
operation times T1 and T2 below must be such that T1<T2.

H T1 Operation
Time

Relative time (with respect to synchronization) when the state of a phase breaker or a ground
breaker changes (s or ms).
T1: Initial status or transition time from low to high (t1) or high to low (t2) with fix,
incremental or random variation types.
All timings specified with these two parameters are in cycles from the fundamental
frequency set in the element control panel.
If a parameter field is blank or contains - no switching will happen for this parameter.
Low: initial digital output status is 0 open;
High: initial digital output status is 1 close.

I T2 Operation
Time
J Control Order
Source

Relative time (with respect to synchronization) when the state of the phase breaker or a
ground breaker returns to the steady state position (s or ms).
Specifies the origin of the control signal (Internal = 0, External = 1, Simulink = 2):
Internal: Hypersim;
External: Digital inputs;
Control block: from Hypersim control block;
Simulink: HyperLink bloc;
Directory: The complete path of the directory where the Simulink model is stored;
Model name: name of the Simulink model;
Execution time: Estimated or measured execution time of the Simulink model.

2-10-459

Electronic Switches and Bridges


Triple-Level Converter in H
Configuration

Ropen/close

Ropen/close

Ropen/close

Ground
Ropen/close
Figure 10 - 9 Connection of the triple H-bridge converter
K List of Available
Signals

At acquisition, the following signals are made available by sensors:


Com_label_a,b,c: Phase breaker commands (pu)
Com_label_n: Ground connected breaker command (pu) (For fault breaker only)
I_label_a,b,c: Phase breaker currents (pu)
I_label_n: Ground connected breaker current (pu) (For fault breaker only)

10.3 TRIPLE-LEVEL CONVERTER IN H CONFIGURATION


A Introduction

Hypersim provides a two-triple-level converter in H configuration. There are 4 switches per


phase for a total of 12. The control signals of the switches can originate from an external
source via digital input, a system control module (control block) or Simulink.

10.3.1 Icon and


Diagram of a 2
Triple-Level
Converter in H
Configuration

The following icon and diagram are used to represent a 2 triple-level converter in H configuration.

Figure 10 - 10 Icon and Diagram of a 2 Triple-Level Converter in H Configuration

2-10-460

Electronic Switches and Bridges

Triple-Level Converter in H
Configuration

10.3.2 Parameter
Description

Figure 10 - 11 shows the control panel for a 2 triple-level converter in H configuration.

10.3.3 Switch
Parameters

A Type

Specifies the type of switch. The types available are the following:
Breaker:
Blocking is set by the control signal. Conduction depends on the control signal and the
current level in the breaker.
Ideal Switch:
Blocking and conduction are set by the control signal.
Thyristor:
Blocking is set by the control signal and the current level. Firing depends on the control
signal and the voltage at the thyristor terminals
Diode
The diode blocking depends only on the current level across it. The diode firing
depends only on the voltage at its terminals.
Back-to-Back GTO and Diode
Blocking of the GTO is set by the control signal if the current level is acceptable. Firing
of the GTO depends on the control signal and the voltage at the GTO terminals.
The diode blocking depends only on the current level across it. The diode firing
depends only on the voltage at its terminals.
Note : The firing of the diode can be forced by sending to it a control signal. This technique is sometimes used to facilitate the simulation.

B Fail Signal
Reset

Fail Signal Reset. If Enable is grey, the FailSig_label alarm signal is reset. This
signal is generated if the switch (diode, thyristor, GTO) has reached the forward or
reverse breakdown voltage or if false firing has occurred.

2-10-461

Electronic Switches and Bridges


Triple-Level Converter in H
Configuration
.

Figure 10 - 11 Control Panel of a 2 Triple H-Bridge Converter


C .Other
Parameters
1 Reverse Break
Overvoltage

Reverse break overvoltage: Highest value of the reverse voltage in a blocked valve.
Applies only to diodes, thyristors and GTO (V).

2 Forward Break
Overvoltage

Forward break overvoltage: Highest value of the forward voltage in a blocked valve.
Applies only to thyristors and GTO (V).

2-10-462

3 Snubber
Resistance

Snubber resistance: resistance of RC branch in parallel with the valve (ohm).

4 Snubber
Capacitance

Snubber capacitance: capacitance of RC branch in parallel with the valve (F).

Electronic Switches and Bridges

Triple-Level Converter in H
Configuration

5 Turn-off Time

6 GTO Maximum
Breakable Current
7 Open State
Resistor
8 Closed State
Resistor

Turn-off time: Shortest time interval during which the voltage in the valve must be
negative to avoid being fired again when the voltage becomes positive. Applies only
to thyristors (s).
GTO maximum breakable current: Maximum GTO current value that can be turned
off by the corresponding GTO command. Applies only to GTO (A).
Open state resistor: resistances for phases A, B and C of the open switch (ohm).
Closed state resistor: resistances for phases A, B and C of the closed switch (ohm).

9 Forward Voltage
Drop

Forward voltage drop: minimum forward voltage at which it is possible to fire the
valves. Applies only to diodes, thyristors and GTO (V).

10 Holding Current

Holding current: Current threshold below which the valve is automatically blocked.
Does not apply to ideal switches (A).

10.3.4 Control Order


Source

Specifies the source of the control signal: external, via control blocks or using Simulink.

A External

The control signals originate from digital input.

B Control Block

The control signals originate from the control block input on the switch icon.

C Simulink

The control signals originate from a HyperLink block. The following information must
be provided:
Directory: full path of the directory where the Simulink model is saved;
Name of model: name of Simulink model;
Execution time: estimated or measured execution time of Simulink model.

10.3.5 List of
Available
Signals

At acquisition, the following signals are made available by the sensors:


vValve1,2,3,4(A,B,C)_label: Voltage in the switch;
iValve1,2,3,4(A,B,C)_label: Current in the switch;
cmd12Ext1,2,3,4(A,B,C)_label: Firing command for the 1 to 2 component of the
switch;
cmd21Ext1,2,3,4(A,B,C)_label: Firing command for the 2 to 1 component of the
switch;
State12_1,2,3,4(A,B,C)_label: State of the 1 to 2 component of the switch;
State21_1,2,3,4(A,B,C)_label: State of the 2 to 1 component of the switch;
FailSig1,2,3,4(A,B,C)_label: Alarm signal of the switch with the following meanings:
1: Violation of extinction time limit Tq for Thyristor 12. (Automatically reset after
one calculation time step).
2-10-463

Electronic Switches and Bridges


THREE-LEVEL CONVERTER

-1: Violation of extinction time limit Tq for Thyristor 21. (Automatically reset after
one calculation time step).
2: Reverse voltage of Thyristor 12 greater than Rbov. (Reset only if fail signal reset =
Enable (Grey).
-2: Reverse voltage of Thyristor 21 greater than Rbov. (Reset only if fail signal reset
= Enable (Grey).
3: Forward voltage of Thyristor 12 greater than Fbov. (Reset only if fail signal reset
= Enable (Grey).
-3: Forward voltage of Thyristor 21 greater than Fbov. (Reset only if fail signal reset
= Enable (Grey).
P_label: Control signal of control module.
D_label: Control signal of control module.

10.4 THREE-LEVEL CONVERTER


A Introduction

Hypersim provides for a three-level or Neutral Point Clamped (NPC) converter bridge equivalent. The NPC converter is composed of 4 controlled (Q1,Q2, Q3, Q4) switches and 6 diodes
per phase. The control signals of the switches can originate from an external source via digital
input, a system control module (control block) or Simulink. The model emulates the NPC
converter by using an ideal three-level switch (P N, M) per phase - The control signals of the
equivalent three-level switches are generated by the model, based on an integrated logic and
the control signals provided externally. In the blocked mode, when the control pulses are ab
sent, the bridge diodes are also emulated.

10.4.1 Icon and


Diagram of a 2
Triple-Level
Converter in H
Configuration

The following icon and diagram are used to represent a three-level converter.

Figure 10 - 12 Icon and Diagram of a three-level converter


10.4.2 Parameter
Description

2-10-464

Figure 10.13 shows the control panel for a three-level converter bridge.

Electronic Switches and Bridges

THREE-LEVEL CONVERTER

10.4.3 Switch
Parameters

A Type

Specifies the type of switch. The type available is the following:


Back-to-Back ideal Switch and Diode
Blocking and conduction are set by a control signal. B Fail Signal Reset

B Other
Parameters

Does not apply to the actual model. Highest value of


the reverse voltage in a blocked valve. Applies only to diodes, thyristors and GTO.
2 Forward Break Overvoltage Does not apply to the actual model. Highest value of
the forward voltage in a blocked valve. Applies only to thyristors and GTO.
3 Snubber Resistance Resistance of RC branch in parallel with the valve.
4 Snubber Capacitance Capacitance of RC branch in parallel with the valve.
1 Reverse Break Overvoltage

5 Turn-off Time Does not apply to the actual model. Shortest time interval during which

the voltage in the valve must be negative to avoid being fired again when
the voltage becomes positive. Applies only to thyristors.
6 GTO Maximum Breakable Current Does not apply to the actual model. Maximum

GTO current value that can be turned off by the corresponding GTO
command. Applies only to GTO.
7 Open State Resistor Resistances for phases A, B and C of the open switch.
8 Closed State Resistor Resistances for phases A, B and C of the closed switch.

2-10-465

Electronic Switches and Bridges


THREE-LEVEL CONVERTER

Figure 10 - 13 Control Panel of a three-level Bridge or NPC Converter


9 Forward Voltage Drop Does not apply to the actual mode!, minimum forward volt age

at which it is possible to fire the valves. Applies only to diodes, thyristors


and GTO
10 Holding Current Does not apply to the actual model. Current threshold below which

the valve is automatically blocked. Does not apply to ideal switches.


10.4.4 Control Order
Source

Specifies the source of the control signal: external, via control blocks or using Simulink.

A External

The control signals originate from digital input.

B Control Block

The control signals originate from the control block input on the switch icon.

2-10-466

Electronic Switches and Bridges

THREE-LEVEL CONVERTER

C Simulink

The control signals originate from a 1 block. The following information must be provided:
Directory: full path of the directory where the Simulink model is saved;
Name of model: name of Simulink model;
Execution time: estimated or measured execution time of Simulink model.

10.4.5 List of
Available
Signals

At acquisition, the following signals are made available by the sensors:


vValveP,N,M(A,B,C)_label: Voltage across the equivalent switch (V);
iValveP,N,M(A,B,C)_label: Current in the equivalent switch (A);
cmdl 2ExtQl,Q2,Q3,Q4(A,B,C))_label: Firing command for the 1 to 2 component of
the switch;
State 12P,N,M(A,B,C)_label: State of the Ito 2 component of the equivalent switch
(Logic);
FailSigl,2,3,4(A,B,C)_label: Does not apply to the actual model. Alarm signal of the
switch with the following meanings:
1: Violation of extinction time limit Tq for Thyristor 12. (Automatically reset after
one calculation time step).
1: Violation of extinction time limit Tq for Thyristor 21. (Automatically reset after
one calculation time step).
2: Reverse voltage of Thyristor 12 greater than Rbov. (Reset only if fail signal reset
Enable (Grey).
2: Reverse voltage of Thyristor 21 greater than Rhov. (Reset only if fail signal reset = Enable (Grey).
3: Forward voltage of Thyristor 12 greater than Fbov. (Reset only if fail signal reset
= Enable (Grey).
3: Forward voltage of Thyristor 21 greater than Fbov. (Reset only if fail signal reset = Enable (Grey).
P_label: Control signal of control module (Binary code).
D_label: Does not apply to the actual model. Control signal of control module (% step).

2-10-467

Electronic Switches and Bridges


THREE-LEVEL CONVERTER

PAGE LEFT INTENTIONALLY BLANK

2-10-468


Chapter 11
HVDC AND SVC CONTROLLERS

11.1 RECTIFIER/INVERTER 6/12 PULSE DC CONTROLLERS


11.1.1 Introduction

The HVDC converter library contains 12-pulse and 6-pulse models. The control system is the
same for both types of converters. However, 12-pulse models offer the possibility of choosing
between two types of synchronization systems. Since each converter can be operated as a rectifier or as an inverter, the set of parameters is the same for all four converter models. However, different icons and elements are provided to differentiate rectifiers and inverters. The
control system1 includes regulation, synchronization, protection and tap changer subsystems.
The models can simulate a valve short-circuit or a DC fault. Step responses can also be simulated to optimize the regulator parameters. Finally, the thyristor bridge can receive firing
pulses from four different sources:
The internal generic control system provided with the converter;
An external physical source;
Simulink;
The Hypersim control module (control block)
A GTO based two-level voltage-source converter (VSC) may be modelled by using the
GTO+diode switch type in the six-pulse inverter shown in Figure 11 - 4. The model
implementation includes a logic for the simultaneous switching (OFF or ON) of a diode
with the switching of a GTO in accordance with the correct sequence. In this case, the
precision valve option is not operational.

11.1.2 Icons and


diagrams
REC01

CC 12

D
P

Id
V_Line

Figure 11 - 1 Icon and diagram of 12-pulse rectifier

1.This control system is only intended for the thyristor based bridge.

2-11-469

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers

InvE9

CC 12

D
P

Id
V_Line

Figure 11 - 2 Icon and diagram of 12-pulse inverter

Rec Q7
+

CC 6

D
P

Id
V_Line

Figure 11 - 3 Icon and diagram of 6-pulse rectifier

InvP1
+

CC 6

D
P

Id
V_Line

Figure 11 - 4 Icon and diagram of 6-pulse inverter


11.1.3 Modelling the
converter and
its control
system

The general diagram of a converter station including a 12-pulse converter, a converter transformer and the generic control system is shown in Figure 11 - 5. For a 6-pulse converter, the
bridge would be connected to one of the two secondary windings (star or triangle connections).
The general diagram of the control system is shown in Figure 11 - 6.

11.1.4 Valve faults


and DC fault

It is possible to simulate a short circuit on any of the 12 valves (at the users choice) for a
specified time interval (see form in Figure 11 - 16). A resistive grounded DC fault can also
be simulated at the converter terminal. The time interval is referenced with respect to the start
of the acquisition, or t = 0.

11.1.5 Firing and


synchronizatio
n system

The lag angle reference (a) is a firing system input. It is generated by the regulation system
and the AC voltages of the switching bus. The synchronization system generates firing pulses
for each thyristor. The generic synchronization system used in a 6-pulse converter is of the
equiangular type. It can be used with a 12-pulse converter for which the user also has the
option of using an equidistant synchronization system.

2-11-470

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
A Equiangular
synchronization
mode

The firing pulses are synchronized with the zero crossings of the switching voltages.

B Equidistant
synchronization
mode

The firing pulses are synchronized with an oscillator whose frequency is 12 times that of the
power grid. The oscillator phase is controlled by the regulation system (current, voltage, etc.)
which lags or leads the firing, if necessary. The oscillator synchronizes itself slowly at the
zero crossings of the switching voltages, but quickly at the previous firing instant. The oscillator gain, set by the user, allows to determine the speed at which the oscillator synchronizes
itself with the zero crossings. A gain of 1 (minimum allowed) means a full synchronization
with the zero crossings1. As the gain increases, the oscillator synchronizes itself more slowly
with the zero crossings (1000 is the maximum limit imposed by the model). Hence, the system is not greatly affected by transients and unbalances of the AC switching voltages. A gain
of 32 (default value) is a good compromise between the synchronization speed and the immunity to the harmonics on the switching voltages. In transient state or during AC faults,
when the switching voltages are absent or severely distorted, the oscillator gain is automatically increased to cancel any zero crossing synchronization.
Note that a valve will be fired (pulse generated) only when the voltage at its terminals has
reached a minimum threshold, adjustable by the user.

1.As it is the case for the equiangular synchronization system

2-11-471

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers

Id

Ld

Line

DC Line
IaY

Tap changer

1Y

3Y

5Y

Resistive
DC
Fault

IbY

VL

Va

4Y

6Y

2Y

1D

3D

5D

b
Vb
IaD

IbD

A thyristor with
parallel snubber
circuit
Thyristor

Valve
Fault

b
c

Vc

4D

6D

2D

Neutral

Zneutral
VN

Id
IaY
IbY
IaD
IbD
Va
Vb

Converter

Control

Vc
VL
VN

Tap Change Demand

Figure 11 - 5 The general diagram of a 12-pulse converter bridge


11.1.6 Band-pass
filter

The voltages used for synchronization are filtered by band-pass filters with an adjustable tuning frequency. The transfer function of one band-pass filter is:

Bs
H ( s ) = ------------------------------2
2
s + Bs + o
o = 2f o

2-11-472

(EQ 1)

(EQ 2)

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
where
BBandwidth in radians/second

o
fo

Central pulsation in radians/second


Central frequency (hertz)

.
0
Manual
blocking

5
Vc

OR
3
Va

4
Vb

Band-pass
filter

Firing
system
Equiangular
6 or 12 pulses
or
Equidistant

AC low voltage
detection

Tap changer
control
1.0
Id REF (pu)

3
Tap -

1.0
Vd REF (pu)
1
Rectifier

Alpha ord
Regulation
system

18
Gamma MIN (deg)
2
Vd

Gamma

1
Id

2
Tap +

DC fault Forced
delay
protection
(on rectifier)
Blocking

6
IaY
7
IbY
8
IaD
9
IbD

Commutation
failure
protection
(on inverter)

Gamma rate

Figure 11 - 6 The general diagram of the generic converter control system


At fo frequency, H(s) has a gain of 1 and its phase is zero. As a result, the band-pass filter
does not affect the fundamental component of the voltage (neither in amplitude nor in phase),
while it reduces other harmonic components.
The B parameter (proportional to the pass-band with a typical value of 45 Hz) is used to control the sensitivity and the speed of the filter. A small bandwidth improves harmonic filtering
and gives less distorted wave-form at the filter output. However, the smaller the bandwidth,
the slower the filter is in following the amplitude and phase fluctuations of the input signals.

2-11-473

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
The three-phase voltages on the primary side of the transformer are thus filtered by an adaptive band-pass filter. The six secondary (Y and side) line voltages (phase to phase) calculated from the primary voltages are used to determine the zero crossing times. For each
voltage, there are two zero crossings in one cycle, one with an positive slope and another with
a negative slope for a total of 12 zero crossings in each cycle.
The period T is updated 12 times per cycle. The measured period T is limited within an adjustable interval defined by the Freq max and Freq min parameters.
11.1.7 Low AC
voltage
detection

If the voltage is lower than a specified threshold during a specified time interval, the Low
AC voltage detection function provides a low voltage flag. In the equiangular synchronization mode this flag is on and the calculated period T is not updated. It is rather maintained at
its past value in prevision of an eventual AC fault. Also, the DC fault detection is inhibited.
A falling edge delay (from True to False) is applied to the flag to ensure that it remains present
for a minimum period of time. Finally, low voltage detection is used in the DC fault protection described further ahead.

11.1.8 The angle


regulation and
limiting
system

The function of the regulation system is to regulate the direct current or voltage by adjusting
firing angle , and to limit the inverter extinction angle to a minimum value.

11.1.9 The static


characteristic

The Vd-Id static characteristic of a rectifier-inverter system is shown in Figure 11 - 7.

min mode

voltage

Voltage
reference

Voltage regulation
mode

min mode
Voltage
margin

V
Current compensated
mode

Current regulation
mode

Current regulation
mode

I
Current margin

rectifier
inverter

Figure 11 - 7

2-11-474

current
Current
reference

Vd-Id Static Characteristic

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
Normally, the rectifier regulates the direct current to maintain it equal to the current reference.
In abnormal cases (e.g. voltage drop in the AC power system) the delay angle can reach its
minimal value min and the rectifier will not be able to regulate the current. In such a case, it
is said to operate in min mode.
The inverter regulates the direct voltage Vd measured at the DC line input to keep it equal to
the voltage reference. In Figure 11 - 7, the inverter operates in voltage regulation mode. If the
current drops below the current reference, the inverter goes in current compensated mode
where the voltage is regulated with a slope determined by the voltage margin (V) and the
current margin (I). If the current falls even lower than the (current reference - current margin), the inverter will operate in current regulation mode.
If the DC current increases (load increase or fault in the AC power system on the inverter
side), the extinction angle can reach the minimal value allowed and the inverter can loose
its regulating capability. It then operates in min mode.
Figure 11 - 8 shows the operation of the voltage dependent current order limiter. The object
of this limiter is to ensure a good recovery of the DC power transit following faults on the AC
side. The risk of commutation failure during recovery is also minimized.

11.1.10 The voltage


dependent
current order
limiter
(VDCOL)

Idref reel

Vd

Idref=1.0
Idref=0.8

1.0

Vd

Vdf
Vdf

Td = 0

Tm

First order dynamic


filter
Time constant

Idref reel

Idref min
Idref=0.3

Idref mina
Vdfmin

Idref

Vdf1pu

Vdf

Idref limiter based on DC voltage


(after dynamic filtering)

Figure 11 - 8 Voltage dependent current order limiter (VDCOL)


The limiter includes two functions: the dynamic filtering of the DC voltage and the calculation of the reference based on the filtered voltage.
1 Dynamic filtering of the voltage The DC voltage Vd goes through a first order filter

whose time constant T varies:

2-11-475

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers

T = T d = 0 when Vd decreases;

T = T m = 80ms when Vd increases.

In this way, the current reference falls immediately when the voltage drops, but increases
more slowly when the voltage rises. This allows for quick but controlled recovery of the direct power transit.
The typical values of the following adjustable parameters are:

Idref min = 0,3 p.u.


Vdf min = 0,18 p.u.
Vdf 1pu = 0,6 p.u.
Idref mina = 0,1 p.u.
11.1.11 Dynamic
operation of
the controller

2-11-476

The functional diagram of the controller is shown in Figure 11 - 9. This pole control function
is the same for the rectifier and the inverter.

HVDC and SVC Controllers

Limiter

limiters

before

Commutation failure
detector and
limiter

Rectifier/Inverter 6/12 Pulse DC


Controllers

Linearization

Kp,I

Kp,V

G()

err Vd

err Id

Ki,V

Ki,I

Regulator
PI

Regulator
PI

(Id)

(Vd)

Selector for minimum

DC voltage (DC line)

DC voltage reference

DC voltage reference step

DC current (converter)

DC current reference

DC current reference step

Current margin (on inverter))

Voltage margin (on inverter)

Firing angle

Vd

Vdref

Vdref

Id

Idref

Idref

+
Vdref

+
Vdref

1
------------------------------------------- ( 1 + 1 s ) ( 1 + 2 s )

Idref

Idref

Id

Vd

LCDT
VDCOL

1 ------------------1 + 1 s

+
+

1 ------------------1 + 0.2 s

dV

dI

V/I

Figure 11 - 9 Functional diagram of the regulation unit


The regulation unit consists essentially of two PI (proportional-integral) regulators with limiters: one for the current and the other for the voltage. The delay angle is established by the
lowest value among the outputs of the two regulators.
On the rectifier side, the reference current Idref takes on a normal value (e.g. < 1.2 p.u.) while
the voltage reference Vdref takes on a very high value (e.g. 2 p.u.). In this way, the regulation
unit cannot regulate the voltage and will be forced to operate in current regulation mode. A
signal allows to apply a current reference step for a specified time interval.
2-11-477

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
On the inverter side, a current margin I is subtracted from the inverter reference, usually
equal to that of the rectifier, so that in normal state, there is a I error at the PI input. The
inverter regulates the voltage at the DC line input.
11.1.12 The PI
regulators

The PI regulator includes the following transfer function:

K
H ( s ) = K i 1--- + T p G ( ) = -----i + K i T p G ( )
s
s

(EQ 3)

where

K i is the integral gain;

K i T p = K p is the proportional gain;


G ( ) is the linearization factor (see Figure 11 - 10).
Upper and lower limits are applied to the regulator output (representing the delay angle) to
ensure it remains within safe range of operation.
11.1.13 Linearization
of gain

2-11-478

The linearization is done by multiplying the proportional gain by a factor G ( ) depending


on as shown in Figure 11 - 10.

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers

G()
G()

1.0

sin ( 20 )
-----------------sin ( )

sin ( 20 )
-----------------sin ( 60 )

20
160

40
140

60
120

Figure 11 - 10 Correction factor for proportional gain of PI regulators


This linearization is necessary to have the regulation respond with the same speed at different
values of .
On the inverter side, the linearization is applied on the = 180 and G() looks the
same as G().
The linearization of the gain does not apply to the integral part of the PI regulator because this
part of the response is slower.
The regulator output goes through two limiting functions before being sent to the firing unit.
These functions are: limiter and limiter.
11.1.14

limits

On the rectifier side, is limited between two adjustable values. The typical limits are:

min rec = 5

max rec = 168

(EQ 4)

(EQ 5)

2-11-479

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
Note : In the equidistant mode of the synchronization, the minrec is not used.
On the inverter side, the lower limit is an adjustable constant, while the upper limit varies dynamically:

min inv = 102

max inv = 180 ( min + ) cf

(EQ 6)
(EQ 7)

where

min is the adjustable minimum value of the extinction angle


is the adjustable reduction on max

inv when a commutation failure is detected


(seecfSection 11.1.18) in order to reduce the risk of successive commutation failures.

is the calculated overlap angle

Note that

min + = min
11.1.15 () limitation

(EQ 8)

In addition to the limit on the value of , a limit is also imposed on the variation rate () of
as shown in Figure 11 - 11. On the rectifier side, is limited between two adjustable values.
The typical values are:
Note that in the equiangular synchronization system, Da is the difference between the current reference and the previous firing reference. In an equidistant synchronization system,
is the difference between the reference a and a value of a reflecting the position of
the oscillator phase (See section 11.1.5).
At the rectifier and the inverter, is within a value range where only the vertical coordinates are adjustable. The typical values for the ordinates (X-axis) are: [Da1, Da2, Da3, Da4]
= [90, 5, -10 and -5] (rectifier); [Da1, Da2, Da3] = [6, 1, -6] (inverter).

2-11-480

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers

(deg)

90

1 6

25
5
10

1 1
30

115
40

60

Rectifier
Figure 11 - 11

6
Inverter
Limitation of

The values marked in Figure 11 - 11 are for illustration only, they can be adapted to the dynamic characteristic of a particular network. The purpose of imposing limits on is to:
reduce the risk of commutation failure particularly when the value of is high;
improve the stability of the control system in case of faults or other large perturbations.
The side effect of limiting the variation rate of is to slow down the response of the control
system.
11.1.16 Protection
system

Two protection functions are implemented in the control system: Protection for DC fault on
the rectifier and Protection for commutation failure on the inverter.

11.1.17 DC fault
protection

A fault in the DC power system is detected on the rectifier side when the following two conditions occur:
The DC voltage falls below a specified threshold for a period of time (adjustable);
No low AC voltage is detected on the rectifier side (characterizing a fault on the AC
side). This detection is done in the Low AC voltage detection function described earlier.
When a fault is detected on the DC side, the rectifier angle is forced to an adjustable value
greater than 90o so that the rectifier operates as an inverter to de-ionize the fault. This forced
is removed after an adjustable period of time. This operation will be repeated until the fault
is cleared or the converter is blocked by the protection system after the operation has been
repeated a number of times.
This function is implemented for simulating faults on the DC side. The function does not discriminate between the faults on the AC side of the inverter and commutation failures on the
inverter, both causing a drop in direct voltage. One way to disable the protection is to assign
a very large value to detection time parameter.
No action is taken on the inverter side since it is already in safe condition.

2-11-481

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
11.1.18 Protection for
commutation
failures

Detected Commutation
failure

ratemax

Figure 11 - 12

Td rate

Tm rate

rate
o

Parameters
----------------

Tm rate

Description
---------------Rise time

Td rate

Fall time

ratemax

Reduction of max

Variation of cf

T typical value
-------------------10ms
100ms
45o

when detecting a commutation failure

The protection against commutation failure is provided on the inverter only. The reason is the
firing angle on the inverter side is large and, therefore, the inverter is more prone to commutation failures.
The detection of commutation failures is based on the following principle. In normal state,
the currents (in pu) on the AC side and on the DC side are nearly equal. A commutation failure creates instantaneously a short circuit on the DC side and the DC current increases quickly. The inverter then has a null voltage and hence, the current drops on the AC side.
Therefore, a commutation failure is detected if:

Id I ac > Tolerance
I ac < I ac cf
with, Tolerance = 0, 15 + 0, 1Id and
I ac comfail = 0, 65 pu

2-11-482

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
When a commutation failure is detected, the protection decreases the upper limit of by
cf as shown in equation (EQ 7). This keeps away from the area where the risk of commutation failure is high. then takes on the form shown in Figure 11 - 12: increases
cf
cf
quickly (adjustable first order time constant) when a commutation failure is detected for
quick protection, but decreases more slowly (adjustable first order time constant) to avoid
successive commutation failures.
It is possible to simulate commutation failures by preventing the current from switching from
one thyristor to its neighbor. To do so, a given thyristor (1 of 12 to users choice) is prevented
from receiving the firing pulse for a given period of time (adjustable).
11.1.19 Unblocking
sequence

There are two ways to unblock the converters (e.g. following a persistent DC fault): manually
or automatically.
Manual unblocking of a converter is initiated by the operator and takes effect only when the
DC current is lower than a specified threshold (set at 0,10 p.u.). This current must then be
decreased by lowering the current reference. All the reference signals have a rate of change
limiter which limits their variation speed (adjustable).When the operator varies the reference,
the effective reference will follow, but at a speed limited by the rate of change limiters.
The automatic disabling takes effect immediately to protect the system. It is controlled by the
DC fault protection system.
When the converter is disabled (manually or automatically), the control system cancels the
firing pulses to the valves. Moreover, a constant delay angle is imposed permanently.

11.1.20 Enabling
(start-up)

Unblocking can only be done manually. To enable the converter, the user has to:
Set the current reference to zero;
Initiate the enabling order. Regular pulses will be sent to the thyristors (instead of
pulses from bypass thyristors).
Set the current or voltage reference to the desired value. After unblocking, the converter will adjust to this given value with a certain delay depending on the limits
imposed by the rate of change limiters. To maintain the current margin, the current
ramp on the rectifier cannot be slower than that of the inverter at start-up.

11.1.21 The tap


changer

The converter transformers (rectifier and inverter) can be equipped with a tap changer.

2-11-483

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
.
Command to change taps

Angle
Inverter

Up

=1

Down = 1

if

Angle > angle max

if

Angle < angle min

Up

Tap changer

Down

Angle = on rectifier or on inverter

Up Area

Down=1

Angle ( or )

max angle

Range
min angle
Down Area

Figure 11 - 13

Up=1

Demand to change taps

The tap changer controller generates the Up or Down order sent to the tap changer of the converter transformer in order to maintain or angle in the range set by:

min < < max

min < < max

on the rectifier

(EQ 9)

on the inverter

(EQ 10)

If the angle is not within the range, an up or down request is generated and sent to the tap
changer in order to bring the angle back within the range (if the tap has not yet reached any
of the limits). The size of the range must be selected to avoid hunting, i.e. oscillation of the
angle between the Up area and the Down area. Usually:
Range = at least 1.5 x maximum variation of angle corresponding to a tap
The default range values (adjustable) are shown in the following table.

Table 1: Typical angles limiting the range

11.1.22 Description of
parameters

2-11-484

Angle

Min Angle

Max Angle

15

18

17

20

The parameter form of HVDC converters are shown in Figures 11 - 14 to 11 - 17

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
11.1.23 References

Id Ref: Current reference (pu);


Id Ref + Slope: Current reference rising rate (pu/s);
Id Ref - Slope: Current reference falling rate (pu/s);
Id Ref min: Current reference lower limit (pu);
Id Ref max: Current reference upper limit (pu);
Vd Ref: Voltage reference (pu);
Vd Ref + Slope: Voltage reference rising rate (pu/s);
Vd Ref - Slope: Voltage reference falling rate (pu/s);
Vd Ref min: Voltage reference lower limit (pu);
Vd Ref max: Voltage reference upper limit (pu).

11.1.24 Converter
parameters

General parameters
Vd Base: Base for direct voltage (kV);
Id Base: Base for direct current (kA);
Vac Base (Ph-Ph): Rated AC voltage on the transformer primary (kV rms);
Synchro Bus: Name of the bus whose voltages are used to synchronize the firing system;
Line Bus (Vd Measure): Name of the bus connecting the converter and the DC line;
the direct voltage measurement is taken on this bus;
Converter transformer
Transfo name: Transformer label;
Leakage: Leakage inductance of converter transformer for star or delta winding on
valve side (henry);
Note : Used to determine the commutation resistance to calculate the and angles. It is
assumed that the leakage on the primary side is null and that no series inductance
is connected between the switching bus and the transformer. Otherwise, the primary leakages and/or series inductance will be brought back on the secondary side and
included in the leakage L.
/ Y (lagging = 0, leading = 1): Indicates the relative phase between secondary
windings of the transformer. If 0, the delta winding lags the wye winding; if 1,
the delta winding leads the wye winding.

11.1.25 Operating
modes

Converter mode (rectifier = 0, inverter = 1): Operating mode of the converter;


Blocking (Disabled = 0, Enabled = 1): If 0, the converter is disabled; if 1 the converter is enabled;
Regulator mode constant IN/OUT(0/1): 1 for constant regulation mode, 0 for
normal mode;

2-11-485

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
constant reference: Value of the delay angle when operating in constant mode
(degrees).
Cathode connection (Neutral = 0, Line = 1): Specifies where the cathode side of the
converter is connected; neutral side or DC line side.
Firing (internal = 0; external = 1)
11.1.26 Controller
parameters

Firing (0 = internal, 1 = external, Simulink=2, Control Block=3): Specifies the source


of firing pulses;
Simulink:
Model name: Name of the Simulink model;
Model directory: Name of the directory in which the Simulink model is stored;
Execution time: Estimated or measured execution time of the Simulink model.
UCC command: Always disable (not yet supported).
As a Rectifier
KI Id: Integral gain of the PI current regulator (degrees/pu/second);
KP Id: Proportional gain of the PI current regulator (degrees/pu/second);
min: Lower limit of the delay angle (degrees);
max: Upper limit of the delay angle (degrees).
1, 2: Limit values for the positive variation of delay angle (degrees)) (See
Figure 11-11);
3, 4: Limit values for the negative variation of delay angle (degrees) (See
Figure 11-11);
As an inverter
KI Id: Integral gain of the PI current regulator (degrees/pu);
KP Id: Proportional gain of the PI current regulator (degrees/pu);
KI Vd: Integral gain of the PI voltage regulator (degrees/pu);
KP Vd: Proportional gain of the PI voltage regulator (degrees/pu);
min: Lower limit for the angle (degrees);
min: Lower limit for the angle (degrees);
Id Margin: Current margin (pu);
Vd Margin: Voltage margin (pu);
1, 2: Limit values for the positive variation of delay angle (degrees) (See
Figure 11-11);
3: Limit value for the negative variation of delay angle (degrees) (See Figure
11-11);
Synchronization system at firing:

2-11-486

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
Synchronization mode (Equidistant, Equiangular): Equidistant for equidistant synchronization mode; Equiangular for equiangular synchronization mode.
Vmin: Minimum voltage value at valve terminal, so that the equidistant synchronization mode can fire the valve (pu).
K osc: Oscillator gain.
Tap changer transformer with decoupling element: Enabled, Disabled.
Transformation ratio, in the event that this last transformer is not used: Ratio,
where 1.0 (pu) represents the rated ratio Ns/Np.
11.1.27 Measurement
filters

First order for Id (1): Time constant of the filter used in the current measurement (seconds);
Second order for Vd (1, 2): Time constants of the filter used in voltage measurement
(Seconds);

11.1.28 Band-pass
filters
(Synchronizati
on)

Freq base: Frequency base (hertz);


Freq min: Lower limit of acceptable frequency (hertz);
Freq max: Upper limit of acceptable frequency (hertz);
Band-pass: Bandwidth of the filter (hertz);

11.1.29 LCDT
<<VDCOL>>
function

Vd min= Vdfmin in Figure 11 - 8;


Id min= Idrefmin in Figure 11 - 8;
Rise time= Tm in Figure 11 - 8;
Vd threshold= Vdf1pu in Figure 11 - 8;
Note : When the user changes the reference, the effective reference varies from the previous value to the requested value following a ramp whose slope is adjustable in both
directions (rise and fall).

11.1.30 Tap changer


control

(see Figure 11 - 13)


min: Lower limit of alpha angle range on rectifier (degrees);
max: Upper limit of alpha angle range on rectifier (degrees);
min: Lower limit of gamma angle range on inverter (degrees);
max: Upper limit of gamma angle range on inverter (degrees).

11.1.31 Protection

DC fault protection (on rectifier)


Detection delay: Detection delay of DC fault (seconds);
Vd threshold: DC voltage threshold used for DC fault detection (pu);

2-11-487

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
delay: Value of the constant angle imposed after a fault is detected (degrees);
delay duration: Time interval during which the value of the forced angle is
imposed by the DC protection system. (seconds);
delay number: Number of times the constant angle is imposed and then removed
before the converter is automatically blocked by the DC fault protection;
Protection against commutation failure (inverter)
ON/OFF Protection (1/0): 1 enables protection, 0 disables protection;
cf: Value added to the lower limit of by the protection for commutation failures
(degrees);
Rise time: First order time constant affecting the increase of minimum (seconds);
Fall time: First order time constant affecting the decrease of minimum (seconds);
11.1.32 Low AC
voltage
detection

Vac threshold: Voltage threshold used for low AC voltage detection (pu)
Detection delay: Detection delay for low AC voltage (seconds);
Fall delay: Minimal duration of flag for low AC voltage condition (Voltage lower than
Vca threshold) before the protection system start acting (seconds).

11.1.33 Disturbances

Faults or Commutation failure (None =0, Valve= 1, DC=2, Misfiring = 3, DCY=4,


DCD=5): Specifies the type of fault.
0 if no disturbance is desired;
1 for valve fault (short circuit);
2 for ground fault on converter terminals;
3 for simulation of commutation failure;
4 for a fault to be applied in the converter connected to the wye secondary of the
transformer
5 for a fault to be applied in the converter connected to the delta secondary of the
transformer
Valve No. for fault or commutation failure (1-12): Number of valve to which the fault
or the commutation failure is applied. Numbers 1 to 12 correspond to the following
valves (see Figure 11 - 5): 1Y, 2Y, 3Y, 4Y, 5Y, 6Y, 1D, 2D, 3D, 4D, 5D, 6D.
DC fault R: Value of fault resistance on converter terminals (ohm) (see Figure 11 - 5).
Reference step (None = 0, Iref =1, Vref=2): Specifies the reference step:
0 if no step is desired;
1 for a step in the current reference;
2for a step in the voltage reference (see Figure 11 - 9).

Iref or Vref: Step size for current or voltage reference (pu);

Start time: Start time of the disturbance (second);


End time: End time of the disturbance (second).

2-11-488

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
11.1.34 Valve
parameters

General parameters
Connection (series = Serial; delta = Delta);
Switch parameters
Switch type (Breaker, Ideal Switch, Thyristor,Diode, GTO+Diode): Specifies the
valve type that makes the converter;
Signal reset (Enable, Disable): Reset the default signal to zero.
Precision valve (Activ=Enable,Dsactiv=Disable)
Specific parameters
Rbov (Reverse break overvoltage): Highest value of reverse voltage across a valve.
Relevant only for diodes, thyristors and GTOs (volts);
Fbov (Forward break overvoltage): Highest value of reverse voltage across a
blocked valve. Relevant only for diodes, thyristors and GTOs (volts);
C_snubber: Snubber capacitance (farads);
R_snubber: Snubber resistance (ohms);
Tq: Turn-off time (seconds);
Ibreak: GTO maximum breakable current (amperes);
Th Roff: Open state resistance (ohms);
Th Ron: Closed state resistance (ohms);
Vf1: Forward voltage drop (volts);
Ihold: Holding current.

1.This parameter is used in the element switching logic. The forward voltage drop is not modeled.

2-11-489

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
11.1.35 Control panel
for HVDC
converters

Figure 11 - 14 The parameter form for HVDC converters (General)

2-11-490

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers

Figure 11 - 15 The parameter form for HVDC converters (Regulation)

2-11-491

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers

Figure 11 - 16 The parameter form for HVDC converters (Protection)

2-11-492

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers

Figure 11 - 17 The parameter form for HVDC converters (Valves)


11.1.36 List of
available
signals

At acquisition, the following signals are made available by the sensors:


VSYNCa,b,c_label: Primary phase voltages used by the firing synchronization system
(volt));
VSYNCba,cb,ac_label: Primary phase-to-phase voltages used by the firing synchronization system (volt);

2-11-493

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
V_LINE_label: DC voltage relative to ground at the DC line input (volt);
V_NEUTRAL_label: DC neutral relative to ground at the DC line input (volt);
IaPrimXfo, IbPrimXfo, IcPrimXfo_label: AC currents in the primary windings of the
transformer (ampere);
Id_label: DC current on bridge (ampere);
IaY, IbY, IcY_label: AC currents in the Y secondary windings of the transformer
(ampere);
V12_xY_label (x = 1, 2, 3, 4, 5, 6): Voltage across valve x of the bridge connected to
the Y windings (volt);
I12_xY_label (x = 1, 2, 3, 4, 5, 6): Current across valve x of the bridge connected to the
Y windings (Amperes);
CMD12INT_xY_label (x = 1,2,3,4,5,6): Firing command from the internal source to
component 1 to 2 of valve x of the bridge connected to the Y windings (logical);
CMD21INT_xY_label (x=1,2,3,4,5,6): Firing command from the internal source to
component 2 to 1 of valve x of the bridge connected to the Y windings (logical);
CMD12EXT_xY_label (x=1,2,3,4,5,6): Firing command from the external source to
component 1 to 2 of valve x of the bridge connected to the Y windings (logical);
CMD21EXT_xY_label (x=1,2,3,4,5,6): Firing command from the external source to
component 2 to 1 of valve x of the bridge connected to the Y windings (logical);
CMDFLT_ label: Flag for a valve fault (logical);
PPattern_label: A number whose binary code specifies that the thyristors are receiving
firing pulses. For example, 5 specifies that firing pulses are sent to thyristors 1 and 3.
Up_Trlabel: Signal sent to the tap changer to increase the tap position (logical);
Down_Trlabel: Signal sent to the tap changer to decrease the tap position (logical);
STATE12_xY_label (x = 1,2,3,4,5,6): State of the 1 to 2 component of valve x of the
bridge connected to the Y windings (logical));
STATE21_xY_label (x = 1,2,3,4,5,6): State of the 2 to 1 component of valve x of the
bridge connected to the Y windings (logical);
FAILSIG_xY_label (x = 1,2,3,4,5,6): Valve alarm signal with the following meanings:
1: Infringement of Tq extinction limit time for Thyristor 12. (Automatically reset to
zero after a time step).
-1: Infringement of Tq extinction limit time for Thyristor 21. (Automatically reset to
zero after a time step).
2: Reverse voltage of Thyristor 12 greater than Rbov. (Reset to zero only if Fail
Reset= Enable.
2: Reverse voltage of Thyristor 21 greater than Rbov. (Reset to zero only if Fail
Reset= Enable.
-3: Direct voltage of Thyristor 12 greater than Rbov. (Reset to zero only if Fail
Reset= Enable.
2-11-494

HVDC and SVC Controllers

Rectifier/Inverter 6/12 Pulse DC


Controllers
DelayImpInt_label: Internal pulse delay.
DelayImpExt_label: External pulse delay.
DelayImp_label: Pulse delay.
DelayImpUsed_label: Pulse delay used.
P_label: Same as Pattern_label, but originating from control module.
D_label: Delay from control module.
IaD, IbD, IcD_label: AC current in the delta secondary windings connected to transformer (ampere);
V12_xD_label (x=1, 2, 3, 4, 5, 6): Voltage in valve x of the bridge connected to the
delta windings (volt);
I12_xD_label (x=1, 2, 3, 4, 5, 6): Current in valve x of the bridge connected to the delta
windings (ampere);
CMD12INT_xD_label (x=1,2,3,4,5,6): Firing command from the internal source to
component 1 to 2 of valve x of the bridge connected to the delta windings (logical).
For the GTO+Diode switch the signal value is -1 when the diode is forced to conduct;
CMD21INT_xD_label (x=1,2,3,4,5,6): Firing command from the internal source to
component 2 to 1 of valve x of the bridge connected to the delta windings (logical);
CMD12EXT_xD_label (x=1,2,3,4,5,6): Firing command from the external source to
component 1 to 2 of valve x of the bridge connected to the delta windings (logical);
CMD21EXT_xD_label (x=1,2,3,4,5,6): Firing command from the external source to
component 2 to 1 of valve x of the bridge connected to the delta windings (logical).
For the GTO+Diode switch the signal value is -1 when the diode is forced to conduct;
STATE12_xD_label (x = 1,2,3,4,5,6): State of the 1 to 2 component of valve x of the
bridge connected to the delta windings (logical);
STATE21_xD_label (x = 1,2,3,4,5,6): State of the 2 to 1 component of valve x of the
bridge connected to the delta windings (logical);
FAILSIG_xD_label (x = 1,2,3,4,5,6):
PeriodY_label: Period of AC voltage measured in the equiangular synchronization
system of the bridge connected to the Y windings (seconds);
PeriodD_label: Period of AC voltage measured in the equiangular synchronization
system of the bridge connected to the delta windings (seconds);
IdRef_label: DC current reference (pu);
VdRref_label: DC voltage reference (pu);
Mu_label: Commutation angle (degrees);
Gamma_label: Extinction angle (degrees);
Alpha_label: Firing delay angle generated by the regulation system (degrees);
Deblocked_label: Unblocking status flag (logical);

2-11-495

HVDC and SVC Controllers


SVC Controller

CmdComFail_label: Command to simulate a switching failure (logical);


CmdInvMode_label: Specifies the rectifier/inverter mode (0 = rectifier; 1 = inverter)
(logical);
ComFail_label: Detection signal for a switching failure on Y or delta bridge (logical);
AlphaRet_label: Signal specifying the forced retard mode (logical).
RatioXfo_label: Normalized transformation ratio (Ns/Np) of converter transformer
(pu);
syn_Vd0_level_label: Mean of the maximum ideal DC voltage (pu) - in the equidistant
synchronization system;
syn_Alpha_Osc_label: Firing delay angle reflecting the oscillator phase (degrees) - in
the equidistant synchronization system;
syn_Alpha_measured_label: Measured firing delay angle (degrees) - in the equidistant
synchronization system;
syn_Delta_alpha_label: Phase variation (positive = lag; negative = lead) of oscillator
(degrees) - in the equidistant synchronization system;
syn_Vac_ZC_number_label: Count for the 12 zero crossings of switching voltages in
the 12 pulse converter [0 to 11] - in the equidistant synchronization system. The 0 count
coincides with the zero crossing of the switching voltage of valve 1 on the Y bridge (D)
when the delta winding is lagging (or ahead) of the Y winding;
syn_Firing_pulse_number_label: Count for the 12 firing of the valves in the 12 pulse
converter [0 to 11] - in the equidistant synchronization system. The 0 count coincides
with the firing pulse of valve 1 on the Y bridge (D) when the delta winding is lagging
(or ahead) of the Y winding;
sys_Frequency_label: Measured frequency of AC voltage (Hz) - in the equidistant type
synchronization system.

11.2 SVC CONTROLLER


A Introduction

This model represents the power component and the control system of a static compensator.
The power component consists of a thyristor controlled reactor (TCR inductive branch) and
three thyristor switched capacitors (TSC capacitive branches). The transformer is not modeled internally and must be added by the user.
The control system includes measuring, synchronization, regulation, distribution and firing
subsystems. Depending on the operation mode, the model allows to study step responses either for a voltage reference or a susceptance reference. This feature can be used to optimize
the regulator parameters.The thyristors can also be fired by signals generated from an external
source.

2-11-496

HVDC and SVC Controllers

SVC Controller

B Static
Compensator
Icon and
Diagram
SV

U
I

Figure 11 - 18 Static Compensator Icon and Diagram.


C Static
Compensator
Model

Figure 11 - 19 shows the static compensator diagram.


2 Power Component The models of the four branches of a static compensator are identical (see Figure 11 - 20). Resistances R and r respectively represent ohmic losses in the capacitor and the reactor. One of these elements can be ignored by assigning a zero value to it in
the control panel. The two resistances, the capacitor and the reactor form a type of black box.
Hence, it is not possible to measure the voltage across one of the resistances or the reactor.
However, the voltage across the capacitor is calculated and available as a signal. This is also
the case for the voltages across the thyristors.

2-11-497

HVDC and SVC Controllers


SVC Controller

Distribution Unit
Measuring Unit
Park

Regulation Unit

Regulator
PI

Vmes

Conversion

BCMT
Bp_tot

Bp_tot
Conversion to
Bs_tot

BICT

BICT
Linearization
Network Frequency

Phase-Lock
Loop

freq
Generation of
Firing Pulses

wt

(PLL)

Synchronization Unit

Firing Unit

CONTROL SYSTEM

Primary

Secondary

I
Network

POWER COMPONENT

Figure 11 - 19 Static Compensator Diagram

2-11-498

BCMT

HVDC and SVC Controllers

SVC Controller

L
R
C

Figure 11 - 20 Static Compensator Branch


D Control System

Synchronization Unit
The synchronization unit consists of a phase-lock loop (PLL) applied to each voltage phase on the transformer primary. The PLL calculates the frequency and phase
angle required to fire the thyristors. Figure 11 - 21 shows a simplified diagram of
this unit. This type of synchronization has the advantage of being insensitive to harmonics and stable in frequency.

Slope
Limitation

1
-

2*PI

Average

Vpu

Value for One


Cycle

Regulator

1
s

PI

Low-Pass
Filter

Modulo

frequency

wt

2*PI

cos

Figure 11 - 21 Phase-Lock Loop (PLL)


Measuring Unit
Voltage measuring must be accurate, fast and insensitive to harmonics. To do this,
the output of the Park conversion block is integrated and the voltage is measured by
subtracting two consecutive samples of the integrator output with a delay of one cycle between them. The voltage measuring unit is shown in Figure 11 - 22.

2-11-499

HVDC and SVC Controllers


SVC Controller

Va

Park

Vb
Vc

Conversion

Frequency

-1
s

Vmeasured

Function

Delay n step

Variable Delay

Figure 11 - 22 Measuring Unit


Control Unit
The control unit consists of a proportional and integral (PI) controller. The latter
compares the voltage measured and voltage reference to achieve:

Umes = Uref + XsI

(EQ 11)

The output of the controller is given by:

K
Bp = Kp + -----i ( Umes Uref XsI )

(EQ 12)

Bp is the required susceptance on the primary side for regulation. The current I is
not measured but calculated using Bp and Umes. The response of the controller depends on the value of the gains. The integral gain determines the speed of the controller, while the proportional gain can be used to compensate for the delay in the
firing system.
Distribution Unit
The distribution unit receives the following input:
The leakage inductance of the transformer;
The signal Bp from the PI;
The states and values of each TSC capacitive and TCR inductive branch;
And the value of the hysteresis to apply at transition points.
From the primary susceptance Bp of the static compensator and the leakage inductance of the transformer, the susceptance Bs on the secondary side is calculated and
then represented as a parallel combination of the TSC capacitive and TCR inductive
branches.

Bs = Bind + Bcap

2-11-500

(EQ 13)

HVDC and SVC Controllers

SVC Controller

The value of the capacitance Bcap produced by the parallel capacitive branches and
the value of Bind is given by the non-linear function:

2 + sin 2Bind = 2
---------------------------------------

(EQ 14)

The calculation of the equivalent impedance of the parallel TSC capacitive branches take into account the availability of the branches. Therefore, it is possible to operate in downgraded or degradation mode.
In order to avoid oscillations when the capacitors are switched, hysteresis is used at
transition points when the number of parallel TSC capacitive branches changes.

Firing Unit
The function of the firing unit is to send the firing orders to the thyristors of the different branches. To do this, it receives the following input:
Phase angle (t) of the synchronization voltage;
Firing angle ;
Firing order of the TSC capacitive branches.
Since the TCR inductive branch is controlled, the firing unit sends the t degree
pulses after the last zero-crossing of the synchronization voltage. Since the TSC capacitive branches are only switched and not controlled, their firing is always executed at the same time on the waveform, that is 90 degrees before the zero-crossing
of the voltage.

11.2.1 Parameters

A General
Parameters

Transformer Parameters
Name of primary XFO Bus: Name of the bus on the high voltage side of the static
compensator transformer;
Primary XFO V: Line-line rated voltage on the primary side of the transformer (kV
rms);
Secondary XFO V: Line-line rated voltage on the secondary side of the transformer
(kV rms).
Leakage: Leakage inductance of the primary winding of the transformer (pu/
100MVA);
vs Y (Lag, Lead): Specifies the connection of the transformer and the Delta windings lagging or preceding the Y winding.

Control System Parameters


Source of control: Where the control system is modelized (Intern = Internal, External, Simulink);
Firing order: (Internal, External);

2-11-501

HVDC and SVC Controllers


SVC Controller

Directory: Directory where the HyperLink model is saved;


Name of HyperLink model;
Execution time: Estimated execution time for the HyperLink model.
Precision valve: Specifies if the user wants to use the precision valve model
11.2.2 Control
System
Parameters

A Reference
Parameters

Vref: Voltage reference (pu) (automatic mode);


Bref: Susceptance reference (pu/100MVA) (manual mode).
CLC Mode: (Automatic, Manual)

B Operating Mode
Parameters

TCC mode: (On = synchronized firing of the TSC capacitive branches, Off = continuous firing);
Valve blocking and unblocking: (Deblock = valve firing enabled, Block = valve firing
disabled);

C Regulation
Parameters

Kp: Proportional gain;


Ki: Integral gain;
Pente: Slope of voltage controller (pu/100MVA);
Hysteresis: (pu/100MVA).

D Protection
Strategies

Vmax: Maximum value of primary voltage (pu). Above this value, the static compensator is disabled;
Vmin_on: Minimum value of primary voltage (pu). Below this value, the static compensator is disabled;
Vmin_off: Minimum value of primary voltage (pu) required to enable the static compensator.

E AC Fault
Parameters

Vac_min: Primary voltage threshold (pu) below which a fault is detected;


Delay AC fault (s);
Minimum duration - AC fault (s);
Delay under voltage: falling edge delay during a specified time interval is applied (s).

F Disturbance
Parameters

Disturbance type: Vref or Bref;


Delta_Vref: Value of step in the voltage reference (pu);
Delta_Bref: Value of step in the value of the susceptance reference (pu/100MVA);
Start time: Time when the disturbance is applied (s);
End time: Time when the disturbance is removed (s).

2-11-502

HVDC and SVC Controllers

SVC Controller

G Adaptive BandPass Parameters

Base frequency (Hz);


Minimum frequency (Hz);
Maximum frequency (Hz);
Bandwidth (Hz).

H Power
Component
Parameters

The parameters of the elements in the compensator power component are the same for all four
branches.
General Parameters
Connections: Y ground; Y floating; Delta.
RLC Element Parameters
Branch reactor (H);
Resistance in parallel with branch reactor ();
Branch resistance ();
Branch capacitor (F).
Back-to-back Valve Parameters
Valve resistance when open ();
Valve resistance when closed ();
Threshold voltage (V);
Chopping current (A);
Snubber resistance ();
Snubber capacitor (F);
Reverse break overvoltage (V);
Forward break overvoltage (V).

11.2.3 List of
Available
Signals

At acquisition, the following signals are made available by the sensors:


CMD12phase_TCR1_label: Firing pulse of the positive valve in the TCR inductive
branch;
CMD21phase_TCR1_label: Firing pulse of the negative valve in the TCR inductive
branch;
Iphase_TCR1_label: Current across the TCR inductive branch;
STATE12phase_TCR1_label: State of the positive valve in the TCR inductive branch;
STATE21phase_TCR1_label: State of the negative valve in the TCR inductive branch;
VphaseTh_TCR1_label: Voltage across the valves in the TCR inductive branch;
VCAPphase_TCR1_label: Voltage across the capacitor in the TCR inductive branch;
FAILSIGphase_TCR1_label:;

2-11-503

HVDC and SVC Controllers


SVC Controller

CMD12phase_TSC1_label: Firing pulse of the positive valve in TSC capacitive


branch no 1;
CMD21phase_TSC1_label: Firing pulse of the negative valve in TSC capacitive
branch no 1;
Iphase_TSC1_label: Current across TSC capacitive branch no 1;
STATE12phase_TSC1_label: State of the positive valve in TSC capacitive branch no
1;
STATE21phase_TSC1_label: State of the negative valve in TSC capacitive branch no
1;
VphaseTh_TSC1_label: Voltage across the valves in TSC capacitive branch no 1;
VCAPphase_TSC1_label: Voltage across the capacitor in TSC capacitive branch no 1;
FAILSIGphase_TSC1_label:
CMD12phase_TSC2_label: Firing pulse of the positive valve in TSC capacitive branch
no 2;
CMD21phase_TSC2_label: Firing pulse of the negative valve in TSC capacitive
branch no 2;
Iphase_TSC2_label: Current across TSC capacitive branch no 2;
STATE12phase_TSC2_label: State of positive valve in TSC capacitive branch no 2;
STATE21phase_TSC2_label: State of negative valve in TSC capacitive branch no 2;
VphaseTh_TSC2_label: Voltage across the valves in TSC capacitive branch no 2;
VCAPphase_TSC2_label: Voltage across the capacitor in TSC capacitive branch no 2;
FAILSIGphase_TSC3_label:
CMD12phase_TSC3_label: Firing pulse of the positive valve in TSC capacitive branch
no 3;
CMD21phase_TSC3_label: Firing pulse of the negative valve in TSC capacitive
branch no 3;
Iphase_TSC3_label: Current across TSC capacitive branch no 3;
STATE12phase_TSC3_label: State of positive valve in TSC capacitive branch no 3;
STATE21phase_TSC3_label: State of negative valve in TSC capacitive branch no 3;
VphaseTh_TSC3_label: Voltage across the valves in TSC capacitive branch no 3;
VCAPphase_TSC3_label: Voltage across the capacitor in TSC capacitive branch no 3;
FAILSIGphase_TSC3_label:
pulsePat_int_label: Signal containing the binary code representing the firing orders of
the valves
VSYNCphase_label: Voltage signal used by synchronization unit;

2-11-504

HVDC and SVC Controllers

SVC Controller

DelayImpInt_ label: Firing delay (as a fraction of calculation step) calculated by the
internal command of the static compensator
DelayImpExt_ label: Firing delay (as a fraction of calculation step) calculated by an
external command of the static compensator
DelayImp_ label: Firing delay (as a fraction of calculation step) sent to the static compensator
DelayImpUsed_ label: Firing delay (as a fraction of calculation step) used by the static
compensator
V_Ref_label: Voltage reference for the controller;
B_Ref_label: Susceptance reference for the controller;
Slope_label: Slope of the controller;
Deblocked_label: Signal specifying that the firing pulses are blocked or not.
TCC_Mode_label: Signal specifying that the TCC mode is enabled or disabled
ManualMode_label: Signal specifying that the manual mode is enabled or disabled
Period_label: Period of the network (inverse of the frequency)
Frequency_label: Network frequency
Alpha_TCR1_label: Firing angle of the TCR inductive branch
wtphase_label: Phase angle of synchronization voltages
V_Prim_label: Voltage measured by the system
V_Error_label: Input of PI regulator of regulation unit
B_SVC_label: Susceptance seen from primary side of transformer
B_TSC_label: Capacitive susceptance required
B_TCR_label: Inductive susceptance required
A Static
Compensator
Control Panel

Figures 11 - 23 to 11 - 25 show respectively the first, second and third pages of the static compensator control panel.

2-11-505

HVDC and SVC Controllers


SVC Controller

Figure 11 - 23 Static Compensator Control Panel (General)

2-11-506

HVDC and SVC Controllers

SVC Controller

Figure 11 - 24 Static Compensator Control Panel (TCR)

2-11-507

HVDC and SVC Controllers


SVC Controller

Figure 11 - 25 Static Compensator Control Panel (TSC1)

Example:
Figure 11 - 26 shows the network used in this example. The test
consists in applying a rising ramp from 0.75 to 1.25 pu to the source

2-11-508

HVDC and SVC Controllers

SVC Controller

voltage. Then a positive sequence reading is taken of the voltage on


the transformer primary and of the current in the Rprim resistance
to draw the U-I dynamic curve of the system. The variation of the
source voltage is done as a ramp over 10 seconds.
The following parameters are used:
Static Compensator: Fault parameters, automatic mode at Vref = 1.0 pu
Network at 735 kV, short-circuit power of 6000 MVA, quality factor of 10
Transformer YD 735/16 kV, 333 MVA, leakage of 15%
Load on primary = 200 MW
Load on secondary = 500 kW

Figure 11 - 26 Test Network for the Static Compensator

2-11-509

HVDC and SVC Controllers

Static Compensator Branches: TCR


and TSC

1,2
1,15
1,1

Voltage (pu)

1,05
1
0,95
0,9
0,85
0,8
0,75
-6

-5

-4

-3

-2

-1

Current (pu/100 MVA)

U-I Dynamic Curve of the Static Compensator


Figure 11 - 27 U-I Dynamic Curve of the Static Compensator

11.3 STATIC COMPENSATOR BRANCHES: TCR AND TSC


As seen in the introduction to this chapter, the static compensator model consists of a control
system and a power component. The latter has 4 three-phase branches, each with the same
configuration as shown in Figure 11 - 20. The model presents a configuration with one TCR
inductive branch and three TSC capacitive branches. However, the user may want to build his
own static compensator model with a different configuration. He can then use the static compensator branch model with an external control which he can program himself. Both types of
branches are available to the user: the TCR inductive branch (TCR or thyristor-controlled reactor) and the TSC capacitive branch (TSC or thyristor-switched capacitor). Essentially, both
of these models are identical, the TCR branch being a specific case of the TSC branch.
These models are built-in and do not add nodes (or increase the Z matrix).

2-11-510

HVDC and SVC Controllers

Static Compensator Branches: TCR


and TSC
A Icons and
Diagrams of TCR
and TSC Static
Compensators

Figure 11 - 28 TCR Inductive Branch Icon and Diagram

Figure 11 - 29 TSC Capacitive Branch Icon and Diagram


B Parameters
C List of Available
SIgnals

The parameters for both types of static compensator are identical to those shown in section
11.2.1.
CMD12phase_label: Firing pulse in the positive valve;
CMD21phase_label: Firing pulse in the negative valve;
Iphase_label: Current across the branch;
STATE12phase_label: State of the positive valve;
STATE21phase_label: State of the negative valve;
VCAPphase_label: Voltage across the capacitor (volt);
DelayImpInt_ label: Firing delay (as a fraction of calculation step) calculated by the
internal command (not used)
DelayImpExt_ label: Firing delay (as a fraction of calculation step) calculated by an
external command

2-11-511

HVDC and SVC Controllers

Static Compensator Branches: TCR


and TSC
DelayImp_ label: Firing delay (as a fraction of calculation step) sent to the valves
DelayImpUsed_ label: Firing delay (as a fraction of calculation step) used
The signals are the same for both types of branches. Of course, the voltage across the capacitor of the TCR inductive branch will always be null.
D Control Panels
of TCR and TSC
Static
Compensators

2-11-512

Figures 11 - 30 and 11 - 31 show respectively the TCR inductive branch and TSC capacitive
branch control panels.

HVDC and SVC Controllers

Static Compensator Branches: TCR


and TSC

Figure 11 - 30 TCR Inductive Branch Control Panel

2-11-513

HVDC and SVC Controllers

Static Compensator Branches: TCR


and TSC

Figure 11 - 31 TSC Capacitive Branch Control Panel

Example:

2-11-514

HVDC and SVC Controllers

Static Compensator Branches: TCR


and TSC
This example shows the use of a static compensator branch and is very similar to the static
compensator model described previously. The network in Figure 11 - 32 is identical to that
in Figure 11 - 26, the only difference being in the static compensator. In this case, the power
component is simulated with static compensator branches and the control system with a HyperLink block. The static compensator being simulated consists of two TSC capacitive
branches and one TCR inductive branch. The powers of the branches are identical to those of
the static compensator in the preceding example.
The same test is made, a voltage ramp of 0.75 to 1.25 pu over 10 seconds. The results of the
test are shown in Figure 11 - 33.

Figure 11 - 32 Test Network for the Static Compensator

2-11-515

HVDC and SVC Controllers

Static Compensator Branches: TCR


and TSC

1,2
1,15

Voltage (pu)

1,1
1,05
1
0,95
0,9
0,85
0,8
0,75
-4

-3

-2

-1

Current (pu/100 MVA)

U-I Dynamic Curve of the Static Compensator


Figure 11 - 33 U-I Dynamic Curve of the Static Compensator

2-11-516

HVDC and SVC Controllers

Static Compensator Branches: TCR


and TSC

2-11-517

HVDC and SVC Controllers

Static Compensator Branches: TCR


and TSC

2-11-518


Chapter 12
VARIOUS NETWORK ELEMENTS

12.1 FREQUENCY MEASURE ELEMENT

Frequency Measure

Frequency Measure

Properties:
Determines the fundamental frequency of a bus voltage signal.

Hz

Features:
Can be used with any bus in the
network using a basic frequency.
Implementation:

Figure 12 - 1 Icon and Diagram Frequency Measure


A General
Parameters

Basic Frequency: Normal fundamental frequency of the network used as the main frequency
of the bandpass filter (Hz)

B Bandpass Filter
Parameters

Bandwidth: Width of bandpass filter (Hz)

C List of Available
Signals

At acquisition, the following signals are made available by the sensors:


Frq_label: Fundamental frequency (Hz)
Priode_label: Fundamental period (s)
Vaf label: Filtered bus voltage for phase A (V)
Vbf label: Filtered bus voltage for phase B (V)
Vcf_label: Filtered bus voltage for phase C (V)

2-12-519

Various Network Elements


Frequency Measure Element

D Frequency
Measure Control
Panel

The following figure shows an example of the parameters used for a 60 Hertz test.

Figure 12 - 2 Frequency Measure Control Panel


E Frequency
Measure Model

The block diagram of the frequency measure element is shown in the next figure. The bus
voltages are read and filtered, then the time between two zero crossings of these voltages is
calculated. When a voltage rise is detected, a counter is reset and increments until the next
rise. The mean of three calculated periods is then determined and inverted to obtain the frequency. The variables used in the block diagram are defined as follows:
Va, Vb, Vc: Bus voltages;
Vaf, Vbf, Vcf: Filtered voltages;
FB: Basic frequency;
LB: Filter bandwidth;
Num: Parameters for the numerator polynomial of the filter;
Den: Parameters for the denominator polynomial of the filter;
Ra, Rb, Rc: Signals to reset the counters used to calculate the period;
Pa, Pb, Pc: Calculated periods for three phases;
f: Fundamental frequency.

2-12-520

Various Network Elements

Digital Output Element

LB

FB

Calculation
of transfer
function
Num

Den

Va
Vb
Vc

Bandpass
Filter

Vaf
Vbf
Vcf

Figure 12 - 3

Zero
Crossing
Detection

Ra
Rb
Rc

Pa

Calculation
Pb
of
periods
Pc

Inverse
of
mean

Block Diagram of Frequency Measure1

12.2 DIGITAL OUTPUT ELEMENT

Digital Output

Digital Output

DO

Properties:
Tool to time-program digital sequences.

DO

Features:
In all, four elements can be
programmed.
The user can choose
between seconds, milliseconds or cycles
Implementation:

Figure 12 - 4 Icon and Diagram Digital Output


A Time Units

The user can choose between seconds, milliseconds or cycles.

2-12-521

Various Network Elements


Digital Output Element

B Operated Phase

Specifies which breakers of phase A, B and C and the ground breaker can change state if the
data acquisition is done with the switching activated in Spectrum. In order for a change of
state to occur, the operating times (see below) must be T1<T2.

C T1 Operating
Time

Relative time (related to synchronization) when the state of a phase or ground breaker changes.

D T2 Operating
Time

Relative time (related to synchronization) when the state of a phase or ground breaker returns
to a steady state position.

E List of Signals
Available

At acquisition, the following signals are made available by the sensors:


CMD01,02,03,04_label: Digital output commands.

F Digital Output
Control Panel

Figure 12 - 5 Digital Output Control Panel

2-12-522

Various Network Elements


Digital Input Element

12.3 DIGITAL INPUT ELEMENT

Digital Input

Digital Input

ACQ
D/ D

Properties:
Digital input element acquires external digital signals from the input/output cards

ACQ

Features:
48 digital signals can be
acquired;
Digital input element is
connected to a network
bus.
Implementation:

Figure 12 - 6 Icon and Diagram Digital Input

2-12-523

Various Network Elements


Analog Input Element

12.4 ANALOG INPUT ELEMENT

Analog Input

Analog Input

ACQ
A/ D

ACQ

Properties:
Analog input element acquires analog signals from the input/output
cards.

Features:
32 analog signals can be
acquired;
Analog input element is
connected to a network
bus.
Implementation:

Figure 12 - 7 Icon and Diagram Analog Input

12.5 CURRENT AND VOLTAGE MEASURE ELEMENTS


A Introduction

The current and voltage measure elements are used to measure the current and voltage of network buses and to connect voltage or current output to Hypersim control blocks. The following table shows the different elements and parameters.

Parameters
Description

Measures
three-phase
voltages

Palette

Element

Input

B1
B2

V3

V
Measures
three-phase
currents

a
b
c
B1

I3

a
b
c
B2

2-12-524

Outpu
t

Nam
e

l.init.v
a

a
b
c

Ga
Gb
Gc

1.0
1.0
1.0

a
b
c

Ga
Gb
Gc
Rpro
be

1.0
1.0
1.0
1.0e-3

Function and
conditions
Measures voltages Va, Vb, Vc of
bus B
a = Va * Ga
b = Vb * Gb
c = Vc * Gc
Measures currents Ia, Ib, Ic
flowing from B1to B2 by
inserting a resistance R
a = Ia * Ga
b = Ib * Gb
c = Ic * Gc

Various Network Elements

Disconnection Element

Measures
single-phase
voltages

B
V
V

Measures
single-phase
currents

1.0

B1
B2

G
Rpro
be

1.0
1.0e-3

Measures voltage V of bus B


y=V*G

B1
I

Measures current I flowing from


B1to B2 by inserting a resistance
R
y=I*G

B2

12.6 DISCONNECTION ELEMENT

Disconnector Element

Disconnect Element

Properties:
Disconnector opens or closes a
connection in the network
between two elements.

Features:
Disconnection possible in
Edition or in Simulation
Mode.
Note : To disconnect an element in simulation
mode, select a breaker
element.
Implementation:

Figure 12 - 8 Icon and Diagram Disconnection Element


A R Resistance

Resistance value of the disconnection when closed.

2-12-525

Various Network Elements


Disconnection Element

B Disconnection
Control Panel

Figure 12 - 9 Disconnection Control Panel


C List of Available
Signals

2-12-526

At acquisition, the following signals are made available by the sensors:


Ia,b,c_label: Disconnector current.


Chapter 13
HYPERSIM WAVE FORM PLAYBACK MODEL

A Introduction

The wave form playback model is a user-friendly interface compatible with Hypersim Version 9.0. The playback model is a block used to play wave forms in order to validate the control and protection equipment of power grids. It allows to play back, on analog or digital
channels, arbitrary wave forms originating from files in COMTRADE format.
The COMTRADE (Common Format for Transient Data Exchange) format is a IEEE standard
used to facilitate the exchange of digital data from transient phenomena such as power grid
faults, test cases or simulation cases. As this format is widespread, the wave forms can originate from different sources, such as:
a recorder (protection relay, measuring device);
a digital or analog network simulator;
a signal processing software (e.g. SCOPEVIEW, SPECTRUM);
any other device or software exporting digital signals in COMTRADE format.

B Main Features

Here is an overview of the system features:


it consists of 32 D/A output channels, 12 bits 10V;
it consists of 32 logical output channels, 0-5V;
the output range is 1 Hz to 20 kHz;
it allows to play back arbitrary wave forms from COMTRADE files in binary or ASCII
format in compliance with the IEEE C37.111-1991 or C37.111-1997 standard;
it allows to change the gain of analog signals;
it allows to select output signals;

C Main
Components

In order to provide an overview of the playback system, this section briefly describes the main
components of the system.
The distinct modules of the playback system are:
the user interface of the playback model in Hypersim;
the CNTR test automation software (option);
the playback hardware (Alphi PCI card, 32D/A - 48 DIO).
The following diagram shows the function of the different modules and their relationships.

2-13-527

Hypersim Wave Form Playback


Model

HYPERSIM PLAYBACK

SCOPEVIEW

MODEL

Setup of simulation block parameters

COMTRADE file display


Interpolation, Reject,
etc.of wave forms
RPC
REAL-TIME
SIMULATION

TEST VIEW
(CGDEV)

Automated tests management


Equipment controller programming
Automated tests setup

Resampling of wave forms


Steady-state cycle detections
Internal or external synchronization

PCI

PLAYBACK
ALPHI 32D/A 32 DO

Analog or digital wave forms generation


Visual displaying on oscilloscope

Figure 13 - 1 General Diagram


D Control
Parameters

The parameters of the PLAYBACK model allow to change the behavior of the software when
wave forms are played. More specifically, these parameters are used to (see Figure 13 - 4):
enter the name of the directory and of the COMTRADE file. Activate Load File; the
signal in the file will be loaded in the analog/digital output page.
select the operating mode (transient or steady-state);
add a number of steady-state cycles at the beginning and end of signals;
if needed, enable the start/stop button for emergencies;
select the type of synchronization required: internal with the current Hypersim POW or
external with an analog signal or a logic command signal (rising front);
select a reference signal to measure the first steady-state cycle or to set the frequency of
the signal.

E Operating Modes

The software can play back wave forms in two modes: transient or steady-state.
In transient mode, the signals are played back entirely.
In steady-state mode, the software automatically detects a permanent cycle at the beginning
of each analog signal and plays back this cycle indefinitely. For digital output, the software
takes the first point as reference and plays back this point indefinitely.
When using the steady-state mode, make sure the signals have at least two steady-state cycles
at is beginning.

2-13-528

Hypersim Wave Form Playback


Model

The Prefault and Postfault fields allow to specify the number of steady-state cycles to add at
the beginning (Prefault) (before the fault or the transient phenomenon) and the end of the
wave forms (Postfault).
F Reference
Frequency for
Steady-State
Mode

A parameter allows to select from a list of analog signals the reference signal used to measure
the first steady-state cycle or to set the frequency.

G Signal Output
Rate

The output rate of signals to play back is based on the execution step of the Hypersim simulation (TimeStep parameters). Hence, if the TimeStep is different from the wave form rate, a
resampling of the original wave forms will take place.

There is no steady-state detection for digital output.

The software interpolates or decimalizes the original signal. In both cases, a message warns
the user.
According to his needs, the user can launch ScopeView to execute a resampling of his
COMTRADE file in order to play back the file using the same rate as with Hypersim.
H Updating
Parameter
Changes

The Apply button allows to apply the changes made.


The Cancel button allows to cancel the changes made and to close the parameter editing window.
The Close button allows to apply the changes made and to close the parameter editing window.

I Playback
Synchronization

A parameter in the control panel allows to select the synchronization mode for the transient
mode. The internal synchronization mode operates with the POW and the external synchronization mode with the T input signal.
In the internal playback mode and in the steady state, there is no playback synchronization
in the steady-state mode.
But, if the internal mode is selected, the acquisition with ScopeView will launch an internal
signal sent to the playback block and the transient mode is then executed using the prefault
and the postfault values using also the prefault and the postfault cycle values.
For the external mode, if the input of the T signal changes from 0 to 1 (rising wavefront), the
transient mode is then launched immediately.

J Hypersim
Graphic
Interface

Here is an example of a playback in Hypersim.

2-13-529

Hypersim Wave Form Playback


Model

Figure 13 - 2 Playback Icopn and Diagram

Figure 13 - 3 Example of Hypersim Diagram


The selected signal connected to the input of the voltage source is send to the mono phase and
the sync out of the POW base on this signal will generate the trigger input for the synchronization of the transient playback.

2-13-530

Hypersim Wave Form Playback


Model

Figure 13 - 4 General Playback Parameters

2-13-531

Hypersim Wave Form Playback


Model

Figure 13 - 5 Parameters for Analog Signals

2-13-532

Hypersim Wave Form Playback


Model

Figure 13 - 6 Parameters for Logical Signals

2-13-533

Hypersim Wave Form Playback


Model

PAGE LEFT INTENTIONALLY BLANK

2-13-534

Part 3
Hypersim control blocks

2-535

PAGE LEFT INTENTIONALLY BLANK

2--536


Chapter 1
CONTROL BLOCK LIST

The Hypersim simulator interface offers a library of models to design control systems. This
function is available directly through the schematic editor 1. To access the HYPERSIM control blocks and the network models, click on the tool palette. (See Figure 1 - 1).The control
blocks are defined in five categories.

Figure 1 - 1 Graphic Tool Palette

1.See Chapter 1 for detailed instructions on graphic interface

3-1-537

Control Block List

Figure 1 - 2 Math Functions

3-1-538

Control Block List

Table 1:
1 - 2 Math Functions
2 input adder with gain

Transfer function with dynamic limits

3 input adder with gain

S Transfer function with internal limits

4 input adder with gain

S Transfer function with internal limits


reset and initial condition

Multiplier

Window averaging

Division
Gain
Absolute value
Sine
Cosine
Tangent
ArcSin
ArcCos
ArcTan
Common exponents
Natural exponents
Common logarithm
Natural logarithm
Maths functions
F Mod
Square root
S Transfer function
Z Transfer function

3-1-539

Control Block List

Figure 1 - 3 Logic Functions

3-1-540

Control Block List

Table 2:
1 - 3 Logic Functions
Two input AND gate
Two input NAND gate
Two input OR gate
Two input NOR
Exclusive OR gate
Exclusive NOR gate
Inverter NOT gate
Dual signal comparator
Timer on level detector
Single level comparator
Counter
Delay on ON
Rising slope detector
Falling slope detector
Region detectors
12 input multiplexer
6 input multiplexer

3-1-541

Control Block List

Figure 1 - 4 Non-linear Functions

3-1-542

Control Block List

Table 3 :
1 - 4 Non-linear Functions
Fix limiter
Two input maximum
Three input maximum
Four input maximum
Two input minimum
Three input minimum
Four input minimum
Delay
Non-linear gain
AM-FM-PM modulator
Falling ramp
Rising ramp
Variation rate limiter
Two input multiplexer
Dead Zone
Buffer with hysteresis
One step delay
PWM modulator
Sampler

3-1-543

Control Block List

Figure 1 - 5 Source Functions

3-1-544

Control Block List

Table 4:
1 - 5 Sources
Fix point constant
Floating point constant
Random wave generator
Pulse train generator
Square wave generator
Triangular wage generator
Sinus generator (amplitude)
Sinus generator (phase)
Simulation time

3-1-545

Control Block List

Figure 1 - 6 Miscellaneous Functions

3-1-546

Control Block List

Tableau 5 :
1 - 6 Miscellaneous Functions
Parks Transformation
Inverse Parks Transformation
Conversion of floating point into fixed point
Conversion of fixed point into floating point
Initial value and its duration
Create a block with desired number of I/O connectors
Transceiver
Transceiver
Frequency measurement of 3-phase signals
Playback

3-1-547

Control Block List

PAGE LEFT INTENTIONALLY BLANK

3-1-548

Function Details


Chapter 2
FUNCTION DETAILS
The following tables give details for each available control block.
Table A: 21 Math functions
Paramtres
Description

Palette

Element

Two input
summation
with gain

u1
u2

Three input
summation
with gain

u1
u2
u3

Four input
summation
with gain

u1
u2
u3

u1
u2

u1
u2
u3

u1
u2
u3
u4

u4

u1

Multiplier.

Divisor.

Input

u2

u1 u1

.
.

Gain.

Gain

Absolute
value

Abs

Sin.

Sin

Cos.

Cos

u2 u2

Gain

Abs

Sin

Cos

Output

Functionality and
conditions

Name

Initial
value

g1
g2

1.0
1.0

g1
g2
g3

1.0
1.0
1.0

y = g1*u1 +g2*u2 + g3*u3

g1
g2
g3
g4

1.0
1.0
1.0
1.0

y = g1*u1 +g2*u2 + g3*u3


+ g4 * u4

y = g1*u1 + g2*u2

u1
u2

y = u1 * u2

u1
u2

y = u1 / u2

y = u if u >= 0
y = -u if u < 0

y = sin (u)
u is in degrees

y = cos(u)
u is in degrees

1.0

y=u*g

3-2-549

Function Details

Table A: 21 Math functions


Paramtres
Description

Palette

Element

Input

Output
Name

Tan.

Tan

Tan

ArcSin.

ArcSin

ArcCos.

ArcCos

u ArcCos y

ArcTan.

ArcTan

eu

eu

exp 10

u
10

u
10

log
(decimal
logarithm)

log

log

ln
(natural
logarithm)

ln

u1

ln

exp natural

ArcSin y

ArcTan y

Functionality and
conditions

Initial
value

y = tan(u)
u is in degrees

y = Arc sin(u)
y is in degrees

y = Arc cos(u)
y is in degrees

y = Arc tan(u)
y is in degrees

y = eu

y = 10u

y = log(u)

y = ln(u)

Math function :
Math

Math

Type

0
If Type = 0
function ceil, y = ceil(u)

Math function

If Type = 1
function floor, y = floor(u)

Modulus

3-2-550

Mod

u1
u2

Mod

u1
u2

u1 / u2 Modulus.
y = Mod (u1, u2)

Function Details

Table A: 21 Math functions


Paramtres
Description

Palette

Element

Input

Output
Name

Square root

H(s)

u H(s) y

S transfer
function

Functionality and
conditions

Initial
value

y =
n
m
a
b

0
1
1
1, 1

Y(s) = H(s).U(s)
H(s)=[a0 + a1.s +..an.sn]/
[b0 + b1.s + .....bm.sm]
a is an n dimension vector, b is an m
dimension vector.
Conditions :
n >= 0
m >= 0

H(z)

u H(z) y

Z transfer
function

n
m
a
b

0
1
1
1, 1

Y(z) = H(z).U(z)
H(z)=[a0 + a1.z +..an.zn]/
[b0 + b1.z + .....bm.zm]
a is an n dimension vector, b is an m
dimension vector..
Conditions :
n >= 0
m >= 0

hi

Transfer
function with
dynamic
limits

H(s)

lo

H(s)

u
lo
hi

n
m
a
b

0
1
1
1, 1

Y(s) = H(s).U(s)
H(s)=[a0 + a1.s + .. +an.sn]/
[b0 + b1.s + .....bm.sm]
a is an n dimension vector, b is an m
dimension vector..
y is limited between lo et hi
Conditions :
n >= 0
m >= 0

lim2

H(s)
S transfer
function with
internal limits.

H(s) y
lim1

n
m
a
b
lim1
lim2

0
1
1
1, 1
-1
+1

Y(s) = H(s).U(s)
H(s)=[a0 + a1.s + .. +an.sn]/
[b0 + b1.s + .....bm.sm]
a is an n dimension vector, b is an m
dimension vector..
y is limited between lim1 et lim2
Conditions :
n >= 0
m >= 0
lim1 < lim2

3-2-551

Function Details

Table A: 21 Math functions


Paramtres
Description

Palette

Element

H(s)

reset
init

Input

u
reset
init

lim2

H(s)

state

Output

y
state

lim1

Name

Initial
value

n
m
a
b
lim1
lim2

0
1
1
1, 1
-1
+1

Functionality and
conditions

Y(s) = H(s).U(s)
H(s)=[a0 + a1.s + .. +an.sn]/
[b0 + b1.s + .....bm.sm]
a is an n dimension vector, b is an m
dimension vector..
y is limited between lim1 et lim2
Conditions :
n >= 0
m >= 0
lim1 < lim2

S transfer
function with
internal limits
and reset

Microprocessor reset type:


Rising edge, falling edge or none
Output state :
If lim 2 is reached, state = 1,
no limit used = 0
and if lim 1 is reached, state = -1
The init signal allows to specify the
integrator initial conditions.
Average on
windows

t
t-T

u
f

t-T

u
f

fBase
nCycle

60
1

fBase is the u signal and the nCycle


frequency, number of windows
average.
t

y =

(t T)
Conditions :
fBase > 0
nCycle > 1

3-2-552

T = nCycle /
fBase
t = actual time

Function Details

Table B: 22 Logic functions


Description

Palette

Element

Two input
AND gate

u1

u2

Input

Output

u1
u2

u1
u2

u1
u2

u1
u2

u1
u2

u1
u2

u1
u2

yH
yL

Parameter

Functionality and
conditions
AND logic block
y = u1.u2

NAND logic block


Two input
NAND gate

u1

u2

Two input OR
gate

u1

u2

y = u1.u2
OR logic block
y = u1+ u2

NOR logic block


u1

Two input
NOR gate

u2

Exclusive OR
gate

u1

u2

y = u1 + u2

Exclusive OR logic block


y = u1 u2

Exclusive NOR logic block


u1

Exclusive
NOR gate

Inverter

Dual signal
comparator

u1? u2

u1
u2

u1? u2

yH
yL

y = u1 u2

Inverter logic block


y=u

yH = 1 if u1 >= u2
= 0 if not
yL = 1 if u1 < u2
= 0 if not

a
Timer on level
detector

u2

u
on
off

u
on
off

Ts
Td
a

0.01
0.02
0.0

if u becomes < a,
y = on after Ts for the Td duration.
if u becomes > a,
y = off , if not it stays on .
Conditions :
Ts > 0
Td > 0

3-2-553

Function Details

Table B: 22 Logic functions


Description

Single level
comparator

Palette

Element

u? A

u? A

Output

cnt
reset

cnt
n1...n2 y
reset

n1....n2

Input

Functionality and
conditions

Parameter
A
yH
yL

0
1
-1

n1
n2
start
circ

0
5
0
1

Counter

If u A
If u < A

y = yH
y=yL.

Counter from n1 to n2.


Increasing if cnt goes from 0 to 1
Decreasing if cnt goes from
0 to -1.
start: reset and start value.
circ: 1 if circular counter
0 if not
Conditions :
n1 < n2
n1 <= start <= n2
circ = 0 or 1

Td
Ton

0.0
0.01

1
0
1

u
y

Td

Ton

Delay on ON

y goes from 0 to 1 after the Td s


delay and stays to 1 for the Ton s
duration.

Conditions
Td >= 0
Ton > 0

Rising slope
detector

1e-3

When u goes from 0 to 1,


y goes from 0 to 1 and stays at 1
for T seconds
Conditions :
T>0

Falling slope
detector

1e-3

When u goes from 1 to 0,


y goes from 0 to 1 and stays at 1
for T seconds
Conditions :
T>0

Region
detectors

3-2-554

?
?

?
?

uL
uH
yL
yM
yH

-1
1
-1
0
1

If u < uL,
y = yL
If uL u uH , y = yM
If u > uH,
y = yH
Conditions :
uL < uH

Function Details

Table B: 22 Logic functions


Description

Palette

M12

12 input
multiplexer

M6

6 input
multiplexer

Element

P1
P2
P3
P4
P5
P6 MUX P
P7
P8
P9
P10
P11
P12

P1
P2
P3 MUX
P
P4
P5
P6

Parameter

Functionality and
conditions

Input

Output

P1
P2
P3
P4
P5
P5
P6
P7
P8
P9
P10
P11
P12

The P output equals the P1 to P12


binary input sum.

P1
P2
P3
P4
P5
P5
P6

The P output equals the P1 to P6


binary input sum.

3-2-555

Function Details

Table C: 23 Non-linear functions


Parameters
Description

Palette

Element

Input

lim2
y

Output

lim1

Fix limiter

Name

Initial
value

lim1
lim2

-1
+1

Functionality and
conditions

if u < lim1, y = lim1


if lim1 u lim2 , y = u
if u > lim2, y = lim2
Conditions :
lim1 < lim2

Two input
maximum

MAX

u2

Three input
maximum

MAX

Four input
maximum

MAX

Two input
minimum

MIN

Three input
minimum

MIN

Four input
minimum

MIN

3-2-556

u1
MAX

u1
u2 MAX
u3

u1
u2 MAX
u3
u4

u1
u2

MIN

u1
u2 MIN
u3

u1
u2
u3 MIN
u4

u1
u2

Maximum of u1 and u2.


y = Max (u1, u2)

u1
u2
u3

Maximum of u1, u2 and u3.


y = Max (u1, u2, u3)

u1
u2
u3
u4

Maximum of u1, u2, u3 and u4.


y = Max (u1, u2, u3, u4)

u1
u2

Minimum of u1 and u2.


y = Min (u1, u2)

u1
u2
u3

Minimum of u1, u2 and u3


y = Min (u1, u2, u3)

u1
u2
u3
u4

Minimum of u1, u2, u3 and u4.


y = Min (u1, u2, u3, u4)

Function Details

Table C: 23 Non-linear functions


Parameters
Description

Palette

Element

Input

Output

Delay

Name

Initial
value

Skip
T
Tmax
init

1
1e-3
0.1
0.0

Functionality and
conditions

y = e-sT
T round-off to the calculation step
multiple
Conditions :
Skip > 0
T > 0
init > 0
NDelay > NHist

Non-linear
gain

n
ytab
utab

3
-1,0,1
-1,0,1

y computed from the


ytab vs utab curve
n: dimension of ytab and utab
Conditions:
n>0

AM-FM-PM
modulator

f AM
p FM
a PM

AM
FM
PM

f
p
a

y = a sin(2*pi*f*t + p)

u1
u2
y2

0
1
1

y
y2
u1

Falling ramp

u2

if u < u1, y = y2
if u1 u u2 , y lowers toward
0 as follows:
u u1- y2
y = y2 ----------------u2 u1
if u > u2, y = 0
Conditions :
u1 < u2

3-2-557

Function Details

Table C: 23 Non-linear functions


Parameters
Description

Palette

Element

Input

Output

Name

Initial
value

u1
u2
y2

0
1
1

Functionality and
conditions

y
y2

u1

u2

if u < u1, y = 0
if u1 u u2 , y rises
toward y2 as follows:

Rising ramp

u u1- y2
y = ----------------u2 u1
if u > u2, y = y2
Conditions :
u1 < u2
limUp

limDn

1
-1

Variation rate
limiter

If u > limUp, y = limUp


If u < limDn, y = limDn
Otherwise y = u
(i.e. y will follow u with a delay if u
varies too quickly)
Conditions :
limDn < limUp

Mpx2

Two input
multiplexer

u1
u2
sel

sel
u1 MPX y
u2

If sel = 0, y = 0
If sel = 1, y = u1
If sel = 2, y = u2

Conditions
sel = 0, 1, 2
Dead zone

Buffer with
hysteresis

One step
delay

3-2-558

Dead Zone

Start
End

-1.0
1.0

uH
uL

0.7
0.1

If u > Start and u < End, y = 0


If u <=Start, y = u - Start
If u >= End, y = u - End
If u > uH, y = 1
If u < uL, y = 0
Conditions :
uL < uH

1/z

u
u

1/z

yn = un-1

Function Details

Table C: 23 Non-linear functions


Parameters
Description

Palette

PWM

Element

s
c

PWM

p
d

Input

s
c

Output

p
d

Name

Initial
value

dS
dC

0
0

PWM
modulator

Functionality and
conditions

s + dS input signal is compared


with (carrier) c + dC
If s + dS > c + dC then p = 1
If s + dS < c + dC then p = 0
d is the normal delay (0 or 1) when
s + dS and c + dC cross at the
actual time.

Samp

Sampler

s
u Sample y

u
s

opt

y output keeps the previous value


except in the following cases:
if opt = 1, y = u if the change goes
from 0 to 1.
if opt = 2, y = u if the change goes
from 1 to 0.
if opt = 3, y = u if the change goes
from 0 to 1 or form 1 to 0.

3-2-559

Function Details

Table D: 24 Sources
Parameters
Description

Palette

Inpu
t

Element

Outpu
t

Name

Initial
value

Functionality and
conditions

Fix point
constant

1.0

y = K , K is a whole

Floating point
constant

1.0

y = A , A is a real number

Random wage
generator

Rand

P.A.
U/G
germ
Min
Max
Mean
Var.

0
5
0.0
1.0
0.0
1.0

P.T.
U/G
germ
Min
Max
Mean
Var.

0
100
0.01
0.02
0.0
0.02

Rand

A et T are random following a


random or gaussian distribution.
Parameters A :
Uniform / Gaussian = 0 / 1
germ : germ value
Minimum and maximum values are
available only for a uniform
distribution.
Mean and variable values are
available only for a Gaussian
distribution.
Parameters B :
Uniform / Gaussian = 0 / 1
germ : germ value

Impulsion
train generator

f
t0
A
opt

100
0
1
0

f : frequency
t0: impulsion train start time
Amplitude = A if opt = 0
Amplitude = A/T (energy)
if opt = 1.
T: calculation step
Conditions :
f>0
t0 > 0
opt = 0 or 1

3-2-560

Function Details

Table D: 24 Sources
Parameters
Description

Palette

Inpu
t

Element

Square wave
generator

Outpu
t

Name

Initial
value

f
A
P
D

100
1
0
0.5

Functionality and
conditions

To

Th

f : frequency = 1/T
A : amplitude
P : phase = (To/T)*360
D (duty cycle) = Th/T
Conditions :
f>0
0 <= P <= 360
0<D<1
Triangular
wave
generator

y
y

f
A
P
D

100
1
0
0.5

To

A
Th
T

f : frequency = 1/T
A : amplitude
P : phase = (To/T)*360
D (duty cycle) = Th/T
Conditions :
f>0
0 <= P <= 360
0<D<1
Sinus
generator
(amplitude)

y
y

f
A
P

100
1
0

P -
y = A sin 2 ft + -------
360
f : frequency.
A : amplitude.
P : phase in degrees
Conditions :
f>0
0 <= P <= 360

3-2-561

Function Details

Table D: 24 Sources
Parameters
Description

Palette

Sinus
generator
(phase)

Element

y
ang

<

Inpu
t

Outpu
t

y
ang

Name

Initial
value

f
A
P

100
1
0

Functionality and
conditions

P
y = A sin 2 ft + ---------
360
f : frequency
A : amplitude
P : phase in degrees
Conditions :
f>0
0 <= P <= 360

Simulation
time

3-2-562

y
y

y = simulation time

Function Details

Table E: 25 Miscellaneous functions


Parameters
Description

ABC->DQ
Conversion

DQ->ABC
Conversion

Float-Integer
Conversion

Integer-Float
Conversion

Palette

Elements

a
b
c
p

ABC
DQ

DQ
ABC

d
q
p

DQ b
ABCc

F To I

I To F

d
ABC
DQq

Outpu
t

Name

Functionality and
conditions

Initial
value
s

a
b
c
p

d
q

d = 0.66667.[a.cos(p) + b.cos(p 120)


+ c.cos(p + 120)]
q = -0.66667.[a.sin(p) + b.sin(p 120)
+ c.sin(p + 120)]

d
q
p

a
b
c

a = d.cos(p) - q.sin(p)
b = d.cos(p - 120)
- q sin(p - 120)
c = d.cos(p + 120)
- q.sin(p + 120)

y = float input converted in int

y = int input converted in float

y from input port

To i
To f

Input

Input port
In

In

Output port
out

Initial value
and duration

INIT

out

INITy

u from output port

Vini
Tini

0.0
0.0

y = Vini if 0 <= t <= Tini


y=u
if t > Tini

Condition
Tini >= 0

.
x=Ax

u1
u2
u3
u4

x=Ax+Bu
y=Cx+Du

Variable states
system
y1
y2

u1
u2
u3
u4

y1
y2
....

nx
nu
ny
A
B
C
D

1.0
1.0
1.0
1.0
1.0
1.0
1.0

x = Ax + Bu
y = Cx + Du
A dimension = nx.nx
B dimension = nx.nu
C dimension = ny.nx
D dimension = ny.nu
Conditions :
nx, nu, ny > 0

3-2-563

Function Details

Table E: 25 Miscellaneous functions


Parameters
Description

Palette

Float
transmitter

Elements

Input

Outpu
t

Name

Initial
value
s

Functionality and
conditions

This block type allows float signal exchange between two tasks.

This block type allows int signal


exchange between two tasks.

float

Int
Transmitter

u
int

3-2-564

Part 4
Advanced Hypersim Functions

2-565

PAGE LEFT INTENTIONALLY BLANK

2--566


Chapter 1
MATLAB AND SIMULINK MODELS

1.1 MATLAB AND SIMULINK MODELS


HYPERSIM QUICK REFERENCE
Matlab and Simulink Models
Icons:

Dynamic Loads

Properties:
- Hyperlink allows the integration of power systems designed
under Matlab/Simulink with
Hypersim operations.

Main features:
- Process models designed under
different Matlab/Simulink versions.
- Hyperlink system can use, in
Hypersim, code generation
with older Simulink versions.
- Many Simulink models can
coexist in the same Hypersim
version
- Many items of the same model
can be used in an Hypersim
program.
- Different models used in the
same diagram can use different
solvers.
- See Section 1.3 below.

Figure 1 - 1 Icon and Diagram of Matlab - Simulink models

1.2 INTRODUCTION
Using HyperLink1 and the RTW2 code generator, it is possible to integrate power systems
designed under Simulink3 with Hypersim operations. In this text, these systems will be called
Simulink models.

4-1-567

Matlab and Simulink Models


Main Features of HyperLink

The Simulink models can be integrated with some Hypersim elements that can use them as
control blocks. It is also possible to create a HyperLink element connected to a power system
bus when a Simulink model must be connected to many elements or control blocks. Finally,
there is a Simulink control block that also allows to use a Simulink model and whose input/
output can be connected graphically, as is the case for all other control blocks.

1.3 MAIN FEATURES OF HYPERLINK


The following are the main features of the HyperLink system.
HyperLink can process models designed using different Matlab/Simulink versions.
Whenever possible, we try to follow the development of the Matlab/Simulink/RTW
versions in order to take into consideration the changes made and to maintain the link
with Hypersim.
The HyperLink system can use, within Hypersim, code generated with older Simulink/
RTW versions (see the versions available in Table 1 below). Moreover, the same
Hypersim diagram can use models whose code originates from different Simulink versions.
Many Simulink models can coexist in the same Hypersim power system.
Many instances of the same model can be used in a Hypersim diagram.
The different models used in the same diagram can use different solvers.
Most Simulink blocks are usable in a model designed for Hypersim. However, the XY
Graph, Display, To File and To Workspace blocks cannot be used. The first
two have not been implemented and the last two are inoperative since the simulation
does not have access to a file system1. These blocks are simply ignored when generating code.
A Simulink model can contain continuous or discrete blocks and S Functions.
A Simulink model can contain blocks originating from different blocksets and toolboxes.
The signals related to Scopes are accessible in Hypersim.
The connection of signals between Hypersim and Simulink models is done using
Import and Export blocks.
It is possible to connect graphically the input/output of Simulink models in Hypersim
diagrams. The connection can also be made by recording in a file the name of the
Hypersim signals corresponding to the input/output of the model.
HyperLink decomposes vectorized signals to create many signals with the same
name, to which will be added a numeric suffix (_0, _1, etc.).
For the Scopes, HyperLink will add an extension identifying the axis, if many are
present.
1.Lien Hypersim - Simulink.
2.RTW: Real-Time Workshop, trademark of The Mathworks Inc.
3.Simulink, trademark of The Mathworks Inc.
1.

4-1-568

At least, in real-time.

Matlab and Simulink Models

Relationship Between HyperLink and


Matlab/Simulink/RTW Versions
The Simulink models used in Hypersim operate in both differed time and real-time.
In real-time, the step size specified when generating code in Simulink must be the same
as the step size in Hypersim.
In differed time, the step size specified in Simulink can be a multiple integer of the
Hypersim step size (Simulink step size = n * Hypersim step size, where n >= 1).
The value of the parameters of the Simulink models can be changed during a simulation.

1.4 RELATIONSHIP BETWEEN HYPERLINK AND


MATLAB/SIMULINK/RTW VERSIONS
The following table shows the relationship between the different versions of HyperLink and
Matlab/Simulink/RTW.

Table 1 : Relationship between HyperLink and Matlab/Simulink/RTW


HyperLink

Matlab

Simulink (RTW)

5.2

2.0

5.3

3.0

6.1

5.3.1 (release 11)

3.0.1

7.1

6.0 (release 12)

4.0

1.5 PREPARING SIMULINK MODELS


Using a Simulink model in Hypersim has several constraints and can require changes. Some
changes may be required to the model and the Simulink and Hypersim step sizes may need
to be adapted before generating the code. The code generation is done in two steps under the
control of Simulink and Hypersim. You should first generate the code in Simulink before using it and then generate the encapsulation code in Hypersim.

1.6 TRANSFORMATIONS REQUIRED IN THE MODEL


Models with continuous blocks and models with many step sizes will need to be transformed.
Even if in principle, code can be generated using a model with continuous blocks, it is possible that the time required to compute the model is too long and that in real-time, this exceeds
the duration of a step size. In order to decrease the calculation time, the continuous blocks
will need to be transformed in their discrete equivalent, more adapted to a sampled universe.
Some commands were designed to execute this transformation automatically. It is preferable
to design all new models using discrete blocks.
If a model has discrete blocks with different step sizes, transitions will be required between
slow blocks and fast blocks.

4-1-569

Matlab and Simulink Models

Adapting Step Sizes of Simulink and


Hypersim in Real-Time
Basically, the method consists in adding a zero order hold block between a fast block and
a slow block, or a unitary delay between a slow block and a fast block, in order to avoid
changes in values during calculations. This method is described in Chapter 71 of the Simulink
Real-Time Workshop -- Users Guide.

1.7 ADAPTING STEP SIZES OF SIMULINK AND HYPERSIM IN REAL-TIME


In real-time, the step sizes of the Simulink model and Hypersim must be identical.

1.8 ADAPTING STEP SIZES OF SIMULINK AND HYPERSIM IN DIFFERED TIME


In differed time, the step sizes defined in the Simulink model and in Hypersim can be different, provided their ratio is a full integer and the step size of the model is slower.

1.9 CODE GENERATION


Generating the code of a Simulink model used in Hypersim consists of two steps:
First, the Simulink model code is generated using the Real-Time Workshop;
Second, the container code of the Simulink model is generated in Hypersim.
HyperLink operation will be described using a simple example. In Figures 1 - 6 (a), the voltage source GeQD is replaced by the Simulink three-phase voltage source (see Figure 1 - 1).
The amplitude of this voltage source can be controlled via the Hypersim Control Module Interface by adjusting the value of the constant ConstFY in Figure 1-6 (a). Alternatively, the
amplitude of the voltage source can be controlled by adjusting the value of the constant Gain
in the Simulink model of the voltage source. The Hypersim files are
cont_volt_sou_opt1.sch, cont_volt_sou_opt2.sch and the Simulink file is voltsousmlk.mdl

1.Models with Multiple Sample Rates

4-1-570

Matlab and Simulink Models

Code Generation

Figure 1 - 1 Simulink Model of a Controlled Voltage Source


1.9.1

Code
Generation of
a Simulink
Model

Start Simulink and build a model or open an existing model. Then, in the Simulink model
window, select
Tools->Real-Time Workshop->Options.... See Figure 1 - 1.

4-1-571

Matlab and Simulink Models


Code Generation

a)

b)

c)

d)

Figure 1 - 2 Simulation Parameters Window of a Simulink Model


Using this window1, execute the following:
A

Click the tab Solver;

In the section Solver Options, select Type: Fixed-step;

Still in Solver Options, select the integration method. If there are no continuous blocks in the
Simulink model, choose the discrete option;

Enter the Step size (must be the same as in Hypersim2);

Click the tab Real-Time Workshop (see Figure 1 - 2);

Enter HyperLink.tlc in the field System target file;

1.Note that all the Simulink windows are those of version 4.0.
2. Or a full integer multiple of the Hypersim step size when the simulation is executed in differed
time.

4-1-572

Matlab and Simulink Models

Code Generation

(e

f)
g)
h)

Figure 1 - 3 Real-Time Files Window of a Simulink Model


G

Enter Hyperlink.tmf in the field Template makefile:.

Do not click the button Generate code only

Select HyperLink code generation options in the list Category.

i)

(k

j)

Figure 1 - 4 Code Generation Options in HyperLink


4-1-573

Matlab and Simulink Models

Adding a Simulink Model to a Hypersim


Diagram
J

If not selected, select External mode in the Options window. This selection is compulsory to
avoid errors when generating code.

Click the button Build.


Simulink will generate the code for the Simulink model in a sub-directory1 of the model directory. Once the code is generated, you can go to the second step which consists in inserting
one or many elements that can integrate the code generated by Simulink/RTW in your power
system.
Afterwards, when generating code in Hypersim, a container code of the Simulink model will
be produced.

1.10 ADDING A SIMULINK MODEL TO A HYPERSIM DIAGRAM


To add a model created in Simulink to a Hypersim diagram, it is necessary to first generate
its code. Once the C code of a model has been generated using RTW in Simulink, it is
possible to add it to a Hypersim diagram and to process the result. Three methods can be used
to do this:
Connecting a HyperLink2 power system element to a bus;
Using some power system elements (such as breakers) for which it is possible to
replace their control block with a contained Simulink model.
Using a Simulink3 block.
Note : Only HyperLink versions 6.1 and after allow to use Simulink blocks whose input/
output connection is done graphically.
Unlike other elements, HyperLink elements do not have ready-to-use simulation block
functions stored in libraries. The simulation functions for a Simulink model are generated at
the time the power system is analyzed and their code is stored directly in the directory .../
exec/src_HyperLink located in the code generation directory selected by the user. Moreover,
the files generated by RTW will also be copied in this directory. A file with the extension
.info will be generated at the same time and location. It defines, among others, the connections between the Hypersim signals and the Simulink input/output.
1.10.1 Using a
Simulink Block

The following steps show how to include a Simulink model, version 3.0.1 (or any more recent
version), in Hypersim, using a Simulink block (control block).

Select the icon


representing a Simulink block in the SYSTEM TOOLS palette and
position an instance in your diagram.

The window below is displayed. It allows to choose the Simulink model to use. In the list,
locate the directory with the Simulink model, select it and click Apply.

1.Valid only for versions 4.0 and more recent of Simulink (Matlab 6.0). If you have a version
older than 4.0, the code will be generated directly in the model directory.
2.Hypersim element, connected to a bus, and allowing to establish a link with a Simulink model.
3.Hypersim control block allowing to establish a link with a Simulink model.

4-1-574

Matlab and Simulink Models

Adding a Simulink Model to a Hypersim


Diagram

The block will appear in the user diagram and will have a number of input/output connectors
depending on the model used. The following example shows the model voltsousmlk

:.

voltsousmlk
> In1 Out1 >
> In2 Out1 >
> In3
> Gain Out1 >

Connect graphically the input/output of the block to the connectors of the required blocks or
elements using the usual Hypersim connection method.

Edit the label of the icon to provide it with a meaningful name.

Continue to draw your power system. At the end, go in Simulation mode to analyze the power
system, generate the code and execute the actual simulation. Later in this chapter, a section
will show how to change some parameters of the Simulink model during simulation.

1.10.2 Using a
HyperLink
Power System
Element

The following steps describe how to integrate a Simulink model using a HyperLink element
(without graphic connection of the input/output) following the Hypersim basic method. Such
an element is still required, since the other Hypersim elements do not have all the connectors
providing access to their internal signals. Moreover, when a Simulink model has numerous
input/output connectors, it is often more practical to use a connections table to link the Hypersim signals, as shown here.

4-1-575

Matlab and Simulink Models

Adding a Simulink Model to a Hypersim


Diagram
A

Select the icon

: representing a HyperLink element in the elements palette or select

an element that can integrate with a HyperLink control block. For now, these elements are all
the control and switching elements (CONTROLLERS+SWITCHES), the voltage source and
the current source of the DC motor.
B

Connect the HyperLink element or the element that can be controlled by a Simulink model,
to a bus.

Edit the label of the power system element to provide it with a meaningful name.

Edit the parameters of the HyperLink element (Figure 1 - 5). There are three such parameters
for now. The first specifies the name of the directory with the Simulink model, the second
provides the name of the model as defined in Simulink and the third represents the measured
execution time of the Simulink model. This is used by the task mapper to distribute the tasks
to different processors for a real-time or accelerated simulation.

Figure 1 - 5 Parameters of a HyperLink Element


Click Apply to include the model. Note that these parameters are also displayed for elements,
such as breakers, that can use a Simulink model. However, you must select the button Simulink in the control section of their respective window to replace the internal control block
with the Simulink command (Figure 1 - 6b shows the window a voltage source controlled by
a Simulink model).
E

Finish drawing the power system and go in Simulation mode.

Proceed with the analysis of the power system. Hypersim will detect the presence of Simulink
models. For each Simulink model detected, a window will be displayed to allow the user to
edit the .info file serving to link the input/output of the Simulink model with the Hypersim
signals. If the links already exist, the window will not be displayed.

4-1-576

Matlab and Simulink Models

Adding a Simulink Model to a Hypersim


Diagram
The text editor is specified by the EDITOR environment variable. vi is used by default.
It is also possible to use xemacs or textedit.
G

Edit the .info file of the model to link the labels of the input/output of the Simulink model
with the Hypersim signals.
Each element/model combination has its own info file whose name is a concatenation of
the following elements: hk, HyperLink version, Element label, Simulink model
name and .info. Hence, for the model gain used in the element ABC, the name of the
info file will be hk7.1_ABC_gain.info in version 7.1 of HyperLink.
In the voltage source example used, the file info hk7.1_GeQD_voltsousmlk.info will be
generated in the HyperLink code generation directory and will be as follows:
# HyperLink 7.1 -- Octobre 2000
#
# hk7.1_GeQD_voltsousmlk.info
#
# Date de generation du fichier: 01/01/24
#
# --------------------------------------------------------------------------# HYPERSIM_STEP_SIZE = 5e-05
# --------------------------------------------------------------------------#
# Informations concernant le modele Simulink "voltsousmlk" version 6.0 de Malab
#
# Ce fichier contient:
#
# 1- Certains parametres du modele
# qui serviront lors de la generation de code dans Hypersim.
#
# 2- La correspondance entre les noms des entrees/sorties du modele Simulink
# et les noms des signaux dans Hypersim.
# A la creation du fichier, les champs definissant les noms des signaux
# Hypersim ne contiennent que des "-" et le type des signaux est "double"
# par defaut (colonnes 4 et 5).
# Vous devez editer ce fichier et remplacer les "-" par les noms
# des signaux Hypersim appropries et remplacer le type "double"
# par defaut par le type reel du signal dHypersim
# (choix de "int" ou "double")
#
#---------------------------------------------------------------------------#
# Parametres:
#
# Les champs modifiables sont precedes de la lettre "M"
#
# MODEL
: Nom du modele
# MODEL_PATH
: "Path" du modele
# MODEL_CHECKSUM
: "Checksum" du modele
# MODEL_STEP_SIZE
: Pas de calcul du modele
#
# NB_PAR_TOT
: Nombre total de parametres

4-1-577

Matlab and Simulink Models

Adding a Simulink Model to a Hypersim


Diagram
# NB_INPUTS
: Nombre de signaux dentrees au modele
# NB_OUTPUTS
: Nombre de signaux de sorties du modele
# NB_SCOPES
: Nombre de "scopes" du modele
# INPUTS
: Liste des entrees
#
Comporte les champs (colonnes) suivants =
#
Indice
#
Etiquette de Simulink
#
M Nom du signal Hypersim
#
M Type du signal Hypersim (int, float, double)
#
# OUTPUTS
: Liste des sorties
#
Comporte les champs (colonnes) suivants =
#
Indice
#
Etiquette de Simulink
#
M Nom du signal Hypersim
#
M Type du signal Hypersim (int, float, double)
#
# SCOPES
: Liste des "scopes"
#
Comporte les champs (colonnes) suivants =
#
Indice
#
Etiquette de Simulink
#
M Nom du signal Hypersim (meme que letiquette)
#
# NOTE:
Les champs dans "INPUTS", "OUTPUTS" et "SCOPES"
#
sont separes par des espaces ou des tabulations!
#
# ATTENTION! Seules les colonnes 4 et 5 des signaux peuvent etre modifiees.
#
MODEL="voltsousmlk"
MODEL_PATH="/pcnet/murere/HYPER_SCH/hyplnk"
MODEL_CHECKSUM=3505657059U,3506833197U,1470380308U,776400657U
MODEL_STEP_SIZE=5e-05
NB_PAR_TOT=10
NB_INPUTS=3
INPUTS={
0
In1
double
1
In2
double
2
In3
double
}
NB_OUTPUTS=3
OUTPUTS={
0
Out1
double
1
Out2
double
2
Out3
double
}
NB_SCOPES=3
SCOPES={
0
Scope
Scope
1
Scope1
Scope1
2
Scope2
Scope2
}

4-1-578

Matlab and Simulink Models

Adding a Simulink Model to a Hypersim


Diagram

Any line beginning with # is a comment. The file consists of three lists INPUTS, OUTPUTS and SCOPES (in bold in the list above), showing respectively the labels for the inputs,
the outputs and the scopes of the model, accompanied by the corresponding1 Hypersim signals. The lists contain four fields (3 for the scopes) separated by tabs or spaces.
The first field contains an order number (0,1,2...), the second is the name of the block2 in the
Simulink model, the third (modifiable) contains the name of the Hypersim signal to connect
and the fourth specifies the type of signal in Hypersim.
During the first analysis, if the Simulink model has just been added to the power system, the
Hypersim signals to connect to the model are not yet defined and the corresponding fields
have a dash (-, as above). The signal type is double by default (except for scopes which
do not have a specified type).
IMPORTANT
Replace the dashes by the name of the Hypersim signals
to be connected with the different inputs and outputs.
Also change the type from double to int for control
signals.

1.
2.

Note that in the case of scopes, the names of the signals are the same as the Simulink labels.
Block of Import, Export and Scope types.

4-1-579

Matlab and Simulink Models

Adding a Simulink Model to a Hypersim


Diagram

(a)

(b)

Figure 1 - 6 Voltage Source Modeled by Simulink


Once edited, the lists in our .info file will be as follows:

4-1-580

Matlab and Simulink Models

Adding a Simulink Model to a Hypersim


Diagram

MODEL=voltsousmlk
MODEL_PATH=/pcnet/murere/HYPER_SCH/hyplnk
MODEL_CHECKSUM=3505657059U,3506833197U,1470380308U,776400657U
MODEL_STEP_SIZE=5e-05
NB_PAR_TOT=10
NB_INPUTS=3
INPUTS={
0
In1 V_BaMM_a
double
1
In2 V_BaMM_b
double
2
In3 V_BaMM_c
double
}
NB_OUTPUTS=3
OUTPUTS={
0
Out1 VintExt_GeQD_a double
1
Out2 VintExt_GeQD_b double
2
Out3 VintExt_GeQD_c double
}
NB_SCOPES=3
SCOPES={
0
Scope Scope
1
Scope1 Scope1
2
Scope2 Scope2
}

Figure 1 - 7 Lower Part of the file hk7.1_GeQD_voltsousmlk.info (After Editing)


Note that the dashes have been replaced by the names of the required Hypersim signals (as
named in the lists of sensors).
Also note that the Simulink label-Hypersim signal association will be kept if you need to regenerate the code of the Simulink model. However, any new label will have a - in its signal
field and any label removed will be deleted from the .info file.
The scopes are considered as outputs of the HyperLink elements.
Special Case

The interconnection of two HyperLink elements is a special case. Usually, the names of the
signals of HyperLink elements are those of the Hypersim signals (in the.info file) related to
the input/output identifiers of Simulink models. For example, if an A Hypersim element defines an output voltage signal, and a B Hypersim element defines a command signal,
the HyperLink element will have to give the name voltage to its input signal, which will
refer to the signal of A having the same name. Moreover, the element will have to give
command as its output signal name, which, in turn, will be referenced by command in
element B.
When connecting two signals of HyperLink elements, it is not possible to mutually associate
the label name of the signal of the other block with the current label. For example, two HyperLink elements Hk1 and Hk2 defining respectively out1 and in2 cannot be connected as follows:
...Hk1.info: (.info file of block Hk1)
...
OUTPUTS={
0
out1
...

in2

double The output signal is named in2

4-1-581

Matlab and Simulink Models

Adding a Simulink Model to a Hypersim


Diagram
...Hk2.info:
...
INPUTS={
0
in2
...

out1

double The input refers to out1!!!

Element Hk1 defines in2 as output signal name, but Hk2 refers to out1, which does
not exist as input signal. To correct the problem, all the output signals of HyperLink elements
that are to be connected to an input of another HyperLink element, must have the same name
as their identifier (label). The input signal of element Hk2 will continue, for its part, to
point to the output label of Hk1, giving the following:
...Hk1.info:
...
OUTPUTS={
0
out1
...

out1

double The output signal is named out1

out1

double The input refers to out1, which exists.

...Hk2.info:
...
INPUTS={
0
in2
...

The type of signals will need to be the same on both sides.


To finish the connection, just exit the text editor (without forgetting to save the changes
made).
1.10.3 Code
Generation
and S
Functions in
HyperLink

There are two ways of integrating an S Function with a Simulink model, in order to generate code usable in Hypersim:

By using an S Function written in C, whose code is available.

By generating the code of the S Function directly within the code of the Simulink model.

Using an S Function
Written in C

This is probably the most common case. The function is written in C, thus allowing for a
shorter execution time. The user will have already compiled the function using the cmex.
This process is useful for Simulink to allow the integration of the function in a diagram. It is
not linked with the generation of the container code in Hypersim.
However, the function code will need to be accessible from Hypersim.
When generating code in Simulink, the links with the S Function will be inserted in the appropriate locations. The different modules of the S Function will be called via pointers to
functions. In some cases, these calls will be made at each step size.

4-1-582

Matlab and Simulink Models

Adding a Simulink Model to a Hypersim


Diagram
The generation of the container code of the model will de done, as usual, when analyzing the
power system in Hypersim. In addition, the code of the S Function will be copied, if required, in the code generation directory, with everything else that has already been generated.
It will be compiled when generating the code in Hypersim.
It is possible that during Hypersim analysis, an S Function may not be found.
Generally, the S Functions files are looked for in the current directory or in the model directory. If the file (.c) of your S Function is located elsewhere, you must define the environment variable SFUN_PATH, with the name of the directory of your S Function,
before starting Hypersim. The directories defined in SFUN_PATH will be added to the default directories and they will be examined first. For example, if you wish to use two S Functions whose code is contained in /mon_home/sfdir/sf1.c and /projets/simulink/sfun/sf2.c,
SFUN_PATH will need to be defined as follows:
setenv SFUN_PATH /mon_home/sfdir:/projets/simulink/sfun (C shell)
or:
SFUN_PATH=/mon_home/sfdir:/projets/simulink/sfun
export SFUN_PATH (Bourne shell)
The different paths are separated by :. The variable must be defined before starting Hypersim.
This use of an S Function is not the most effective. The call mechanism is heavy and costly
for some architectures. Moreover, contrarily to other Simulink blocks, the parameter values
of the function cannot be changed during a simulation. Fortunately, the inlining procedure
allows to add the function code directly to the code generated for the model.
S Function
Inlining

As is the case for the first method, this method also requires to have previously compiled the
source file (.c) of the S Function using cmex. The .tlc1 version needs to be added which
allows to insert the algorithm code in the full model code. This file consists of script type
statements capable of looking into a database describing the model, and also the C code,
which has references to variables of the script language. An interpreter (tlc), called when
generating code in Simulink, allows to recognize and to interpret the statements, while copying verbatim the C code, after substituting the values of the script variables in the code generation file.
This method is more work, since it requires keeping two files (.c and.tlc) for the same function. However, it is more efficient, since the code is directly inserted next to the code of the
other blocks. In fact, it is as if a Simulink block had been created. Moreover, it is possible to
change the parameters of the function during simulation.
The .tlc files of the S Functions must be seen from Matlab. In other words, they must
be located in the directories listed in MATLABPATH. If required, change the latter to include the directory of your S Functions.

1.

Code generation files in Simulink/RTW. Please consult the following manuals: Writing S Functions,
Target Language Compiler Reference Guide and Real-Time Workshop Users Guide, published by
The Mathworks Inc., for complete information on S Functions.

4-1-583

Matlab and Simulink Models

Changing Simulink Model Parameters


During a Hypersim Simulation
In this case, you do not need to define SFUN_PATH in Hypersim, since the code will be
found in the usual model files and it will not be necessary to copy and compile the source file
(.c) of the S Function.

1.11 CHANGING SIMULINK MODEL PARAMETERS DURING


A HYPERSIM SIMULATION
When integrating a Simulink model with Hypersim, it is possible to change some model parameters during a simulation. The parameter change is done via the Simulink interface. Simulink allows, when the user specifies the external simulation mode, to transmit the values
of changed parameters towards the external simulation process. To do this, Simulink uses a
MEX file containing predefined functions allowing to communicate with an external process.
We have developed a mex file which communicates with the Hypersim parameter change
mechanism and that is recognizable by Simulink.
The parameters of the Simulink block and the HyperLink element correspond to the information transmitted when changing parameters in the Simulink interface, and as such, they
can pass the values originating from the interface.

1.12 LIMITS OF PARAMETERS


It is not possible to change the block parameters of a Simulink model without recompiling.
Actually, a parameter cannot be changed during a simulation if this affects the following:
the number of states, inputs or outputs in any block;
the sampling rate or the number of step sizes;
the integration algorithm for continuous systems;
the name of the model or of any block;
the parameters of Fcn blocks;
the zero parameters in the blocks State Space and Zero Pole (continuous and discrete) among those specified by the user or those that are calculated (i.e. the matrices A,
B, C, and D generated by a transformation from Zero-pole to State space;
the parameters of Fcn blocks.
If you wish to change one of the parameters above, you must generate the model code
and, hence, the code in Hypersim.
However, the parameters of the transfer functions and of the State space blocks can
be changed under certain circumstances.
The parameters (polynomial numerators and denominators) of
Transfer Fcn (continuous and discrete) and Discrete Filter blocks can be changed,
as long as the number of states is not affected.
Consult the SIMULINK Real-Time Workshop - Users Guide1 for detailed information on the changes of parameters that are not allowed during a simulation.
1.

4-1-584

Simulink 4.0, release 12

Matlab and Simulink Models

Procedure Used to Change


Parameters

1.13 PROCEDURE USED TO CHANGE PARAMETERS


In order for the Simulink interface to communicate with Hypersim, the environment variables
IG_DISPLAY (example: setenv IG_DISPLAY menelas:1) and SSR_ROOTDIR must be
defined before starting Matlab. IG_DISPLAY specifies the name of the machine running the
Hypersim interface and also its number1, and SSR_ROOTDIR defines the base directory of
the power system simulation software. However, if not already done, it is possible to pass
these values when initializing the communication. See step below.
To change the parameters during a simulation, execute the following:
A

Start the simulation in Hypersim

Start Simulink

Open the model in which you want to change the parameters.

Display the External Mode Control Panel window by selecting the menu:
Tools->External Mode Control Panel....

Click the Target Interface button. The following window is displayed:

1.

Multi interfaces mode allowing to use many Hypersim copies on the same computer.

4-1-585

Matlab and Simulink Models


Procedure Used to Change
Parameters

In the External Target Interface window, enter the name of the mex communication file:
HyperLink_comm_s4_0 in the field MEX-file for external interface.

Fill in the field MEX-file arguments: This is where the user defines the recipient of the parameter1change. All the parameters entered on this line must be set between single quotation
marks (). Enter the identification (label) of the Simulink block or of the element containing
a HyperLink block, or of the HyperLink element in the diagram of the Hypersim interface.
This identification must have the following format: label_of_block/bus name. Generally, this
is the only value that the user has to enter. However, others can be added.
If the environment variable IG_DISPLAY which specifies the name of the machine running the Hypersim interface has not been assigned before starting Matlab, or if it has been
wrongly defined, you can add its definition after the element. This variable will need to be set
between quotation marks in the following format: IG_DISPLAY=machine:number where
machine is the name of the computer running the interface and number, the identification
number of this machine (specified in the window of the Hypersim interface).
This method can also be used to add the definition of SSR_ROOTDIR.
The previous figure shows a case where IG_DISPLAY and SSR_ROOTDIR had to be
defined.

Select Simulation->External in the menu bar at the top of your model window.

Still in the menu bar, select Simulation->Connect to target or click the Connect button of the
External Mode Control Panel window. This sets the communication with Hypersim. At this
time, Simulink would be able to transmit all the parameters of the model towards the simulation if the parameter INIT_ALL_PAR were equal to y. The default value of the latter is n.
To assign a value to INIT_ALL_PAR, add its definition just after the parameters of the mex
file (see section 7 above) by following this format: INIT_ALL_PAR=o.

Then, select Simulation->Start real-time code or press ctrl-t (optional).


Afterwards, each time you change a parameter (one that is allowed), Simulink will transmit
when you click Apply in the window of the corresponding block.
1.To which element or block of the Hypersim diagram and in which interface instance.

4-1-586

Matlab and Simulink Models

Guidelines for a joint Simulink Hypersim real-time simulation.

1.14 GUIDELINES FOR A JOINT SIMULINK - HYPERSIM REAL-TIME SIMULATION.


This section introduce the basic guidelines to design a Simulink diagram that can be used in
a Real-Time simulation using Hypersim.
Note : Please refer to document "Quick Start using Hypersim and Matlab/Simulink" for a
more detailed procedure.
Rule 1: Generic use of
Simulink with
Hypersim

Generally, Simulink is used to design control system, regulation, monitoring devices. In the
same manner, Hypersim is used to represent Power System elements. Thus, only controls signals are exchanged between Hypersim and Simulink.
The use of a Simulink C code generator, called Real-Time Workshop (RTW) is used to convert Simulink diagram in to C code.
If a power system was designed using Simulink, refer to rule #xxx. If a power system network
is implemented in Simulink, using PSB models, refers to rules #xxx.

Rule 2: Signals
exchange
between
Simulink &
Hypersim

Communications between Simulink and Hypersim are bi-directional. The simulink diagram
must contain input and/or output connectors, to exchange control signals with Hypersim.
Signals to be exchanged can be scalar or vector.
If a Simulink "scope" device is used in the diagram, the corresponding signal will be
automatically available in Hypersim.
Input and output connectors should be in relation with Simulink signal only. It cannot
be a connection to a Power System diagram using PSB.

Rule 3: Modelling in
Simulink in
discrete-time
domain (Z)

In order to achieve real-time simulation:


Only discrete-time (in Z-domain) modelling is allowed. Thus, no continuous states is
allowed in the diagram, like S-domain blocks.
All discrete blocks (Z-domain) should operate at the same timestep, or at a greater multiple of the timestep.
No limitation is present on the discrete method (trapeze, Euler, etc).
The timestep values should be identical in Hypersim and Simulink.
Note : Simulink offers the capability to discretize automatically (transform from s to z).
See Simulink-Tool-Model Discretizer.

Rule 4: Limitation in
Simulink
modelling.

In order to correctly use the real-time workshop:


No block "S-Function based on a "m-file" are allowed in the diagram;
No block "Matlab-Function" are allowed;
No timer block or time related elements are allowed (see rules #xxx).
Note : "S-Function" based on C code is allowed. Please refer to Matlab/Simulink for
more details.

4-1-587

Matlab and Simulink Models

Guidelines for a joint Simulink Hypersim real-time simulation.


Rule 5: Simulation of
time
referenced
event in
Simulink.

In a Simulink simulation, some operations in time can be achieved with a time reference from
the beginning of the simulation.
In a real-time simulation, this time reference cannot be used, since the simulation can be executed perpetually, and events (maneuver) are performed form a steady-state operation.
Thus, Hypersim gets a time reference from a "Voltage Level Crossing" called "Point-onWave" or POW.
The only time reference available, is then produced by Hypersim, and it is called "Point-onWave" or POW. This synchronization pulse can be exchanged to Simulink for some particular operations in time.
Please refer to Hypersim manual for more details.

Rule 6: Code
Generation of
Simulink
diagram.

Before code generation using RTW, you make sure the Matlab path contains Hypersim directory. Use the following command to add and verify the path:
addpath /hypersim/HYP/matlab
Solver option: Fixed-step;
Solver option: discrete (no-continuos-state);
Solver option, Fixed step size: set to a proper value (non-auto);
Real-TimeWorkshop, System Target file: hyperlink.tlc;
Real-TimeWorkshop, template makefile: hyperlink.tmf;
Real-TimeWorkshop, make command: make_rtw.

Rule 7: Using PSB


block in a
simulink
diagram.

A power system can be constructed in Simulink using PSB block. Although ONLY simulink
signal can be exchanged with Hypersim.
If PSB block are presents in the Simulink diagram, you must:
Place on your Simulink diagram a PowerGUI block;
Specify in the PowerGui "Discretize electrical model";
Specify in the PowerGui the corresponding timestep.
The presence of this PowerGui block will automatically discretize all PSB blocks present in
the diagram. Please note that some PSB blocks do not supports discretization.
Note : HYPERSIM will require the environment variable SFUN_PATH in order to identify
a system file from Matlab installation directory (sfun_psbdicc.c)

Rule 8: Design of
power system
model with
Simulink

If a power system models is modelized in Simulink environment, the general implementation


must be:
The model should receive voltage or current signals from Hypersim;
The model should make calculations from those input signals;

4-1-588

Matlab and Simulink Models

Guidelines for a joint Simulink Hypersim real-time simulation.


The models calculates a voltage or a current that is sent back to Hypersim.
Those signals are used in Hypersim to supply controlled voltage source or current source.
Note : On the Power System side (Hypersim), model must be implemented as a voltage or
a current source.
On the control side (Simulink), only calculations are done based on voltage/current measurements.
Rule 9: The SimulinkHypersim
interface

Some special considerations should be taken into account about the signal interface between
Hypersim and Simulink. Basically:
A delay of one timestep (z-1), is present at each interface. (Hyp->sim; Sim->Hyp);
The Simulink task can only be executed on a single processor.
A special implementation of Simulink block can eliminate one timestep delay in the interface.

4-1-589

Matlab and Simulink Models

Guidelines for a joint Simulink Hypersim real-time simulation.

PAGE LEFT INTENTIONALLY BLANK

4-1-590


Chapter 2
USER CODED BLOCKS

2.1 INTRODUCTION
Hypersim users can build their own control blocks with the UCB (User Coded Block) utility,
independently and without recompiling the simulator.This utility is described in the following sections. It consists of a development environment which guides the user in creating
blocks. The integration of a block in a Hypersim diagram is done using a general UCB with
a specific icon in the elements palette and whose diagram element can be connected to other
blocks of the control module in the Hypersim graphic interface.
The following sections explain the normal procedure to create a UCB and then use it in a Hypersim diagram.

2.2 UCB ICON AND DIAGRAM


The following icon and diagram represent a UCB. Note that the diagram is a general functional block with the same number of inputs and outputs as a UCB.

GAIN KJ

Use

ENTREE

SORTIE

Figure 2 - 1 UCB Icon and Diagram

2.3 UCB COMPONENTS


The simulation of a UCB is done via a block simulation function that implements the users
algorithm.
The UCB has the following features:
The UCB simulation function is called at each step size to process input signals generated by other blocks and to produce output signals that will be used by other blocks;
The UCB can have parameters that can be changed during the execution of the simulation. For example, a block implementing a sine generator will have the following
parameters: amplitude, frequency and phase shift. The parameters used in the interface
and those of the simulation function can be different. In such cases, it is possible to
define a transformation code allowing to switch from one representation to another;
The UCB can keep past values (historical) of some variables which are inherent to the
block instance that generated them;

4-2-591

User Coded Blocks


UCB Components

The UCB can have an initialization function called once at the beginning of the simulation;
The UCB functions are saved in a file called ucb_label_ex.c while the declarations are made
in a file called ucb_label_ex.h, where label is the block label.
A file named ucb_label.bldat contains the required information that will be used by Hypersim
to include a UCB in a power system. This file is located in the same directory as the UCB.
The following is an example of a .bldat file:

Example:

# Block breaker data file


NOMBLOC = breaker
DESCR = breaker de base
NOMEX = ucb_breaker_ex
NOMINIT = ucb_breaker_ex_init();
TEXEC = 5.0e-6
# 1- Block parameters
NPAR = 3
Tman1 s double 1 0.0 1 First operation time
Tman2 s double 1 0.0 1 Second operation time
EtIn - int 1 0 1 Initial state
# 2- Simulation function parameters
NPARSIM = 3
T1 ech. int 1 0.0 1 No. sample of the first operation time
T2 ech. int 1 0.0 1 No. sample of the second operation time
EtIn - int 1 0 1 Initial state
# 3- Simulation function historical values
NHIST = 4
POW_1 int* 1 0 POW value
CountEnab int* 1 0 HistoriqueCount enable history
Count1 int* 1 0 Present count for the 1st state change
Count2 int* 1 0 Present count for the 2nd state change
# 4- Block inputs/outputs

4-2-592

User Coded Blocks

UCB Limits

NIO = 1
Command - int* Out Command signal 0: open, 1: closed

2.4 UCB LIMITS


UCBs are subject to the following limits:
Parameters with many elements can only have one initial value identical for all;
The use of functions, other than those defined in the various system libraries (for example: mathematical library libm...) is not allowed in the parameter transformation code.

2.5 BUILDING BLOCKS


2.5.1

Introduction

Building blocks is done using a ucb command that guides the user through the process and
hides implementation details from the user who can then concentrate on his task while being
assured that the proper links will be established.
All the block requirements are entered by the user in the block definition file which consists
of sections used to define parameters, inputs and outputs, documentation, code, etc.
Each file section is preceded by explanatory remarks.

2.5.2

Using the
ucb
Command

The UCB program guides the user through the process of building a UCB. This command
hides implementation details from the user who can then concentrate on the algorithm of his
block.
All the specifications for the block simulation function are entered in a definition file that includes the following sections: parameter definition, input/output definition, block documentation and execution code. Each section begins with an explanation on how to fill in the
required information.

2.5.3

2.5.4

ucb
Command
Operating
Modes

The ucb command has two operating modes: interactive and batch. In the interactive mode,
the ucb executes commands specified by the user and ends when the user enters the command quit.

Using the
Interactive
Mode

To execute the ucb command in interactive mode, type:

In batch mode, each ucb call executes only one task.and ends as soon as the task is completed.

ucb [-i] [name of block]<cr>


The switch -i which stands for interactive is optional. The name of the block is also optional. When a block name is specified, the ucb command opens the block with that name,
otherwise it prompts for a block name. If no block name is entered, the ucb command creates the default block NewBlock1.

4-2-593

User Coded Blocks


UCB Commands

If a non existing block is entered, the ucb assumes that the user wants to create a new block
with that name.
The ucb will automatically start the editor preferred by the user to allow completion of the
block definition file.
The name of the block can have the extension .ucb and include the complete path of the
block. If no path is specified, the block is assumed to be in the current directory.
2.5.5

ucb Prompt

When the ucb command is entered, a prompt with the name of the current block is displayed. The prompt also contains information about the block. In interactive mode, the
prompt is as shown below1:

[SM] BLOCK>
Block Name
(NewBlock if no block name is specified)
Block Modification Flag
_ = block not modified; * = bloc modified
Status
O Block Opened
N New Block Opened
_ Block Not Opened

Example:
bloc src
[__] src>: Bloc src non ouvert;
[O_] src>: Bloc src ouvert;
[O*] src>: Bloc src ouvert et modifi;
[N*] src>: Nouveau bloc src modifi.

2.6 UCB2 COMMANDS


In the following description of UCB commands, the string of characters between < > is
optional. The parameters between [ ] are also optional, block stands for the block
name. Commands with no parameters apply to the current block.
Here is the list of commands accepted by UCBs:
1.NouveauBloc in French.
1.In English version. See appendix for French version.
2.In English version. See appendix for French version.

4-2-594

User Coded Blocks

UCB Commands

cat file [file]...

Calls the Unix command cat and displays the content of the files specified.

co<mpile>

Compiles the code of the current block. If the code of the block has not been generated or if
the definition file of the block is not up to date, you will be asked if you want to generate the
code. If you answer No, the code will not be generated and, if an old version of the code
exists, it will be compiled.The compilation at this time is only for debugging purposes because the code will be recompiled when the block is included in a Hypersim power system.
If no error is detected, the prompt will be displayed again after the compilation. Otherwise,
error messages will be displayed and added next to the erroneous statements in the corresponding files. The editor preferred by the user will be called automatically for each erroneous file. Error messages inserted in the files will be delimited by: "/*### ... %%%*/". The
number of the corresponding line will be displayed within the error message. Error messages
must be deleted from the file after errors are corrected. Most files that need to be edited have
at the beginning a reminder of the block parameters, historical variables and input/output signals. After correcting the errors and closing the editor, you will be asked if you want to save
the corrections. The default answer is Yes. If you answer No, the corrections will be lost.
You will then be asked if you want to recompile the new block code. The default answer is
Yes. This cycle will be repeated until there are no more errors in the file. If the block code
has not been generated, you will be asked if you want to generate it. The default answer is
Yes. If your answer is No, an old version of the code will be compiled.

dat

Displays the content of the file ucb_BLOCK.bldat. All information relating to a block and
required by Hypersim are found in this file. It will be used by Hypersim to incorporate the
block into a simulation program. This file is not directly modifiable.

de<lete> [block]

Deletes the current block or the block specified as parameter. You will be prompted to confirm if you really want to delete the block. The default answer is No.

di<scard>

Erases the last changes made to the current block. Is operative only if the block has not been
saved. You will be prompted to confirm your decision. The default answer is No.

exec

Displays the content of the file ucb_BLOCK.exec. This file contains the simulation code
of the block.

cl<ose>

Closes the current block. If the block has been modified but not saved, you will be asked to
save the block before closing it. The default answer is Yes.

gen<erate>

Generates the code of the current block. The names of the files generated are displayed as they
are generated. If the code of the block is up to date, no action is taken.

init

Displays the content of the file ucb_BLOCK.init. This file contains the code to initialize
the block.

lb

Displays the list of blocks in the current directory. A short description is appended to each
block name.

ls

Calls the Unix command ls which displays the content of the current directory.

4-2-595

User Coded Blocks


UCB Commands

ed<it> [block]

more

Creates or changes the block definition file specified as parameter or, by default, the current
block. If the specified block doesnt exist, an error message will be displayed. If the specified
block exists and is different from the current block, the later one will be closed and the specified block opened. Then, UCB will indicate that it is ready to change the block and will open
the editor preferred by the user. Press <Return> or <Enter> to start editing. The editor is selected by the environment variable EDITOR. This variable must be defined before starting
the UCB program. The editors supported are vi, textedit and xemacs. The default editor
is vi.
Calls the Unix command more which shows the content of a file.

n<ew> [block]

Creates a new block! Before UCB creates a new block, you will be asked if you want to close
the current block (if it is opened). The default answer is No. In case no block name is specified, the block will be called NewBlock. If such a name already exists, the name
NewBlock1 will be used and so forth. An error message will displayed if the specified
block already exists. If all the required conditions are met, UCB will ask the user to enter the
block definition. Refer to the command edit for the subsequent operations.

o<pen> [block]

Opens the specified block or the current block. A block must be opened to execute any operation (except deleting it). No action is taken if the block is already open. If the specified block
is not the current block, you will be asked if you want to close the current block. The default
answer is No. If your answer is Yes, the current block will be closed (see the command
Close) and the specified block opened. An error message will be displayed if you try to
open a block that doesnt exist. You can open a block by simply typing its name at the UCB
prompt. The rest of the procedure is the same as when a block is opened with the Open command.

parform

Displays the parameters that can be accessed via the data control panel. The list displayed
consists of three columns: the identification number of the parameter (this number is used in
the data control panel); the parameter name and the parameter description.

pwd

Calls the Unix command pwd.

s<ave>

Saves the current block.

save as

Saves the current block under another name. If a block with the same name already exists,
you will be asked if you want to overwrite it. The default answer is No. If the saving operation is successful, the saved block will become the current block with the status Open.

sh [command]

Executes a Unix shell command or goes in shell mode, if no command is specified. In shell
mode, the shell prompt replaces the UCB prompt. To return to UCB, press <Ctrl> + D.

q<uit>

Quits the UCB program. If the current block has been changed, you will be asked if you want
to save it before quitting. The default answer is Yes.

v<iew>

Displays the definition file of the current block in your preferred editor. (See the command
Edit on how to specify your preferred editor). This command opens the file for viewing
only.

vglob

Displays the content of the file ucb_BLOC.vglob which contains declarations of variables
and global variables of the block simulation function.

4-2-596

User Coded Blocks

UCB Commands

Displays the list of UCB commands with a brief description. Below is the list displayed by
the ? command.
Syntax: ucb [ -g | -c | -d | -i ] [block name]
ucb: List of available commands
----------------------------------------------------------------[] = Optional parameters -- <> = Optional characters
cat
Same as UNIX cat.
cl<ose>
Close current block.
co<mpile> Compilation of current block.
dat
Show content of file ucb_NewBlock.bldat
de<lete> [block]Destruction of current block or optionally name block.
di<scard> Discard last changes to current block
ed<it> [block]
Modify definition of current block or block in
parameter.
exec
Display content of file:
ucb_NewBlock_ex.exec
gen<erate>
Generate C code of current block
init
Display content of file: ucb_NewBlock_ex.init
lb
Display list of blocks in current directory
ls
Same as UNIX ls.
more
Same as UNIX more.
n<ew> [block]
Create a new block of name block or default
name.
o<pen> [block]
Open current block or block named block.
pwd
Same as UNIX pwd.
q<uit>
Exit ucb
s<ave>
Save current block
save as
Save current block under another name.
example: save as NewBlock
sh [command]
If command is present, execute it under UNIX.
Else, enter shell mode. This will start shell
program specified by environment variable:
SHELL.
Enter <ctrl-d> to exit shell and return to ucb.
v<iew>
Display synthesis of current block.
vglob
Display content of file:
ucb_NewBlock_ex.vglob
name of block
Open block of that name.
?
Display present help message
Note : The name of the current block is always part of the prompt:... CurrBblock>

4-2-597

User Coded Blocks

UCB Program in Batch Mode

2.7 UCB PROGRAM IN BATCH MODE


As stated earlier, the batch mode allows to perform only one operation every time the ucb
command is executed. The UCB program ends after completing the requested task.
Four types of operations are possible in this mode:
generate code;
compile code;
delete block;
display list of block parameters.
Each of the four operations is specified by its respective option -g, -c, -d and -p. If
more than one option is specified, only the last one will be considered.
.
Syntax:
ucb [ -g | -c | -d | -p ] [ Block name ]
Options:
-g: Generates the code of the block;
-c: Compiles the code of the block;
-d: Deletes the block;
-p: Displays the list of parameters of the block.

The name of the block can include the extension .ucb and a complete path. If no path is
specified, the block will be assumed to be in the current directory. If no block name is specified, UCB will request it. If the block specified doesnt exist, an error message will be displayed.
Code Generation

Syntax: ucb -g [Block name]

If the block exists, ucb will open it, generate its code and close it. See the descriptions of
the corresponding Open, Generate and Close commands in interactive mode.
Code Compilation

Syntax: ucb -c [Block name]

If the block exists, ucb will open it, compile its code and close it. See the descriptions of
the corresponding Open, Compile and Close commands in interactive mode.
Block Deletion

Syntax: ucb -d [Block name]

The specified block will be deleted automatically. If the block doesnt exist, a warning message will be displayed. See the description of the corresponding delete command in interactive mode.
Display a List of
Block Parameters

4-2-598

Syntax: ucb -p [Block name]

This command is useful for those who want to design their own data control panel for a UCB.
It displays the identification numbers of the parameters that can be changed.

User Coded Blocks

Building a Block

2.8 BUILDING A BLOCK


2.8.1

Creating a
Block

Suppose you want to create a block called gain. In order to do this, you will need to use the
UCB program in interactive mode.

2.8.2

Starting the
UCB Program

To start the UCB program, type:


ucb gain <enter>

gain is specified as block name. A text similar to the one below will be displayed in the
window where the UCB program was launched (some of the lines are truncated):
Users blocks development system
Opening block: gain!
Editing block: gain definition
!
!Editing in textedit!
! ---------------------------------------------------------!
!To save and exit editor: Menu= File->Save Current File
!
!You are going to edit the file!
Enter <CR> to continue!>>>

The program pauses and waits for you to press <Enter>. The editor that will be used is specified in the text displayed. In our example, the editor textedit will be used because the environment variable EDITOR has been set to textedit before starting the UCB program.
This is done by typing the following:
setenv EDITOR textedit <enter>

xemacs or vi could have been used instead. If EDITOR is not specified, the UCB program uses vi.
You can now edit the block definition file. The file that will be generated is temporary and
will be destroyed once its content has been processed and saved.
If the block already exists, UCB will not edit it immediately. It will open the block, display
the ucb prompt and wait for a command from the user.
2.8.3

Block
Definition File

The block definition file is a temporary file that contains the required information for the
block. It has 10 sections and each section covers a particular aspect of the block. An example
of a block definition file is given below.
The file is well documented (comment lines start with %%). A general header section gives
basic instructions and a list of the sections in the file. Each section has its own header describing the function of the section, the data format, etc.
WARNING
Do not change these comments!!!

4-2-599

User Coded Blocks


Building a Block

The following sections describe the 10 sections of a block definition file:


2.8.4

General
Information

The general information are the execution time TEXEC and the description of the block DESCR.
DESCR = Description of breaker
TEXEC = 5.0e-6

Default values are assigned to these two parameters. You can change them to adapt them to
the block you are programming.
WARNING
Do not change these names: DESCR and TEXEC!!!
The description of the block, i.e. the string assigned to DESCR, must always be delimited by
double quotation marks.
2.8.5

Block
Documentatio
n

You can enter the block documentation in this section. The text will be in free format and will
be saved as typed. However, text lines that begin with %% will be considered as comments
and will not be saved as part of the block documentation.

2.8.6

Block
Parameters

The block parameters are defined in this section. These parameters will be entered in the parameters control panel accessible from Hypersim. Parameters are values that you can change
before the simulation starts or during its execution. The parameters are entered in tabular
form in which one line describes one parameter. Following is the data format of a parameter
line. You must follow this format:
Name Units Type Dimension Defeat Modify Description
where:
Name:Name of parameter;
Units:
Units of the parameter. Enter a dash (-) or without if no unit is specified
for the parameter;
Type:Type of parameter
int

Integer value

int*

Vector of values in integers

double Value in real number


double* Vector of values in real numbers
Dimension:Dimension of the parameters. Enter 1 for scalars and the dimension of the
vector for parameters with vector values.
Default:Default value for parameters
Modif:Specifies if the parameter can be changed during the execution of the simulation
(1: Yes, 0: No);

4-2-600

User Coded Blocks

Building a Block

Description:Short description of the parameter (between double quotation marks)


When the parameter type is int* or double*, you must enter a dimension greater than 1.
Conversely, you must enter a dimension of 1 for parameters with types int or double. The
different fields in a parameter description line are separated by spaces.
For example, the breaker block has a parameter Tman1 which specifies the first operation
time of the breaker:
Tman1 s double 1 1.0 1 First operation time
The parameter is called gain, is double type and has a default value of 1.0.
The default value applies to all the elements of a parameter with a dimension > 1.
2.8.7

Parameters of
the Block
Simulation
Function

This section must be filled in only if some parameters of the simulation function are different from the block parameters (entered in the control panel). Otherwise, the parameters
of the control panel are passed directly to the simulation.
When parameters of the simulation function are different, you must describe here all the parameters of the function that are identical to the function parameters, including those that are
identical to the control panel parameters. You must also fill in section 10 which will hold the
code to transform the block parameters into simulation parameters that will be ready to be
used by the block execution code.
The names of the simulation function parameters must be different from the names of the
block parameters (entered in the block data control panel) except when the parameter requires
no preliminary transformation. In fact, when the name of a simulation function parameter and
that of a block parameter are identical, the latter is transmitted to the block simulation function without transformation. In this case, you dont have to process that parameter in the transformation code you will specify in section 2.8.13.
The default value applies to all the elements of a parameter with a dimension > 1.
Here is an example of a parameter definition of a block simulation function:
NT1

ech. int 1 0 1 No. of sample corresponding to the time Tman1

It is an integer type parameter whose default value is 0. In fact, it is the time Tman1 that has
been converted into a number of samples.
2.8.8

Inputs and
Outputs of the
Block
Simulation
Function

The block inputs and outputs are defined in tabular form where each line refers to one input
signal or one output signal. Following is the format of an input/output signal line. You must
follow this format:
Name Units Type Direction Description
where:
Name:
Units:
Type:

Name of signal
Units of the signal. Enter a dash (-) or without if no unit is specified.
Type of signal
int* Signal with an integer value

4-2-601

User Coded Blocks


Building a Block

double* Signal with a real number value


Direction of the signal relative to the block.
In for an input signal towards the block
Out for an output signal from the block
Description : Short description of the parameter (between double quotation marks)
Direction:

2.8.9

Historical
Variables of a
Block

Historical variables ensure the persistence of certain values, between the calls to the simulation function at each step size. These historical variables are private to the instance of the
block. You must follow the provided data format. The parameters are entered in tabular form
where each line of the table corresponds to one historical variable. Below is the format of a
historical variable line. You must follow this format:
Name Type Dimension Default Description
where:
Name:
Type:

Name of historical variable


Type of historical variable
int* Historical variable in integer (scalar or vectorial)
double* Historical variable in real number (scalar or vectorial)
Dimension: Dimension of historical variable
Default
: Default value (or initial) of the historical variable
Description: Short description of the parameter (between double quotation marks)

The different fields in a parameter description line are separated by spaces.


If the block doesnt have historical variables, just leave this section empty.
Example of a historical variable
POW_1 int* 1 0 Value of the last POW
2.8.10 Global
Variables of a
Block (code C)

C language declarations of global variables. These variables can be accessed by all the functions defined in the block simulation file. Such variables are static and common to all instances of the block. All the functions required by the block simulation function are declared in
this section. You can also include C language header (.h) files. The format must be conform
to C language rules. In the case of our breaker block, the following declarations are made
in this section:
intblPOW_Get ();
intblIsTestEnable();

2.8.11 Initializing a
Block (C Code)

4-2-602

The initialization code of the block is entered in this section. This code will be part of the
block simulation function and will be executed only once before the simulation. This function
can not access the parameters, input/output signals and historical variables of the block. The
initialization procedure can use global variables only. Remember that global variables are
common to all functions in the block simulation file and are also common to all instances of
the blocks. The format must be conform to C language rules.

User Coded Blocks

Building a Block

2.8.12 Block
Execution
Code (C Code)

The block simulation code is entered in this section. This code is executed at each step size.
It applies the block simulation algorithm to the input signals of the previous step size to generate the current output signals of the block. This code will be part of the block simulation
function which will be automatically generated by the UCB program.
In the execution code, input/output signals, parameters and historical variables are referred to
by using the names assigned to them in their respective definition section. In the case of a gain
block, the execution code would be as follows:
*output = gain * *input;

Note the use of the de-reference operator *. Input and output signals must always be dereferenced because they are passed by address to the block simulation function. This address
always points to a single value since input signals are not vectorized.
Historical variables are always passed by address and, therefore, must always be dereferenced. However the address can point to a scalar or a vector value. It is the dimension of the
historical variable that separates scalar historical variables from vector ones.
Scalar parameters are passed by value, while vector parameters are passed by address. In the
case of the breaker block, the parameter T1 is scalar. Here, the use of a de-reference operator is not required.
An array of values can be passed as parameters to a block. In this case, the square brackets
[] can be used in lieu of the de-reference operator. The format must follow C language
rules.
2.8.13 Transforming
Parameters (C
Code)

When some parameters of the block simulation function are different from the block parameters, then the parameter transformation code must be entered in this section. This code will
be executed each time a parameter is changed. From the block parameters in the corresponding block control panel, it will calculate the values of the parameters of the block simulation
function.
The instructions in this code use the parameters defined in sections 2.8.6 and 2.8.7. The scalar
parameters can be used directly. The vectors are used via the de-reference operator * or via
the index, for example ParVec[i].
No transformation is required for a block simulation function parameter with a name identical
to that of a block parameter. These parameters will be passed without transformation to the
block simulation function.
Some variables and pre-defined MACROS are provided to facilitate this task:
TO_SAMPLE: Macro that converts the time in seconds into number of samples.
Ex: TO_SAMPLE(Tman1);
HYSIZE:Macro that returns the dimension of a parameter.
Ex: HYSIZE(Tman1);
(The return value is always an integer type scalar)
NPARB:Number of parameters of the block.
NPARS:Number of parameters of the block simulation
step_size: The time step in seconds.

4-2-603

User Coded Blocks


Building a Block

All block simulation function parameters that are different from block parameters must be assigned values.
2.8.14 Closing the
Capture of a
Block
Definition

After having specified the information required for the block definition, save the file and
close the editor. The analysis of the block information will be executed immediately and the
information saved in a temporary file.
Some errors in the definition of parameters, of inputs/outputs and of historical variables will
probably be detected when the analysis of the block is done. For example, it is an error to declare a parameter as scalar and assign it a dimension greater than 1.
The errors will be reported as follows:
Error(s) while analyzing block definition!
List of rejected lines by section:
%% 1- General informations or parameters
%% 2- Block documentation text
%% 3- Block's parameters
Tman1 s double 10 0.0 1 Time of first operation
%% 4- Simulation function parameters (OPTIONAL)
%% 5- Block's signals
%% 6- Block's historical values
%% 7- Global variables or defines of block (C code)
%% 8- Block's initialization code (C code)
%% 9- Block's execution code (C code)
%% 10-Parameters transformation (C code)

The list of the sections in the definition file is displayed. The lines where errors are detected
are inserted after the title of the section to which they belong. You will be asked if you want
to edit the block definition file in order to correct the errors. If you answer Yes, the block
definition file will be edited again and you can correct the errors. When no more errors are
detected, the block status will become Changed and you can save it, generate its code and
compile it. To save the block, enter the command Save.
2.8.15 Generating the
Block Code

Once the definition of a block is completed, you can proceed with generating its code by entering the UCB command Generate. You dont have to save the block before generating its
code.
The list of files generated is displayed as follows:
Generating code for block: breaker!
Generating code for block: disjoncteur!
Generating: ucb_breaker.vglob!
Generating: ucb_breaker.init!
Generating: ucb_breaker.exec!
Generating: ucb_breaker_ex.c!
Generating: ucb_breaker_ex.h!
Generating: ucb_breaker.xform!
Generating: ucb_breaker_xform.c!
Generating: ucb_breaker.mk!

4-2-604

User Coded Blocks

Including a UCB in a Power System

The files ucb_BLOCK.xform and ucb_BLOCK_xform.c will not be generated if the user has
not defined block simulation function parameters that are different from the block parameters.
The code will not be generated if the block definition has not changed since the last generation of the block code.
2.8.16 Compiling the
Block Code

Here, the compilation of the block code is mainly for validation purposes since the block code
will be compiled again when it will be used in Hypersim. The compilation is done in two
steps. The block simulation function (simul) will be compiled first. The parameter transformation function (xform) will be compiled next if different parameters were defined for the
simulation function.
To compile the block code, enter the command: compile <Enter>
If the compilation is successful, the following message will be displayed and the UCB prompt
will be displayed again:
Compiling block: breaker (simul)!
No errors.
You didn't touch any files.
Compilation succeeded!
Compiling block: breaker (xform)!
No errors.
You didn't touch any files.
Compilation succeeded!

If a block doesnt have a parameter transformation function, only one compilation (simul)
will be executed. If errors are detected during the compilation, error messages will be displayed next to the erroneous statement that caused the error.
Refer to the UCB command Compile for more information on compilation. If the block
code has not been generated, you will be asked if you want execute this operation. The default
answer is Yes. If you answer No, the existing block code will be compiled.
This completes the definition of the block which is now ready to be used in Hypersim.

2.9 INCLUDING A UCB IN A POWER SYSTEM


2.9.1

Introduction

The inclusion of a UCB in a power system consists of the following steps:


Adding a UCB diagram to a Hypersim power system and connecting it to other blocks;
Entering the block parameters;
Analyzing the power system;
Generating the code of the Hypersim power system;
Simulating the power system.

4-2-605

User Coded Blocks

Including a UCB in a Power System

2.9.2

To add a UCB to a Hypersim power system, click the UCB icon in the palette, then click
the Hypersim window. The following dialogue box is displayed:

Adding a UCB
to a Power
System

a
b
c
d
e

The box allows to choose the UCB block and its control panel. It contains four modifiable
fields and a selection list.
A

This first field specifies the path of the directory containing the control panels. This field is
initialized from the Forms Directory field in the Default Directories Properties dialogue
box of the Hypersim interface. You can replace the content with the path of the directory containing your customized control panels.

Enter here the name of the customized control panel of the block. Leave the field empty to
use the default control panel.

Filter to display only the names of the relevant files in the selection list. You do not have to
modify this field.

Path of the directory containing the UCB blocks. The content of this field is initialized from
the User Block Directory field in the Default Directories Properties dialogue box of the
Hypersim interface. You can modify this field.

List of UCB blocks contained in the directory specified in d.

2.9.3

Identifying a
Block

4-2-606

Locate the UCB required in the e list and click it. Then, click Apply. Using this information, Hypersim will read the file containing the block identification, its parameters and its
inputs/outputs.

User Coded Blocks

Including a UCB in a Power System

This data is used to modify the appearance of the block in the diagram by replacing the block
name and its input/output labels with the definitions of the user.
You can enter the name of the control panel1 corresponding to the block parameters in the
same dialogue box. If you do not do this, a default parameters control panel will be generated
with the identifier of the parameters read previously. (See the additional information on user
programmable blocks in the appendix).
2.9.4

Connecting
the Inputs/
Outputs of a
Block

In the Hypersim interface, connect the inputs and outputs of the block with other blocks of
the control module.

2.9.5

Specifying the
Parameters

The specification of the block parameters can be done via a default data control panel (UserBlocDefaut.form) or a custom data control panel designed by the user. Such user designed
forms will be located in the directory defined by the environment variable USERDIR and
will bear the name: Blockname.form.

The user can design the block data control panel as he likes, provided the parameter identification numbers are accurate. Parameters are numbered starting from 1 in the order they appear in the .bldat file of the block. For help in designing a custom parameter control panel,
the UCB command parform can be used to display the list of parameters and their identification numbers. To this end, the ucb command can also be used in batch mode with the
switch -p by entering: ucb -p Blockname
In the default data control panel, parameters are presented in a list whose order is specified
by the command parform.
2.9.6

Simulation

You can proceed as you normally would for power systems without UCBs.

Appendix

Example:
Example of a block definition file
%%
%%.ucb_breaker.def -- Date: 98/11/25
%% ---------------------------------------------------------------1.The definition of control panels is done in administration mode in Hypersim.

4-2-607

User Coded Blocks

Including a UCB in a Power System

%%
%% Definition of a user's defined Hypersim block
%% --------------------------------------------%%
%% Comments in this file are preceded by this string: %%
%%
%% DO NOT EDIT COMMENTS!
%% --------------------%%
%% Only edit zones between comments.
%% Follow directives describing format of data.
%%
%% File is divided en 10 sections covering the following topics:
%%
%% 1. General informations or parameters
%% 2. Block documentation text
%% 3. Block's parameters
%% 4. Simulation function parameters
%% 5. Block's inputs/outputs
%% 6. Block's historical values
%% 7. Global variables or defines of block (C code)
%% 8. Block's initialization code (C code)
%% 9. Block's execution code (C code)
%% 10.Block's parameters transformation code (C code)
%%
%%
%% ---------------------------------------------------------------%%
%% 1- General information or parameters
%% ---------------------------------%%
%% DESCR:
%%
%% Enter a short description of block, between double quotes
%%
%% TEXEC:
%%
%% Replace default value of 5.0e-6 by estimated execution time of block
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

DESCR = General purpose breaker


TEXEC = 5.00e-6
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 2- Block documentation text
%% -----------------------%%
%% Enter text after comments
%%

4-2-608

User Coded Blocks

Including a UCB in a Power System

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
This block defines a general purpose breaker control.
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 3- Block's parameters
%% -----------------%%
%% Enter block's parameters in a tabular form (7 columns).
%% Fields should be separated by one or more space characters.
%% Description should be between double quotes
%%
%%ATTENTION: If you do not supply parameters for simulation function
%% in section 4 below, it will uses parameters defined here.
%%
%% Name : Name of parameter
%% Units : Parameter's units.
%%
Text field at user's convenience
%%
Enter a - when not used
%% Type : Type of parameter
%%
Enter: int
Integer value
%%
int*
Integer array
%%
double Real value
%%
double* Real array
%% Size : Parameter size (number of units)
%%
Enter 1 for scalars
%% Default: Default value of parameter
%% Change: 1 => parameter can change during simulation,else 0
%% Description: Short description of parameter (BETWEEN DOUBLE QUOTES)
%%
%% Format: (7 columns table)
%%
%% Name Units Type Size Default Change Description
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Tman1 s double 1 0.0 1 Time of first operation
Tman2 s double 1 0.0 1 Time of second operation
EtIn - int 1 0 1 Initial state
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 4- Simulation function parameters (OPTIONAL)
%% -----------------------------%%
%% If the simulation function uses parameters different
%% from the block parameters you must also enter the transformation code
%% in section 10 below. If simulation function parameters and block
%% parameters have the same name, you do not have to assign them
%% in the transformation code. Ucb will do it for you.
%%

4-2-609

User Coded Blocks

Including a UCB in a Power System

%% Enter simulation function parameters in a tabular form (7 columns).


%% Fields should be separated by one or more space characters.
%% Description should be between double quotes
%%
%% ATTENTION:If you do not supply parameters for simulation
%%function it will use block's parameters.
%%
%% Name : Name of parameter
%% Units : Parameter's units.
%%
Text field at user's convenience
%%
Enter a - when not used
%% Type : Type of parameter
%%
Enter: int
Integer value
%%
int*
Integer array
%%
double Real value
%%
double* Real array
%% Size : Parameter size (number of units)
%%
Enter 1 for scalars
%% Default: Default value of parameter
%% Change: 1 => parameter can change during simulation, else 0
%% Description: Short description of parameter (BETWEEN DOUBLE QUOTES)
%%
%% Format: (7 columns table)
%%
%% Name Units Type Size Default Change Description
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
T1 sample int 1 0.0 1 Sample number of first operation
T2 sample int 1 0.0 1 Sample number of first operation
EtIn int 1 0 1 Initial state
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 5- Block's signals
%% --------------%%
%% Enter block's signals in a tabular form (5 columns).
%% Fields should be separated by one or more space characters.
%% Description should be between double quotes
%%
%% Name : Name of signal
%% Units : Signal's units.
%%
Text field at user's convenience
%%
Enter a - when not used
%% Type : Signal type
%%
Enter: int*
Integer (pointer to scalar)
%%
double* Real (pointer to scalar)
%% Direction: Enter: In For block's input signal
%%
Out For block's output signal
%% Description: Short description of signal
%%
(BETWEEN DOUBLE QUOTES)

4-2-610

User Coded Blocks

Including a UCB in a Power System

%%
%% Format: (5 columns table)
%%
%% Name Units Type Direction Description
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%%
Command - int* Out Command signal 0: open, 1: close
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 6- Block's historical values
%% --------------------------%%
%% Enter block's historical values in a tabular form (5 columns).
%% Fields should be separated by one or more space characters.
%% Description should be between double quotes
%%
%% Name : Name of historical value
%% Type : Type of historical value
%%
Enter: int*
Integer (scalar or array)
%%
double* Real (scalar or array)
%% Size : Size of historical value (number of units)
%% Description: Short description of historical value
%%
(BETWEEN DOUBLE QUOTES)
%%
%% Format: (5 columns table)
%%
%% Name Type Size Default Description
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%%
POW_1 int* 1 0 Last POW value
CountEnab int* 1 0 Count enable historical value
Count1 int* 1 0 Counter for first change of state
Count2 int* 1 0 Counter for second change of state
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 7- Global variables or defines of block (C code)
%% --------------------------------------------%%
%% Enter global variables and defines after comments.
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%%
int
int

blPOW_Get ();
blIsTestEnable();

4-2-611

User Coded Blocks

Including a UCB in a Power System

%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 8- Block's initialization code (C code)
%% -----------------------------------%%
%% Enter code that should be run only once, at beginning,
%% after comments.
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%%
/* This block has no initial is at ion function */
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 9- Block's execution code (C code)
%% ------------------------------%%
%% Enter block's implementation code (executed at each step)
%% after comments.
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%%
intPOW;
if (blIsTestEnable())
{
POW = blPOW_Get ();
if ((POW - *POW_1) > 0)
{
*Count1 = 0;
*Count2 = 0;
*CountEnab= 1;
}
if (*CountEnab)
{
if (*Count1 == T1)
{
*Command = 1 - EtIn;
}
if (*Count2 == T2)
{
*Command = EtIn;
*CountEnab = 0;/* 2 chang.d'etats effectue: Fin*/
}
(*Count1)++;
(*Count2)++;

4-2-612

User Coded Blocks

Including a UCB in a Power System

}
else
*Command = EtIn;/* Permet changement etat permanent */
*POW_1 = POW;
}
else
*Command = EtIn;
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 10-Parameters transformation (C code)
%% ---------------------------------%%
%% Enter block parameters transformation function code here.
%% This code will transform block parameters to simulation
%% function parameters. You do not have to assign simulation
%% function parameters which are the same for the block.
%%
%% Predefined values:
%%
%% Defines:
%%
%%
%%

NPARB
NPARS

Number of block parameters


Number of simulation function parame-

%%

TO_SAMPLE(t)

Conversion from seconds to sample num-

%%

HYSIZE(parname)

Returns size of array parameter

ters
ber

%%
%% Variables:
%%
%% double step_size;Simulation step size in seconds
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%%
T1
T2

= TO_SAMPLE(Tman1);
= TO_SAMPLE(Tman2);

%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%% End of.ucb_breaker.def

Example:
Prompt description when English is the chosen language.

4-2-613

User Coded Blocks

Including a UCB in a Power System

[SM] BLOCK>
Block Name
(New Block if no block name is specified)
Block Modification Flag
_ = block not modified; * = bloc modified
Status
O Block Opened
N New Block Opened
_ Block Not Opened

Example:
List of Commands in French:

4-2-614

cat fichier [fichier]...:

Lists the content of files

co<mpiler>:

Used to compile the code of the current block yes

dat:

Displays the content of the file ucb_BLOC.bldat

de<truire> [bloc]:

Deletes the current block or the block specified as parameter

eff<acer>:

Deletes the last changes made to the current block

exec:

Displays the content of the file ucb_BLOC.exec

fe<rmer>:

Closes the current block

gen<erer>:

Generates the code of the current block

init:

Displays the content of the file ucb_BLOC.init

lb:

Displays the list of blocks in the current directory

ls:

Calls the UNIX command ls.

mod<ifier> [bloc]:

Creates or modifies the block definition specified as


parameter or by default the current block

more:

Calls the UNIX command more.

n<ouveau> [bloc]:

Creates a new block

o<uvrir> [bloc]:

Opens the block specified or the current block

parform:

Displays the list of parameters that can be accessed using a


control panel

pwd:

Calls the UNIX command pwd

s<auver>:

Saves the current block

User Coded Blocks

User Programmable Blocks

sauver sous bloc:

Saves the current block under another name

sh [commande]:

Executes a command from the shell (Unix) or goes in shell


mode

t<erminer>:

End or quit the ucb

v<isualiser>:

Displays the definition file of the current block

vglob:

Displays the content of the file ucb_BLOC.vglob

?:

Displays a short help message

2.10 USER PROGRAMMABLE BLOCKS


A

The files $TOOLDIR/userbloc.tool (tool created initially) and $PALETTEDIR/userbloc


(representation of the user block in the palette) must exist to allow proper operation of the
program.

If the tool already exists in the $TOOLDIR directory, just add it to the palette.

When instantiating a user block, a dialogue is displayed to allow the user to determine where
to get the information to build his block.
The directory of the default control panel is $FORMULDIR, if this environment variable was defined. Otherwise, ./ will be displayed by default.
The field identifying the name of the control panel is empty.
A filebrowser allows to select the file containing the information on the block to build.
By default, the directory is displayed in $USERDIR, if this environment variable was
defined. Otherwise, ./ will be displayed by default.

The new $USERDIR environment variable can be defined in the directory properties panel.

If the file containing the block information is not valid, a dummy block will be instantiated:
no input/output connector and no control panel.

If the name of a control panel is specified and if it is valid, it will be assigned to the block.
Only the values of identical parameters will be assigned in the control panel (name and type).

If the name of a control panel is specified and if it is not valid, there will be validation of the
existence of the UserBlocDefaut.form default control panel file in the specified directory.

If it does not exist or is not valid, no control panel will be assigned to the block instanciated.

If it exists, the scalar parameters whose integer identifier is identical will have the name of
the variable, the units and the values assigned to the control panel. The unused parameters of
the default control panel will be destroyed.

If no control panel is specified, there will be a validation of the existence of the file NomBloc.form in the specified control panel directory. NomBloc represents the same prefix as the
file.bldat specified for the information on the block.

4-2-615

User Coded Blocks

User Programmable Blocks

Steps 6, 7, 8 and 9 are repeated as if the NomBloc.form control panel has already been recorded.

If the control panel used is different from the one specified in the dialogue, a message will be
given indicating which control panel was used or if no panel was used at all.

4-2-616


Chapter 3
GENERATION AND IMPORTATION OF EMTP FILES

3.1 INTRODUCTION
This chapter covers the automatic drawing and repositioning of diagrams using the Diagram
menu commands next to the View Menu of the interface. These commands apply globally and
cannot be cancelled with the Cancel option in the background menu.
However, most commands are complementary and, hence, reversible. The commands do not
interfere with the normal operation of the editor. They should be considered as added capabilities.
The main goal of automatic drawing and repositioning of diagrams is the production of diagrams corresponding to EMTP files.
A Historical
Account

The goal is to develop an efficient means of automatically generating a diagram from different sources (such as an EMTP file) and hiding interactively parts of large diagrams without
losing any connection.

B Edit functions

All the edit functions are available with diagrams drawn and repositioned automatically. It is
also possible to add new elements or delete existing ones at any time.

C Multiple uses

In addition to drawing EMTP diagrams, the repositioning algorithm can be used in the following cases:
Fast drawing or updating of a diagram and automatic repositioning. Improvements can
then be made manually and saved.
Loading a large diagram of which only a small part is of interest to the user. It is then
possible to enclose and implode the undesired parts into a small rectangle without losing any connection. However, the diagram must be repositioned prior to this operation.
If the resulting diagram is not satisfactory, no save is made.

D Multiple
representations

There are four (2x2) representation possibilities: branches can be oblique or orthogonal and
buses can be stretched or fixed to a pre-defined size.
The original algorithm was designed for oblique branches and fixed length buses. It is useful
to display this representation since it is often the best. It is very difficult to clearly position a
complex network with orthogonal branches due to the great number of changes in direction
or involuntary crossings, except for planar graphs1, where stretching buses allows to generate
a diagram approximating a manual drawing.
1.Diagram that can be drawn without any branch crossing.

4-3-617

Generation and Importation of


EMTP Files
Limits of the Current Algorithm

If the graph is planar (and represented as such, see limits further ahead), orthogonal or oblique
branches will give the same results.

3.2 LIMITS OF THE CURRENT ALGORITHM


The limits described here are those of the current version.
A One-way
(Vertical)

All the branches are directed vertically from top to bottom and the elements and buses are
assumed to have this orientation. If vertical buses or elements with horizontal connections are
used (i.e. such as a line), repositioning will be poor.
You can override these limits. However, you will need to reposition or reconnect manually
all poorly processed objects.
The algorithm used is designed for a directed graph. In the case of a graph without a definite
orientation, the circuits can be processed automatically, but some branches need to be reversed to do so. This is a type of problem that cannot be solved completely. Hence, it is important to orient elements and buses in the direction of the required final result to generate a
clear diagram.

B Processing
Planar Graphs

The barycentre method used to order the nodes of a level does not guarantee a planar result
for a planar graph. The advantage of this method is its quickness
When the graph is planar and the buses are stretched, the method used generates a diagram
that is not centered as well as a method without stretching.

3.3 RECURSIVE CHARACTERISTIC OF DIAGRAMS


The term recursive here means enclosing sub-networks at an arbitrary depth. The algorithm
provided allows to process each sub-network as an element in a given diagram.
A Temporary
Recursive
Structuring

It is not possible to save any added recursive structuring. If a recursive diagram is saved, it
will be initially reread as is since the added rectangles are Unidraw objects. However, the
diagram will be repositioned using only the buses, the elements and the connections saved in
the Unidraw file.

B Characteristics
of Processed
Elements

The algorithm assumes that elements have only two connectors and that these are centred vertically. However, Unidraw uses a magnetism function for all the connections. The result is
that off-centred connectors, even when there are more than two, are processed adequately.
Note : The algorithm handles the processing of nodes with more than two connection
points. However, this capability was not included in the current interface, since
each case must be processed individually. Furthermore, the relative coordinates
for each connection point in each element must be provided.

3.4 GENERATION OF EMTP FILES


The Hypersim simulator offers direct compatibility with EMTP software. Once a network is
drawn in the Hypersim schematic editor, it is possible to generate the corresponding EMTP
file.
Although, since EMTP does not support the exact same model library as Hypersim, some
models available in Hypersim will not be generated, since there are not yet supported, or does
not exist in EMTP.

4-3-618

Generation and Importation of


EMTP Files
Importation of EMTP file

During generation, the user will be notified on which models are not yet supported.
To generate an EMTP file, in simulation mode, click on top of the menu Special and select
Generate EMTP file. The EMTP file will then be generated.

3.5 IMPORTATION OF EMTP FILE


When importing a file, place it in the GUI. Automatic positioning is possible in Hypersim, to
help the user.

3.6 DIAGRAM MENU


This section describes each menu item used to automatically draw and reposition diagrams.
The commands are combined in the menu to show how they complement each other.

Fix and reposition

Global repositioning based on the current parameters of the buses, connections and elements
in the editor. The recursive structuring added interactively is saved. The diagram generated
can spill over the page (represented by a black rectangle). The size of the page can be modified using the appropriate menu. The diagram is always centred.

Undo

Return to the previous positioning. The latter is kept in the temporary file.cancel.axxxxx of
the current directory which is usually destroyed after execution. The xxxxx extension is the
Unix process number of the interface.

EMTP File

Automatic generation of the diagram corresponding to the EMTP file selected in the file selector window. An *.emtp file can be processed with the original EMTP card images or those
generated by interemtp. It is also possible to use the result file from a previous filter pass
(possibly edited manually) named *.emtp.schrec. The format is described further ahead.

Bidirectional Diagram

Reposition the diagram considering that a part of the network was rotated by the user.

Orthogonal Branches

Displays the connections using the convention for single-wire diagrams with square-angle
branches and a layout selected automatically. When this option is chosen, the diagram is redrawn, but not repositioned. This is the initial default value.

Oblique Branches

Displays the connections with oblique branches and a layout selected automatically. This is
the most compact and clean representation. When this option is chosen, the diagram is redrawn, but not repositioned.

Implode

This function allows to create a sub-network.

4-3-619

Generation and Importation of


EMTP Files
Diagram Menu

You first select the rectangles enclosing the sub-networks to implode. Then you execute this
command to reduce this sub network to a small red rectangle (2 times the horizontal and vertical distance parameters, or 70x30 pixels by default). The outside branches with sub network
objects are combined into only one branch consisting of many straight line segments whose
colour matches that of the imploded rectangle.

Explode

This function allows to delete a sub-network.


You first select the imploded rectangles to explode. Then you execute this command to reset
the state of the enclosed sub network by re-displaying the real connections with the external
part of the sub network.

Enclose

You first select the elements and the buses (not fixed) to be enclosed (connections follow).
Then you execute this command to completely reposition the drawing with the enclosed objects grouped inside a red rectangle identifying the sub-network. To add a level, you can include in this selection already defined enclosing rectangles. The rectangles can be imploded
or not. However, an imploded rectangle will first be exploded before being enclosed so as to
reset the real connections. If you select objects already enclosed, they will be grouped at the
global level. In other words, to have many enclosing levels, you must select each time objects
at the same level.

Separate

You first select the rectangles representing the sub networks to separate. Then you execute
this command to reposition completely the diagram with the objects of the sub-network
brought up one level. The rectangles can be imploded or not.

Permute

Allows the user to permute two selected elements. By selecting two elements and clicking
this function, the drawing is repositioned considering the permutation.

Rotate normal

Part of the network can be selected and rotated clockwise.

Rotate inverted

Part of the network can be selected and rotated counter-clockwise.

Fuse back

Not supported yet.

Shows Model Yes/No

The internal model is superimposed over the network diagram. This model uses red rectangles, lines and text without any other type of structure. This option allows you to see what the
algorithm does with respect to what Unidraw executes. Selecting again disables the command
and the diagram is redrawn.

4-3-620

Generation and Importation of


EMTP Files
Configurable X Resources

Stretch Bus Yes/No

Stretches the buses to align the connections of the buses and the elements, and hence minimize the changes in direction of these branches. This option provides better results with a planar graph. Selecting again disables the command and the diagram is redrawn. This is the
initial default value.

Vertical yes/no

All buses are drawn horizontally or vertically.

Compact yes/no

All elements are drawn as close as possible to the bus.

Show structure yes/no

Not supported yet.

Unstretchable symbols yes/no

Not supported yet.

3.7 CONFIGURABLE X RESOURCES


The X resources defined in this section apply to automatic drawing and repositioning and are
shown with their default values. The more general *EtiquetteFont1 resource is also useful to
control the size of the diagram generated.
1 *SchParDistEntreElem:60 Minimum distance (horizontal) in pixels between elements

or buses aligned horizontally.


2 *SchParDistGauDroite:35 Minimum distance (horizontal) in pixels between elements

or buses and left and right limits of an enclosing rectangle.


3 *SchParDistHautBas:15 Minimum distance (vertical) in pixels between elements or
buses and top or bottom of an enclosing rectangle.
4 *SchParLongLien:40 Minimum length (vertical) in pixels of branches between ele-

ments and buses.


5 *SchParNbIter:20 Maximum number of iterations using the Barry centre method. In-

creasing this limit does not guarantee a better result due to the existing circuits when minimizing crossings. Decreasing this limit exceedingly can produce a diagram with too many
crossings. The suggested value is between 10 and 20.
6 *SchParTailleBarre:60 Minimum length of buses in pixels (when only one branch en-

ters or exits the bus).


The following resources were specified for the example shown in the figures:
*SchParDistEntreElem:
*SchParDistGauDroite:
*SchParDistHautBas:
*SchParLongLien:
*SchParNbIter:

32
32
16
8
10

4-3-621

Generation and Importation of


EMTP Files
Configurable X Resources

*SchParTailleBarre:
*EtiquetteFont1:

36
*-menu-medium-r-normal-*-12-100-* Menu 12

Example:
Examples of EMTP diagram generated automatically

Figure 3 - 1 Example of EMTP Diagram Generated Automatically

4-3-622

Generation and Importation of


EMTP Files
Configurable X Resources

Figure 3 - 2 Same Example with Elements at Normal Size

4-3-623

Generation and Importation of


EMTP Files
Configurable X Resources

PAGE LEFT INTENTIONALLY BLANK

4-3-624


Chapter 4
AUTOMATIC INITIALIZATION OF CONTROL PANEL PARAMETERS

Here is some detailed information on generating EMTP diagrams, particularly on the initialization of form parameters from an EMTP specification.
A EMTP Decoding
Conventions

The EMTP software does not use the concept of phase. Consequently, it is necessary to set
conventions to represent a three-phase network as a single-wire diagram.
The filter recognizes the a b c and n or A B C and N characters, as specifying the 3 phases
and the neuter only if these characters are in position 6 (last character) in the EMTP fields
bus1 and bus21.
The cards representing the a b and c phases of a branch must follow each other in the proper
order in the EMTP file.
The specific coding of the bus1 and bus2 fields described in the interemtp2 manual prioritizes
understanding node names. This generally produces a 4 character name. If only the phase notation is identified, then a 5 character node name is produced.
Any other convention or use of option 0 when calling the filter maintains the use of 6 characters in the bus1 and bus2 fields as a node name.

B Validation

The filter usually operates without messages, except when non-supported entities or errors in
the conventions described above occur. In this last case, a message in the language chosen by
the user is displayed on the standard output of the EMTP card that caused the error. Still, the
diagram is generated with the information that is actually partly recognized.

C Relationship
between Names
and Values

The filter uses the concept of appositional parameter to initialize the values obtained from
EMTP in the interface forms. In the ElementsEMTP file, the symbol name is followed by a
classified list of the parameter names ending with a semi-colon.
A name is a string of characters in between quotation marks. It can be either an identification
or a variable name as predefined in the interface. The number is unique and it is better to use
it. However, for clarity sake, it is also possible to use the identification which is on the form.
This identification can be modified. It can be long and can have blank spaces.
In the file shown above, the numbers were substituted for long names only. If the file is
changed to use numbers, such as adapting for form translation, the use of comments is advised
to ensure readability. The order is essential and it should not be modified.

1.See EMTP documentation for this terminology.


2.IREQ-94-247 Report - Base de donnes de rseau et interfaces by Gilbert Sybille

4-4-625

Automatic Initialization of Control


Panel Parameters

Any addition or deletion of a parameter to be initialized will require a change in the


filtre_emtp program, and occasionally, in its startup code for the interface.
Initializing parameters is optional. For example, the following diagrams are drawn but are not
the object of any initialization:
59Machine3
SwSectionneur (Switch)
PaParaf
PaTParaf_Shunt
To each parameter corresponds in the *.schrec file generated a value in the form of a character string in between quotation marks. This value can be an alphanumerical code, a scalar, a
vector or an array, based on the expected type in the form.
Real values with more than 10 characters are limited to 8 in the forms, except for arrays imported directly from EMTP cards. This is also the case for Marti models where values can
take up 26 positions. All the internal calculations are in double precision. The values are read
without any loss in precision. The output limit has been set only to save space in the forms
and the arbitrary limit of 8 can be modified as required.
The following line in the.ElementsEMTP file:
Rs

Phases Connexion R;

can correspond to the following line in the generated file:


N%12 Rs12

Rs 3 S [ 0.1 0.2 0.3 ];

where the R parameter is obtained from the following EMTP cards:

D Simplifying
EMTP Branches

CENA_aC1010a

.10000.00000.00000

CENA_bC1010b

.20000.00000.00000

CENA_cC1010c

.30000.00000.00000

The following changes are made to the original specification of the EMTP format in order to
simplify the diagram and make it more readable:
The arbitrary order of EMTP branches is changed so as to put the sources at the top of
the diagram and to unfold the branches as much as possible by moving out. This optimization is only applied with option 1 (default).
The RLC branches which come immediately after the sources are withdrawn and their
parameters integrated with the form for sources.
The resistances which follow the breakers are withdrawn and their parameters integrated with the form for breakers.
All the MEASURING breakers are withdrawn and the branches reconnected accordingly.

4-4-626

Automatic Initialization of Control


Panel Parameters

E Drawn and
Initialized EMTP
Elements

The EMTP format allows a wide variety of specifications of which some are used often and
others rarely. The elements processed by the filter are those for which a simulation is currently possible. The emphasis is on three-phase AC networks. Hence, DC branches are not initialized for the time being.
The capabilities of the filter will be increased as the simulation possibilities are developed.
For now, any EMTP card which is not recognized is the object of a message on the standard
output.
The values read on the EMTP cards are transformed automatically in the Ohm-Henry-Farad
system used for simulation.
The following sections briefly describe the EMTP branches recognized and explain the characteristics and limits for each case.

F RLC Elements

All cases with RLC elements are handled, including mutually coupled (51 52 53) R-L elements with Z0 and Z1.
By convention, a resistance of 0.00100 ohm is considered as specifying a switch.

G Lines

Transposed and untransposed lines are handled. Lines can have 3 phases, or coupled with 6
phases. Only Marti models with 2, 3 or 4 phases are processed.
lines are processed, but only with the $VINTAGE, 0 option.
Note that symbols with multiple connectors used for coupled lines and Marti lines reduce the
quality of the diagram because it is not possible to make permutations between connectors.
You will need to edit manually the diagram in such cases. However, the connectivity (and
therefore the simulation) is always accurate.

H Transformers

Linear and saturable transformers with 1, 2 or 3 windings are handled.


If there are neutral impedances, they are enclosed in the form and are not drawn separately.
The links originating from transformers with 3 connectors are not always drawn optimally.
You will need to edit the diagram manually in such cases. However, the connectivity (and
therefore the simulation) is always accurate.

I Breakers

Only timed breakers are handled, specified with an opening and a closing time.

J Generators

Only sinusoidal sources of type 14 are handled.

K Drawn but
Uninitialized
EMTP Elements

The following elements are only drawn in the diagram:


Code 59 - Machines
Code 92 - Arresters
Switches (RLC .00100 ohms)

L Handled but
Undrawn EMTP
Elements

The following elements, which are specified on many cards, are decoded to avoid many error
messages:

4-4-627

Automatic Initialization of Control


Panel Parameters

Code 98 - Non Linear Reactors


XFORMER Transformers
M EMTP
Characteristics
Considered

The two formats allowed ($VINTAGE,0 and $VINTAGE,1) are handled, except when specified explicitly. However, only fixed format cards are handled.
The inclusion of files ($INCLUDE) is carried out.
$DISABLE and $ENABLE cards are handled.
Comment cards are ignored.

N EMTP
Characteristics
Not Considered

The concept of reference branch (bus3 and bus4 non empty) is not processed by the filter.
When this occurs, a message is displayed To generate the diagram correctly, you need to copy
explicitly the referenced parameters on the appropriate card in the EMTP file and then remove reference.
This option is not handled for reasons of efficiency and also because of its erratic and nonstandardized use which can be hazardous in some situations. At the present time, this capability is rarely used since it is easy to repeat values with the Cut/Paste command.

4-4-628


Chapter 5
User Coded Model (UCM)

5.1 INTRODUCTION
User Code Model (UCM) is a Hypersim utility allowing users to build their particular models
which can not be built from existing models. As stated by its name, an UCM is coded by users
using C language in respecting some Hypersim rules.
The UCM allows to build models composed of power part and control part. The advantage of
using the UCM is that its power part is solved simultaneously with other power components.
The UCMs admittance is added to the admittance of the whole substation and all node voltages are solved together in the same step. This gives much more numerical stability than if
the power part of users model is represented as controlled sources which imply one-step delay.
Because the UCMs power part is solved together with other power elements, user must follow the same procedure used in Hypersim algorithm to solved node voltages. The control part
is simply a relationship between inputs and outputs and is simpler to model.
The purpose of this document is at the same time the user manual and the tutorial on the
UCM. It contains mainly the following parts:
Solution method in Hypersim: description of the way Hypersim models power elements, handles non-linearity, solves node equations, organizes parallel tasks. This helps
to understand the procedure to build an UCM.
User Code Model: description of the UCM and the procedure to build and use UCMs.
Progressive practices with UCM: series of examples allowing to learn and practice with
UCMs.

5-629

User Coded Model (UCM)


Introduction

5.2 SOLUTION METHOD IN HYPERSIM


5.2.1 Introduction

The Hypersim solution method is based mainly on the traditional EMTP technique. Using the
trapezoidal rule for integration, the EMTP converts most lump components of power system
into resistors and current sources and finally solve for node voltages.
Hypersim takes also the advantage of transmission lines to separate the whole power system
into parallel tasks and simulate them it in parallel computers.
This chapter will first describe the line model and show that events happened at one end of
the line will affect the other end only after a transmission delay. Different types of branches
will be analysed to show that they can be represented as resistor-source equivalents.
The simulation of a network is therefore summarized to the modelling of lines and the solution of node equations formed by resistors and current sources to find the node voltages. Nonlinear elements and switches will affect the model behaviour during the simulation and require Hypersim to recalculate them during the simulation.
Hypersim simulates also control systems which are simply represented as relationships of
outputs to inputs.
In the software point of view, Hypersim is composed of a GUI and a Simulation program.
The GUI is not simply a graphical interface but it also analyses the network, calculates models and generates codes necessary for the simulation. Most of simulation preparation works
are done with the GUI to optimize the simulation speed. The Simulation program can run either in real-time on parallel computers or in non real-time on workstations.

5.2.2 Line model


A

Conversion from 3
coupled phases
into 3 decoupled
modes

In a three-phase line, each phase is mutually coupled with other phases. To facilitate the line
simulation, the EMTP uses a technique to convert a mutually coupled three-phase line into 3
decoupled single-phase lines representing 3 decoupled modes. This is graphically represented
in 5 - 1.
In Hypersim, lines are modeled as follows:
Get three phase node voltages at each terminal K and M,
Convert three phase voltages into three-mode voltages:

V0
V1 = Tv

V2

Va
Vb

(EQ 1)

Vc

For an unbalanced line, T v is the solution of the following equation:


1

[ ] = T v ZYT v

5-630

(EQ 2)

User Coded Model (UCM)


Line model

V aK
V bK
V cK

I aK

I aM

I bK

I bM

I cK

I cC

V aM
V bM
V cM

Mutually coupled three-phase line

V cK

I bK
I cK

V 0K

I 0K

I 0M

V 1K

I 1K

I 1M

V 2K

I 2K

I 2M V 2M

I aM

V 0M
V 1M

Conversion
abc
012

V bK

I aK
Conversion
abc
012

V aK

I bM
I cC

Three uncoupled single-phase lines

V aM
V bM
V cM

Figure 5 - 1 : Conversion from three coupled phases into three uncoupled modes
where [ ] is a diagonal matrix containing the eigenvalues of the matrix product ZY.
For a balanced line:

1- ------31 -----1
T v = ------2 2
3
1- ------31 -----2
2

(EQ 3)

Calculate three mode currents using single phase line equation (represent each mode),
Convert three modes current into three phase currents,

Ia

I0

Ib = Ti I1
Ic

(EQ 4)

I2
t 1

Ti = [ Tv ]

(EQ 5)

Inject phase current to terminal nodes K and M.

5-631

User Coded Model (UCM)


Line model

B Model of singlephase line

Each mode (0, 1, 2) can then be represented as shown in 5 - 2. The current sources in this
figure are given as

h- V
mK ( t )
J mK = 1----------------------------------+ hI mK ( t ) +

2
R eq
V
+ h- ------------------------mM ( t )
1----------- + hI mM ( t )
2
R eq

(EQ 6)

where

R
R eq = Z c + -----T4

(EQ 7)

Zc ( RT 4 )
h = ----------------------------Zc + ( RT 4 )

(EQ 8)

is the mode number (0, 1, 2), Z c is the line characteristic impedance, is the transmission

delay along the line and R T is the line loss.


A similar expression can also be derived for J mM , the current source at terminal M .
Therefore a single mode line model is reduced at each terminal to an equivalent circuit composed of a current source in parallel with a resistor. The actual current source J mK at the terminal K and J mM at terminal M depend only on the past voltages and past currents at both
terminals. Equivalent at each terminal can therefore be calculated in parallel.
Model for frequency dependent lines uses the same philosophy but with a more complex
equivalent.

K
+

V mK

I mM

I mK
R
Z c + -----T4

J mK

J mM

R
Z c + -----T4

M
+

V mM

Figure 5 - 2 : Equivalent circuit of one mode of a transmission line


Each half (left and right) of the line equivalents will be converted from mode to phase form
and incorporated into the corresponding substation equation to be solved with other elements.

5-632

User Coded Model (UCM)

Substation modelling

5.2.3 Substation
modelling

In each substation, there are passive components interpreted as RLC elements which can be
linear or non-linear, circuit-breakers, different kinds of generation interpreted as voltage and
current sources equipped with control systems. Machines and motors are considered as sources with control systems.
Beside control systems, other equipments are power elements working at the power system
level voltages and currents. Power elements of a substation are interconnected together via
nodes. Power elements are not simulated sequentially one by one but rather simultaneously
all together in a single equation call the node equation:

YV = I

(EQ 9)

where Y is the substation admittance matrix, V is vector of node voltages and I is vector of
node currents (currents injected to nodes).
Control systems are modeled using the bloc diagram principle, either under graphic form
(Hypersim bloc diagram and Simulink bloc diagram) or coded in C/C++. Their inputs can be
node voltages and currents while their outputs can be used to control sources and switches.
A

RLC element

Trapezoidal integration
Hypersim, as EMTP, uses the trapezoidal integration technique, it means that
t

y(t) =

x ( t ) dt

(EQ 10)

will be evaluated as

y(t) = y( t T) + T
--- [ x ( t ) + x ( t T ) ]
2

(EQ 11)

where T is the calculation time step.

dy ( t )
dt

By the same rule, the derivative ------------ is approximated as a difference deduced from eq.
on page 633 as

y( t) y(t T )
1
---------------------------------- = --- [ x ( t ) + x ( t T ) ]
T
2

(EQ 12)

L branch
For a L branch connected between node k and node m, the following equation is applied:

di km ( t )
v k ( t ) v m ( t ) = L ---------------dt

(EQ 13)

or

5-633

User Coded Model (UCM)


Substation modelling

i km ( t ) = --1- [ v k ( t ) v m ( t ) ] dt
L

(EQ 14)

Using the trapezoidal integration rule given by eq. 11 above, we get

T- [ v ( t ) v ( t ) + v ( t T ) v ( t T ) ]
i km ( t ) = i km ( t T ) + ----m
k
m
2L k

(EQ 15)

vk ( t ) vm ( t )
- + i hist ( t T )
i km ( t ) = ----------------------------R eq

(EQ 16)

R eq = 2L
-----T

(EQ 17)

vk ( t T ) vm ( t T )
i hist ( t T ) = i km ( t T ) + -----------------------------------------------R eq

(EQ 18)

with

According to eq. on page 634, an L branch is equivalent to a resistor R eq in parallel to a


historic current source i hist as shown in 5 - 3. One can see that the historic current depends
only on the values of voltage and current of the previous step.
For a fix inductor, L is constant, therefore R eq is constant and need not to be recalculated at
each time step.

k
i km

k
2L
-----T

L
m

i hist
m

k
i km

k
T-----2C

i hist
m

Figure 5 - 3 : Equivalents of L and C branch using the trapezoidal rule

C branch
The current of a C branch connected between nodes k and m is given by

5-634

User Coded Model (UCM)

Substation modelling

d [ vk ( t ) vm ( t ) ]
i km ( t ) = C -------------------------------------dt

(EQ 19)

Replace the derivative by the difference equation given in on page 633, we get

i km ( t ) + i km ( t T )
[ vk ( t ) vm ( t ) ] [ vk ( t T ) vm ( t T ) ]
------------------------------------------- = C ----------------------------------------------------------------------------------------------2
T

(EQ 20)

[ vk ( t ) vm ( t ) ]
i km ( t ) = ---------------------------------- + i hist
R eq

(EQ 21)

T
R eq = ------2C

(EQ 22)

i hist = i km ( t T ) + 2C
------- [ v k ( t T ) v m ( t T ) ]
T

(EQ 23)

or

with

The C branch is also equivalent to a resistor given by eq. on page 635 in parallel with a
historic current source given by eq. on page 635 as shown in 5 - 3. Here again, for a fix
capacitor, R eq is constant. The historic current is recalculated at each time step using voltages and current of the previous time step.

Branch of RLC combination


For branches of different combinations of RLC elements, one can always write down the voltage-current relationship, replace integrals by eq. on page 633, derivative by eq. on
page 633, and get more or less complex forms of a equivalent resistor and a historic current.
B Current and
voltage sources

A current source i flowing from node k to node m has the effect of removing a current i from
node k and adding a current i to node m.
Voltage sources with output impedances are converted into current sources in parallel with
the same impedance using Thevenin-Norton conversion.

5-635

User Coded Model (UCM)


Substation modelling

i
Figure 5 - 4 : Example of an v-i characteristics of a non-linear resistor
C Non-linear
elements

Non-linear elements are treated as RLC elements, they are also equivalent to a resistor R eq
in parallel with a historic current i hist (if it is not a pure resistor).
Non-linearity is represented normally as a characteristic curve approximated by successive
linear segments. Due to the non-linearity, R eq is no longer constant and need to be recalculated for each time step. Theoretically, this must be done based on the conditions of the actual
time step, but Hypersim does it based on conditions obtained at the last time step because the
current results are not yet available. The change from one segment to the next can be one
time-step delayed. It is therefore a good practice to define the non linearity characteristic with
a smooth changing (more points where there are more changes and vice versa) to avoid the
hunting. An example of a non-linear resistance is shown in 5 - 4.
Hypersim works rather with the conductance Y eq = 1 R eq and splits it as follows:

Y eq = Y ini + Y add

(EQ 24)

where Y ini is the fixed part used as initial condition and Y add is the varying part used to update the conductance according to its operating point.

D Switches

Switches such as circuit-breaker and power electronic switches are simulated as resistors with
two values: one small value (milliohms) for closing state and one large value (meghoms) for
opening state. To know which resistor value to be used, Hypersim needs to know the state of
switched prior to the calculation of Y matrix.

E Generalized power

Each branch element described above is connected between node k and m of the substation
and is equivalent to a resistor Y eq = 1 R eq in parallel to a current source i hist .

element

A generalized power element is simply a black box connected to nodes k, m, n, etc. in the
substation. It is equivalent to a conductance (inverse of resistance) square matrix Y eq and a
vector of historic current I hist . Their dimensions are the number of nodes of the element.

5-636

User Coded Model (UCM)

Substation modelling

Y eq, kk of the matrix Y eq is its self conductance at node k while Y eq, km is the mutual conductance between node k and node m.
In case of a non-linear element, Y eq is splitted into two parts:

Y eq = Y ini + Y add

(EQ 25)

where Y ini is the fixed part used as initial condition and Y add is the varying part used to
update the conductance according to its operating point.
Therefore, all branches are also generalized elements connected to two nodes in the substation. Linear branches have Y add = [ 0 ] and Y ini = Y eq
F Solution of
substations node
equation

As explained above, all power elements, fix or non-linear, are equivalent to resistors in parallel with historic currents. In the node equation YV = I , Y becomes therefore a pure conductance matrix, I is the algebraic sum of currents, including source currents and historic
currents, injected to nodes; currents entering a node will have + sign, currents leaving have
- sign

( all self conductances connected to node i )

(EQ 26)

( all mutual conductances connected between nodes i and j )

(EQ 27)

Y ii =
Y ij =

Ii =

( source & historic currents entering node i )


( source & historic currents leaving node i )

(EQ 28)

Y has dimension n x n where n is number of nodes in the substation (excluding the ground
node), V and I are vectors of dimension n. A three-phase bus bar corresponds to 3 nodes.
Like each individual element, Hypersim splits also Y into a fixed part and a varying part:

Y = Y INI + Y ADD

(EQ 29)

Y INI is formed by the fixed parts Y ini of all elements and Y ADD is formed by varying parts
Y add of all elements.
The simulation of all power elements in a substation required to solve the node equation
YV = I where Y and I are known by eqs. 23 to 27 and V is the node voltage vector to be
found.
Hypersim solve the node equation using the LDU conversion:

Y = LDU

(EQ 30)

5-637

User Coded Model (UCM)


Substation modelling

where L is a lower triangular matrix with all values in the upper triangular equal to 0 and all
elements on the diagonal equal to 1, D is a diagonal matrix, U is a upper triangular matrix
with all values in the lower triangular equal to 0 and all elements on the diagonal equal to 1.
For example, if the matrix Y has a dimension 3x3, the LDU conversion will have the following form:

Y 11 Y 12 Y 13
Y 21 Y 22 Y 23
Y 31 Y 32 Y 33

1 0 0 D 11 0 0
= L 21 1 0 0 D 22 0
L 31 L 32 1

1 U 12 U 13
0 1 U 23

0 D 33 0 0

(EQ 31)

The LDU conversion is chosen instead of the LU conversion because when Y is symmetrical
T

(which is the case for most of substations node equation), U = L . Hypersim will take this
advantage if it exists to save the time needed to compute U.

The node equation YV = I now becomes


LDUV = I

(EQ 32)

This is solve in two steps: first, replace J = DUV and solve for J in

LJ = I

(EQ 33)

using the forward substitution (because L is lower triangular). Then solve for V in

DUV = J

(EQ 34)

using the backward substitution (because DU is an upper triangular matrix).


G LDU
decomposition

The LDU conversion is done based on the pivot technique used to nullify a particular element
in a matrix. Only the final formulas are listed here:
i1

D ii = Y ii

Dkk Lik Uki

(EQ 35)

k=0

L ii = U ii = 1

(EQ 36)

j1

1- Y
L ij = ----- ij D kk L ik U kj , i > j (elements in lower triangular)
D jj

k=1

(EQ 37)

1- Y
U ij = -----
D ii ij

5-638

i1

D
L
U
kk ik kj , i < j (elements in upper triangular) (EQ 38)
k=0

User Coded Model (UCM)

Substation modelling

At any time step, if Y does not change from the previous step, the LDU decomposition needs
not to be redone. If Y changes due to either a switching or a change of behaviour of some nonlinear elements, then the LDU decomposition must be recalculated.
In Hypersim, for saving space, matrices L, D and U are stored in a single Y LDU matrix as
shown in 5 - 5 for an example of 3 nodes: elements of D are on the diagonal, elements of L
and U (except their diagonal) are respectively in the lower left and upper right triangular.

D 11 U 12 U 13
L 21 D 22 U 23
L 31 L 32 D 33
Figure 5 - 5 : Example of a Y LDU matrix and a part of it which
needs to be recalculated if a resistor connected to node 2 changes
All equivalent resistors of power elements contributing to Y are connected either between a
node k and the ground node or between two nodes k and m. According to equations 35 to 38,
if a resistor connected to node k change its value, this will change at least the value of Y kk .
Therefore D ii , L ij and U ij , for all i andj k , have to be re-evaluated. In the Y LDU matrix
shown in 5 - 5, this corresponds to elements in the square bloc below and in the right starting
from D kk (k = 2 in this example).
For the purpose of saving the computation time, Hypersim orders the Y and Y LDU matrices
such as nodes connected to varying elements are grouped together and correspond to the lower right part of these matrices.
H Sparsity of Y
matrix

The Y matrix is normally sparse, it means that many elements are 0. To avoid calculation with
zero elements, Hypersim keep a matrix YF indicating the state of each element of Y:

YF ij = 1 if Y ij 0
YF ij = 0 if Y ij = 0
I Sequence of
operations needed
for node equation
solution

Hypersim preforms the simulation of substations in two parts: The off-line preparation executed on the workstation where the Hypersims GUI has been launched, and the simulation
executed either in real-time on parallel computer or in non-real-time on workstation. The non
real-time simulation can run either on the same workstation as the GUI or on another computer.

5-639

User Coded Model (UCM)


Substation modelling

Preparation
To calculate parameters for all power elements and the substations node equation, the preparation operations are:
1 Read elements parameters from the parameter form.
2 Define node signals: voltages and currents.
3 Define elements signals: voltages (except node voltages), currents (source, historic), control
signals.

4 Calculate the fixed part Y ini as initial admittance of all elements, as well as other elements
parameters needed during the simulation.

5 Calculate the fixed part Y INI and initialize the substation admittance matrix Y to this value.
6 Reorder Y such as varying elements will affect only the lower right part of Y
7 Download Y INI , Y ini and other simulation parameters needed to the simulation program.

Simulation
At each step of simulation, the following operations are required to simulate power elements
and solve the node equation of a substation:
1 Determine the commands of switches (used to turn them on or off)
2 Determine states of switches
3 If needed (some switches have changed their state or some non-linear elements have
changed their operation point), determine the area of matrix Y needed to be re-evaluated due
to elements which has changed their operating point.
Re-calculate this part of Y.

4 If needed (as above), perform the LDU decomposition of the lower-right bloc of the Y LDU
matrix

5 Calculate sources currents (voltage sources and current sources)


6 Add sources currents to node currents I.
7 Solve YV = I to calculate node voltages V.
8 Determine if a non-linear element changes its operating point. If it is the case, calculate its
new

Y add and update Y eq = Y ini + Y add for that element.

9 Calculate elements historic current I hist as well as all other signals it needs.
10 Re-initialize node currents I to [0] for the next step
11 Add elements historic currents I hist to node current I.
12 Calculate control functions

5-640

User Coded Model (UCM)

Parallel tasks in Hypersim

5.2.4 Parallel tasks in


Hypersim

As mentioned in the line modelling, lines are equivalent to current sources in parallel to resistors at each line end. Current sources at each end depend only on the past value of line voltages and currents of both ends. Variations at one end will therefore affect the other end at one
transmission delay later. The transmission speed is about the light speed which is 300 000 km/
s. A 30km line has a transmission delay of 100 s.
Due to the transmission delay, in a network composed of lines and substation as shown in 5
- 6a, following tasks can be performed in parallel:
Substation tasks solving substation node equations which include also line-end equivalents (current sources in parallel with resistors) and simple control systems,
Line tasks calculating line equivalents at each line end.
Certain complex substations can have complex control systems like an ac-dc conversion station, generation station with machine models. These substations are simulated
with many tasks: one for solving the node equation and others for control systems.
In non real-time mode running in a single processor, all tasks are given to the same processor.
With a parallel computer, tasks are distributed among parallel processors using a task mapping algorithm based on following criteria: execution time of each task, available time of processor, communications needed and communication link available, IO needed and IO
availability etc.

Simple
substation

Line

Complex
substation

Line

Simple
substation

Line
Task

Substation
Task

(a)

Substation
Task

Line
Task

Substation
Task

Substation
control
task #1

Substation
control
task #2
(b)

Figure 5 - 6 : A network structure and the corresponding parallel tasks

5-641

User Coded Model (UCM)


Introduction

5.3 USER CODED MODEL


5.3.1 Introduction

Hypersim provides a fairly large library of models for power elements and control blocs. User
can also build model graphically using subsystem containing Hypersims elements and blocs.
For some cases, available models and blocs in Hypersim are not sufficient to represent some
particular needs. This is why User Code Model (UCM) is introduced.

Bus1

Bus3

Bus2

Bus4

T1
In

UCM
T2

Figure 5 - 7 Example of an UCM inside Hypersim network


Graphically, as the example shown in 5 - 7, an UCM looks like all other Hypersim models. It
has power connectors (T1, T2 in the example) to connect to the network through bus bars,
control connectors (In in the example) to connect to measurement and control signals. The
behaviour of the UCM is completely defined by user in his code written in C, C++.
5.3.2 UCM
characteristics

A UCM is a component located inside a substation. It is simulated together with other components of the same substation. The UCM is composed of a power part and a control part.
The power part has external nodes (graphically visible) and internal nodes (invisible). This
part is represented as an admittance matrix which will be added to the substation admittance
matrix to solve the node equation. he UCMs admittance matrix can be linear or non-linear.
The control part perform user define control functions using signals from the UCMs control
inputs and internal signals, then produces signals to send to the UCMs control outputs or to
be used internally.
The UCM has its admittance matrix Y eq composed of a fixed part Y ini and a varying part

Y add :
Y eq = Y ini + Y add

5-642

(EQ 39)

User Coded Model (UCM)

Composition of an UCM

The admittance matrix has a certain degree of sparsity. This is indicated by the matrix Yfill:

Yfill ij = 0 if Y eq, ij = 0

(EQ 40)

Yfill ij = 1 if Y eq, ij 0

(EQ 41)

The dimension of all these matrices is the total number of external and internal nodes.
The UCM can have current sources as well as historic currents injected to internal / external
nodes.
The code provided by user has the purpose of calculating the admittance matrix, currents
sources, historic currents and perform all desired control functions.
5.3.3 Composition of
an UCM
A

Input parameters

B Calculated
parameters

Input parameters are those that will be in the parameter form. They can be modified once the
UCM is inserted in the Hypersim diagram.
These parameters are calculated by the Preparation function to be used in the Simulation
functions. The purpose is to avoid doing the same calculation at every time step, thus reducing
the simulation execution time.

C Power nodes

Power nodes can be external or internal. External nodes are graphically visible and will be
connected to bus bars. Internal nodes are not visible. Hypersim will include all UCMs internal and external nodes into the substations node equation and calculates their voltages. Hypersim provides utilities to user to access UCMs node voltages.

D Control IOs

Control inputs allow an UCM to get informations coming from other systems while control
outputs allow to send out informations computed by the UCM. The control outputs can be
connected to other systems or simply used for monitoring purpose.

E Preparation

The Preparation function prepares the parameters needed during the simulation. The objective is to reduced the calculation effort during the simulation.

function

Among the simulation parameters, there are


The fixed part of the admittance matrix Y ini ,
The sparsity indication matrix Y fill ,
Other parameters derived from the input parameters. For example: if the input parameter is the frequency f, but during the simulation the period T = 1 f is needed, then T
is calculated during the preparation to avoid its calculation at every time steps.
The Preparation function provided by user is compiled and linked with the Hypersims GUI.

5-643

User Coded Model (UCM)

Building an UCM through an example

F Simulation
functions

The Simulations functions of the UCM is compiled together with the simulation code generated by Hypersim to form the Simulation program. This simulation program runs either in
real-time or non real-time mode and communicates with the Hypersims GUI for simulation
control purpose.
The Simulation functions include: Initialization function executed only once at the beginning
of the simulation, preVNode (calculations done before the solution of node voltages) and
postVNode (calculation after the solution of node voltages) executed at every time step.

Initialization
This function is executed once only at the beginning of the simulation to perform various initializations needed by the UCM: set default parameters, initialize counters, etc.

Function preVNode
This function is called prior to the calculation of node voltages by Hypersim. It performs the
following tasks:
Determine switchs commands and switchs states
Calculate Y add by taking into account the switchs state and new non-linear operating
point.
Indicate nodes which are affected by changing in Y add
Calculate currents sources.
Note: Voltage sources must be converted to current sources using Norton equivalent

Function postVNode
This function is called after the calculation of node voltages to
Calculate historics currents,
Determine new operating point of non-linearities,
Perform control functions and other calculations.
5.3.4 Building an
UCM through
an example
A

Functional
description of the
UCM in example

The example of an UCM show in 5 - 8 covers many aspects in the UCM coding. It has current
sources, historic currents, non-linearity, internal and external nodes as well as control inputsoutputs.

5-644

User Coded Model (UCM)

Building an UCM through an example

Calculate
3 phase
sine wave
Rs

NI
IL

IL_a, IL_b, IL_c


L

VL_a
VL_b 3 phase
VL_c rectifier
Lvec

Vinc

VLrec

VLrec

Ind

NE

Figure 5 - 8 Example of an UCM with its functional content


The control input A fixes the amplitude of the 3 phase sine-wave voltages source which has
an output resistor Rs. The source resistor is then connected with a non-linear inductor L
through an internal node NI. The other end of the inductor is connected to an external node
NE to be connected to a Hypersim network (internal node can not be connected to a Hypersim
network). The three phase current of the inductor IL_a, IL_b, IL_c are outputted to a multiplex port IL for monitoring purpose. The three-phase voltages across the inductor are rectified and send to a output port VLrec.
The non-linear inductor has its value L depending on the rectified voltage VLrec as shown
also in 5 - 8. The output Ind indicate the actual step number on the non-linear curve.
B Parameters

Input parameters
Rs: internal resistor of voltage source
Lvec, Vinc, Ldim: the non linear inductor depends on the rectified three-phase voltage across it. It is define as a table Lvec of Ldim inductance values picked at regular
intervals of voltage Vinc.
freq: frequency of the source.

Calculated parameters and other parameters


used during the simulation
GaddVec: table of additional conductance values (to be added to the initial value to
get actual value) corresponding to Lvec. It is calculated as follows:
Lo = Lvec[0]: first value in table Lvec.
GLo = T/(2 * Lo): conductance equivalent to Lo. T is calculation time step.
5-645

User Coded Model (UCM)

Building an UCM through an example

GaddVec[i] = T/(2 * Lvec[i]) - GLo


Lindex: indexes in the table GaddVec to be used to obtain current value of conductance for each phase.
Lchanged: Indication if inductor has changed it value.
omega: angular frequency = 2 * freq.
C Connectors

Power nodes
NE: three-phase external node. It is visible to allow user to connect it to a three-phase
bus bar.
NI: three-phase internal node. It is not graphically visible on the Hypersim diagram,
but Hypersim calculates its voltages and makes them available to user.

Control Inputs Outputs


A: control input which determines the amplitude of the voltage source.
IL: multiplex output port containing the three phase currents IL_a, IL_b, IL_c of
the inductance.
VLrec: control output giving the three-phase rectified value of the inductors voltages.

Current sources
Currents sources are named (by user) Isrc_a, Isrc_b, Isrc_c. They are calculated
by dividing the voltage source value to its internal resistor Rs.
Note : For a multi-phase currents, their name must be terminated by _a, _b, _c.

Historic currents
The non-linear inductor has historic currents. They are named (by user) Ihist_a,
Ihist_b, Ihist_c and calculated according to the EMTP model of inductor.
Note : For a multi-phase historic currents, their name must also be terminated by _a, _b,
_c.
D UCM utilities
available to user

Followings are various utilities (under #define forms) to provide communication between
Hypersim and the UCM:
double ucmVNode (int nodeNum): obtain the node voltage calculated by Hypersim for node number nodeNum which can be the node order number (0, 1, 2, ...) or its
symbolic name (NE_a, NE_b, ...)
Ex: ucmVNode(0) or ucmVNode(NE_a)

5-646

User Coded Model (UCM)

Building an UCM through an example

double ucmYini(int node1, int node2): element of the matrix Y ini of the
UCM corresponding to row node1 and column node2. Y ini is calculated by user but
the space for this matrix is allocated by Hypersim.
Ex: ucmYini (NI_a, NI_a) = (1.0/Rs) + (1.0/GL)
or ucmYini(0, 0) = (1.0/Rs) + (1.0/GL)
double ucmYadd(int node1, int node2): element of the matrix Y add of the
UCM corresponding to row node1 and column node2. Y add is calculated by user
but the space for this matrix is allocated by Hypersim.
Ex: ucmYadd(NI_a, NE_a) = -GaddVec[0]
int ucmYfill(int node1, int node2): element of the matrix Y fill of the
UCM corresponding to row node1 and column node2. Y fill is determined by user
but the space for this matrix is allocated by Hypersim.
Ex: ucmYfill (1,2) = 0
int ucmNodeChange(int node): nodeth element of vector NodeChange. this
vector is also allocated by Hypersim.
Ex: ucmNodeChange(NE_b) = 1
double ucmTimeStep: obtain the current simulation time step.
Ex: G = ucmTimeStep / (2.0 * L)
E Editing the UCM

Before starting to build a new UCM, select the preferred editor by the command
setenv EDITOR myEditor
myEditor is either vi, xemacs, gedit, etc.

To start editing an UCM from scratch, go into the directory where the UCM will be
constructed (edited. compiled) and launch the script
ucm myUCM
myUCM is the UCM name. In our case we choose Example as the UCM name.
If this is a new UCM, the editor of your choice will be activated and filled with a documented
template to allow user to fill various sections of an UCM definition file named
ucm_myUCM.def, in our case the UCM definition file will be ucm_Exemple.def.
When the editing of the UCM definition file is completed, save it and exit from the editor.
The ucm script will continue to check for errors and build the UCM codes required by Hypersim.
If myUCM is an already existing UCM, the script will not activate the editor but goes right to
the error checking and building codes.

5-647

User Coded Model (UCM)

Building an UCM through an example

To modify an existing UCM, just edit the ucm_myUCM.def file, save it and launch again
the script
ucm myUCM

Naming conventions
Many utilities provided by Hypersim start with three letters ucm. Therefore DO NOT
use variable or function name starting with ucm (for example ucmFreqency) to
avoid duplication error.
Although power nodes are entered as multiphase, all calculation must be done on perphase basis. Single phase node is specified either by nodeName_phase (for example
NI_a) or by its ordering number. As with our example above, nodes are numbered and
named as follows (if NE is defined before NI):
0: NE_a
1: NE_b
2: NE_c
3: NI_a
4: NI_b
5: NI_c
Name of multiphase current sources and historic currents must be terminated with _a,
_b, _c, etc. to indicate the phase they belong to. Ex: Isrc_a, Ihist_b.
User must declare variables and functions he uses except certain variables which are
mandatory for UCM. They are allocated by Hypersim and user can access to them by
UCM utilities described above. The mandatory variables already allocated by Hypersim are:

Y ini : fixed part of the UCM admittance matrix,


Y add : variable part of the UCM admittance matrix,
Y fill : matrix indicating the sparsity of the UCM admittance matrix,
NodeChange: vector indicating which node has been affected by non-linearity.
NodeChange[i] = 1 if node i has been affected,
NodeChange[i] = 0 if node i has not been affected,
Input parameters, Calculated parameters, Control IOs are named according to C conventions (but avoid to start with 3 letters ucm). They are defined in their appropriate
section in the UCM file and must not be re-declared in the function sections.

5-648

User Coded Model (UCM)

Building an UCM through an example

UCM generated files and directories


For a UCM named myUCM, one directory and many files are generated. Among them, users
may be interested to look into following files and directory for more understanding. But beside the Definition file (file with extension .def), user must not modify other files.
Definition file
generated code directory containing following
files:

ucm_myUCM.def
myUCM_ucm_gen
ucm_myUCM_prep.h
ucm_myUCM_prep.c
ucm_myUCM_sim.h
ucm_myUCM_sim.c

include file for the Preparation function


Preparation function
include file for Simulation functions
Simulation functions

UCM definition file


The UCM definition file to be edited for the UCM Example is named ucm_Exemple.def
and is presented below. All lines started with %% are comments in the template to explain the
format of data to be entered by user. The file contains various sections which correspond to
the UCM building procedure described above.
The UCM Preparation and Simulation functions are coded according to standard C.
User entries are in bold face.

%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%
%%

UCM Model Definition File -- Generated from:


Model Example definition file -- Date: Tue Mar 22 16:16:10 EST 2005
----------------------------------------------------------------------------Definition of a user's created Hypersim model
--------------------------------------------Comments used by the definition file are preceded by this string: "%%"
***************************
* DO NOT MODIFY COMMENTS! *
***************************
Only edit zones between comments.
Follow directives describing format of data.
This file is divided en 3 major sections : General description,
Preparatory data preprocessing and Model simulation.
Here is the file general structure :
I- Model description.
1- General informations or parameters.
2- Model's documentation.
3- Form parameters (tunables).
3.1- General parameters table.
3.2- (Load Flow parameters table. NOT IMPLEMENTED!!!)
4- Control IOs.
5- Network nodes.
5-649

User Coded Model (UCM)

Building an UCM through an example

%% 6- Current sources.
%% 7- Historical currents.
%%
%% II- Preparatory data preprocessing.
%% 8- Calculated values.
%%
8.1- Calculated parameters table.
%%
8.2- (Calculated Load Flow values. NOT IMPLEMENTED!!!)
%%
8.3- Preparation function code.
%%
8.3.1- Function's global code.
%%
8.3.2- Parameters & initial admittance matrix (Yini) calculation code.
%%
8.3.3- (Load Flow results calculation code. NOT IMPLEMENTED!!!)
%%
8.4- Includes paths list.
%%
8.5- Required libraries list.
%%
8.6- Required libraries paths list.
%%
%% III- Model simulation.
%% 9- Simulation code.
%%
9.1- Historical values table.
%%
9.2- Test points table.
%%
9.3- Simulation functions global code.
%%
9.4- Simulation initialization function.
%%
9.5- Before nodes voltage calculation function code.
%%
9.5.1- Sources calculation.
%%
9.5.2- Command selection.
%%
9.5.3- Admittances matrix calculation (YMadd).
%%
9.6- After nodes voltage calculation function code.
%%
9.6.1- Historical values calculation.
%%
9.6.2- Commands outputs calculation.
%%
9.6.3- Determine nodes to recalculate.
%%
9.7- Includes paths list.
%%
9.8- Required libraries list.
%%
9.9- Required libraries paths list.
%%
%% ----------------------------------------------------------------------------%% Beginning of model definition:
%% ----------------------------------------------------------------------------%%
%% I- Model description.
%%
%% 1- General informations or parameters.
%%
----------------------------------%%
%%
UCM_NAME:
Model Unique Name, already assigned
%%
UCM_TYPE:
Model type (Choice of NetworkElement or CommandBlock)
%%
Default: NetworkElement.
%%
UCM_CATEGORY: Model category (Breaker, Transformer, etc.)
%%
UCM_VERSION: User's model version number (in a string)
%%
UCM_EXEC_TIME: Estimated model's average simulation step time.
%%
Default: 5.0e-6 s.
%%
UCM_DESCRIPTION: Short description of model (one phrase).
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN GENERAL INFORMATION -- Enter or modify general information
UCM_NAME
UCM_TYPE
UCM_CATEGORY
UCM_VERSION
UCM_EXEC_TIME
UCM_DESCRIPTION

=
=
=
=
=
=

Example
NetworkElement
User

1.0
5.0e-6
Voltage source with non-linear inductor

%% END GENERAL INFORMATION


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5-650

User Coded Model (UCM)

Building an UCM through an example

%%
%% 2- Model's documentation.
%%
---------------------%%
%%
Enter text or reference after comments.
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN DOCUMENTATION -- Enter model's documentation after this line...
Three-phase sine-wave voltage source with
- Programmable amplitude of sine waves
- Voltage sources have resistor in series with non-linear inductor
at output
- Inductor voltages are rectified and sent out for display

%% END DOCUMENTATION
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 3- Form parameters (tunables).
%%
%%
Form parameters can be changed by the user, through an editable form
%%
or by any other public mean. Parameters definitions
%%
are in a tabular form.
%%
%%
3.1- General parameters table (10 columns).
%%
Contains the general parameters of the model.
%%
%%
Format: ( 10 columns records)
%%
%%
Name Tag Units Type Size Default Min Max Flags Description
%%
---- --- ----- ---- ---- ------- --- --- ------ ----------%%
%%
Columns descriptions:
%%
%%
Name
: Unique name of parameter (in model's scope).
%%
Tag
: Descriptive name to use in forms.
%%
Units
: Parameter's units.
%%
Text field : Must follows the SI symbols definitions.
%%
Enter a "-" when not used
%%
Type
: Type of parameter
%%
Enter: intInteger value(s)
%%
double Real value(s)
%%
Size
: Parameter size (1->n).
%%
1 defines a scalar.
%%
Default
: Default value(s) of parameter.
%%
v : Default value for a scalar or an array.
%%
(all array's cell will have the same value).
%%
[v1 v2 v3 ... vn] : Default values for an array.
%%
The last value will be propagated to remaining of array
%%
if the default value set is smaller than the array.
%%
Min
: Minimum value allowed.
%%
Max
: Maximum value allowed.
%%
Flags
: Ored values of flags definitions or '-'.
%%
Available values :
%%
NOT_SIMUL_MOD : Cannot be modified during simulation.
%%
Description : Short description of parameter (BETWEEN DOUBLE QUOTES)
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN TUNABLE PARAMETERS -- Enter parameters table after this line...
Rs

"Rs"

Ohm double 1 0.01 0.0 1.0e12 - "Rs"

5-651

User Coded Model (UCM)

Building an UCM through an example

Lvec
10.0
Vinc
Ldim
freq

"Lvec"
H
- "Lvec"
"Vinc" V
"Ldim" "freq" Hz

double 9 [1.0 0.60 0.36 0.22 0.13 0.08 0.04 0.03 0.01] 0.0
double 1 500 0.0 1000 - "Vinc"
int
1 9 0.0 10.0 - "Ldim"
double 1 60.0 30.0 90.0 - "freq"

%% END TUNABLE PARAMETERS


%%

3.2- Load Flow parameters NOT IMPLEMENTED!!!

%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 4- Control IOs.
%%
-----------%%
%%
Control IOs will be visible on network schematics as inputs
%%
and outputs connectors.
%%
%%
Control IOs definitions table (7 columns).
%%
%%
Format: ( 7 fields records)
%%
%%
NOTE: All control connectors have a UNITARY width
%%
but they can be grouped.
%%
%%
Name Units Type Direction Position Group Description
%%
---- ----- ---- --------- -------- ----- ----------%%
%%
Fields descriptions:
%%
%%
Name
: Connector's unique identifier (tag).
%%
%%
Units
: Signal's units.
%%
Text field: use the official SI symbols.
%%
Enter a "-" when not used
%%
Type
: Signal type
%%
Enter: int
: Integer
%%
double : Real double precision
%%
Direction
: Enter: in
For model's input signal
%%
out For model's output signal
%%
Position
: Position of connector around the Ucm box
%%
in schematic.
%%
Choice of :
%%
left, right, top, bottom, auto
%%
Group
: Group name or "-" for "no group".
%%
All the connectors with the same group name
%%
will use a single "multiplexed" connector
%%
bearing the group name.
%%
Description
: Short description of connector.
%%
(BETWEEN DOUBLE QUOTES)
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CONTROL IOS -- Enter control IOs table after this line...
A
IL_a
IL_b
IL_c
VLrec
Ind

5-652

V
A
A
A
V
-

double
double
double
double
double
double

in
out
out
out
out
out

auto
auto
auto
auto
auto
auto

I
I
I
-

"Voltage Amplitude"
"L current, phase a"
"L current, phase b"
"L current, phase c"
"Rectified L voltage"
"Current index in Lvec"

User Coded Model (UCM)

Building an UCM through an example

%% END CONTROL IOS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 5- Model nodes definitions table (6 columns).
%%
%%
%%
Format: ( 6 fields records)
%%
%%
Name Phases
IntExt Position Connect NL element Description
%%
---- -------- ------ -------- ------------------ ----------%%
%%
Fields descriptions:
%%
%%
Name
: Node's unique identifier.
%%
%%
Phases
: Number of phases.
%%
Text field: Enter a number (1, 3) or
%%
0 for dynamic number of phases.
%%
IntExt
: Nodes can be internal or external.
%%
An external node has a connection to the network
%%
and will be visible as a "network connector"
%%
on the schematic.
%%
Values : intern/extern
%%
Position
: Position of connector around the Ucm box
%%
in schematic (external nodes only!).
%%
Choice of :
%%
left, right, top, bottom, auto
%%
or '-' : Non applicable.
%%
Connect NL element :
%%
Indicates if a non linear element is connected
%%
to this node.
%%
Text field : Enter "yes" or "no".
%%
Description
: Short description of node.
%%
(BETWEEN DOUBLE QUOTES)
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN NODES DEFINITIONS -- Enter nodes table after this line...
NE
NI

3
3

extern
intern

top
-

yes
yes

"Network Connection"
"Internal node"

%% END NODES DEFINITIONS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 6- Current sources definitions table (single phase).
%%
%%
%%
Format: ( 3 fields records)
[1] o +
%%
|
%%
Name Pos. End conn. Neg. End conn.
|
%%
---- -------------- -------------_|_
%%
/ ^ \ I
%%
Fields descriptions:
\_|_/
%%
|
%%
Name
: Current source unique identifier.
|
%%
(Append phase suffix : _a, _b, etc.) [2] o %%
if applicable.
%%
Pos. End conn. : Positive end connection point [1].
%%
Neg. End conn. : Negative end connection point [2].
%%
%%
Connections points accepted values:
%%

5-653

User Coded Model (UCM)

Building an UCM through an example

%%
Node name
: The name of a node defined in section 4.
%%
ground
: Connected to ground.
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CURRENT SOURCES -- Enter sources table after this line...
Isrc_a
Isrc_b
Isrc_c

NI_a
NI_b
NI_c

ground
ground
ground

%% END CURRENT SOURCES


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 7- Historical currents definitions table (single phase).
%%
%%
%%
Format: ( 3 fields records)
[1] o +
%%
|
%%
Name Pos. End conn. Neg. End conn.
|
%%
---- -------------- -------------_|_
%%
/ ^ \ I
%%
Fields descriptions:
\_|_/
%%
|
%%
Name
: Historical current unique identifier.
|
%%
(Append phase suffix : _a, _b, etc.) [2] o %%
if applicable.
%%
Pos. End conn. : Positive end connection point [1].
%%
Neg. End conn. : Negative end connection point [2].
%%
%%
Connections points accepted values:
%%
%%
Node name
: The name of a node defined in section 4.
%%
ground
: Connected to ground.
%%
: Not connected
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN HISTORICAL CURRENTS -- Enter historical currents table after this...
Ihist_a
Ihist_b
Ihist_c

NE_a
NE_b
NE_c

NI_a
NI_b
NI_c

%% END HISTORICAL CURRENTS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% II- Preparatory data preprocessing.
%%
%%
Due to performances issues, we must do as much work as possible
%%
before simulation starts. This part never runs in real time.
%%
%% 8- Calculated values (used as parameters).
%%
--------------------------------------%%
%%
Values to calculate before the simulation starts.
%%
Simulation tasks will use results of this calculations.
%%
%%
8.1- Calculated parameters table. (5 columns).
%%
Contains the calculated parameters definitions.
%%
%%
Format: ( 5 columns records)
%%
%%
Name Units Type Size Description

5-654

User Coded Model (UCM)

Building an UCM through an example

%%
---- ----- ---- ---- ----------%%
%%
Columns descriptions:
%%
%%
Name
: Unique name of parameter (in model's scope).
%%
Units
: Parameter's units.
%%
Text field : Must follows the SI symbols definitions.
%%
Enter a "-" when not used
%%
Type
: Type of parameter
%%
Enter: intInteger value(s)
%%
double Real value(s)
%%
Size
: Parameter size (1->n).
%%
1 defines a scalar.
%%
Description : Short description of parameter (BETWEEN DOUBLE QUOTES)
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CALCULATED PARAMETERS -- Enter parameters table after this line...
GaddVec
Lchanged
Lindex
omega
period

double
int
int
double
double

9
1
1
1
1

"GaddVec"
"Lchanged"
"Lindex"
"omega"
"period"

%% END CALCULATED PARAMETERS


%%

8.2- Calculated Load Flow values. NOT IMPLEMENTED!!!

%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
8.3- Preparation function code.
%%
Contains the code to produce the calculated values .
%%
%%
8.3.1- Functions global code.
%%
The following code will be at the beginning of the
%%
preparatory code file.
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATORY GLOBAL CODE -- Enter code under the appropriate comment...
/* 8.3.1.1 -- User includes */
#include <stdio.h>

/* 8.3.1.2 -- Definitions */
/* 8.3.1.3 -- Declarations */
/* 8.3.1.4 -- Local functions (static) */
%% END PREPARATORY GLOBAL CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
8.3.2- Parameters & initial admittance matrix (Yini) calculation code.
%%
%%
Enter code here to calculate the initial admittance matrix
%%
and the calculated parameters.
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATION FUNCTION CODE -- Enter code after this line...
int

i, j;

5-655

User Coded Model (UCM)

Building an UCM through an example

doubleGLo, Lo, Gs;


printf ("********** ucm_Exemple_prep: Rs = %f *******************\n", Rs);
/* Initialize Yini and Yfill to 0 */
for (i = 0; i < 6; i++)
{
for (j = 0; j < 6; j++)
{
ucmYini(i,j) = 0.0;
ucmYfill(i,j) = 0;
}
}
/* Compute Yini, Yfill */
Lo = Lvec[0];
GLo = ucmTimeStep / (2.0 * Lo);
Gs = 1.0 / Rs;
ucmYini(NI_a, NI_a) = Gs + GLo;
ucmYini(NI_b, NI_b) = Gs + GLo;
ucmYini(NI_c, NI_c) = Gs + GLo;
ucmYfill (NI_a, NI_a) = 1;
ucmYfill (NI_b, NI_b) = 1;
ucmYfill (NI_c, NI_c) = 1;
ucmYini(NI_a,NE_a) = ucmYini(NE_a, NI_a) = -GLo;
ucmYini(NI_b,NE_b) = ucmYini(NE_b, NI_b) = -GLo;
ucmYini(NI_c,NE_c) = ucmYini(NE_c, NI_c) = -GLo;
ucmYfill(NI_a,NE_a) = ucmYfill(NE_a,NI_a) = 1;
ucmYfill(NI_b,NE_b) = ucmYfill(NE_b,NI_b) = 1;
ucmYfill(NI_c,NE_c) = ucmYfill(NE_c,NI_c) = 1;
ucmYini(NE_a,NE_a) = GLo;
ucmYini(NE_b,NE_b) = GLo;
ucmYini(NE_c,NE_c) = GLo;
ucmYfill(NE_a,NE_a) = 1;
ucmYfill(NE_b,NE_b) = 1;
ucmYfill(NE_c,NE_c) = 1;
/* Calculer GaddVec (param de simulation) */
for (i = 0; i < Ldim; i++)
{
GaddVec[i] = (ucmTimeStep / (2.0 * Lvec[i])) - GLo;
}
/* Calculate other parameters */
omega = 2.0 * 3.141593 * freq;
period = 1.0 / freq;

5-656

User Coded Model (UCM)

Building an UCM through an example

%% END PREPARATION FUNCTION CODE


%%

8.3.3- Load Flow results function code. NOT IMPLEMENTED!!!

%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
8.4- "Includes" paths list.
%%
Enter paths of your include files separated by spaces after "=".
%%
Put an "\" at end of line to continue list on next line.
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATORY INCLUDES PATHS LIST -- Modify the following list...
UCM_PREP_INCLUDES_PATHS =
%% END PREPARATORY INCLUDES PATHS LIST
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
8.5- Required dependency libraries pathnames list.
%%
%%
Enter the pathnames of your dependency libraries
%%
separated by spaces after "=".
%%
Put an "\" at end of line to continue list on next line.
%%
%%
NOTE :
%%
%%
Use the following special names to select the proper paths and/or
%%
libraries names if needed. They will be replaced according to
%%
the system architecture.
%%
%%
<UCMA_DIR>
: Will be replaced by a directory name
%%
according to the computer/os
%%
combination you have.
%%
<UCMA_LIB_SUFFX> : Current library name suffix (Ex.: .a).
%%
<UCMA_LIB_RSUFFX> : Current dynamic library name suffix
%%
(Ex. : .so).
%%
<UCMA_LIB_PREFX> : Current library name prefix (Ex.: lib).
%%
%%
Exemples :
%%
%%
UCM_PREP_DEP_LIBS_PATHNAMES = \! Always the same library
%%
/usr/ucm/libmath.a
%%
%%
UCM_PREP_DEP_LIBS_PATHNAMES = \! Change according to architecture
%%
/user/ucm/libs/<UCMA_DIR>/<UCMA_LIB_PREFX>math<UCMA_LIB_SUFFX>
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATORY DEPENDANT LIBRARIES LIST -- Modify the following list...
UCM_PREP_DEP_LIBS_PATHNAMES =
%% END PREPARATORY DEPENDANT LIBRARIES LIST
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
8.6- Required libraries for preparatory functions.
%%
Enter full paths or lib notation (-Lpath -llibrary) of your
%%
libraries separated by spaces after "=".
%%
Put an "\" at end of line to continue list on next line.
%%
%%
ARCHITECTURE DEPENDANT PATHS: See NOTE in section 8.5
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATORY LIBRARIES LIST -- Modify the following list...
5-657

User Coded Model (UCM)

Building an UCM through an example

UCM_PREP_LIBRARIES =
%% END PREPARATORY LIBRARIES LIST
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% III- Model simulation.
%%
%% This sections deals with model's simulation topics.
%%
%% 9- Simulation code.
%%
%%
Code to simulate the model can be executed before or after the nodes
%%
voltages calculations. Code that change topology and cause
%%
recalculation of admittances matrix (YMadd) must be executed before.
%%
%%
9.1- Historical values table.
%%
%%
Contains the historical values of the model.
%%
Historical values are used to keep data from step to step.
%%
%%
Format: ( 5 columns records)
%%
%%
Name Type Size Default Description
%%
---- ---- ---- ------- ----------%%
%%
Columns descriptions:
%%
%%
Name
: Unique name of historical (in model's scope).
%%
Type
: Type of historical value
%%
Enter: intInteger value(s)
%%
double Real value(s)
%%
Size
: Historical value size (1->n).
%%
1 defines a scalar.
%%
Default
: Default value(s).
%%
v : Default value for a scalar or an array.
%%
(all array's cell will have the same value).
%%
[v1 v2 v3 ... vn] : Default values for an array.
%%
The last value will be propagated to remaining of array
%%
if the default value set is smaller than the array.
%%
Description : Short description of historical value
%%
(BETWEEN DOUBLE QUOTES)
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN HISTORICAL VALUES -- Enter the table after this line...
time double 1 0.0 "time"

%% END HISTORICAL VALUES


%%

9.2- (Test points table. NOT IMPLEMENTED!!!)

%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
9.3- Simulation functions global code.
%%
The following code will be at the beginning of the
%%
simulation functions file.
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN SIMULATION GLOBAL CODE -- Enter code under the appropriate comment...
/* 9.3.1 -- User includes */

5-658

User Coded Model (UCM)

Building an UCM through an example

#include <math.h>

/* 9.3.2 -- Definitions */
/* 9.3.3 -- Declarations */
/* 9.3.4 -- Local functions (static) */
%% END SIMULATION GLOBAL CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
9.4- Simulation initialization function.
%%
Code executed once before simulation starts.
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN SIMULATION INITIALIZATION FUNCTION CODE -- Enter code ->...
time = 0;
Lindex = 0;
Lchanged = 0;

%% END SIMULATION INITIALIZATION FUNCTION CODE


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
9.5- Before "nodes voltage calculation" function code.
%%
Code executed before "nodes voltages calculations".
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN BEFORE VOLTAGE CALCULATION CODE -- Enter code ->...
/* User code: calulate Yadd */
int i;
doubleVsrc_a, Vsrc_b, Vsrc_c;
doubleTwoPiOver3 = 2.094395333;

/* 2.0 Pi / 3 */

/* Calculate current sources */


Vsrc_a = A * sin (omega * time);
Vsrc_b = A * sin (omega * time - TwoPiOver3);
Vsrc_c = A * sin (omega * time + TwoPiOver3);
Isrc_a = Vsrc_a / Rs;
Isrc_b = Vsrc_b / Rs;
Isrc_c = Vsrc_c / Rs;
/* Compute Yadd if non-linearity changes */
for (i = 0; i < 6; i++)
ucmNodeChanged(i) = 0;
if (Lchanged)
{
ucmYadd(NI_a,NI_a) = GaddVec[Lindex];
ucmYadd(NI_a,NE_a) = -GaddVec[Lindex];
ucmYadd(NE_a,NE_a) = GaddVec[Lindex];
ucmYadd(NI_b,NI_b) = GaddVec[Lindex];

5-659

User Coded Model (UCM)

Building an UCM through an example

ucmYadd(NI_b,NE_b) = -GaddVec[Lindex];
ucmYadd(NE_b,NE_b) = GaddVec[Lindex];
ucmYadd(NI_c,NI_c) = GaddVec[Lindex];
ucmYadd(NI_c,NE_c) = -GaddVec[Lindex];
ucmYadd(NE_c,NE_c) = GaddVec[Lindex];
/* Indicate to Hypersim that nodes are affected by */
/* non-linear change */
ucmNodeChanged(NI_a) = ucmNodeChanged(NE_a) = 1;
ucmNodeChanged(NI_b) = ucmNodeChanged(NE_b) = 1;
ucmNodeChanged(NI_c) = ucmNodeChanged(NE_c) = 1;
}

%% END BEFORE VOLTAGE CALCULATION CODE


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
9.6- After "nodes voltage calculation" function code.
%%
Code executed after "nodes voltages calculations".
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN AFTER VOLTAGE CALCULATION -- Enter code ->...
doubleLo, GLo, GL;
doubleVL_a, VL_b, VL_c;
int index;
time += ucmTimeStep;
/* Calculate historic currents */
Lo = Lvec[0];
GLo = ucmTimeStep / (2.0 * Lo);
GL = GLo + GaddVec[Lindex];
VL_a = ucmVNode(NI_a) - ucmVNode(NE_a);
IL_a = VL_a*GL + Ihist_a;
Ihist_a = IL_a + VL_a*GL;
VL_b = ucmVNode(NI_b) - ucmVNode(NE_b);
IL_b = VL_b*GL + Ihist_b;
Ihist_b = IL_b + VL_b*GL;
VL_c = ucmVNode(NI_c) - ucmVNode(NE_c);
IL_c = VL_c*GL + Ihist_c;
Ihist_c = IL_c + VL_c*GL;
/* Compute 3-phase rectified voltage accross inductance */
VLrec = fabs (VL_a);
if (VLrec < fabs(VL_b))
VLrec = fabs(VL_b);
if (VLrec < fabs(VL_c))
VLrec = fabs(VL_c);
/* New operating point of L */

5-660

User Coded Model (UCM)

Building an UCM through an example

Lchanged = 0;
index = (int)(VLrec / Vinc);
if (index > Ldim-1)
index = Ldim - 1;
if (index < 0)
index = 0;
if (index != Lindex)
{
Lindex = index;
Lchanged = 1;
}
Ind = Lindex;
/* Other calculations */
time += ucmTimeStep;
if (time >= period)
time -= period;

/* To avoid truncation error */

%% END AFTER VOLTAGE CALCULATION CODE


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
9.7- "Includes" paths list.
%%
Enter paths of your include files separated by spaces after "=".
%%
Put an "\" at end of line to continue list on next line.
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN SIMULATION INCLUDES PATHS LIST -- Modify the following list...
UCM_SIMULATION_INCLUDES_PATHS =
%% END SIMULATION INCLUDES PATHS LIST
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
9.8- Required simulation dependency libraries pathnames list.
%%
Enter the pathnames of your libraries separated
%%
by spaces after "=".
%%
Put an "\" at end of line to continue list on next line.
%%
%%
ARCHITECTURE DEPENDANT PATHS: See NOTE in section 8.5
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN SIMULATION DEP LIBS LIST -- Modify the following list...
UCM_SIMULATION_DEP_LIBS_PATHNAMES =
%% END SIMULATION DEP LIBS LIST
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%%
9.9- Libraries required by simulation functions.
%%
Enter full paths or lib notation (-Lpath -llibrary) of your
%%
libraries separated by spaces after "=".
%%
Put an "\" at end of line to continue list on next line.
%%
%%
ARCHITECTURE DEPENDANT PATHS: See NOTE in section 8.5
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN SIMULATION LIBRARIES LIST -- Modify the following list...

5-661

User Coded Model (UCM)

Using an UCM in Hypersim diagram

UCM_SIMULATION_LIBRARIES =
%% END SIMULATION LIBRARIES LIST
%% END OF FILE

5.3.5 Using an UCM


in Hypersim
diagram

Launch Hypersim with the command hyper,


On the top tool bar, use the menu
Properties -> Directories -> User Code Bloc Directory
to define the directory (complete path) where UCMs are built and stored. Actually
User Code Bloc Directory stands for UCBs as well as for UCMs.
To put an UCM into the diagram, open the drawer System Tools, click on icon UCM,
then click in the diagram. A dialogue box will be pop up as shown in 5 - 9 to let user
choose the UCM to be used.

Figure 5 - 9 Dialogue box to choose an UCM and put into the Hypersim
diagram
In the dialogue box:
Form name is the name of the customized parameter form (not yet implemented).
The files with extension .ucm in the list are all UCMs available in the User Code
Bloc Directory defined above.
5-662

User Coded Model (UCM)

Management of library of UCMs

The selected UCM appears in the diagram with its power connectors representing external nodes and control IOs. Internal nodes are not visible.
The UCM can then be connected inside a Hypersim diagram as usual. The Example
UCM with a simple network is shown in 5 - 10.

Figure 5 - 10 The UCM Exemple used in a Hypersim diagram

Double click on an UCM will bring up its parameter forms which show the list of all
input parameters. User can change them as with any other model in Hypersim.
In the Simulation mode, point the UCM, right click and execute the command Edit Sensors to bring up the UCMs sensor list and choose those to be plotted in ScopeView.
Sensors available are
Current sources
Historic currents
Control IOs
To monitor any UCM internal signals, user must define them as control outputs such that they
will be accessed via the sensor list.
All sensor names, except for control inputs, have the same names as they are define in the
UCM file. Sensors of control inputs take the name of signals connected to them.
5.3.6 Management of
library of UCMs

An UCM can be put in Hypersims library and then it becomes accessible through the Hypersim component palette as any other model.
The procedure to put an UCM into Hypersims library is the same as with a sub-

system, a hyperlink model or an user code block (UCB). Refer to Part I, chapter
Model libraries for details.

5-663

User Coded Model (UCM)


Resistor

5.4 PROGRESSIVE PRACTICES WITH UCM


5.4.1 Resistor
A

Description

Build an UCM to represent a three-phase resistor connected in Y, the neutral is grounded. The
parameters of the UCM is the vector R[3] of 3 values of resistance. The resistors are connected to the external node T. Calculate the current in each phase and send them to control
outputs Ia, Ib, Ic which are grouped together and sent to connector I.

R[3]

B Codes

Ia,Ib,Ic
I

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN GENERAL INFORMATION -- Enter or modify general information
UCM_NAME
UCM_TYPE
UCM_CATEGORY
UCM_VERSION
UCM_EXEC_TIME
UCM_DESCRIPTION

=
=
=
=
=
=

Resistor
NetworkElement
User
"1.0"
5.0e-6
"Resistor 3 phase-ground" # Description du modele

%% END GENERAL INFORMATION


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN DOCUMENTATION -- Enter models documentation after this line...
Documentation de Exemple.
--------------------Three-phase resistor connected in Y grounded
%% END DOCUMENTATION
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN TUNABLE PARAMETERS -- Enter parameters table after this line...
R "R" - double 3 [1.0 1.0 1.0] 0.0 1.0e12 - "R"
%% END TUNABLE PARAMETERS
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

5-664

User Coded Model (UCM)


Resistor

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CONTROL IOS -- Enter control IOs table after this line...
Ia
Ib
Ic

A double out auto I "Ia"


A double out auto I "Ib"
A double out auto I "Ic"

%% END CONTROL IOS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN NODES DEFINITIONS -- Enter nodes table after this line...
T 3 extern bottom no "Network Connection"
%% END NODES DEFINITIONS
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CALCULATED PARAMETERS -- Enter parameters table after this line...
G

- double 3 "Equiv.conductance"

%% END CALCULATED PARAMETERS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATORY GLOBAL CODE -- Enter code under the appropriate comment...
/* 8.3.1.1 -- User includes */
#include <stdio.h>
%% END PREPARATORY GLOBAL CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATION FUNCTION CODE -- Enter code after this line...
int

i, j;

G[0] = 1.0 / R[0];


G[1] = 1.0 / R[1];
G[2] = 1.0 / R[2];
/* Initialization of Yini and Yfill */
for (i = 0; i < 3; i++)
{
for (j = 0; j < 3; j++)
{
ucmYini(i,j) = 0.0;
ucmYfill(i,j) = 0;
}
}
5-665

User Coded Model (UCM)


Inductor

/* Calculate Yini and define Yfill */


ucmYini(T_a, T_a) = 1.0 * G[0];
ucmYini(T_b, T_b) = 1.0 * G[1];
ucmYini(T_c, T_c) = 1.0 * G[2];
ucmYfill(T_a, T_a) = 1;
ucmYfill(T_b, T_b) = 1;
ucmYfill(T_c, T_c) = 1;
%% END PREPARATION FUNCTION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN AFTER VOLTAGE CALCULATION -- Enter code ->...
/* Calculate Resistor current and send them to control outputs */
Ia = ucmVNode(T_a) * G[0];
Ib = ucmVNode(T_b) * G[1];
Ic = ucmVNode(T_c) * G[2];
%% END AFTER VOLTAGE CALCULATION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

C Exercise

Build an UCM to represent a three-phase resistor connected in delta. Use control outputs to
send out phase-to-phase voltages and resistors currents.

5.4.2 Inductor
A

Description

Build an UCM to represent a three-phase inductor connected in Y, the neutral is grounded.


The parameters of the UCM is the vector Lval[3] of 3 values of inductance. The inductors
are connected to the external node T. Calculate the current in each phase and send them to
control outputs Ia, Ib, Ic which are grouped together and sent to connector I.

T
Ia,Ib,Ic
Lval[3]

B Codes

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN GENERAL INFORMATION -- Enter or modify general information
UCM_NAME
UCM_TYPE
UCM_CATEGORY
UCM_VERSION
UCM_EXEC_TIME

5-666

=
=
=
=
=

Inductor
NetworkElement
User
"1.0"
5.0e-6

User Coded Model (UCM)


Inductor

UCM_DESCRIPTION = "Linear Inductor" # Description du modele


%% END GENERAL INFORMATION
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN DOCUMENTATION -- Enter models documentation after this line...
Documentation de Exemple.
--------------------Three-phase linear inductor connected in Y grounded
%% END DOCUMENTATION
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN TUNABLE PARAMETERS -- Enter parameters table after this line...
Lval

"L" H double 3 [0.1 0.1 0.1] 0.0 1.0e12 - "Inductor values"

%% END TUNABLE PARAMETERS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CONTROL IOS -- Enter control IOs table after this line...
Ia
Ib
Ic

A double out auto I "Ia"


A double out auto I "Ib"
A double out auto I "Ic"

%% END CONTROL IOS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN NODES DEFINITIONS -- Enter nodes table after this line...
T 3 extern bottom no "Network Connection"
%% END NODES DEFINITIONS
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN HISTORICAL CURRENTS -- Enter historical currents table after this...
Ihist_a ground T_a
Ihist_b ground T_b
Ihist_c ground T_c
%% END HISTORICAL CURRENTS
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CALCULATED PARAMETERS -- Enter parameters table after this line...
G

- double 3 "Equiv.conductance of L"

%% END CALCULATED PARAMETERS


5-667

User Coded Model (UCM)


Inductor

%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATION FUNCTION CODE -- Enter code after this line...
int

i, j;

/* Calculte the equivalent conductances of L */


G[0] = ucmTimeStep / (2.0 * Lval[0]);
G[1] = ucmTimeStep / (2.0 * Lval[1]);
G[2] = ucmTimeStep / (2.0 * Lval[2]);
/* Initialization of Yini and Yfill */
for (i = 0; i < 3; i++)
{
for (j = 0; j < 3; j++)
{
ucmYini(i,j) = 0.0;
ucmYfill(i,j) = 0;
}
}
/* Initialize Yini to the equiv. conductance of L */
/* Define Yfill */
ucmYini(T_a, T_a) = G[0];
ucmYini(T_b, T_b) = G[1];
ucmYini(T_c, T_c) = G[2];
ucmYfill(T_a, T_a) = 1;
ucmYfill(T_b, T_b) = 1;
ucmYfill(T_c, T_c) = 1;
%% END PREPARATION FUNCTION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN AFTER VOLTAGE CALCULATION -- Enter code ->...
Ia = ucmVNode(T_a) * G[0] + Ihist_a;
Ihist_a = Ia + ucmVNode(T_a) * G[0];
Ib = ucmVNode(T_b) * G[1] + Ihist_b;
Ihist_b = Ib + ucmVNode(T_b) * G[1];
Ic = ucmVNode(T_c) * G[2] + Ihist_c;
Ihist_c = Ic + ucmVNode(T_c) * G[2];
%% END AFTER VOLTAGE CALCULATION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

C Exercise

5-668

Build an UCM to represent a three-phase RL circuit. R and L are in parallel in each phase.
Use control outputs to send out monitoring signals as needed.

User Coded Model (UCM)


Series Resistor-Inductor

5.4.3 Series ResistorInductor


A

Description

Build an UCM to represent a three-phase RL circuit. R and L are in series and connected together by an internal node Ti. L is grounded while R is connected to the outside by an external
node T.

R[3]

IRa,IRb,IRc

IR

Ti
L[3]

B Code

ILa,ILb,ILc

IL

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN GENERAL INFORMATION -- Enter or modify general information
UCM_NAME
UCM_TYPE
UCM_CATEGORY
UCM_VERSION
UCM_EXEC_TIME
UCM_DESCRIPTION

=
=
=
=
=
=

RL
NetworkElement
User
"1.0"
5.0e-6
"R and L in series" # Description du modele

%% END GENERAL INFORMATION


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN DOCUMENTATION -- Enter models documentation after this line...
Documentation de Exemple.
--------------------Three-phase series R-L connected in Y grounded
%% END DOCUMENTATION
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN TUNABLE PARAMETERS -- Enter parameters table after this line...
L
R

"L" H double 3 [0.01 0.01 0.01] 0.0 1.0e12 - "Inductors"


"R" ohm double 3 [0.1 0.1 0.1]
0.0 1.0e12 - "Resistors"

%% END TUNABLE PARAMETERS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

5-669

User Coded Model (UCM)


Series Resistor-Inductor

%% BEGIN CONTROL IOS -- Enter control IOs table after this line...
ILa
ILb
ILc
IRa
IRb
IRc

A
A
A
A
A
A

double
double
double
double
double
double

out
out
out
out
out
out

auto
auto
auto
auto
auto
auto

IL
IL
IL
IR
IR
IR

"ILa"
"ILb"
"ILc"
"IRa"
"IRb"
"IRc"

%% END CONTROL IOS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN NODES DEFINITIONS -- Enter nodes table after this line...
T 3 extern bottom no "Network Connection"
Ti 3 intern no "Internal node"
%% END NODES DEFINITIONS
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN HISTORICAL CURRENTS -- Enter historical currents table after this...
Ihist_a ground Ti_a
Ihist_b ground Ti_b
Ihist_c ground Ti_c
%% END HISTORICAL CURRENTS
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CALCULATED PARAMETERS -- Enter parameters table after this line...
GL
GR

- double 3 "Equiv.L conductance"


- double 3 "Equiv.R conductance"

%% END CALCULATED PARAMETERS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATORY GLOBAL CODE -- Enter code under the appropriate comment...
/* 8.3.1.1 -- User includes */
#include <stdio.h>

/* Needed for using printf */

%% END PREPARATORY GLOBAL CODE


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATION FUNCTION CODE -- Enter code after this line...
int
5-670

i, j;

User Coded Model (UCM)


Series Resistor-Inductor

/* Calculate equivalent L conductances */


GL[0] = ucmTimeStep / (2.0 * L[0]);
GL[1] = ucmTimeStep / (2.0 * L[1]);
GL[2] = ucmTimeStep / (2.0 * L[2]);
/* Calculate Rs conductances */
GR[0] = 1.0 / R[0];
GR[1] = 1.0 / R[1];
GR[2] = 1.0 / R[2];
/* Initialize Yini and Yfill to 0 */
for (i = 0; i < 6; i++)
{
for (j = 0; j < 6; j++)
{
ucmYini(i,j) = 0.0;
ucmYfill(i,j) = 0;
}
}
/* Calculate Yini and define Yfill */
ucmYini(Ti_a, Ti_a) = GL[0] + GR[0];
ucmYini(Ti_b, Ti_b) = GL[1] + GR[1];
ucmYini(Ti_c, Ti_c) = GL[2] + GR[2];
printf ("**** Preparation: GL[0] = %f, GR[0] = %f, ucmYini(Ti_a,Ti_a) = %f *****\n",
GL[0], GR[0], ucmYini(Ti_a, Ti_a));
ucmYini(T_a, T_a) = GR[0];
ucmYini(T_b, T_b) = GR[1];
ucmYini(T_c, T_c) = GR[2];
ucmYini (Ti_a, T_a) = ucmYini (T_a, Ti_a) = -GR[0];
ucmYini (Ti_b, T_b) = ucmYini (T_b, Ti_b) = -GR[1];
ucmYini (Ti_c, T_c) = ucmYini (T_c, Ti_c) = -GR[2];
ucmYfill(T_a, T_a) = 1;
ucmYfill(T_b, T_b) = 1;
ucmYfill(T_c, T_c) = 1;
ucmYfill(Ti_a, Ti_a) = 1;
ucmYfill(Ti_b, Ti_b) = 1;
ucmYfill(Ti_c, Ti_c) = 1;
ucmYfill(Ti_a, T_a) = ucmYfill(T_a, Ti_a) = 1;
ucmYfill(Ti_b, T_b) = ucmYfill(T_b, Ti_b) = 1;
ucmYfill(Ti_c, T_c) = ucmYfill(T_c, Ti_c) = 1;
%% END PREPARATION FUNCTION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN AFTER VOLTAGE CALCULATION -- Enter code ->...
ILa = ucmVNode(Ti_a) * G[0] + Ihist_a;
5-671

User Coded Model (UCM)


Voltage source

Ihist_a = ILa + ucmVNode(Ti_a) * G[0];


ILb = ucmVNode(Ti_b) * G[1] + Ihist_b;
Ihist_b = ILb + ucmVNode(Ti_b) * G[1];
ILc = ucmVNode(Ti_c) * G[2] + Ihist_c;
Ihist_c = ILc + ucmVNode(Ti_c) * G[2];
IRa = (ucmVNode(T_a) - ucmVNode(Ti_a)) * GR[0];
IRb = (ucmVNode(T_b) - ucmVNode(Ti_b)) * GR[1];
IRc = (ucmVNode(T_c) - ucmVNode(Ti_c)) * GR[2];
%% END AFTER VOLTAGE CALCULATION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

C Exercise

Instead of considering R and L as 2 separated branches as the example above, combine them
together as a combined RL single branch (there is no more internal node). Write down its
equivalent equation using trapezoidal integration rule and build an UCM to represent it. Compare results with those of the example above.

5.4.4 Voltage source


A

Description

Build a tree-phase sine-wave voltage source. The parameter Amp control the sine wave amplitude and the parameter freq control its frequency. The voltage sources are connected in
Y grounded and each phase have an inductor Ls at its output.
The control outputs I_a, I_b, I_c at the connector I send out the source currents and the
control outputs Db1, Db2, Db3 at connector Db are use for debugging purpose.

T
I_a,I_b,I_c
Ls[3]

I
Db

B Codes

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN GENERAL INFORMATION -- Enter or modify general information
UCM_NAME
UCM_TYPE
UCM_CATEGORY
UCM_VERSION
UCM_EXEC_TIME
UCM_DESCRIPTION

=
=
=
=
=
=

VSrc
NetworkElement
User
"1.0"
5.0e-6
"Three-phase Voltage source with inductor at output"

%% END GENERAL INFORMATION


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

5-672

User Coded Model (UCM)


Voltage source

%% BEGIN DOCUMENTATION -- Enter models documentation after this line...


Three-phase sine-wave voltage source with inductor at output
%% END DOCUMENTATION
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN TUNABLE PARAMETERS -- Enter parameters table after this line...
Amp "Amp" V
Ls
"Ls"
H
freq "freq" Hz

double 1 1.0 0.0 10.0 - "Source Amplitude"


double 3 [0.1 0.1 0.1] 0.0 1.0e12 - "Output inductor"
double 1 60.0 1.0e-12 1.0e12 - "frequency"

%% END TUNABLE PARAMETERS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CONTROL IOS -- Enter control IOs table after this line...
I_a
I_b
I_c

- double out auto I "Output current, phase a"


- double out auto I "Output current, phase b"
- double out auto I "Output current, phase c"

Db1
Db2
Db3

- double out auto Db "Debugging output 1"


- double out auto Db "Debugging output 2"
- double out auto Db "Debugging output 3"

%% END CONTROL IOS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN NODES DEFINITIONS -- Enter nodes table after this line...
T 3 extern bottom no "Network Connection"
%% END NODES DEFINITIONS
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CURRENT SOURCES -- Enter sources table after this line...
Isrc_a
Isrc_b
Isrc_c

T_a ground
T_b ground
T_c ground

%% END CURRENT SOURCES


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN HISTORICAL CURRENTS -- Enter historical currents table after this...
Ihist_a T_a ground
Ihist_b T_b ground
Ihist_c T_c ground
%% END HISTORICAL CURRENTS
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

5-673

User Coded Model (UCM)


Voltage source

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CALCULATED PARAMETERS -- Enter parameters table after this line...
Gs
omega
period

- double 3 "Equiv.Conductance"
- double 1 "omega"
- double 1 "period"

%% END CALCULATED PARAMETERS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATION FUNCTION CODE -- Enter code after this line...
int
i, j;
doubleGLo, Lo;
/* Calculate equivalent conductances of Inductances */
Gs[0] = ucmTimeStep / (2.0 * Ls[0]);
Gs[1] = ucmTimeStep / (2.0 * Ls[1]);
Gs[2] = ucmTimeStep / (2.0 * Ls[2]);
/* Initialize Yini and Yfill */
for (i = 0; i < 3; i++)
{
for (j = 0; j < 3; j++)
{
ucmYini(i,j) = 0.0;
ucmYfill(i,j) = 0;
}
}
/* Calculate Yini and determine Yfill */
ucmYini(T_a, T_a) = Gs[0];
ucmYini(T_b, T_b) = Gs[1];
ucmYini(T_c, T_c) = Gs[2];
ucmYfill(T_a, T_a) = 1;
ucmYfill(T_b, T_b) = 1;
ucmYfill(T_c, T_c) = 1;
/* Calculate other Simulation parameters */
period = 1.0 / freq;
omega = 2.0 * 3.141593 * freq;
%% END PREPARATION FUNCTION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN HISTORICAL VALUES -- Enter the table after this line...

5-674

User Coded Model (UCM)


Voltage source

time double 1 0.0 "time"


%% END HISTORICAL VALUES
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN SIMULATION GLOBAL CODE -- Enter code under the appropriate comment...
/* 9.3.1 -- User includes */
#include <math.h>
%%% END SIMULATION GLOBAL CODE
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN BEFORE VOLTAGE CALCULATION CODE -- Enter code ->...
/* User code: calulate Yadd */
int i;
doubleVsrc_a, Vsrc_b, Vsrc_c;
doubleTwoPiOver3 = 2.094395333; /* 2.0 Pi / 3 */
/* Calculate source voltages */
Vsrc_a = Amp * sin (omega * time);
Vsrc_b = Amp * sin (omega * time - TwoPiOver3);
Vsrc_c = Amp * sin (omega * time + TwoPiOver3);
/* Calculate current sources */
Isrc_a = Vsrc_a * Gs[0];
Isrc_b = Vsrc_b * Gs[1];
Isrc_c = Vsrc_c * Gs[2];
%% END BEFORE VOLTAGE CALCULATION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN AFTER VOLTAGE CALCULATION -- Enter code ->...
double Vsrc_a, Vsrc_b, Vsrc_c;
Vsrc_a = Isrc_a / Gs[0];
Vsrc_b = Isrc_b / Gs[1];
Vsrc_c = Isrc_c / Gs[2];
/* Calculate output currents and historic currents */
I_a = (Vsrc_a - ucmVNode(T_a)) * Gs[0] + Ihist_a;
Ihist_a = I_a + (Vsrc_a - ucmVNode(T_a)) * Gs[0];
I_b = (Vsrc_b - ucmVNode(T_b)) * Gs[1] + Ihist_b;
Ihist_b = I_b + (Vsrc_b - ucmVNode(T_b)) * Gs[1];
I_c = (Vsrc_c - ucmVNode(T_c)) * Gs[2] + Ihist_c;
Ihist_c = I_c + (Vsrc_c - ucmVNode(T_c)) * Gs[2];
5-675

User Coded Model (UCM)


Non-linear inductance

/* Other calculations */
time += ucmTimeStep;
if (time >= period)
time -= period;

/* To avoid truncation error */

/* Debugging outputs */
Db1 = I_a;
Db2 = Ihist_a;
Db3 = time;
%% END AFTER VOLTAGE CALCULATION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

C Exercise

Build an UCM to model a three-phase sine-wave voltage source with the possibility of modulating the sine-wave amplitude. The modulating signal is a triangular wave of slow frequency.

5.4.5 Non-linear
inductance
A

Description

The thee-phase non-linear inductor has its value depending on the rectified three-phase voltage across it. The non linearity is defined by an inductance table Lvec of dimension Ldim
values picked at regular voltage interval Vinc.
The inductor is connected to the network by it external node T. Three phase currents Ia, Ib,
Ic are sent out to the connector I, the rectified three-phase voltage across L is sent out at
connector Vrec. The inductor has Y grounded configuration.

T
Lvec
Ia,Ib,Ic
I

V
Rectifier

Vrec

Vinc

B Codes

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN GENERAL INFORMATION -- Enter or modify general information
UCM_NAME
UCM_TYPE
UCM_CATEGORY
UCM_VERSION
UCM_EXEC_TIME

5-676

Vrec

=
=
=
=
=

Lnlin
NetworkElement
User
"1.0"
5.0e-6

User Coded Model (UCM)


Non-linear inductance

UCM_DESCRIPTION = "Non-linear inductor"


%% END GENERAL INFORMATION
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN DOCUMENTATION -- Enter models documentation after this line...
Non-linear inductor:
L depend on rectified value of three-phase voltages across it
%% END DOCUMENTATION
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN TUNABLE PARAMETERS -- Enter parameters table after this line...
Lvec "Lvec" H double 9 [1.0 0.60 0.36 0.22 0.13 0.08 0.04 0.03 0.01] 0.0 10.0 - "Lvec"
Vinc "Vinc" V double 1 500 0.0 1000 - "Vinc"
Ldim "Ldim" - int
1 9 0.0 10.0 - "Ldim"
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CONTROL IOS -- Enter control IOs table after this line...
Ia
Ib
Ic

A double out auto I "Current phase a"


A double out auto I "Current phase b"
A double out auto I "Current phase c"

Db1
Db2
Db3

- double out auto Db "Debugging signal no. 1"


- double out auto Db "Debugging signal no. 2"
- double out auto Db "Debugging signal no. 3"

Vrec

V double out auto - "Rectified 3-phase voltage across L"

%% END CONTROL IOS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN NODES DEFINITIONS -- Enter nodes table after this line...
T 3 extern top yes "Network Connection"
%% END NODES DEFINITIONS
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN HISTORICAL CURRENTS -- Enter historical currents table after this...
Ihist_a ground T_a
Ihist_b ground T_b
5-677

User Coded Model (UCM)


Non-linear inductance

Ihist_c ground T_c


%% END HISTORICAL CURRENTS
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN CALCULATED PARAMETERS -- Enter parameters table after this line...
GaddVec
Lchanged
Lindex

- double 9 "Additional conductance of L"


- int
1 "Indicate that L has changed"
- int
1 "Index in table GaddVec"

%% END CALCULATED PARAMETERS


%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATION FUNCTION CODE -- Enter code after this line...
int
i, j;
doubleGLo, Lo;
/* Initialize Yini and Yfill */
for (i = 0; i < 3; i++)
{
for (j = 0; j < 3; j++)
{
ucmYini(i,j) = 0.0;
ucmYfill(i,j) = 0;
}
}
/* Compute Yini and define Yfill */
Lo = Lvec[0];
GLo = ucmTimeStep / (2.0 * Lo);
ucmYini(T_a, T_a) = GLo;
ucmYini(T_b, T_b) = GLo;
ucmYini(T_c, T_c) = GLo;
ucmYfill(T_a, T_a) = 1;
ucmYfill(T_b, T_b) = 1;
ucmYfill(T_c, T_c) = 1;
/* Calculate GaddVec, conductance to be added when L changes */
for (i = 0; i < Ldim; i++)
{
GaddVec[i] = (ucmTimeStep / (2.0 * Lvec[i])) - GLo;
}
%% END PREPARATION FUNCTION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5-678

User Coded Model (UCM)


Non-linear inductance

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN SIMULATION INITIALIZATION FUNCTION CODE -- Enter code ->...
Lindex = 0;
Lchanged = 0;
%% END SIMULATION INITIALIZATION FUNCTION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN BEFORE VOLTAGE CALCULATION CODE -- Enter code ->...
/* User code: calulate Yadd */
int i;
/* Initialize indication of nodes affacted by changing in L */
for (i = 0; i < 3; i++)
ucmNodeChanged(i) = 0;
/* If L has been changed, determine the additional conductance and
indicate that corresponding nodes are affected */
if (Lchanged)
{
ucmYadd(T_a,T_a) = GaddVec[Lindex];
ucmYadd(T_b,T_b) = GaddVec[Lindex];
ucmYadd(T_c,T_c) = GaddVec[Lindex];
ucmNodeChanged(T_a) = 1;
ucmNodeChanged(T_b) = 1;
ucmNodeChanged(T_c) = 1;
}
%% END BEFORE VOLTAGE CALCULATION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN AFTER VOLTAGE CALCULATION -- Enter code ->...
doubleLo, GLo, GL;
doubleVL_a;
doubleVL_b;
doubleVL_c;
int index;
/* Calculate rectified of 3 phase voltage across L */
VL_a = ucmVNode(T_a);
VL_b = ucmVNode(T_b);
VL_c = ucmVNode(T_c);
Vrec = fabs(VL_a);
if (Vrec < fabs(VL_b))
Vrec = fabs(VL_b);
if (Vrec < fabs(VL_c))
Vrec = fabs(VL_c);
/* Calculate historic currents */
5-679

User Coded Model (UCM)


Non-linear inductance

Lo = Lvec[0];
GLo = ucmTimeStep / (2.0 * Lo);
GL = GLo + GaddVec[Lindex];
Ia = VL_a * GL + Ihist_a;
Ihist_a = Ia + VL_a * GL;
Ib = VL_b * GL + Ihist_b;
Ihist_b = Ib + VL_b * GL;
Ic = VL_c * GL + Ihist_c;
Ihist_c = Ic + VL_c * GL;
/* New operating point of L: calculate the index in the non-linear table */
Lchanged = 0;
index = (int)(Vrec / Vinc);
if (index
index
if (index
index

>
=
<
=

Ldim-1)
Ldim - 1;
0)
0;

if (index != Lindex)
{
Lindex = index;
Lchanged = 1;
}

/* To avoid of going outside of the table */

/* Compare index with its past value (historic) */

/* Debugging signal */
Db1 = Lchanged;
Db2 = index;
Db3 = 0.0;
%% END AFTER VOLTAGE CALCULATION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

5-680

You might also like