Documentation Home Page HYPERSIM Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

UCM: Exercise #1 Inductor Description

Exercise 1: 

Inductor Description

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.

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.

Codes

%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN GENERAL INFORMATION -- Enter or modify general information
UCM_NAME = Inductor
UCM_TYPE = NetworkElement
UCM_CATEGORY = User
UCM_VERSION = "1.0"
UCM_EXEC_TIME = 5.0e-6
UCM_DESCRIPTION = "Linear Inductor" # Description du modele
%% END GENERAL INFORMATION
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN DOCUMENTATION -- Enter model’s 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 A double out auto I "Ia"
Ib A double out auto I "Ib"
Ic 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
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%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
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter