Skip to content
Jonathan edited this page Aug 17, 2020 · 4 revisions

Electric Node / Bus (Enode)

The Enode class is used by the NPSS Power System Library to connect multiple components to a single node or bus. It may alternatively be used for when a model requires two nodeless components (e.g. a cable to a breaker) to be connected which must have a nodal component placed in between to correctly propagate voltage information across its network (see Home).

Usage

The Enode component is primarily used as an electrical bus that connects multiple components to each other via Cables or Breakers (i.e. nodeless components). Used in this way, it propagates the voltage information to conform to the Power System Libary's solver configuration.

Bus Example

Consider the diagram below where two Source components , S1 & S2, are supplying power to a ConstantPowerLoad CPL:

 Branch 1
 Source (S1) -> Cable (C1) ->|
                             | Branch 3
                  Enode (E1) |-> Cable (C3) -> ConstantPowerLoad (CPL)
 Branch 2                    |
 Source (S2) -> Cable (C2) ->|

Because the model requires multiple source (nodal) components to be connected to the constant power load, the Enode E1 is used as a bus to connect all three branches together via cables (C1, C2, C3).

Defining an Enode component is similar to any other nodal component, however, requires the user to also define each ElectricInputPort and ElectricOutputPort manually as required by the model.

Enode E1 {
  ElectricInputPort EP_I1, EP_I2;
  ElectricInputPort EP_O;
  VrealRMS  = 100;  // [volts]
  VimagRMS  = 0;    // [volts]
  frequency = 400;  // [Hz]
}

Once this is done, the components must be linked via their ports to each Enode port to form a branch. User's are encouraged to use findSourcesAndPropagate() when using Enodes to avoid setting incorrect power types. An Enode's electric ports must all have the same power type.

// Branch 1
linkPortI("S1.EP_O", "C1.EP_I");
linkPortI("C1.EP_O", "E1.EP_I1");

// Branch 2
linkPortI("S2.EP_O", "C2.EP_I");
linkPortI("C2.EP_O", "E1.EP_I2");

// Branch 3
linkPortI("E1.EP_O", "C3.EP_I");
linkPortI("C3.EP_O", "CPL.EP_I");

findSourcesAndPropagate();

Implementation

The source code for the Enode class may be found in the Enode.int file. The Enode class contains real variables for voltage (VrealRMS & VimagRMS) and a ComplexNumber variable for current (Inet). The class defines an array of string variables named ElectricPorts[] which contains string pointers for each electric port defined within the component (these are automatically appended to the array by the postcreate() function).

As discussed in Home, the NPSS solver drives voltage independents within nodes to balance currents and preserve Kirchoff's Current Law (KCL). In the Enode class, the voltage independents are ind_Vreal and ind_Vimag which both correspond to the real voltage variables described above. The dependent variables are dep_Ireal and dep_Iimag which correspond to the real and imaginary parts of Inet and are equated to 0. Before an iteration begins, the prePass() function is called, pushing the voltage and frequency values to each of the node's ports. During an iteration, the calculate() function will be called, adding all the input currents and subtracting all the output currents to Inet. Once this is done, the solver will observe the error between the summed current values to 0, and change the voltage independents accordingly.

Clone this wiki locally