LBL logo

Buildings.Electrical.DC.Loads

Package with models for DC electrical loads

Information

This package contains models that represent different types of DC loads.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Electrical.DC.Loads.Conductor Conductor Model of a generic DC load
Buildings.Electrical.DC.Loads.Resistor Resistor Ideal linear electrical resistor
Buildings.Electrical.DC.Loads.Examples Examples Package with example models

Buildings.Electrical.DC.Loads.Conductor Buildings.Electrical.DC.Loads.Conductor

Model of a generic DC load

Buildings.Electrical.DC.Loads.Conductor

Information

Model of a generic DC load. The load can be either constant or variable depending on the value of the parameter mode. See the model Buildings.Electrical.Interfaces.Load for more information.

The model computes the current drawn from the load as

P = V i,

where P is the power, V is the voltage and i is the current.
If the component consumes power, then P < 0. If it feeds power into the electrical grid, then P > 0.

Linearization

Consider the simple DC circuit shown in the figure below

image

where VS is a constant voltage source, and R is the line resistance. The load has a voltage V across its electrical pins and a current i is flowing through it. If the power consumption drawn by the load is prescribed by the variable PLOAD, the equation that describes the circuit is

VS - R i - PLOAD/i = 0

The unknown variable i appears in a nonlinear equation. This means that in order to compute the current that is drawn by the load, a nonlinear equation has to be solved. If the number of loads increases (as typically happens in real case examples) the number of nonlinear equations to be solved increases too, and the resulting system of nonlinear equations can slow down the simulation. It is possible to avoid such a problem by introducing a linearized model.

The first step to linearize the load model is to define its nominal voltage conditions Vnom, around which the equations will be linearized.
The constitutive equation of the load can be linearized around the nominal voltage condition Vnom as

i = PLOAD/V = PLOAD/Vnom + (V - Vnom)[∂ (PLOAD/V)/ ∂V ]V = Vnom + ₒ((V - Vnom)2),

which leads to the linearized formulation

i ≃ PLOAD (2/Vnom - V/Vnom2).

The linearized formulation approximates the load power consumption (or production), with the approximation error being proportional to (V - Vnom)2. A further approximation has been introduced to improve the approximation of the linearized model even if the voltage is far from the nominal condition. This piecewise linearized approximation instead of approximating the model just in the neighborhood of the nominal voltage Vnom introduces two new points where the model is approximated. The points are at 0.8 Vnom and 1.2 Vnom.

EquationCondition
i ≃ PLOAD (2/(0.8 Vnom) - V/(0.8 Vnom2)) V < 8/9⋅ Vnom
i ≃ PLOAD (2/(1.2 Vnom) - V/(1.2 Vnom2)) V ≥ 12/11⋅ Vnom
i ≃ PLOAD (2/Vnom - V/Vnom2) Otherwise

Extends from Buildings.Electrical.Interfaces.ResistiveLoad (Partial model of a resistive load).

Parameters

TypeNameDefaultDescription
replaceable package PhaseSystemPartialPhaseSystemPhase system
Modeling assumption
BooleanlinearizedfalseIf true, the load model is linearized
LoadmodeBuildings.Electrical.Types.L...Type of load model (e.g., steady state, dynamic, prescribed power consumption, etc.)
Nominal conditions
PowerP_nominal0Nominal power (negative if consumed, positive if generated). Used if mode <> Buildings.Electrical.Types.Load.VariableZ_P_input [W]
VoltageV_nominal Nominal voltage (V_nominal >= 0) [V]
Initialization
InitModeinitModeBuildings.Electrical.Types.I...Initialization mode for homotopy operator

Connectors

TypeNameDescription
replaceable package PhaseSystemPhase system
input RealInputyFraction of the nominal power consumed [1]
input RealInputPowPower consumed [W]

Modelica definition

model Conductor "Model of a generic DC load" extends Buildings.Electrical.Interfaces.ResistiveLoad( redeclare package PhaseSystem = PhaseSystems.TwoConductor, redeclare Interfaces.Terminal_n terminal); protected Modelica.SIunits.Voltage absDV "Absolute value of the voltage difference between the two conductors (used by the linearized model)"; equation absDV = abs(terminal.v[1]-terminal.v[2]); if linearized then // Linearized version of the model if absDV <= (8/9)*V_nominal then terminal.i[1] + P*(2/(0.8*V_nominal) - (terminal.v[1]-terminal.v[2])/(0.8*V_nominal)^2) = 0; elseif absDV >= (12/11)*V_nominal then terminal.i[1] + P*(2/(1.2*V_nominal) - (terminal.v[1]-terminal.v[2])/(1.2*V_nominal)^2) = 0; else terminal.i[1] + P*(2/V_nominal - (terminal.v[1]-terminal.v[2])/V_nominal^2) = 0; end if; else // Full nonlinear version of the model // PhaseSystem.activePower(terminal.v, terminal.i) + P = 0; if initMode == Buildings.Electrical.Types.InitMode.zero_current then i[1] = - homotopy(actual= P/(v[1] - v[2]), simplified= 0); else i[1] = - homotopy(actual= P/(v[1] - v[2]), simplified= P*(2/V_nominal - (v[1]-v[2])/V_nominal^2)); end if; end if; // Since the connector is a two conductor, the sum of the currents at the terminal // is null sum(i) = 0; end Conductor;

Buildings.Electrical.DC.Loads.Resistor Buildings.Electrical.DC.Loads.Resistor

Ideal linear electrical resistor

Buildings.Electrical.DC.Loads.Resistor

Information

Model of a linear DC resistor that can vary with respect to temperature.

The model implements the Ohm's law

V = R(T) i.

The resistance R(T) varies depending on the temperature T as

R(T) = R (1 + α (T - Tref),

where the resistance R is the reference value of the resistance, α is the linear temperature coefficient, and Tref is the reference temperature. The temperature T is the temperature of the heat port if useHeatPort = true.

Extends from Buildings.Electrical.Interfaces.ResistiveLoad (Partial model of a resistive load), Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort (Partial model to include a conditional HeatPort in order to describe the power loss via a thermal network).

Parameters

TypeNameDefaultDescription
replaceable package PhaseSystemPartialPhaseSystemPhase system
BooleanuseHeatPortfalse=true, if HeatPort is enabled
TemperatureTT_refFixed device temperature if useHeatPort = false [K]
ResistanceR Resistance at temperature T_ref [Ohm]
TemperatureT_ref300.15Reference temperature [K]
LinearTemperatureCoefficientalpha0Temperature coefficient of resistance (R_actual = R*(1 + alpha*(T_heatPort - T_ref)) [1/K]
Modeling assumption
BooleanlinearizedfalseIf true, the load model is linearized
LoadmodeBuildings.Electrical.Types.L...Type of load model (e.g., steady state, dynamic, prescribed power consumption, etc.)
Nominal conditions
PowerP_nominalV_nominal^2/max(R, Modelica....Nominal power (negative if consumed, positive if generated). Used if mode <> Buildings.Electrical.Types.Load.VariableZ_P_input [W]
VoltageV_nominal Nominal voltage (V_nominal >= 0) [V]
Initialization
InitModeinitModeBuildings.Electrical.Types.I...Initialization mode for homotopy operator

Connectors

TypeNameDescription
replaceable package PhaseSystemPhase system
input RealInputyFraction of the nominal power consumed [1]
input RealInputPowPower consumed [W]
HeatPort_aheatPort 

Modelica definition

model Resistor "Ideal linear electrical resistor" extends Buildings.Electrical.Interfaces.ResistiveLoad( redeclare package PhaseSystem = PhaseSystems.TwoConductor, redeclare Interfaces.Terminal_n terminal, final mode=Buildings.Electrical.Types.Load.FixedZ_steady_state, final P_nominal=V_nominal^2/max(R, Modelica.Constants.small)); extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort(T = T_ref); parameter Modelica.SIunits.Resistance R(start=1) "Resistance at temperature T_ref"; parameter Modelica.SIunits.Temperature T_ref=300.15 "Reference temperature"; parameter Modelica.SIunits.LinearTemperatureCoefficient alpha=0 "Temperature coefficient of resistance (R_actual = R*(1 + alpha*(T_heatPort - T_ref))"; Modelica.SIunits.Resistance R_actual "Actual resistance = R*(1 + alpha*(T_heatPort - T_ref))"; equation assert((1 + alpha*(T_heatPort - T_ref)) >= Modelica.Constants.eps, "Temperature outside of scope of model"); R_actual = R*(1 + alpha*(T_heatPort - T_ref)); PhaseSystem.systemVoltage(v) = R_actual*PhaseSystem.systemCurrent(i); LossPower = PhaseSystem.activePower(v,i); sum(i) = 0; end Resistor;

http://simulationresearch.lbl.gov/modelica