PVSystems.Electrical

Library for electrical models

Information

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

Package Content

Name Description
PVSystems.Electrical.IdealCBSwitch IdealCBSwitch Basic two-cuadrant current bidirectional switch
PVSystems.Electrical.SW1 SW1 Switched model implemented with switch + diode
PVSystems.Electrical.SW2 SW2 Switched model implemented with switch x 2
PVSystems.Electrical.SW3 SW3 Switched model implemented with switch + anti-parallel diode x 2
PVSystems.Electrical.CCM1 CCM1 Average CCM model with no losses
PVSystems.Electrical.CCM2 CCM2 Average CCM model with conduction losses
PVSystems.Electrical.CCM3 CCM3 Average CCM model with no losses and tranformer
PVSystems.Electrical.CCM4 CCM4 Average CCM model with conduction losses and tranformer
PVSystems.Electrical.CCM5 CCM5 Average CCM model with conduction losses and diode reverse recovery
PVSystems.Electrical.CCM_DCM1 CCM_DCM1 Average CCM-DCM model with no losses
PVSystems.Electrical.CCM_DCM2 CCM_DCM2 Average CCM-DCM model with no losses and transformer
PVSystems.Electrical.PVArray PVArray Flexible PV array model
PVSystems.Electrical.SimpleBattery SimpleBattery Simple battery model
PVSystems.Electrical.Assemblies Assemblies Electrical assemblies useful in PV and power electronics
PVSystems.Electrical.Interfaces Interfaces Interfaces

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 BooleanInputc 

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 c; equation connect(p, idealClosingSwitch.p); connect(idealClosingSwitch.n, n); connect(idealDiode.p, n); connect(idealDiode.n, p); connect(c, idealClosingSwitch.control); end IdealCBSwitch;

PVSystems.Electrical.SW1 PVSystems.Electrical.SW1

Switched model implemented with switch + diode

PVSystems.Electrical.SW1

Information

Extends from Interfaces.SwitchNetworkInterface (Interface for the averaged switch network models).

Parameters

TypeNameDefaultDescription
Realdmin1e-3Minimum duty cycle [1]
Realdmax1Maximum duty cycle [1]
RealdMax1Maximum duty cycle
RealdMin0Minimum duty cycle
Frequencyfs Switching frequency [Hz]
TimestartTime0Start time [s]
ResistanceRD1.E-5Forward state-on differential resistance (closed resistance) [Ohm]
VoltageVD0Forward threshold voltage [V]
ResistanceRon1.E-5Closed switch resistance [Ohm]

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 SW1 "Switched model implemented with switch + diode" extends Interfaces.SwitchNetworkInterface; Modelica.Electrical.Analog.Ideal.IdealClosingSwitch sw1(Ron=Ron); Modelica.Electrical.Analog.Ideal.IdealDiode sw2(Ron=RD, Vknee=VD); Control.SwitchingPWM signalPWM( dMax=dMax, dMin=dMin, fs=fs, startTime=startTime); parameter Real dMax=1 "Maximum duty cycle"; parameter Real dMin=0 "Minimum duty cycle"; parameter Modelica.SIunits.Frequency fs "Switching frequency"; parameter Modelica.SIunits.Time startTime=0 "Start time"; parameter Modelica.SIunits.Resistance RD=1.E-5 "Forward state-on differential resistance (closed resistance)"; parameter Modelica.SIunits.Voltage VD=0 "Forward threshold voltage"; parameter Modelica.SIunits.Resistance Ron=1.E-5 "Closed switch resistance"; equation connect(p1, sw1.p); connect(n1, sw1.n); connect(sw2.n, p2); connect(n2, sw2.p); connect(signalPWM.vc, d); connect(signalPWM.c1, sw1.control); end SW1;

PVSystems.Electrical.SW2 PVSystems.Electrical.SW2

Switched model implemented with switch x 2

PVSystems.Electrical.SW2

Information

Extends from Interfaces.SwitchNetworkInterface (Interface for the averaged switch network models).

Parameters

TypeNameDefaultDescription
Realdmin1e-3Minimum duty cycle [1]
Realdmax1Maximum duty cycle [1]
RealdMax1Maximum duty cycle
RealdMin0Minimum duty cycle
Frequencyfs Switching frequency [Hz]
TimestartTime0Start time [s]
ResistanceRD1.E-5Forward state-on differential resistance (closed resistance) [Ohm]
VoltageVD0Forward threshold voltage [V]
ResistanceRon1.E-5Closed switch resistance [Ohm]
TimedeadTime0Dead time [s]

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 SW2 "Switched model implemented with switch x 2" extends Interfaces.SwitchNetworkInterface; Modelica.Electrical.Analog.Ideal.IdealClosingSwitch sw1(Ron=Ron); Control.SwitchingPWM spwm( dMax=dMax, dMin=dMin, fs=fs, startTime=startTime); parameter Real dMax=1 "Maximum duty cycle"; parameter Real dMin=0 "Minimum duty cycle"; parameter Modelica.SIunits.Frequency fs "Switching frequency"; parameter Modelica.SIunits.Time startTime=0 "Start time"; parameter Modelica.SIunits.Resistance RD=1.E-5 "Forward state-on differential resistance (closed resistance)"; parameter Modelica.SIunits.Voltage VD=0 "Forward threshold voltage"; parameter Modelica.SIunits.Resistance Ron=1.E-5 "Closed switch resistance"; Modelica.Electrical.Analog.Ideal.IdealClosingSwitch sw2(Ron=Ron); Control.DeadTime dt(deadTime=deadTime); parameter Modelica.SIunits.Time deadTime=0 "Dead time"; equation connect(p1, sw1.p); connect(n1, sw1.n); connect(spwm.vc, d); connect(dt.c, spwm.c1); connect(dt.c1, sw1.control); connect(sw2.n, p2); connect(n2, sw2.p); connect(dt.c2, sw2.control); end SW2;

PVSystems.Electrical.SW3 PVSystems.Electrical.SW3

Switched model implemented with switch + anti-parallel diode x 2

PVSystems.Electrical.SW3

Information

Extends from Interfaces.SwitchNetworkInterface (Interface for the averaged switch network models).

Parameters

TypeNameDefaultDescription
Realdmin1e-3Minimum duty cycle [1]
Realdmax1Maximum duty cycle [1]
RealdMax1Maximum duty cycle
RealdMin0Minimum duty cycle
Frequencyfs Switching frequency [Hz]
TimestartTime0Start time [s]
ResistanceRD1.E-5Forward state-on differential resistance (closed resistance) [Ohm]
VoltageVD0Forward threshold voltage [V]
ResistanceRon1.E-5Closed switch resistance [Ohm]
TimedeadTime0Dead time [s]

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 SW3 "Switched model implemented with switch + anti-parallel diode x 2" extends Interfaces.SwitchNetworkInterface; Modelica.Electrical.Analog.Ideal.IdealClosingSwitch sw1(Ron=Ron); Control.SwitchingPWM spwm( dMax=dMax, dMin=dMin, fs=fs, startTime=startTime); parameter Real dMax=1 "Maximum duty cycle"; parameter Real dMin=0 "Minimum duty cycle"; parameter Modelica.SIunits.Frequency fs "Switching frequency"; parameter Modelica.SIunits.Time startTime=0 "Start time"; parameter Modelica.SIunits.Resistance RD=1.E-5 "Forward state-on differential resistance (closed resistance)"; parameter Modelica.SIunits.Voltage VD=0 "Forward threshold voltage"; parameter Modelica.SIunits.Resistance Ron=1.E-5 "Closed switch resistance"; Modelica.Electrical.Analog.Ideal.IdealClosingSwitch sw2(Ron=Ron); Control.DeadTime dt(deadTime=deadTime); Modelica.Electrical.Analog.Ideal.IdealDiode d1; Modelica.Electrical.Analog.Ideal.IdealDiode d2; parameter Modelica.SIunits.Time deadTime=0 "Dead time"; equation connect(p1, sw1.p); connect(n1, sw1.n); connect(spwm.vc, d); connect(dt.c, spwm.c1); connect(dt.c1, sw1.control); connect(sw2.n, p2); connect(n2, sw2.p); connect(dt.c2, sw2.control); connect(d1.n, sw1.p); connect(d1.p, sw1.n); connect(d2.n, p2); connect(d2.p, n2); end SW3;

PVSystems.Electrical.CCM1 PVSystems.Electrical.CCM1

Average CCM model with no losses

PVSystems.Electrical.CCM1

Information

Application: two-switch PWM converters.

Limitations: ideal switches, CCM only, no transformer.

Model taken from EM01 and EMA16.

Extends from Interfaces.SwitchNetworkInterface (Interface for the averaged switch network models).

Parameters

TypeNameDefaultDescription
Realdmin1e-3Minimum duty cycle [1]
Realdmax1Maximum duty cycle [1]

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 CCM1 "Average CCM model with no losses" extends Interfaces.SwitchNetworkInterface; equation 0 = p1.i + n1.i; 0 = p2.i + n2.i; v1 = (1 - dsat)/dsat*v2; -i2 = (1 - dsat)/dsat*i1; end CCM1;

PVSystems.Electrical.CCM2 PVSystems.Electrical.CCM2

Average CCM model with conduction losses

PVSystems.Electrical.CCM2

Information

Application: two-switch PWM converters, includes conduction losses due to Ron, VD, Rd.

Limitations: CCM only, no transformer.

Model taken from EM01 and EMA16.

Extends from Interfaces.SwitchNetworkInterface (Interface for the averaged switch network models).

Parameters

TypeNameDefaultDescription
Realdmin1e-3Minimum duty cycle [1]
Realdmax1Maximum duty cycle [1]
ResistanceRon0Transistor on resistance [Ohm]
ResistanceRD0Diode on resistance [Ohm]
VoltageVD0Diode forward voltage drop [V]

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 CCM2 "Average CCM model with conduction losses" extends Interfaces.SwitchNetworkInterface; parameter Modelica.SIunits.Resistance Ron=0 "Transistor on resistance"; parameter Modelica.SIunits.Resistance RD=0 "Diode on resistance"; parameter Modelica.SIunits.Voltage VD=0 "Diode forward voltage drop"; equation 0 = p1.i + n1.i; 0 = p2.i + n2.i; v1 = i1*(Ron/dsat + (1 - dsat)*RD/dsat^2) + (1 - dsat)/dsat*(v2 + VD); -i2 = i1*(1 - dsat)/dsat; end CCM2;

PVSystems.Electrical.CCM3 PVSystems.Electrical.CCM3

Average CCM model with no losses and tranformer

PVSystems.Electrical.CCM3

Information

Application: two-switch PWM converters, with (possibly) transformer.

Limitations: ideal switches, CCM only.

Model taken from EM01 and EMA16.

Extends from Interfaces.SwitchNetworkInterface (Interface for the averaged switch network models).

Parameters

TypeNameDefaultDescription
Realdmin1e-3Minimum duty cycle [1]
Realdmax1Maximum duty cycle [1]
Realn1Transformer turns ratio 1:n (primary:secondary) [1]

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 CCM3 "Average CCM model with no losses and tranformer" extends Interfaces.SwitchNetworkInterface; parameter Real n(final unit="1") = 1 "Transformer turns ratio 1:n (primary:secondary)"; equation 0 = p1.i + n1.i; 0 = p2.i + n2.i; v1 = (1 - dsat)*v2/dsat/n; -i2 = (1 - dsat)*i1/dsat/n; end CCM3;

PVSystems.Electrical.CCM4 PVSystems.Electrical.CCM4

Average CCM model with conduction losses and tranformer

PVSystems.Electrical.CCM4

Information

Application: two-switch PWM converters, includes conduction losses due to Ron, VD, RD and (possibly) transformer.

Limitations: CCM only.

Model taken from EM01 and EMA16.

Extends from Interfaces.SwitchNetworkInterface (Interface for the averaged switch network models).

Parameters

TypeNameDefaultDescription
Realdmin1e-3Minimum duty cycle [1]
Realdmax1Maximum duty cycle [1]
ResistanceRon0Transistor on resistance [Ohm]
ResistanceRD0Diode on resistance [Ohm]
VoltageVD0Diode forward voltage drop [V]
Realn1Transformer turns ratio 1:n (primary:secondary) [1]

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 CCM4 "Average CCM model with conduction losses and tranformer" extends Interfaces.SwitchNetworkInterface; parameter Modelica.SIunits.Resistance Ron=0 "Transistor on resistance"; parameter Modelica.SIunits.Resistance RD=0 "Diode on resistance"; parameter Modelica.SIunits.Voltage VD=0 "Diode forward voltage drop"; parameter Real n(final unit="1") = 1 "Transformer turns ratio 1:n (primary:secondary)"; equation 0 = p1.i + n1.i; 0 = p2.i + n2.i; v1 = i1*(Ron/dsat + (1 - dsat)*RD/n^2/dsat^2) + (1 - dsat)/dsat/n*(v2+VD); -i2 = i1*(1 - dsat)/dsat/n; end CCM4;

PVSystems.Electrical.CCM5 PVSystems.Electrical.CCM5

Average CCM model with conduction losses and diode reverse recovery

PVSystems.Electrical.CCM5

Information

Application: two-switch PWM converters, includes conduction losses due to Ron, VD and diode reverse recovery losses.

Limitations: CCM only, d'>tr/Ts, <i1> > Qr/Ts.

Model taken from EM01 and EMA16.

Extends from Interfaces.SwitchNetworkInterface (Interface for the averaged switch network models).

Parameters

TypeNameDefaultDescription
Realdmin1e-3Minimum duty cycle [1]
Realdmax1Maximum duty cycle [1]
ResistanceRon0Transistor on resistance [Ohm]
VoltageVD0Diode forward voltage drop [V]
ChargeQr Diode reverse recovery charge [C]
Timetr Diode reverse recovery time [s]
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 CCM5 "Average CCM model with conduction losses and diode reverse recovery" extends Interfaces.SwitchNetworkInterface; parameter Modelica.SIunits.Resistance Ron=0 "Transistor on resistance"; parameter Modelica.SIunits.Voltage VD=0 "Diode forward voltage drop"; parameter Modelica.SIunits.Charge Qr "Diode reverse recovery charge"; parameter Modelica.SIunits.Time tr "Diode reverse recovery time"; parameter Modelica.SIunits.Frequency fs "Switching frequency"; equation 0 = p1.i + n1.i; 0 = p2.i + n2.i; v1 = (i1 - fs*Qr)*Ron/(dsat + fs*tr) + (1 - dsat)/dsat*(v2 + VD); -i2 = i1*(1 - dsat - fs*tr)/(dsat + fs*tr) - fs*Qr/(dsat + fs*tr); end CCM5;

PVSystems.Electrical.CCM_DCM1 PVSystems.Electrical.CCM_DCM1

Average CCM-DCM model with no losses

PVSystems.Electrical.CCM_DCM1

Information

Application: two-switch PWM converters, CCM or DCM.

Limitations: ideal switches, no transformer.

Model taken from EM01 and EMA16.

Extends from Interfaces.SwitchNetworkInterface (Interface for the averaged switch network models).

Parameters

TypeNameDefaultDescription
Realdmin1e-3Minimum duty cycle [1]
Realdmax1Maximum duty cycle [1]
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 CCM_DCM1 "Average CCM-DCM model with no losses" extends Interfaces.SwitchNetworkInterface; parameter Modelica.SIunits.Inductance Le "Equivalent DCM inductance"; parameter Modelica.SIunits.Frequency fs "Switching frequency"; protected Real mu "Effective switch conversion ratio"; Real Re "Equivalent DCM port 1 resistance"; equation 0 = p1.i + n1.i; 0 = p2.i + n2.i; Re = 2*Le*fs/dsat^2; mu = max(dsat, 1/(1 + Re*max(0,i1)/v2)); v1 = (1 - mu)/mu*v2; -i2 = (1 - mu)/mu*i1; end CCM_DCM1;

PVSystems.Electrical.CCM_DCM2 PVSystems.Electrical.CCM_DCM2

Average CCM-DCM model with no losses and transformer

PVSystems.Electrical.CCM_DCM2

Information

Application: two-switch PWM converters, CCM or DCM with (possibly) transformer.

Limitations: ideal switches.

Model taken from EM01 and EMA16.

Extends from Interfaces.SwitchNetworkInterface (Interface for the averaged switch network models).

Parameters

TypeNameDefaultDescription
Realdmin1e-3Minimum duty cycle [1]
Realdmax1Maximum duty cycle [1]
InductanceLe Equivalent DCM inductance [H]
Frequencyfs Switching frequency [Hz]
Realn1Transformer turns ratio 1:n (primary:secondary) [1]

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 CCM_DCM2 "Average CCM-DCM model with no losses and transformer" extends Interfaces.SwitchNetworkInterface; parameter Modelica.SIunits.Inductance Le "Equivalent DCM inductance"; parameter Modelica.SIunits.Frequency fs "Switching frequency"; parameter Real n(final unit="1") = 1 "Transformer turns ratio 1:n (primary:secondary)"; protected Real mu "Effective switch conversion ratio"; Real Re "Equivalent DCM port 1 resistance"; equation 0 = p1.i + n1.i; 0 = p2.i + n2.i; Re = 2*Le*n*fs/dsat^2; mu = max(dsat, 1/(1 + Re*max(0,i1)/v2)); v1 = (1 - mu)*v2/mu/n; -i2 = (1 - mu)*i1/mu/n; end CCM_DCM2;

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.SimpleBattery PVSystems.Electrical.SimpleBattery

Simple battery model

PVSystems.Electrical.SimpleBattery

Information

Extends from Interfaces.BatteryInterface (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" extends Interfaces.BatteryInterface; 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 Mon Sep 11 16:11:46 2017.