**Package with models for DC electrical loads**

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

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

Name | Description |
---|---|

Conductor | Model of a generic DC load |

Resistor | Ideal linear electrical resistor |

Examples | Package with example models |

**Model of a generic DC load**

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*.

Consider the simple DC circuit shown in the figure below

where *V _{S}* is a constant voltage source, and

V_{S} - R i - P_{LOAD}/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 *V _{nom}*,
around which the equations will be linearized.

The constitutive equation of the load can be linearized around the nominal voltage condition

i = P_{LOAD}/V = P_{LOAD}/V_{nom} +
(V - V_{nom})[∂ (P_{LOAD}/V)/ ∂V ]_{V = Vnom}
+ ₒ((V - V_{nom})^{2}),

which leads to the linearized formulation

i ≃ P_{LOAD} (2/V_{nom} - V/V_{nom}^{2}).

The linearized formulation approximates the load power consumption (or production),
with the approximation error being proportional to *(V - V _{nom})^{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

Equation | Condition |
---|---|

i ≃ P_{LOAD} (2/(0.8 V_{nom}) - V/(0.8 V_{nom}^{2})) |
V < 8/9⋅ V_{nom} |

i ≃ P_{LOAD} (2/(1.2 V_{nom}) - V/(1.2 V_{nom}^{2})) |
V ≥ 12/11⋅ V_{nom} |

i ≃ P_{LOAD} (2/V_{nom} - V/V_{nom}^{2}) |
Otherwise |

Extends from Buildings.Electrical.Interfaces.Load (Partial model for a generic load).

Type | Name | Default | Description |
---|---|---|---|

replaceable package PhaseSystem | PartialPhaseSystem | Phase system | |

Modelling assumption | |||

Boolean | linearized | false | If true, the load model is linearized |

Load | mode | Buildings.Electrical.Types.L... | Type of load model (e.g., steady state, dynamic, prescribed power consumption, etc.) |

Nominal conditions | |||

Power | P_nominal | Nominal power (negative if consumed, positive if generated) [W] | |

Voltage | V_nominal | Nominal voltage (V_nominal >= 0) [V] | |

Initialization | |||

InitMode | initMode | Buildings.Electrical.Types.I... | Initialization mode for homotopy operator |

Type | Name | Description |
---|---|---|

replaceable package PhaseSystem | Phase system | |

input RealInput | y | Fraction of the nominal power consumed [1] |

input RealInput | Pow | Power consumed [W] |

model Conductor "Model of a generic DC load"
extends Buildings.Electrical.Interfaces.Load(
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;

**Ideal linear electrical resistor**

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 - T_{ref}),

where the resistance *R* is the reference value of the resistance, *α* is the
linear temperature coefficient, and *T _{ref}* is the reference temperature.
The temperature

`useHeatPort = true`

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

Type | Name | Default | Description |
---|---|---|---|

replaceable package PhaseSystem | PartialPhaseSystem | Phase system | |

Boolean | useHeatPort | false | =true, if HeatPort is enabled |

Temperature | T | T_ref | Fixed device temperature if useHeatPort = false [K] |

Resistance | R | Resistance at temperature T_ref [Ohm] | |

Temperature | T_ref | 300.15 | Reference temperature [K] |

LinearTemperatureCoefficient | alpha | 0 | Temperature coefficient of resistance (R_actual = R*(1 + alpha*(T_heatPort - T_ref)) [1/K] |

Modelling assumption | |||

Boolean | linearized | false | If true, the load model is linearized |

Load | mode | Buildings.Electrical.Types.L... | Type of load model (e.g., steady state, dynamic, prescribed power consumption, etc.) |

Nominal conditions | |||

Power | P_nominal | 0 | Nominal power (negative if consumed, positive if generated) [W] |

Voltage | V_nominal | Nominal voltage (V_nominal >= 0) [V] | |

Initialization | |||

InitMode | initMode | Buildings.Electrical.Types.I... | Initialization mode for homotopy operator |

Type | Name | Description |
---|---|---|

replaceable package PhaseSystem | Phase system | |

input RealInput | y | Fraction of the nominal power consumed [1] |

input RealInput | Pow | Power consumed [W] |

HeatPort_a | heatPort |

model Resistor "Ideal linear electrical resistor"
extends Buildings.Electrical.Interfaces.Load(
redeclare package PhaseSystem = PhaseSystems.TwoConductor,
redeclare Interfaces.Terminal_n terminal,
final mode=Buildings.Electrical.Types.Load.FixedZ_steady_state,
final P_nominal=0);
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;

Automatically generated Mon May 4 10:19:52 2015.