PVSystems.Electrical

Library for electrical models

Information

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
PVSystems.Electrical.HBridgeAveraged HBridgeAveraged Basic ideal H-bridge topology (averaged)
PVSystems.Electrical.HBridgeSwitched HBridgeSwitched Basic ideal H-bridge topology (switched)
PVSystems.Electrical.Ideal2LevelLeg Ideal2LevelLeg Basic ideal two level switching leg
PVSystems.Electrical.IdealAverageCCMSwitch IdealAverageCCMSwitch Average switch model for any ideal 2-switch PWM converter in CCM
PVSystems.Electrical.IdealAverageDCMSwitch IdealAverageDCMSwitch Average switch model for any ideal 2-switch PWM converter in DCM
PVSystems.Electrical.IdealCBSwitch IdealCBSwitch Basic two-cuadrant current bidirectional switch
PVSystems.Electrical.PVArray PVArray Flexible PV array model
PVSystems.Electrical.PartialBattery PartialBattery Partial model for battery
PVSystems.Electrical.SimpleBattery SimpleBattery Simple battery model
PVSystems.Electrical.Interfaces Interfaces Interfaces

PVSystems.Electrical.HBridgeAveraged PVSystems.Electrical.HBridgeAveraged

Basic ideal H-bridge topology (averaged)

PVSystems.Electrical.HBridgeAveraged

Information

This model further composes IdealAverageCCMSwitch to form a typical H-bridge configuration from which a 1-phase inverter can be constructed. This model is based in averaged switch models.

Connectors

TypeNameDescription
PindcpPositive pin of the DC port
PindcnNegative pin of the DC port
PinacpPositive pin of the AC port
PinacnNegative pin of the AC port
input RealInputd 

Modelica definition

model HBridgeAveraged "Basic ideal H-bridge topology (averaged)" // Interface Modelica.Electrical.Analog.Interfaces.Pin dcp "Positive pin of the DC port"; Modelica.Electrical.Analog.Interfaces.Pin dcn "Negative pin of the DC port"; Modelica.Electrical.Analog.Interfaces.Pin acp "Positive pin of the AC port"; Modelica.Electrical.Analog.Interfaces.Pin acn "Negative pin of the AC port"; Modelica.Blocks.Interfaces.RealInput d; Modelica.SIunits.Voltage vdc "DC voltage"; Modelica.SIunits.Voltage vac "AC voltage"; // Components IdealAverageCCMSwitch s1; IdealAverageCCMSwitch s2; equation vdc = dcp.v - dcn.v; vac = acp.v - acn.v; connect(s1.p1, dcp); connect(s1.n1, acp); connect(s2.n1, dcn); connect(s2.p1, acn); connect(s1.n2, dcn); connect(d, s2.d); connect(d, s1.d); connect(s2.p2, dcp); connect(s1.p2, acp); connect(s2.n2, acn); end HBridgeAveraged;

PVSystems.Electrical.HBridgeSwitched PVSystems.Electrical.HBridgeSwitched

Basic ideal H-bridge topology (switched)

PVSystems.Electrical.HBridgeSwitched

Information

This model further composes IdealTwoLevelBranch to form a typical H-bridge configuration from which a 1-phase inverter can be constructed. This model is based on discrete switch models.

Connectors

TypeNameDescription
PindcpPositive pin of the DC port
PindcnNegative pin of the DC port
PinacpPositive pin of the AC port
PinacnNegative pin of the AC port
input BooleanInputfireA 
input BooleanInputfireB 

Modelica definition

model HBridgeSwitched "Basic ideal H-bridge topology (switched)" // Interface Modelica.Electrical.Analog.Interfaces.Pin dcp "Positive pin of the DC port"; Modelica.Electrical.Analog.Interfaces.Pin dcn "Negative pin of the DC port"; Modelica.Electrical.Analog.Interfaces.Pin acp "Positive pin of the AC port"; Modelica.Electrical.Analog.Interfaces.Pin acn "Negative pin of the AC port"; Modelica.Blocks.Interfaces.BooleanInput fireA; Modelica.Blocks.Interfaces.BooleanInput fireB; Modelica.SIunits.Voltage vdc "DC voltage"; Modelica.SIunits.Voltage vac "AC voltage"; // Components Ideal2LevelLeg legA; Ideal2LevelLeg legB; equation vdc = dcp.v - dcn.v; vac = acp.v - acn.v; connect(dcp, legA.p); connect(legA.n, dcn); connect(legA.midPoint, acp); connect(legB.midPoint, acn); connect(fireA, legA.fire); connect(fireB, legB.fire); connect(legB.p, dcp); connect(legB.n, dcn); end HBridgeSwitched;

PVSystems.Electrical.Ideal2LevelLeg PVSystems.Electrical.Ideal2LevelLeg

Basic ideal two level switching leg

PVSystems.Electrical.Ideal2LevelLeg

Information

This model composes IdealCBSwitch model into a two level leg, also very common in the constructoin of power converters. It provides input only for the firing signal of the top switch, generating the firing signal for the bottom switch by logical negation.

Extends from Modelica.Electrical.Analog.Interfaces.TwoPin (Component with two electrical pins).

Connectors

TypeNameDescription
PositivePinpPositive pin Positive pin (potential p.v > n.v for positive voltage drop v)
NegativePinnNegative pin
input BooleanInputfire 
PinmidPoint 

Modelica definition

model Ideal2LevelLeg "Basic ideal two level switching leg" extends Modelica.Electrical.Analog.Interfaces.TwoPin; // Interface Modelica.Blocks.Interfaces.BooleanInput fire; Modelica.Electrical.Analog.Interfaces.Pin midPoint; // Components Modelica.Blocks.Logical.Not notBlock; IdealCBSwitch topSwitch; IdealCBSwitch bottomSwitch; equation connect(p, topSwitch.p); connect(topSwitch.n, bottomSwitch.p); connect(bottomSwitch.n, n); connect(fire, notBlock.u); connect(fire, topSwitch.fire); connect(notBlock.y, bottomSwitch.fire); connect(midPoint, topSwitch.n); end Ideal2LevelLeg;

PVSystems.Electrical.IdealAverageCCMSwitch PVSystems.Electrical.IdealAverageCCMSwitch

Average switch model for any ideal 2-switch PWM converter in CCM

PVSystems.Electrical.IdealAverageCCMSwitch

Information

Extends from Modelica.Electrical.Analog.Interfaces.TwoPort (Component with two electrical ports, including current).

Connectors

TypeNameDescription
PositivePinp1Positive pin of the left port (potential p1.v > n1.v for positive voltage drop v1)
NegativePinn1Negative pin of the left port
PositivePinp2Positive pin of the right port (potential p2.v > n2.v for positive voltage drop v2)
NegativePinn2Negative pin of the right port
input RealInputdDuty cycle

Modelica definition

model IdealAverageCCMSwitch "Average switch model for any ideal 2-switch PWM converter in CCM" extends Modelica.Electrical.Analog.Interfaces.TwoPort; Modelica.Blocks.Interfaces.RealInput d "Duty cycle"; equation v1 = (1 - d)/d*v2; -i2 = (1 - d)/d*i1; end IdealAverageCCMSwitch;

PVSystems.Electrical.IdealAverageDCMSwitch PVSystems.Electrical.IdealAverageDCMSwitch

Average switch model for any ideal 2-switch PWM converter in DCM

PVSystems.Electrical.IdealAverageDCMSwitch

Information

Extends from Modelica.Electrical.Analog.Interfaces.TwoPort (Component with two electrical ports, including current).

Parameters

TypeNameDefaultDescription
InductanceLe Equivalent DCM inductance [H]
Frequencyfs Switching frequency [Hz]

Connectors

TypeNameDescription
PositivePinp1Positive pin of the left port (potential p1.v > n1.v for positive voltage drop v1)
NegativePinn1Negative pin of the left port
PositivePinp2Positive pin of the right port (potential p2.v > n2.v for positive voltage drop v2)
NegativePinn2Negative pin of the right port
input RealInputdDuty cycle

Modelica definition

model IdealAverageDCMSwitch "Average switch model for any ideal 2-switch PWM converter in DCM" extends Modelica.Electrical.Analog.Interfaces.TwoPort; parameter Modelica.SIunits.Inductance Le "Equivalent DCM inductance"; parameter Modelica.SIunits.Frequency fs "Switching frequency"; Modelica.Blocks.Interfaces.RealInput d "Duty cycle"; Real mu "Effective switch conversion ratio"; Real Re "Equivalent DCM port 1 resistance"; equation Re = 2*Le*fs/d^2; mu = max(d, 1/(1 + Re*i1/v2)); v1 = (1 - mu)/mu*v2; -i2 = (1 - mu)/mu*i1; end IdealAverageDCMSwitch;

PVSystems.Electrical.IdealCBSwitch PVSystems.Electrical.IdealCBSwitch

Basic two-cuadrant current bidirectional switch

PVSystems.Electrical.IdealCBSwitch

Information

This model represents and idealized current bi-directional switch. This is the typical IGBT in anti-parallel with a diode from which many converters are built.

Extends from Modelica.Electrical.Analog.Interfaces.TwoPin (Component with two electrical pins).

Connectors

TypeNameDescription
PositivePinpPositive pin Positive pin (potential p.v > n.v for positive voltage drop v)
NegativePinnNegative pin
input BooleanInputfire 

Modelica definition

model IdealCBSwitch "Basic two-cuadrant current bidirectional switch" extends Modelica.Electrical.Analog.Interfaces.TwoPin; // Components Modelica.Electrical.Analog.Ideal.IdealClosingSwitch idealClosingSwitch; Modelica.Electrical.Analog.Ideal.IdealDiode idealDiode; Modelica.Blocks.Interfaces.BooleanInput fire; equation connect(p, idealClosingSwitch.p); connect(idealClosingSwitch.n, n); connect(idealDiode.p, n); connect(idealDiode.n, p); connect(fire, idealClosingSwitch.control); end IdealCBSwitch;

PVSystems.Electrical.PVArray PVSystems.Electrical.PVArray

Flexible PV array model

PVSystems.Electrical.PVArray

Information

Flexible PV array model. The model can be parametrized with the use of PV module datasheets. As a default, the data from the Kyocera KC200GT is provided. The model is presented in "Comprehensive Approach to Modeling and Simulation of Photovoltaic Arrays" by M.G. Villalva et al.

Extends from Modelica.Electrical.Analog.Interfaces.OnePort (Component with two electrical pins p and n and current i from p to n).

Parameters

TypeNameDefaultDescription
CurrentImp7.61Maximum power current [A]
VoltageVmp26.3Maximum power voltage [V]
CurrentIscn8.21Short circuit current [A]
VoltageVocn32.9Open circuit voltage [V]
RealKv-0.123Voc temperature coefficient
RealKi3.18e-3Isc temperature coefficient
RealNs54Number of cells in series
RealNp1Number of cells in parallel
ResistanceRs0.221Equivalent series resistance of array [Ohm]
ResistanceRp415.405Equivalent parallel resistance of array [Ohm]
Reala1.3Diode ideality constant
CurrentIpvnIscnPhotovoltaic current at STC [A]

Connectors

TypeNameDescription
PositivePinpPositive pin (potential p.v > n.v for positive voltage drop v)
NegativePinnNegative pin
input RealInputGSolar irradiation
input RealInputTPanel temperature

Modelica definition

model PVArray "Flexible PV array model" extends Modelica.Electrical.Analog.Interfaces.OnePort; // Interface Modelica.Blocks.Interfaces.RealInput G "Solar irradiation"; Modelica.Blocks.Interfaces.RealInput T "Panel temperature"; // Constants constant Modelica.SIunits.Charge q=1.60217646e-19 "Electron charge"; constant Real Gn=1000 "STC irradiation"; constant Modelica.SIunits.Temperature Tn=298.15 "STC temperature"; // Basic datasheet parameters parameter Modelica.SIunits.Current Imp=7.61 "Maximum power current"; parameter Modelica.SIunits.Voltage Vmp=26.3 "Maximum power voltage"; parameter Modelica.SIunits.Current Iscn=8.21 "Short circuit current"; parameter Modelica.SIunits.Voltage Vocn=32.9 "Open circuit voltage"; parameter Real Kv=-0.123 "Voc temperature coefficient"; parameter Real Ki=3.18e-3 "Isc temperature coefficient"; // Basic model parameters parameter Real Ns=54 "Number of cells in series"; parameter Real Np=1 "Number of cells in parallel"; parameter Modelica.SIunits.Resistance Rs=0.221 "Equivalent series resistance of array"; parameter Modelica.SIunits.Resistance Rp=415.405 "Equivalent parallel resistance of array"; parameter Real a=1.3 "Diode ideality constant"; // Derived model parameters parameter Modelica.SIunits.Current Ipvn=Iscn "Photovoltaic current at STC"; // Variables Modelica.SIunits.Voltage Vt "Thermal voltage of the array"; Modelica.SIunits.Current Ipv "Photovoltaic current of the cell"; Modelica.SIunits.Current I0 "Saturation current of the cell"; Modelica.SIunits.Current Id "Diode current"; Modelica.SIunits.Current Ir "Rp current"; equation // Auxiliary variables Vt = Ns*Modelica.Constants.k*T/q; Ipv = (Ipvn + Ki*(T - Tn))*G/Gn; I0 = (Iscn + Ki*(T - Tn))/(exp((Vocn + Kv*(T - Tn))/a/Vt) - 1); Id = I0*(exp((v - Rs*i)/a/Vt) - 1); Ir = (v - Rs*i)/Rp; if v < 0 then i = v/((Rs + Rp)/Np); elseif v > Vocn then i = 0; else i = -Np*(Ipv - Id - Ir); end if; end PVArray;

PVSystems.Electrical.PartialBattery PVSystems.Electrical.PartialBattery

Partial model for battery

PVSystems.Electrical.PartialBattery

Information

Partial model for battery

Extends from Modelica.Electrical.Analog.Interfaces.OnePort (Component with two electrical pins p and n and current i from p to n).

Connectors

TypeNameDescription
PositivePinpPositive pin (potential p.v > n.v for positive voltage drop v)
NegativePinnNegative pin

Modelica definition

partial model PartialBattery "Partial model for battery" extends Modelica.Electrical.Analog.Interfaces.OnePort; end PartialBattery;

PVSystems.Electrical.SimpleBattery PVSystems.Electrical.SimpleBattery

Simple battery model

PVSystems.Electrical.SimpleBattery

Information

Extends from PartialBattery (Partial model for battery).

Parameters

TypeNameDefaultDescription
ResistanceRint0.09Internal resistance [Ohm]
VoltageE03.7348Constant battery voltage [V]
VoltageK0.00876Polarization voltage [V]
RealQ1Rated battery capacity [A.h]
VoltageA0.468Exponential region amplitude [V]
RealB3.5294Exponential zone time constant inverse
RealDoDini0Initial Depth of Discharge [A.h]

Connectors

TypeNameDescription
PositivePinpPositive pin (potential p.v > n.v for positive voltage drop v)
NegativePinnNegative pin

Modelica definition

model SimpleBattery "Simple battery model" // Model taken from // TODO: // + Would be cool to have capacities relative to absolute battery capacity, // i.e., 'it' from 0 to 1 instead of from 0 to Q. // + Would probably be more intuitive to provide parameter for initial State // of charge (in relative terms) instead of initial depth of discharge. // + Would probably be nice to introduce safeguards around Q = it, which // currently just produces a division by 0 an a simulation error. // + Would probably be more convenient to move the type definition of // BatteryCapacity to another place. extends PartialBattery; import Modelica.SIunits.Resistance; import Modelica.SIunits.Voltage; import Modelica.SIunits.Current; type BatteryCapacity = Real (final quantity="Energy", final unit="A.h"); // Parameters (Li-ion values as defaults) parameter Resistance Rint=0.09 "Internal resistance"; parameter Voltage E0=3.7348 "Constant battery voltage"; parameter Voltage K=0.00876 "Polarization voltage"; parameter BatteryCapacity Q=1 "Rated battery capacity"; parameter Voltage A=0.468 "Exponential region amplitude"; parameter Real B=3.5294 "Exponential zone time constant inverse"; parameter BatteryCapacity DoDini=0 "Initial Depth of Discharge"; // Variables Voltage E; BatteryCapacity it(start=DoDini, fixed=true) "Actual depth of discharge"; equation v = E + i*Rint; der(it) = -i/3600; E = max(0, E0 - K*Q/(Q - it) + A*exp(-B*it)); end SimpleBattery;

Automatically generated Sun Apr 02 18:12:00 2017.