text
stringlengths
1
4.74k
code
stringlengths
69
637k
Converters
within PhotoVoltaics.Components; package Converters "Converters" extends Modelica.Icons.Package; end Converters;
Ideal polyphase DC/AC converter. This is an ideal DC/AC converter.<p> <p> The polyphase converter is characterized by:
within PhotoVoltaics.Components.Converters; model PolyphaseConverter "Ideal polyphase DC/AC converter" import Modelica.Constants.pi; extends Modelica.Electrical.PowerConverters.Interfaces.DCAC.DCtwoPin; extends .PhotoVoltaics.Icons.Converter; Modelica.Electrical.Polyphase.Interfaces.PositivePlug ac "AC output" Modelica.Blocks.Interfaces.RealInput vDCRef(final unit = "V") "DC voltage" parameter Modelica.Units.SI.Frequency f=50 "Frequency"; parameter Modelica.Units.SI.Voltage VRef=400 "Reference line to line voltage"; parameter Modelica.Units.SI.Time Ti=1E-6 "Internal integration time constant"; Modelica.Units.SI.Power powerDC=vDC*iDC "Power of DC side"; Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor Modelica.Blocks.Math.Product product Modelica.Blocks.Math.Feedback feedback Modelica.Electrical.Machines.SpacePhasors.Blocks.FromPolar fromPolar Modelica.Blocks.Continuous.Integrator integrator(k=sqrt(3)/VRef/Ti) Modelica.Blocks.Math.Gain gain(final k=1) Modelica.Electrical.Machines.SpacePhasors.Blocks.FromSpacePhasor fromSpacePhasor(m=3) Modelica.Blocks.Sources.Constant zeroConst(final k=0) Modelica.Electrical.Polyphase.Sources.SignalCurrent signalCurrent Modelica.Electrical.Polyphase.Basic.Star star Modelica.Electrical.Analog.Basic.Ground ground Modelica.Blocks.Sources.Constant constOmega(final k=2*pi*f) Modelica.Blocks.Math.RectangularToPolar rectangularToPolar Modelica.Electrical.Polyphase.Sensors.VoltageSensor voltageSensorAC( final m=3) Modelica.Blocks.Math.Product productPower[3] Modelica.Blocks.Math.Add add Modelica.Blocks.Interfaces.RealInput phi "Phase angle of current with respect to voltage" Modelica.Blocks.Continuous.Integrator integratorOmega(final k=1) Modelica.Blocks.Continuous.FirstOrder firstOrder[3](k=ones(3), T=fill(Ti, 3), initType=fill(Modelica.Blocks.Types.Init.InitialState, 3), y_start=fill(0, 3)) Modelica.Electrical.Machines.SpacePhasors.Blocks.Rotator rotatorOut Modelica.Blocks.Math.Gain neg(final k=-1) Modelica.Electrical.Machines.SpacePhasors.Blocks.ToSpacePhasor toSpacePhasor Modelica.Electrical.Machines.SpacePhasors.Blocks.Rotator rotatorIn Modelica.Blocks.Math.Sum sum3(nin=3) equation connect(currentSensor.n,signalVoltage. p) connect(signalVoltage.v,vDCRef) connect(dc_p, currentSensor.p) connect(dc_n, signalVoltage.n) connect(product.y,feedback. u1) connect(feedback.y,integrator. u) connect(gain.y,feedback. u2) connect(product.u1, currentSensor.i) connect(product.u2, vDCRef) connect(star.plug_p, signalCurrent.plug_p) connect(ground.p, star.pin_n) connect(fromSpacePhasor.zero, zeroConst.y) connect(integrator.y, fromPolar.u[1]) connect(voltageSensorAC.plug_n, star.plug_p) connect(voltageSensorAC.plug_p, ac) connect(rectangularToPolar.y_arg, add.u1) connect(add.y, fromPolar.u[2]) connect(constOmega.y, integratorOmega.u) connect(fromSpacePhasor.y, firstOrder.u) connect(firstOrder.y, signalCurrent.i) connect(fromPolar.y, rotatorOut.u) connect(neg.y, rotatorOut.angle) connect(rotatorIn.u, toSpacePhasor.y) connect(rotatorIn.angle, integratorOmega.y) connect(neg.u, integratorOmega.y) connect(rotatorOut.y, fromSpacePhasor.u) connect(rectangularToPolar.u_re, rotatorIn.y[1]) connect(rectangularToPolar.u_im, rotatorIn.y[2]) connect(sum3.y, gain.u) connect(productPower.u2, voltageSensorAC.v) connect(sum3.u, productPower.y) connect(firstOrder.y, productPower.u1) connect(signalCurrent.plug_n, voltageSensorAC.plug_p) connect(voltageSensorAC.v, toSpacePhasor.u) connect(add.u2, phi) end PolyphaseConverter;
Ideal quasi stastic polyphase DC/AC converter. This is an ideal DC/AC converter.
within PhotoVoltaics.Components.Converters; model QuasiStaticPolyphaseConverter "Ideal quasi stastic polyphase DC/AC converter" extends Modelica.Electrical.PowerConverters.Interfaces.DCAC.DCtwoPin; extends .PhotoVoltaics.Interfaces.QuasiStatic.ACplug; extends .PhotoVoltaics.Icons.Converter; parameter Modelica.Units.SI.Voltage VRef=400 "Reference line to line voltage"; parameter Modelica.Units.SI.Time Ti=1E-6 "Internal integration time constant"; Modelica.Units.SI.Power powerDC=vDC*iDC "Power of DC side"; Modelica.Units.SI.Power powerAC=Modelica.ComplexMath.real(vAC* Modelica.ComplexMath.conj(iAC)) "Complex apparent power of AC side"; Modelica.Blocks.Interfaces.RealInput vDCRef(final unit = "V") "DC voltage" Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor Modelica.Blocks.Math.Product product Modelica.Blocks.Math.Feedback feedback Sources.Electrical.VariableUnrootedPolyphaseCurrentSource variableCurrentSource(final m=m) Modelica.Electrical.QuasiStatic.Polyphase.Basic.Star star(final m=m) Modelica.Electrical.QuasiStatic.Polyphase.Sensors.PowerSensor powerSensor(final m=m) Modelica.Electrical.QuasiStatic.Polyphase.Sensors.PotentialSensor potentialSensor(final m=m) Modelica.Electrical.QuasiStatic.Polyphase.Blocks.ToSpacePhasor toSpacePhasor(final m=m) Modelica.ComplexBlocks.ComplexMath.ComplexToReal complexToReal Modelica.Electrical.QuasiStatic.Polyphase.Blocks.FromSpacePhasor fromSpacePhasor(final m=m) Modelica.Electrical.Machines.SpacePhasors.Blocks.FromPolar fromPolar Modelica.Electrical.Machines.SpacePhasors.Blocks.ToPolar toPolar Modelica.Electrical.QuasiStatic.SinglePhase.Basic.Ground ground Modelica.Blocks.Continuous.Integrator integrator(k=sqrt(3)/VRef/Ti) Modelica.Blocks.Math.Gain gain(final k = -1) equation connect(signalVoltage.n, dc_n) connect(currentSensor.p, dc_p) connect(currentSensor.n, signalVoltage.p) connect(signalVoltage.v, vDCRef) connect(currentSensor.i, product.u1) connect(vDCRef, product.u2) connect(product.y, feedback.u1) connect(powerSensor.currentP, powerSensor.voltageP) connect(powerSensor.voltageN, star.plug_p) connect(potentialSensor.v, toSpacePhasor.u) connect(complexToReal.u, powerSensor.apparentPower) connect(fromSpacePhasor.y, variableCurrentSource.I) connect(fromSpacePhasor.u, fromPolar.y) connect(integrator.y, fromPolar.u[1]) connect(toSpacePhasor.y, toPolar.u) connect(toPolar.y[2], fromPolar.u[2]) connect(star.pin_n, ground.pin) connect(powerSensor.currentP, ac) connect(potentialSensor.plug_p, ac) connect(feedback.y, integrator.u) connect(powerSensor.currentN, variableCurrentSource.plug_n) connect(variableCurrentSource.plug_p, star.plug_p) connect(gain.u, complexToReal.re) connect(gain.y, feedback.u2) end QuasiStaticPolyphaseConverter;
Ideal quasi static single phase DC/AC converter. This is an ideal DC/AC converter.
within PhotoVoltaics.Components.Converters; model QuasiStaticSinglePhaseConverter "Ideal quasi static single phase DC/AC converter" extends Modelica.Electrical.PowerConverters.Interfaces.DCAC.DCtwoPin; extends .PhotoVoltaics.Interfaces.QuasiStatic.ACpins; extends .PhotoVoltaics.Icons.Converter; parameter Modelica.Units.SI.Voltage VRef=400/sqrt(3) "Reference voltage"; parameter Modelica.Units.SI.Time Ti=1E-6 "Internal integration time constant"; Modelica.Units.SI.Power powerDC=vDC*iDC "Power of DC side"; Modelica.Units.SI.Power powerAC=Modelica.ComplexMath.real(vAC* Modelica.ComplexMath.conj(iAC)) "Complex apparent power of AC side"; Modelica.Blocks.Interfaces.RealInput vDCRef(final unit = "V") "DC voltage" Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor Modelica.Blocks.Math.Product product Modelica.Blocks.Math.Feedback feedback Sources.Electrical.VariableUnrootedSinglePhaseCurrentSource variableCurrentSource Modelica.Electrical.QuasiStatic.SinglePhase.Sensors.PowerSensor powerSensor Modelica.Electrical.QuasiStatic.SinglePhase.Sensors.VoltageSensor potentialSensor Modelica.ComplexBlocks.ComplexMath.ComplexToReal complexToReal Modelica.Blocks.Continuous.Integrator integrator(k=1/VRef/Ti) Modelica.ComplexBlocks.ComplexMath.ComplexToPolar complexToPolar Modelica.ComplexBlocks.ComplexMath.PolarToComplex polarToComplex Modelica.Blocks.Math.Gain gain(final k = -1) equation connect(signalVoltage.n, dc_n) connect(currentSensor.p, dc_p) connect(currentSensor.n, signalVoltage.p) connect(signalVoltage.v, vDCRef) connect(currentSensor.i, product.u1) connect(vDCRef, product.u2) connect(product.y, feedback.u1) connect(powerSensor.currentP, powerSensor.voltageP) connect(complexToReal.u, powerSensor.apparentPower) connect(feedback.y, integrator.u) connect(powerSensor.currentP, ac_p) connect(potentialSensor.pin_p, ac_p) connect(potentialSensor.pin_n, ac_n) connect(powerSensor.voltageN, ac_n) connect(complexToPolar.u,potentialSensor.v) connect(polarToComplex.y, variableCurrentSource.I) connect(integrator.y, polarToComplex.len) connect(polarToComplex.phi, complexToPolar.phi) connect(gain.u, complexToReal.re) connect(gain.y, feedback.u2) connect(powerSensor.currentN, variableCurrentSource.pin_n) connect(variableCurrentSource.pin_p, ac_n) end QuasiStaticSinglePhaseConverter;
DC converter with sampled maximum power tracking. This is DC/DC <a href=\"modelica://PhotoVoltaics.Components.Converters.DCConverter\">converter</a> with integrated power measurement and sampled <a href=\"modelica://PhotoVoltaics.Components.Blocks.MPTrackerSample\">maxmimum power tracking</a>.
within PhotoVoltaics.Components.Converters.ConvertersWithSampleMPTracker; model DCConverter "DC converter with sampled maximum power tracking" import PhotoVoltaics; extends Modelica.Electrical.PowerConverters.Interfaces.DCDC.DCtwoPin1; extends Modelica.Electrical.PowerConverters.Interfaces.DCDC.DCtwoPin2; extends PhotoVoltaics.Icons.Converter; extends PhotoVoltaics.Icons.MPTrackerSmall; parameter Modelica.Units.SI.Voltage VRef=48 "Reference DC source voltage" parameter Modelica.Units.SI.Time Ti=1E-6 "Internal integration time constant" parameter Modelica.Units.SI.Time startTime=0 "Start time" parameter Modelica.Units.SI.Time samplePeriod=1 "Sample period" parameter Modelica.Units.SI.Voltage VmpRef "Reference maximum power power of plant" parameter Modelica.Units.SI.Current ImpRef "Reference maximum power current of plant" parameter Integer n = 100 "Number of voltage and power discretizations" PhotoVoltaics.Components.Converters.DCConverter converter(final Ti=Ti, final VRef=VRef) Modelica.Electrical.Analog.Sensors.PowerSensor powerSensor PhotoVoltaics.Components.Blocks.MPTrackerSample mpTracker( final startTime=startTime, final samplePeriod=samplePeriod, final VmpRef=VmpRef, final ImpRef=ImpRef, final n=n) equation connect(dc_p1, powerSensor.pc) connect(powerSensor.nc, converter.dc_p1) connect(converter.dc_p2, dc_p2) connect(dc_n1, converter.dc_n1) connect(converter.dc_n2, dc_n2) connect(powerSensor.pc, powerSensor.pv) connect(powerSensor.nv, dc_n1) connect(mpTracker.vRef, converter.vDCRef) connect(mpTracker.power, powerSensor.power) end DCConverter;
Converter models with integrated sampling MP tracker
within PhotoVoltaics.Components.Converters; package ConvertersWithSampleMPTracker "Converter models with integrated sampling MP tracker" extends Modelica.Icons.Package; end ConvertersWithSampleMPTracker;
Diode with one exponential function.
within PhotoVoltaics.Components.Diodes; model Diode "Diode with one exponential function" extends .PhotoVoltaics.Interfaces.PartialDiode; equation i = Ids * (exp(v / m / Vt) - 1) + v / R; end Diode;
Diode with two superimposed exponential functions. The simple model of a diode is derived from <a href=\"modelica://Modelica.Electrical.Analog.Semiconductors.ZDiode\">ZDiode</a>. It consists of the diode with exponental forward and backward breakthrough characteristic, including parallel ohmic resistance <code>R</code>. The diode formula is:
within PhotoVoltaics.Components.Diodes; model Diode2exp "Diode with two superimposed exponential functions" extends .PhotoVoltaics.Interfaces.PartialDiode; parameter Modelica.Units.SI.Voltage Bv=5.1 "Breakthrough voltage"; parameter Modelica.Units.SI.Current Ibv=0.7 "Breakthrough knee current"; parameter Real Nbv = 0.74 "Breakthrough emission coefficient"; equation i = Ids * (exp(v / m / Vt) - 1) - Ibv * exp(-(v + Bv) / (Nbv * m * Vt)) + v / R; end Diode2exp;
Diode model with four different sections including breakthrough. This model consists of four different regions:<p> <ul> <li>Forward direction: exponential function, see <a href=\"modelica://PhotoVoltaics.Components.Diodes.Diode2exp\">Diode2exp</a></li> <li>Backwards direction: linear, before reaching backwards breakthrough region<li> <li>Breaktrough: exponential function, see <a href=\"modelica://PhotoVoltaics.Components.Diodes.Diode2exp\">Diode2exp</a></li> <li>Beyond breakthrough: linear region in order to limit magnitude of exponential breakthrough</li> </ul> <p>One particular feature of this scalable model is that this diode can be used to model cells, symmetric modules and symmetric plants, as
within PhotoVoltaics.Components.Diodes; model Diode2Module "Diode model with four different sections including breakthrough" extends .PhotoVoltaics.Interfaces.PartialDiode; parameter Modelica.Units.SI.Voltage Bv=5.1 "Breakthrough voltage"; parameter Modelica.Units.SI.Current Ibv=0.7 "Breakthrough knee current"; parameter Real Nbv = 0.74 "Breakthrough emission coefficient"; parameter Integer ns = 1 "Number of series connected cells per module"; parameter Integer nsModule(final min = 1) = 1 "Number of series connected modules"; parameter Integer npModule(final min = 1) = 1 "Number of parallel connected modules"; final parameter Modelica.Units.SI.Voltage VtRef=Modelica.Constants.k* TRef/Q "Reference voltage equivalent of temperature"; final parameter Modelica.Units.SI.Voltage VBv=(-m*Nbv*log(IdsRef*Nbv/ Ibv)*VtRef) - Bv "Voltage limit of approximation of breakthrough"; final parameter Modelica.Units.SI.Current IdsRef=IRef/(exp(VRef/m/VtRef) - 1) "Reference saturation current"; final parameter Modelica.Units.SI.Voltage VNegLin=(-VRef/m/VtRef*(Nbv*m* VtRef)) - Bv "Limit of linear range left of breakthrough"; Modelica.Units.SI.Voltage VNeg "Limit of linear negative voltage range"; Modelica.Units.SI.Voltage vCell=v/ns/nsModule "Cell voltage"; Modelica.Units.SI.Voltage vModule=v/nsModule "Module voltage"; Modelica.Units.SI.Current iModule=i/npModule "Module current"; equation // Voltage limit of negative range VNeg = m * Vt * log(Vt / VtRef); // Current approximation i / npModule = smooth(1, if v / ns / nsModule > VNeg then Ids * (exp(v / ns / nsModule / m / Vt) - 1) + v / ns / nsModule / R elseif v / ns / nsModule > VBv then Ids * v / ns / nsModule / m / VtRef + v / ns / nsModule / R elseif v / ns / nsModule > VNegLin then (-Ibv * exp(-(v / ns / nsModule + Bv) / (Nbv * m * Vt))) + Ids * VBv / m / VtRef + v / ns / nsModule / R else Ids * v / ns / nsModule / m / Vt - Ibv * exp(VRef / m / VtRef) * (1 - (v / ns / nsModule + Bv) / (Nbv * m * Vt) - VRef / m / VtRef) + v / ns / nsModule / R); end Diode2Module;
Diodes
within PhotoVoltaics.Components; package Diodes "Diodes" extends Modelica.Icons.Package; end Diodes;
Photovoltaic cells, modules and plants
within PhotoVoltaics.Components; package SimplePhotoVoltaics "Photovoltaic cells, modules and plants" extends Modelica.Icons.Package; end SimplePhotoVoltaics;
Simple cell model. The basic simple cell model consists of a scalable <a href=\"modelica://PhotoVoltaics.Components.Diodes.Diode2Module\">diode</a> model and a <a href=\"modelica://PhotoVoltaics.Sources.Electrical.SignalCurrent\">signal current source</a> with temperature dependency in order to consider the temperature coefficient of the short circuit of PV cell.
within PhotoVoltaics.Components.SimplePhotoVoltaics; model SimpleCell "Simple cell model" extends .PhotoVoltaics.Interfaces.PartialCell(signalCurrent( final irradianceRef=moduleData.irradianceRef, final alphaRef=moduleData.alphaIsc, final IRef=IphRef), diode( final Bv=moduleData.BvCell, final Ibv=moduleData.Ibv, final Nbv=moduleData.Nbv, final VRef=moduleData.VocCellRef, final IRef=moduleData.IscRef, final alphaI=moduleData.alphaIsc, final alphaV=moduleData.alphaVoc, final R=1E8, final m=m, final ns=1, final nsModule=1, final npModule=1)); final parameter Real m(start = 2, fixed = false) "Ideality factor of diode"; final parameter Modelica.Units.SI.Current IsdRef(start=1E-4, fixed=false) "Reference saturation current of cell"; final parameter Modelica.Units.SI.Current IphRef=moduleData.IscRef "Reference photo current of cell"; initial equation IphRef = IsdRef * (exp(moduleData.VocCellRef / m / moduleData.VtCellRef) - 1); IphRef = IsdRef * (exp(moduleData.VmpCellRef / m / moduleData.VtCellRef) - 1) + moduleData.ImpRef; (2) IphRef = IsdRef * (exp(moduleData.VmpCellRef / m / moduleData.VtCellRef) - 1) + moduleData.ImpRef; </pre> <p> These two equations are evaluated in the <code>initial equation</code> section of this model. </p> <p> The solar irradiance of the model can eithe be constant or provided by signal input. The current of current source is determined linearely dependent of irradiance.</p> </html>")); end SimpleCell;
Simple module consisting of series connected cells.
within PhotoVoltaics.Components.SimplePhotoVoltaics; model SimpleModule "Simple module consisting of series connected cells" extends .PhotoVoltaics.Interfaces.PartialComponent; parameter Real shadow[moduleData.ns] = zeros(moduleData.ns) "Shadow vector based on: 0 = full sun, 1 = full shadow"; SimpleCell cell[moduleData.ns]( final useHeatPort=fill(useHeatPort, moduleData.ns), final T=fill(T, moduleData.ns), final constantIrradiance=fill(constantIrradiance, moduleData.ns), final moduleData=fill(moduleData, moduleData.ns), final useConstantIrradiance=fill(false, moduleData.ns), final shadow=shadow) Modelica.Thermal.HeatTransfer.Components.ThermalCollector collectorModule(final m = moduleData.ns) if useHeatPort Diodes.Diode diode[moduleData.nb](final useHeatPort = fill(useHeatPort, moduleData.nb), final T = fill(T, moduleData.nb), final m = fill(1, moduleData.nb), final R = fill(1E8, moduleData.nb), final TRef = fill(moduleData.TRef, moduleData.nb), final IRef = fill(moduleData.IscRef, moduleData.nb), final alphaI = fill(0, moduleData.nb), final alphaV = fill(0, moduleData.nb), final VRef = fill(0.5, moduleData.nb)) Modelica.Thermal.HeatTransfer.Components.ThermalCollector collectorByPass(final m = moduleData.nb) if useHeatPort Modelica.Blocks.Routing.Replicator replicator(final nout=moduleData.ns) equation assert(mod(moduleData.ns, moduleData.nb) == 0, "Simple: number of bypassed cells cannot be determined unambiguously"); // Connect cells to module connect(p, cell[1].p) for k in 1:moduleData.ns - 1 loop connect(cell[k].n, cell[k + 1].p); end for; // Inter-module connections connect(cell[moduleData.ns].n, n) connect(cell.heatPort, collectorModule.port_a) connect(collectorModule.port_b, heatPort) // Connect bypass diodes for k in 1:moduleData.nb loop connect(diode[k].n, cell[(k - 1) * div(moduleData.ns, moduleData.nb) + 1].p) connect(diode[k].p, cell[k * div(moduleData.ns, moduleData.nb)].n) end for; connect(collectorByPass.port_a, diode.heatPort) connect(collectorByPass.port_b, heatPort) connect(irradiance, replicator.u) connect(replicator.y, cell.variableIrradiance) end SimpleModule;
Simple module consisting of symmetric series connected cells.
within PhotoVoltaics.Components.SimplePhotoVoltaics; model SimpleModuleSymmetric "Simple module consisting of symmetric series connected cells" extends .PhotoVoltaics.Interfaces.PartialCell(diode( final m=m, final R=1E8, final Bv=moduleData.BvCell, final Ibv=moduleData.Ibv, final Nbv=moduleData.Nbv, final IRef=moduleData.IscRef, final alphaI=moduleData.alphaIsc, final alphaV=moduleData.alphaVoc, final ns=moduleData.ns, final VRef=moduleData.VocCellRef, final nsModule=1, final npModule=1), signalCurrent( final IRef=IphRef, final irradianceRef=moduleData.irradianceRef, final alphaRef=moduleData.alphaIsc)); final parameter Real m(start = 2, fixed = false) "Ideality factor of diode"; final parameter Modelica.Units.SI.Current IsdRef(start=1E-4, fixed=false) "Reference saturation current of cell"; final parameter Modelica.Units.SI.Current IphRef=moduleData.IscRef "Reference photo current of cell"; Modelica.Units.SI.Voltage vCell=v/moduleData.ns "Cell voltage"; Modelica.Units.SI.Current iCell=i "Cell current"; Modelica.Units.SI.Current iCellGenerating=-iCell "Negative cell current (generating)"; Modelica.Units.SI.Power powerCell=vCell*iCell "Cell power"; Modelica.Units.SI.Power powerCellGenerating=vCell*iCellGenerating "Negative power consumption (generating)"; initial equation IphRef = IsdRef * (exp(moduleData.VocCellRef / m / moduleData.VtCellRef) - 1); IphRef = IsdRef * (exp(moduleData.VmpCellRef / m / moduleData.VtCellRef) - 1) + moduleData.ImpRef; end SimpleModuleSymmetric;
Simple plant consisting of symmetric series and parallel connected modules.
within PhotoVoltaics.Components.SimplePhotoVoltaics; model SimplePlantSymmetric "Simple plant consisting of symmetric series and parallel connected modules" extends .PhotoVoltaics.Interfaces.PartialCell(diode( final m=m, final R=1E8, final Bv=moduleData.BvCell, final Ibv=moduleData.Ibv, final Nbv=moduleData.Nbv, final IRef=moduleData.IscRef, final alphaI=moduleData.alphaIsc, final alphaV=moduleData.alphaVoc, final ns=moduleData.ns, final VRef=moduleData.VocCellRef, final nsModule=nsModule, final npModule=npModule), signalCurrent( final irradianceRef=moduleData.irradianceRef, final alphaRef=moduleData.alphaIsc, final IRef=npModule*IphRef)); parameter Integer nsModule(final min = 1) = 1 "Number of series connected modules"; parameter Integer npModule(final min = 1) = 1 "Number of parallel connected modules"; final parameter Real m(start = 2, fixed = false) "Ideality factor of diode"; final parameter Modelica.Units.SI.Current IsdRef(start=1E-4, fixed=false) "Reference saturation current of cell"; final parameter Modelica.Units.SI.Current IphRef=moduleData.IscRef "Reference photo current of cell"; Modelica.Units.SI.Voltage vCell=v/moduleData.ns/nsModule "Cell voltage"; Modelica.Units.SI.Current iCell=i/npModule "Cell current"; Modelica.Units.SI.Current iCellGenerating=-iCell "Negative cell current (generating)"; Modelica.Units.SI.Power powerCell=vCell*iCell "Cell power"; Modelica.Units.SI.Power powerCellGenerating=vCell*iCellGenerating "Negative power consumption (generating)"; Modelica.Units.SI.Voltage vModule=v/nsModule "Module voltage"; Modelica.Units.SI.Current iModule=i/npModule "Modile current"; Modelica.Units.SI.Current iModuleGenerating=-iModule "Negative module current (generating)"; Modelica.Units.SI.Power powerModule=vModule*iModule "Module power"; Modelica.Units.SI.Power powerModuleGenerating=vModule*iModuleGenerating "Negative module power (generating)"; initial equation IphRef = IsdRef * (exp(moduleData.VocCellRef / m / moduleData.VtCellRef) - 1); IphRef = IsdRef * (exp(moduleData.VmpCellRef / m / moduleData.VtCellRef) - 1) + moduleData.ImpRef; end SimplePlantSymmetric;
Solar pyramid with DC/DC converters. Model of a symmetric solar pyramid as used for a <a href=\"https://images.sciencedaily.com/2011/04/110425081301-medium.jpg\">Mars rover</a> prototype. This model consists of four symmetrical photovoltaic panels. The center position of can be moved vertically, such that the four panels are moved altogether. The angle of inclination of each panel, <code>gamma</code>, is an input to this model. The second input is the azimuth of one of the fore panels. The remaining three panels are displaced by 90 degrees, each.
within PhotoVoltaics.Components.SimplePhotoVoltaics; model SolarPyramidDCConverter "Solar pyramid with DC/DC converters" import Modelica.Constants.pi; extends Modelica.Thermal.HeatTransfer.Interfaces.PartialConditionalHeatPort( T = 298.15); extends Modelica.Electrical.PowerConverters.Interfaces.ACDC.DCtwoPin; parameter Records.ModuleData moduleData "Module parameters" parameter Modelica.Units.SI.Angle sunAzimuth=0 "Azimuth of sun" parameter Modelica.Units.SI.Angle sunHeight=1.0471975511965976 "Height of sun" parameter Modelica.Units.SI.Irradiance irradiance=1000 "Irradiance" parameter Modelica.Units.SI.Voltage VRef=48 "Reference DC source voltage" parameter Modelica.Units.SI.Time Ti=1E-6 "Internal integration time constant" parameter Modelica.Units.SI.Time startTime=0 "Start time" parameter Modelica.Units.SI.Time samplePeriod=1 "Sample period" parameter Modelica.Units.SI.Voltage VmpRef "Reference maximum power power of plant" parameter Modelica.Units.SI.Current ImpRef "Reference maximum power current of plant" parameter Integer n = 100 "Number of voltage and power discretizations" parameter Real shadow1(final min=0, final max=1)=0 "Shadow of module 1"; parameter Real shadow2(final min=0, final max=1)=0 "Shadow of module 2"; parameter Real shadow3(final min=0, final max=1)=0 "Shadow of module 3"; parameter Real shadow4(final min=0, final max=1)=0 "Shadow of module 4"; Modelica.Blocks.Sources.Constant const(k=Modelica.Constants.pi/2) Modelica.Blocks.Math.Add add1 Modelica.Blocks.Math.Add add2 Modelica.Blocks.Math.Add add3 SimpleModuleSymmetric module1( final useConstantIrradiance=false, final moduleData=moduleData, final useHeatPort=useHeatPort, final T=T, final shadow=shadow1) SimpleModuleSymmetric module2( final useConstantIrradiance=false, final moduleData=moduleData, final useHeatPort=useHeatPort, final T=T, final shadow=shadow2) SimpleModuleSymmetric module3( final useConstantIrradiance=false, final moduleData=moduleData, final useHeatPort=useHeatPort, final T=T, final shadow=shadow3) SimpleModuleSymmetric module4( final useConstantIrradiance=false, final moduleData=moduleData, final useHeatPort=useHeatPort, final T=T, final shadow=shadow4) Sources.Irradiance.IrradianceFixedSun irradianceParameter1( final irradianceRef=irradiance, final sunHeight = sunHeight, final sunAzimuth = sunAzimuth) Sources.Irradiance.IrradianceFixedSun irradianceParameter2( final irradianceRef=irradiance, final sunHeight = sunHeight, final sunAzimuth = sunAzimuth) Sources.Irradiance.IrradianceFixedSun irradianceParameter3( final irradianceRef=irradiance, final sunHeight = sunHeight, final sunAzimuth = sunAzimuth) Sources.Irradiance.IrradianceFixedSun irradianceParameter4( final irradianceRef=irradiance, final sunHeight = sunHeight, final sunAzimuth = sunAzimuth) Modelica.Electrical.Analog.Interfaces.NegativePin nModule "Common negative pin of all four PV modules (needs ground)" Modelica.Blocks.Interfaces.RealInput azimuth "Azimuth of first solar panel" Modelica.Blocks.Interfaces.RealInput gamma "Angle of inclination of each solar panel" // Voltages Modelica.Units.SI.Voltage v1=module1.v "Voltage of module 1"; Modelica.Units.SI.Voltage v2=module2.v "Voltage of module 2"; Modelica.Units.SI.Voltage v3=module3.v "Voltage of module 3"; Modelica.Units.SI.Voltage v4=module4.v "Voltage of module 4"; // Currents Modelica.Units.SI.Current i1(start=0) = module1.i "Current of module 1"; Modelica.Units.SI.Current i2(start=0) = module2.i "Current of module 2"; Modelica.Units.SI.Current i3(start=0) = module3.i "Current of module 3"; Modelica.Units.SI.Current i4(start=0) = module4.i "Current of module 4"; Modelica.Units.SI.Current iGenerating1=module1.iGenerating "Negativ current of module 1 (generating)"; Modelica.Units.SI.Current iGenerating2=module2.iGenerating "Negativ current of module 2 (generating)"; Modelica.Units.SI.Current iGenerating3=module3.iGenerating "Negativ current of module 3 (generating)"; Modelica.Units.SI.Current iGenerating4=module4.iGenerating "Negativ current of module 4 (generating)"; // Power Modelica.Units.SI.Power power1=module1.power "Power of module 1"; Modelica.Units.SI.Power power2=module2.power "Power of module 2"; Modelica.Units.SI.Power power3=module3.power "Power of module 3"; Modelica.Units.SI.Power power4=module4.power "Power of module 4"; Modelica.Units.SI.Power power=power1 + power2 + power3 + power4 "Total power of all four modules"; Modelica.Units.SI.Power powerGenerating1=module1.powerGenerating "Negative power consumption (generating) of module 1"; Modelica.Units.SI.Power powerGenerating2=module2.powerGenerating "Negative power consumption (generating) of module 2"; Modelica.Units.SI.Power powerGenerating3=module3.powerGenerating "Negative power consumption (generating) of module 3"; Modelica.Units.SI.Power powerGenerating4=module4.powerGenerating "Negative power consumption (generating) of module 4"; Modelica.Units.SI.Power powerGenerating=powerGenerating1 + powerGenerating2 + powerGenerating3 + powerGenerating4 "Total negative power consumption (generating) of all four modules"; Converters.ConvertersWithSampleMPTracker.DCConverter dcConverter1( final VRef=VRef, final Ti=Ti, final startTime=startTime, final samplePeriod=samplePeriod, final VmpRef=VmpRef, final ImpRef=ImpRef, final n=n) Converters.ConvertersWithSampleMPTracker.DCConverter dcConverter2( final VRef=VRef, final Ti=Ti, final startTime=startTime, final samplePeriod=samplePeriod, final VmpRef=VmpRef, final ImpRef=ImpRef, final n=n) Converters.ConvertersWithSampleMPTracker.DCConverter dcConverter3( final VRef=VRef, final Ti=Ti, final startTime=startTime, final samplePeriod=samplePeriod, final VmpRef=VmpRef, final ImpRef=ImpRef, final n=n) Converters.ConvertersWithSampleMPTracker.DCConverter dcConverter4( final VRef=VRef, final Ti=Ti, final startTime=startTime, final samplePeriod=samplePeriod, final VmpRef=VmpRef, final ImpRef=ImpRef, final n=n) equation connect(const.y,add1. u2) connect(const.y,add2. u2) connect(const.y,add3. u2) connect(irradianceParameter3.gamma,irradianceParameter4. gamma) connect(irradianceParameter2.gamma,irradianceParameter3. gamma) connect(irradianceParameter1.gamma,irradianceParameter2. gamma) connect(add3.y,irradianceParameter4. azimuth) connect(add2.y,irradianceParameter3. azimuth) connect(add1.y,irradianceParameter2. azimuth) connect(irradianceParameter4.irradiance,module4. variableIrradiance) connect(irradianceParameter3.irradiance,module3. variableIrradiance) connect(irradianceParameter2.irradiance,module2. variableIrradiance) connect(irradianceParameter1.irradiance, module1.variableIrradiance) connect(add3.u1,add2. y) connect(add2.u1,add1. y) connect(module4.n, nModule) connect(irradianceParameter1.azimuth, azimuth) connect(azimuth, add1.u1) connect(irradianceParameter1.gamma, gamma) connect(module3.n, nModule) connect(module2.n, nModule) connect(module1.n, nModule) connect(module3.heatPort, module4.heatPort) connect(module2.heatPort, module4.heatPort) connect(module1.heatPort, module4.heatPort) connect(module1.n, dcConverter1.dc_n1) connect(module1.p, dcConverter1.dc_p1) connect(internalHeatPort, module4.heatPort) connect(module2.p, dcConverter2.dc_p1) connect(module2.n, dcConverter2.dc_n1) connect(module3.p, dcConverter3.dc_p1) connect(module3.n, dcConverter3.dc_n1) connect(module4.p, dcConverter4.dc_p1) connect(module4.n, dcConverter4.dc_n1) connect(dcConverter1.dc_p2, dc_p) connect(dcConverter1.dc_n2, dc_n) connect(dcConverter2.dc_p2, dc_p) connect(dcConverter3.dc_p2, dc_p) connect(dcConverter4.dc_p2, dc_p) connect(dcConverter2.dc_n2, dc_n) connect(dcConverter3.dc_n2, dc_n) connect(dcConverter4.dc_n2, dc_n) end SolarPyramidDCConverter;
Compare different diode models.
within PhotoVoltaics.ComponentTesting; model DiodeCompare "Compare different diode models" extends Modelica.Icons.Example; parameter Integer ns = 10 "Number of series connected cells"; parameter Integer nsModule = 2 "Number of series connected modules"; parameter Integer npModule = 2 "Number of parallel connected modules"; parameter Modelica.Units.SI.Voltage Vmin=-5.30 "Minimum voltage range"; parameter Modelica.Units.SI.Voltage Vmax=+0.75 "Maximum voltage range"; Modelica.Electrical.Analog.Semiconductors.ZDiode zDiode(useHeatPort = true, R = 1E8, Maxexp = 0.6292 / 0.04, Ids = 1.26092E-6, T = 298.15) Modelica.Electrical.Analog.Sources.RampVoltage rampVoltage(duration = 1, startTime = 0, V = Vmax - Vmin, offset = Vmin) PhotoVoltaics.Components.Diodes.Diode2exp diode(m = 40 / 25.69, useHeatPort = true) parameter PhotoVoltaics.Records.ModuleData moduleData Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature(T = 318.15) Modelica.Electrical.Analog.Sources.RampVoltage rampVoltagem(duration = 1, startTime = 0, V = nsModule * ns * (Vmax - Vmin), offset = nsModule * ns * Vmin) Modelica.Electrical.Analog.Basic.Ground groundm PhotoVoltaics.Components.Diodes.Diode2Module diodexm(m = 40 / 25.69, useHeatPort = true, nsModule = nsModule, npModule = npModule, ns = ns) Modelica.Electrical.Analog.Basic.Ground ground equation connect(rampVoltage.p, zDiode.p) connect(zDiode.n, rampVoltage.n) connect(rampVoltage.p, diode.p) connect(rampVoltage.n, diode.n) connect(fixedTemperature.port, diode.heatPort) connect(fixedTemperature.port, zDiode.heatPort) connect(rampVoltagem.n, groundm.p) connect(diodexm.p, rampVoltagem.p) connect(diodexm.heatPort, fixedTemperature.port) connect(diodexm.n, groundm.p) connect(ground.p, rampVoltage.n) end DiodeCompare;
Testing of single components
within PhotoVoltaics; package ComponentTesting "Testing of single components" extends Modelica.Icons.ExamplesPackage; end ComponentTesting;
Test of voltage current controlled converter.
within PhotoVoltaics.ComponentTesting; model PolyphaseVoltageControlledConverter "Test of voltage current controlled converter" extends Modelica.Icons.Example; PhotoVoltaics.Components.Converters.QuasiStaticPolyphaseConverter converter Modelica.Electrical.Analog.Sources.ConstantCurrent constantCurrent(I = 1) Modelica.Electrical.Analog.Basic.Ground groundDC Modelica.Electrical.QuasiStatic.Polyphase.Sources.VoltageSource voltageSource(f=50, V=fill(400/sqrt(3), 3)) Modelica.Electrical.QuasiStatic.SinglePhase.Basic.Ground groundAC Modelica.Blocks.Sources.Ramp ramp(duration = 0.6, startTime = 0.2, height = 200, offset = -100) Modelica.Electrical.QuasiStatic.Polyphase.Basic.Star star equation connect(constantCurrent.n, converter.dc_p) connect(constantCurrent.p, converter.dc_n) connect(groundDC.p, constantCurrent.p) connect(ramp.y, converter.vDCRef) connect(star.pin_n, groundAC.pin) connect(star.plug_p, voltageSource.plug_n) connect(converter.ac, voltageSource.plug_p) end PolyphaseVoltageControlledConverter;
Test of voltage current controlled converter.
within PhotoVoltaics.ComponentTesting; model SinglePhaseVoltageControlledConverter "Test of voltage current controlled converter" extends Modelica.Icons.Example; PhotoVoltaics.Components.Converters.QuasiStaticSinglePhaseConverter converter Modelica.Electrical.Analog.Sources.ConstantCurrent constantCurrent(I = 1) Modelica.Electrical.Analog.Basic.Ground groundDC Modelica.Electrical.QuasiStatic.SinglePhase.Sources.VoltageSource voltageSource( f=50, V=100, phi=0) Modelica.Electrical.QuasiStatic.SinglePhase.Basic.Ground groundAC Modelica.Blocks.Sources.Ramp ramp(duration = 0.6, startTime = 0.2, height = 200, offset = -100) equation connect(constantCurrent.n, converter.dc_p) connect(constantCurrent.p, converter.dc_n) connect(groundDC.p, constantCurrent.p) connect(converter.ac_p, voltageSource.pin_p) connect(converter.ac_n, voltageSource.pin_n) connect(groundAC.pin, voltageSource.pin_n) connect(ramp.y, converter.vDCRef) end SinglePhaseVoltageControlledConverter;
Testing irradiance model.
within PhotoVoltaics.ComponentTesting; model TestIrradiance "Testing irradiance model" extends Modelica.Icons.Example; PhotoVoltaics.Sources.Irradiance.Irradiance irradiance(startMonth = 12, startDay = 30) Modelica.Blocks.Continuous.Integrator integrator(y(unit = "J/m2")) equation connect(irradiance.irradiance, integrator.u) end TestIrradiance;
Examples
within PhotoVoltaics; package Examples "Examples" extends Modelica.Icons.ExamplesPackage; end Examples;
Simple cell with load resistor.
within PhotoVoltaics.Examples; model SimpleCell "Simple cell with load resistor" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground ground Modelica.Electrical.Analog.Basic.VariableResistor variableResistor PhotoVoltaics.Sources.Blocks.PowerRamp powerRamp(duration = 0.6, height = 8, offset = -4, ref = moduleData.VmpCellRef / moduleData.ImpRef, startTime = 0.2) PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleCell cell(moduleData=moduleData) parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData equation connect(cell.p, variableResistor.p) connect(ground.p, cell.n) connect(ground.p, variableResistor.n) connect(variableResistor.R, powerRamp.y) end SimpleCell;
Voltage current characteristic for different irradiances.
within PhotoVoltaics.Examples; model SimpleCellIrradianceCharacteristic "Voltage current characteristic for different irradiances" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground ground Modelica.Electrical.Analog.Basic.VariableResistor variableResistor PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleCell cell(useConstantIrradiance=false, moduleData=moduleData) PhotoVoltaics.Sources.Blocks.TriangleAndStep triangleAndStep(T = 1, stepHeight = 1000, triangleHeight = 8, triangleOffset = -4) PhotoVoltaics.Components.Blocks.Power10 power10(k = moduleData.VocCellRef / moduleData.IscRef) parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData equation connect(variableResistor.n, ground.p) connect(cell.p, variableResistor.p) connect(ground.p, cell.n) connect(triangleAndStep.step, cell.variableIrradiance) connect(triangleAndStep.triangle, power10.u) connect(variableResistor.R, power10.y) end SimpleCellIrradianceCharacteristic;
Voltage current characteristic for different temperatures.
within PhotoVoltaics.Examples; model SimpleCellTemperatureCharacteristic "Voltage current characteristic for different temperatures" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground ground Modelica.Electrical.Analog.Basic.VariableResistor variableResistor PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleCell cell( moduleData=moduleData, useHeatPort=true, useConstantIrradiance=true) PhotoVoltaics.Sources.Blocks.TriangleAndStep triangleAndStep(T = 1, triangleHeight = 8, triangleOffset = -4, stepNumber = 5, stepOffset = 293.15 - 40, stepHeight = 60) PhotoVoltaics.Components.Blocks.Power10 power10(k = moduleData.VocCellRef / moduleData.IscRef) Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature prescribedTemperature parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData equation connect(variableResistor.n, ground.p) connect(cell.p, variableResistor.p) connect(ground.p, cell.n) connect(triangleAndStep.triangle, power10.u) connect(variableResistor.R, power10.y) connect(prescribedTemperature.port, cell.heatPort) connect(triangleAndStep.step, prescribedTemperature.T) end SimpleCellTemperatureCharacteristic;
Simple cell with DC voltage.
within PhotoVoltaics.Examples; model SimpleCellVoltageSource "Simple cell with DC voltage" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground ground Modelica.Blocks.Sources.Ramp rampCurrent(duration = 0.6, height = moduleData.VocCellRef + moduleData.BvCell, offset = -moduleData.BvCell, startTime = 0.2) PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleCell cell(moduleData=moduleData) Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData equation connect(signalVoltage.n, ground.p) connect(signalVoltage.p, cell.p) connect(ground.p, cell.n) connect(signalVoltage.v, rampCurrent.y) end SimpleCellVoltageSource;
Simple module with load resistor.
within PhotoVoltaics.Examples; model SimpleModule "Simple module with load resistor" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground ground PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleModule module( T=298.15, moduleData=moduleData, cell(v(start=zeros(moduleData.ns)))) PhotoVoltaics.Sources.Blocks.PowerRamp powerRamp(duration = 0.6, height = 8, offset = -4, ref = moduleData.VmpCellRef / moduleData.ImpRef, startTime = 0.2) Modelica.Electrical.Analog.Basic.VariableResistor variableResistor parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData equation connect(module.p, variableResistor.p) connect(ground.p, module.n) connect(variableResistor.n, ground.p) connect(variableResistor.R, powerRamp.y) end SimpleModule;
Simple module supplies quasi-static single-phase AC grid with maximum power tracker.
within PhotoVoltaics.Examples; model SimpleModuleMP "Simple module supplies quasi-static single-phase AC grid with maximum power tracker" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground groundDC PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleModuleSymmetric module( moduleData=moduleData, T=298.15, useConstantIrradiance=false) Modelica.Blocks.Sources.Ramp ramp(duration = 100, startTime = 100, height = 800, offset = 200) PhotoVoltaics.Components.Converters.QuasiStaticSinglePhaseConverter converter PhotoVoltaics.Components.Blocks.MPTrackerSample mpTracker(VmpRef = moduleData.VmpRef, ImpRef = moduleData.ImpRef) Modelica.Electrical.QuasiStatic.SinglePhase.Basic.Ground groundAC Modelica.Electrical.QuasiStatic.SinglePhase.Sources.VoltageSource voltageSource( f=50, V=230, phi=0, gamma(fixed=true, start=0)) Modelica.Electrical.Analog.Sensors.PowerSensor powerSensor parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData equation connect(groundDC.p, module.n) connect(ramp.y, module.variableIrradiance) connect(groundDC.p, converter.dc_n) connect(mpTracker.vRef, converter.vDCRef) connect(converter.ac_n, groundAC.pin) connect(groundAC.pin, voltageSource.pin_n) connect(module.p, powerSensor.pc) connect(powerSensor.nc, converter.dc_p) connect(mpTracker.power, powerSensor.power) connect(powerSensor.pc, powerSensor.pv) connect(powerSensor.nv, groundDC.p) connect(converter.ac_p, voltageSource.pin_p) end SimpleModuleMP;
Simple module supplies quasi-static three-phase AC grid with maximum power tracker.
within PhotoVoltaics.Examples; model SimpleModuleMP3 "Simple module supplies quasi-static three-phase AC grid with maximum power tracker" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground groundDC PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleModuleSymmetric module( moduleData=moduleData, T=298.15, useConstantIrradiance=false) Modelica.Blocks.Sources.Ramp ramp(duration = 100, startTime = 100, height = 800, offset = 200) PhotoVoltaics.Components.Converters.QuasiStaticPolyphaseConverter converter PhotoVoltaics.Components.Blocks.MPTrackerSample mpTracker(VmpRef = moduleData.VmpRef, ImpRef = moduleData.ImpRef) Modelica.Electrical.QuasiStatic.SinglePhase.Basic.Ground groundAC Modelica.Electrical.QuasiStatic.Polyphase.Sources.VoltageSource voltageSource( f=50, V=fill(400/sqrt(3), 3), gamma(fixed=true, start=0)) Modelica.Electrical.Analog.Sensors.PowerSensor powerSensor Modelica.Electrical.QuasiStatic.Polyphase.Basic.Star star parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData equation connect(groundDC.p, module.n) connect(ramp.y, module.variableIrradiance) connect(groundDC.p, converter.dc_n) connect(mpTracker.vRef, converter.vDCRef) connect(module.p, powerSensor.pc) connect(powerSensor.nc, converter.dc_p) connect(mpTracker.power, powerSensor.power) connect(powerSensor.pc, powerSensor.pv) connect(powerSensor.nv, groundDC.p) connect(star.plug_p, voltageSource.plug_n) connect(star.pin_n, groundAC.pin) connect(converter.ac, voltageSource.plug_p) end SimpleModuleMP3;
Simple module supplies DC grid with maximum power tracker.
within PhotoVoltaics.Examples; model SimpleModuleMPDC "Simple module supplies DC grid with maximum power tracker" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground groundDC PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleModuleSymmetric module( moduleData=moduleData, T=298.15, useConstantIrradiance=false) PhotoVoltaics.Components.Converters.DCConverter converter PhotoVoltaics.Components.Blocks.MPTrackerSample mpTracker(VmpRef = moduleData.VmpRef, ImpRef = moduleData.ImpRef, samplePeriod=10) Modelica.Electrical.Analog.Basic.Ground ground Modelica.Electrical.Analog.Sensors.PowerSensor powerSensor parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData PhotoVoltaics.Sources.Electrical.IdealBattery battery( ns=4, np=1, V1Cell=14, V0Cell=11, ECell=12*100*3600, allowOvercharge=true, allowUndercharge=true, ViniCell=11) PhotoVoltaics.Sources.Irradiance.Irradiance irradiance equation connect(groundDC.p, module.n) connect(mpTracker.vRef, converter.vDCRef) connect(module.p, powerSensor.pc) connect(mpTracker.power, powerSensor.power) connect(powerSensor.pc, powerSensor.pv) connect(powerSensor.nv, groundDC.p) connect(battery.pin_n, ground.p) connect(irradiance.irradiance, module.variableIrradiance) connect(groundDC.p, converter.dc_n1) connect(converter.dc_p1, powerSensor.nc) connect(converter.dc_p2, battery.pin_p) connect(converter.dc_n2, ground.p) end SimpleModuleMPDC;
Simple module supplies transient three-phase AC grid with maximum power tracker.
within PhotoVoltaics.Examples; model SimpleModulePolyphase "Simple module supplies transient three-phase AC grid with maximum power tracker" import Modelica.Constants.pi; extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground groundDC Modelica.Electrical.Analog.Sensors.PowerSensor powerSensor Modelica.Electrical.Polyphase.Basic.Star star Modelica.Electrical.Analog.Basic.Ground ground Modelica.Electrical.Polyphase.Sources.CosineVoltage cosineVoltage( f=fill(50, 3), V=fill(400*sqrt(2/3), 3), phase=-Modelica.Electrical.Polyphase.Functions.symmetricOrientation(3)) Modelica.Blocks.Sources.Ramp ramp( height=-100, duration=2, offset=1000, startTime=1) Modelica.Blocks.Sources.Constant powerfactor(k=-acos(0.9)) PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleModuleSymmetric module( moduleData=moduleData, useConstantIrradiance=false, T=298.15) PhotoVoltaics.Components.Blocks.MPTrackerSample mpTracker(VmpRef=moduleData.VmpRef, ImpRef=moduleData.ImpRef, samplePeriod=0.1) PhotoVoltaics.Components.Converters.PolyphaseConverter converter parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData Modelica.Electrical.Polyphase.Sensors.PowerSensor powerSensorGrid Modelica.Electrical.Polyphase.Sensors.VoltageQuasiRMSSensor voltageQuasiRMSSensor(m=3) Modelica.Electrical.Polyphase.Sensors.CurrentQuasiRMSSensor currentQuasiRMSSensor(final m=3) Modelica.Blocks.Math.Division powerFactorActual Modelica.Blocks.Math.Product product Modelica.Blocks.Math.Gain gain(final k=3) Modelica.Units.SI.Power powerDC=powerSensor.power "DC power"; Modelica.Units.SI.Power powerAC=powerSensorGrid.power "AC real power"; Modelica.Units.SI.ApparentPower aparrentPowerAC=powerFactorActual.u2 "AC apparent power"; Real powerFactorAC = powerFactorActual.y "Actual power factor"; Modelica.Blocks.Nonlinear.Limiter limiter(uMax=Modelica.Constants.inf, uMin=Modelica.Constants.small) equation connect(powerSensor.pc,powerSensor. pv) connect(powerSensor.nv,groundDC. p) connect(ground.p,star. pin_n) connect(cosineVoltage.plug_n,star. plug_p) connect(module.variableIrradiance, ramp.y) connect(module.n, groundDC.p) connect(module.p, powerSensor.pc) connect(converter.dc_p, powerSensor.nc) connect(converter.dc_n, groundDC.p) connect(mpTracker.power, powerSensor.power) connect(mpTracker.vRef, converter.vDCRef) connect(powerfactor.y, converter.phi) connect(converter.ac, powerSensorGrid.pc) connect(powerSensorGrid.pv, powerSensorGrid.pc) connect(powerSensorGrid.nv, star.plug_p) connect(powerSensorGrid.nc, currentQuasiRMSSensor.plug_p) connect(currentQuasiRMSSensor.plug_n, cosineVoltage.plug_p) connect(voltageQuasiRMSSensor.plug_n, star.plug_p) connect(voltageQuasiRMSSensor.plug_p, currentQuasiRMSSensor.plug_n) connect(powerFactorActual.u1, powerSensorGrid.power) connect(gain.u, product.y) connect(product.u1, currentQuasiRMSSensor.I) connect(product.u2, voltageQuasiRMSSensor.V) connect(limiter.y, powerFactorActual.u2) connect(limiter.u, gain.y) end SimpleModulePolyphase;
Simple module with load resistor, partially shadowed.
within PhotoVoltaics.Examples; model SimpleModuleShadow "Simple module with load resistor, partially shadowed" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground ground PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleModule module( moduleData=moduleData, T=298.15, shadow=cat( 1, fill(0.2, 1), fill(0, moduleData.ns - 1)), cell(v(start=zeros(moduleData.ns))), diode(i(start=fill(1E-11, moduleData.nb)))) Modelica.Electrical.Analog.Basic.VariableResistor variableResistor PhotoVoltaics.Sources.Blocks.PowerRamp powerRamp(duration = 0.6, height = 8, offset = -4, ref = moduleData.VmpCellRef / moduleData.ImpRef, startTime = 0.2) parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData equation connect(powerRamp.y, variableResistor.R) connect(variableResistor.n, ground.p) connect(module.p, variableResistor.p) connect(ground.p, module.n) end SimpleModuleShadow;
Simple symmetric module without freewheeling diodes.
within PhotoVoltaics.Examples; model SimpleModuleSymmetric "Simple symmetric module without freewheeling diodes" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground ground PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleModuleSymmetric module(T=298.15, moduleData=moduleData) PhotoVoltaics.Sources.Blocks.PowerRamp powerRamp(duration = 0.6, height = 8, offset = -4, ref = moduleData.VmpCellRef / moduleData.ImpRef, startTime = 0.2) Modelica.Electrical.Analog.Basic.VariableResistor variableResistor parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData equation connect(variableResistor.n, ground.p) connect(module.p, variableResistor.p) connect(variableResistor.R, powerRamp.y) connect(ground.p, module.n) end SimpleModuleSymmetric;
Simple symmetric plant.
within PhotoVoltaics.Examples; model SimplePlantSymmetric "Simple symmetric plant" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground ground PhotoVoltaics.Components.SimplePhotoVoltaics.SimplePlantSymmetric plant( moduleData=moduleData, T=298.15, nsModule=10, npModule=2) PhotoVoltaics.Sources.Blocks.PowerRamp powerRamp(duration = 0.6, height = 8, offset = -4, ref = moduleData.VmpCellRef / moduleData.ImpRef, startTime = 0.2) Modelica.Electrical.Analog.Basic.VariableResistor variableResistor parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData equation connect(variableResistor.n, ground.p) connect(plant.p, variableResistor.p) connect(variableResistor.R, powerRamp.y) connect(ground.p, plant.n) end SimplePlantSymmetric;
Solar pyramid charging a battery.
within PhotoVoltaics.Examples; model SolarPyramidBatteryCharge "Solar pyramid charging a battery" import Modelica.Constants.pi; extends Modelica.Icons.Example; PhotoVoltaics.Components.SimplePhotoVoltaics.SolarPyramidDCConverter solarPyramid( moduleData=moduleData, VRef=moduleData.VmpRef, VmpRef=moduleData.VmpRef, ImpRef=moduleData.ImpRef, samplePeriod=0.5, sunHeight=0.38397243543875) Modelica.Blocks.Sources.Ramp gammaRamp( offset=0, height=60*pi/180, startTime=10, duration=480) Modelica.Blocks.Sources.Constant azimuthConst(k=260*pi/180) Modelica.Electrical.Analog.Basic.Ground ground Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage(V=24) parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData Modelica.Units.NonSI.Angle_deg gamma_deg= Modelica.Units.Conversions.to_deg(solarPyramid.gamma); equation connect(gammaRamp.y, solarPyramid.gamma) connect(azimuthConst.y, solarPyramid.azimuth) connect(ground.p, solarPyramid.nModule) connect(solarPyramid.dc_n, ground.p) connect(solarPyramid.dc_p, constantVoltage.p) connect(solarPyramid.dc_n, constantVoltage.n) end SolarPyramidBatteryCharge;
Functions
within PhotoVoltaics; package Functions "Functions" extends Modelica.Icons.Package; end Functions;
Interfaces
within PhotoVoltaics; package Interfaces "Interfaces" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Partial cell model. The partial cell model considers the basic components of a simple <a href=\"modelica://PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleCell\">cell</a>, simple symmetric <a href=\"modelica://PhotoVoltaics.Components.SimplePhotoVoltaics.SimpleModuleSymmetric\">module</a> and simple symmetric <a href=\"modelica://PhotoVoltaics.Components.SimplePhotoVoltaics.SimplePlantSymmetric\">plant</a> model.
within PhotoVoltaics.Interfaces; partial model PartialCell "Partial cell model" extends PhotoVoltaics.Interfaces.PartialComponent; parameter Real shadow = 0 "Shadow based on: 0 = full sun, 1 = full shadow"; PhotoVoltaics.Components.Diodes.Diode2Module diode(final useHeatPort = useHeatPort, final T = T, final TRef = moduleData.TRef) PhotoVoltaics.Sources.Electrical.SignalCurrent signalCurrent(final useHeatPort = useHeatPort, final T = T, final TRef = moduleData.TRef) Modelica.Blocks.Math.Gain gain(final k=PhotoVoltaics.Functions.limit(1-shadow,0,1)) equation connect(gain.y, signalCurrent.irradiance) connect(irradiance, gain.u) connect(signalCurrent.p, n) connect(p, signalCurrent.n) connect(diode.p, signalCurrent.n) connect(signalCurrent.heatPort, internalHeatPort) connect(diode.n, signalCurrent.p) connect(diode.heatPort, internalHeatPort) end PartialCell;
Partial cell or module. This partial model contains the connectors and some parameters of photovoltaic components. Interfaces voltages, currents and power terms are defined.
within PhotoVoltaics.Interfaces; partial model PartialComponent "Partial cell or module" extends Modelica.Electrical.Analog.Interfaces.TwoPin(v(start = 0)); extends Modelica.Thermal.HeatTransfer.Interfaces.PartialConditionalHeatPort( T = 298.15); parameter Boolean useConstantIrradiance = true "If false, signal input is used" parameter Modelica.Units.SI.Irradiance constantIrradiance=1000 "Constant solar irradiance, if useConstantIrradiance = true" parameter Records.ModuleData moduleData "Module parameters" Modelica.Units.SI.Current i=p.i "Current"; Modelica.Units.SI.Current iGenerating=-i "Negative current (generating)"; Modelica.Units.SI.Power power=v*i "Power"; Modelica.Units.SI.Power powerGenerating=v*iGenerating "Negative power consumption (generating)"; Modelica.Blocks.Interfaces.RealInput variableIrradiance(unit = "W/m2") if not useConstantIrradiance "Solar irradiance" Modelica.Blocks.Sources.Constant const(final k = constantIrradiance) if useConstantIrradiance protected Modelica.Blocks.Interfaces.RealInput irradiance(unit = "W/m2") "Solar irradiance (either constant or signal input)" equation connect(irradiance, variableIrradiance) connect(const.y, irradiance) end PartialComponent;
Diode with one exponential function. This partial model of the diode does not yet contain any current versus voltage characteristic. In this model the temperature dependencies of the temperature voltage, the saturation current, etc. are defined.
within PhotoVoltaics.Interfaces; partial model PartialDiode "Diode with one exponential function" extends Modelica.Electrical.Analog.Interfaces.OnePort(v(start = 0)); extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort(T = 298.15); constant Modelica.Units.SI.Charge Q=1.6021766208E-19 "Elementary charge of electron"; parameter Real m = 1 "Ideality factor of diode"; parameter Modelica.Units.SI.Resistance R=1E8 "Parallel ohmic resistance"; parameter Modelica.Units.SI.Temperature TRef=298.15 "Reference temperature" parameter Modelica.Units.SI.Voltage VRef(min=Modelica.Constants.small) = 0.6292 "Reference voltage > 0, i.e. open circuit voltage, at TRef" parameter Modelica.Units.SI.Current IRef(min=Modelica.Constants.small) = 8.540 "Reference current > 0, i.e. short circuit current, at TRef" parameter Modelica.Units.SI.LinearTemperatureCoefficient alphaI=+0.00053 "Temperature coefficient of reference current at TRef" parameter Modelica.Units.SI.LinearTemperatureCoefficient alphaV=-0.00340 "Temperature coefficient of reference voltage at TRef*" Modelica.Units.SI.Voltage Vt "Voltage equivalent of temperature (k*T/Q)"; Modelica.Units.SI.Voltage VRefActual "Reference voltage w.r.t. actual temperature"; Modelica.Units.SI.Current IRefActual "Reference current w.r.t. actual temperature"; Modelica.Units.SI.Current Ids "Saturation current"; equation // Temperature dependent voltage Vt = Modelica.Constants.k * T_heatPort / Q; // Re-calculate reference voltage and current with respect to reference temperature VRefActual = VRef * (1 + alphaV * (T_heatPort - TRef)); IRefActual = IRef * (1 + alphaI * (T_heatPort - TRef)); // Actual temperature dependent saturation current is determined from reference voltage and current Ids = IRefActual / (exp(VRefActual / m / Vt) - 1); LossPower = v * i; end PartialDiode;
Single-phase AC pins. This model provides single-phase AC quasi static pins.
within PhotoVoltaics.Interfaces.QuasiStatic; partial model ACpins "Single-phase AC pins" import Modelica.ComplexMath.conj; Modelica.Electrical.QuasiStatic.SinglePhase.Interfaces.PositivePin ac_p "AC positive pin" Modelica.Electrical.QuasiStatic.SinglePhase.Interfaces.NegativePin ac_n "AC negative pin" Modelica.Units.SI.ComplexVoltage vAC=ac_p.v - ac_n.v "AC potential"; Modelica.Units.SI.ComplexCurrent iAC=ac_p.i "AC current"; Modelica.Units.SI.ComplexPower apparentPowerAC=vAC .* conj(iAC) "AC apparent power"; end ACpins;
AC polyphase plug. This model provides a polyphase AC quasi static plug.
within PhotoVoltaics.Interfaces.QuasiStatic; partial model ACplug "AC polyphase plug" import Modelica.ComplexMath.conj; parameter Integer m(final min = 3) = 3 "Number of phases"; Modelica.Electrical.QuasiStatic.Polyphase.Interfaces.PositivePlug ac(final m=m) "AC output" Modelica.Units.SI.ComplexVoltage vAC[m]=ac.pin[:].v "AC potential"; Modelica.Units.SI.ComplexCurrent iAC[m]=ac.pin[:].i "AC current"; Modelica.Units.SI.ComplexPower apparentPowerAC[m]=vAC .* conj(iAC) "AC apparent power"; end ACplug;
Quasi-static interfaces
within PhotoVoltaics.Interfaces; package QuasiStatic "Quasi-static interfaces" extends Modelica.Icons.Package; end QuasiStatic;
Records
within PhotoVoltaics; package Records "Records" extends Modelica.Icons.RecordsPackage; end Records;
Sources
within PhotoVoltaics; package Sources "Sources" extends Modelica.Icons.Package; end Sources;
Block sources
within PhotoVoltaics.Sources; package Blocks "Block sources" extends Modelica.Icons.Package; end Blocks;
Generate ramp signal based logarithmic range. The Real output y of this block is determined by a <a href=\"modelica://Modelica.Blocks.Sources.Ramp\">ramp</a> output from which
within PhotoVoltaics.Sources.Blocks; block PowerRamp "Generate ramp signal based logarithmic range" parameter Real height = 1 "Height of ramps"; parameter Modelica.Units.SI.Time duration(min=0.0, start=2) "Duration of ramp (= 0.0 gives a Step)"; parameter Real offset = 0 "Offset of output signal"; parameter Modelica.Units.SI.Time startTime=0 "Output = offset for time < startTime"; parameter Real ref = 1 "Reference value, determined by ref * 10 ^ (ramp function)"; extends Modelica.Blocks.Interfaces.SO; equation y = ref * 10 ^ (offset + (if time < startTime then 0 else if time < startTime + duration then (time - startTime) * height / duration else height)); end PowerRamp;
Multiple steps and triangles.
within PhotoVoltaics.Sources.Blocks; block TriangleAndStep "Multiple steps and triangles" parameter Modelica.Units.SI.Time T=1 "Total time of varying outputs"; parameter Integer stepNumber = 5 "Number of steps"; parameter Real stepHeight = 1 "Total step height"; parameter Real stepOffset = 0 "Offset"; parameter Modelica.Units.SI.Time startTime=0 "Start time"; parameter Real triangleHeight = 1 "Height of triangle output"; parameter Real triangleOffset = 0 "Offset of triangle output"; Modelica.Blocks.Sources.Ramp ramp( final startTime=startTime, final height=stepNumber - 1, final duration=T*(stepNumber - 1)/stepNumber, final offset=0) Modelica.Blocks.Math.RealToInteger realToInteger Modelica.Blocks.Math.IntegerToReal integerToReal Modelica.Blocks.Math.Feedback feedback Modelica.Blocks.Sources.Constant constantOffset(final k = stepOffset) Modelica.Blocks.Math.Add add Modelica.Blocks.Math.Gain gain(final k = stepHeight / (stepNumber - 1)) Modelica.Blocks.Sources.Trapezoid trapezoid(final amplitude = triangleHeight, final rising = T / stepNumber / 2, final width = 0, final falling = T / stepNumber / 2, final period = T / stepNumber, final nperiod = stepNumber, final offset = triangleOffset, final startTime = startTime) Modelica.Blocks.Interfaces.RealOutput step Modelica.Blocks.Interfaces.RealOutput triangle Modelica.Blocks.Sources.Step const(offset=0, startTime=0, height=0.5) Modelica.Blocks.Nonlinear.Limiter limiter(final uMax=Modelica.Constants.inf, final uMin=0) equation connect(realToInteger.y, integerToReal.u) connect(ramp.y, feedback.u1) connect(integerToReal.y, gain.u) connect(constantOffset.y, add.u1) connect(gain.y, add.u2) connect(add.y, step) connect(trapezoid.y, triangle) connect(const.y, feedback.u2) connect(feedback.y, limiter.u) connect(limiter.y, realToInteger.u) end TriangleAndStep;
Re-chargeable ideal battery without loss. This is a simple, linear rechargable battery model. The actual physical model consists of one capacitor. In order to consider the number of series and parallel connected cells, an internal scaling of voltages, currents and power terms, is performed.
within PhotoVoltaics.Sources.Electrical; model IdealBattery "Re-chargeable ideal battery without loss" parameter Integer ns(min = 1) = 1 "Number of series cells"; parameter Integer np(min = 1) = 1 "Number of parallel cells"; parameter Modelica.Units.SI.Voltage V1Cell "Maximum cell voltage > V0Cell"; parameter Modelica.Units.SI.Voltage V0Cell "Minimum cell voltage < V1Cell"; final parameter Modelica.Units.SI.Voltage V1=V1Cell*ns "Maximum battery voltage > V0"; final parameter Modelica.Units.SI.Voltage V0=V0Cell*ns "Maximum battery voltage < V1"; parameter Boolean allowOvercharge = false "Allows overcharging without error"; parameter Boolean allowUndercharge = false "Allows undercharging without error"; parameter Modelica.Units.SI.Energy ECell "Total cell energy between V0Cell and V1Cell"; final parameter Modelica.Units.SI.Capacitance CCell=2*ECell/(V1Cell^2 - V0Cell^2) "Total charge of battery"; parameter Modelica.Units.SI.Voltage ViniCell=V1Cell "Initial cell voltage"; Modelica.Units.SI.Voltage v=pin_p.v - pin_n.v "Battery voltage"; Modelica.Units.SI.Voltage vCell=v/ns "Cell voltage"; Modelica.Units.SI.Current i=capacitor.i "Battery current"; Modelica.Units.SI.Current iCell=i/np "Cell current"; Modelica.Units.SI.Power power=v*i "Battery power"; Modelica.Units.SI.Power powerCell=power/ns/np "Cell power"; Modelica.Units.SI.Energy energy "Energy"; Modelica.Units.SI.Energy energyCell "Cell energy"; Modelica.Electrical.Analog.Basic.Capacitor capacitor(final C = CCell * np / ns, v(start = ns * ViniCell, fixed = true)) Modelica.Electrical.Analog.Interfaces.PositivePin pin_p "Positive pin" Modelica.Electrical.Analog.Interfaces.NegativePin pin_n "Negative pin" initial equation energyCell = CCell * (ViniCell ^ 2 - V0Cell ^ 2) / 2; equation der(energy) = power; energyCell * ns * np = energy; assert(vCell >= V0Cell or allowUndercharge, "Battery: cell voltage less than V0Cell"); assert(vCell <= V1Cell or allowOvercharge, "Battery: cell voltage greater than V1Cell"); connect(pin_p, capacitor.p) connect(capacitor.n, pin_n) end IdealBattery;
Electrical sources
within PhotoVoltaics.Sources; package Electrical "Electrical sources" extends Modelica.Icons.Package; end Electrical;
Generic current source using the input signal as source current. The signal current source is a converter of real valued irradiance signal into a source current. Depending on the actual temperature the current is adjusted through a linear temperature coeffficient.
within PhotoVoltaics.Sources.Electrical; model SignalCurrent "Generic current source using the input signal as source current" extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort(T = 298.15); parameter Modelica.Units.SI.Temperature TRef=298.15 "Reference temperature"; parameter Modelica.Units.SI.Current IRef=1 "Reference current at reference irradiance and reference temperature"; parameter Modelica.Units.SI.Irradiance irradianceRef=1000 "Reference solar irradiance"; parameter Modelica.Units.SI.LinearTemperatureCoefficient alphaRef=0 "Temperature coefficient of reference current at TRref"; Modelica.Electrical.Analog.Interfaces.PositivePin p Modelica.Electrical.Analog.Interfaces.NegativePin n Modelica.Units.SI.Voltage v "Voltage drop between the two pins (= p.v - n.v)"; Modelica.Units.SI.Current i "Current flowing from pin p to pin n as input signal"; Modelica.Blocks.Interfaces.RealInput irradiance(unit = "W/m2") "Irradiance" equation i = IRef * (irradiance / irradianceRef + alphaRef * (T_heatPort - TRef)); v = p.v - n.v; 0 = p.i + n.i; i = p.i; LossPower = 0; end SignalCurrent;
Unrooted variable polyphase AC current source.
within PhotoVoltaics.Sources.Electrical; model VariableUnrootedPolyphaseCurrentSource "Unrooted variable polyphase AC current source" extends Modelica.Electrical.QuasiStatic.Polyphase.Interfaces.OnePort; import Modelica.Constants.pi; Modelica.ComplexBlocks.Interfaces.ComplexInput I[m] equation i = I; end VariableUnrootedPolyphaseCurrentSource;
Unrooted variable polyphase AC current source.
within PhotoVoltaics.Sources.Electrical; model VariableUnrootedSinglePhaseCurrentSource "Unrooted variable polyphase AC current source" extends Modelica.Electrical.QuasiStatic.SinglePhase.Interfaces.OnePort; import Modelica.Constants.pi; Modelica.ComplexBlocks.Interfaces.ComplexInput I equation i = I; end VariableUnrootedSinglePhaseCurrentSource;
Simple solar irradiance without considering weather conditions.
within PhotoVoltaics.Sources.Irradiance; model Irradiance "Simple solar irradiance without considering weather conditions" import Modelica.Constants.pi; import PhotoVoltaics.Functions.rad; import PhotoVoltaics.Functions.degree; import PhotoVoltaics.Functions.dayOfTheYear; parameter Integer startDay(final min = 1, final max = 31) = 10 "Day"; parameter Integer startMonth(final min = 1, final max = 12) = 9 "Month"; parameter Integer startYear = 2016 "Year"; parameter Integer TimeZone = 1 "Time zone"; parameter Modelica.Units.SI.Angle longitude=0.2856929452589518 "Longitude"; parameter Modelica.Units.SI.Angle latitude=0.8418964085999744 "Latitude"; parameter Modelica.Units.SI.Irradiance irradianceRef=1000 "Reference solar irradiance"; parameter Modelica.Units.SI.Angle gamma=10*pi/180 "Angle of PV module with w.r.t. horizontal plane"; parameter Modelica.Units.SI.Angle azimuth=0 "Azimuth of the PV module orientation"; Integer startDayOfYear(start = dayOfTheYear(startDay, startMonth, startYear), fixed = true) "Start day of year in simulation"; Integer dayOfYear(final start = dayOfTheYear(startDay, startMonth, startYear), fixed = true) "Actual day of year"; Integer daysOfYear(final start = dayOfTheYear(31, 12, startYear), fixed = true) "Total number of days of year"; Integer year(final start = startYear, fixed = true) "Actual year"; Modelica.Units.SI.Angle Jprime(final start=dayOfTheYear( startDay, startMonth, startYear)/dayOfTheYear( 31, 12, startYear)*2*pi, fixed=true) "Equivalent Angle of the day of the year w.r.t. total number of days"; Real delta_J; Real timeequation_J; Modelica.Units.NonSI.Time_day localTimeDays "Local time in days"; Integer localDays "Locale day"; Modelica.Units.SI.Time localTime "Local time"; Modelica.Units.NonSI.Time_hour localTimeHours "Local time in unit hours"; Modelica.Units.NonSI.Time_hour LocalMeanTimeHours "Local mean time in unit hours"; Modelica.Units.NonSI.Time_hour trueMeanTimeHours "True mean time in unit hours"; Modelica.Units.SI.Angle hoursAngle "Hours angle"; Modelica.Units.SI.Angle sunHeight "Sun height"; Modelica.Units.SI.Angle sunAzimuth1 "Sun azimuth before 12 p.m."; Modelica.Units.SI.Angle sunAzimuth2 "Sun azimuth after 12 p.m."; Modelica.Units.SI.Angle sunAzimuth "Sun azimuth"; Modelica.Units.SI.Angle angleOfIncidence "Angle of incidence between a vector in sun direction and a normal vector"; Modelica.Units.SI.Irradiance directIrradianceHorizontal "Direct irradiance on the horizontal in W/m^2"; Modelica.Units.SI.Irradiance directIrradianceInclined "Direct irradiance on the inclined plane in w/m^2"; Modelica.Blocks.Interfaces.RealOutput irradiance "Irradiance of inclined area" algorithm // Calculate ratio of day w.r.t. total number of days of a year as equivalent angle when sample(24 * 3600, 24 * 3600) then dayOfYear := mod(pre(dayOfYear), pre(daysOfYear)) + 1; end when; when startDayOfYear + localDays == daysOfYear + 1 then startDayOfYear := 1; year := pre(year) + 1; daysOfYear := dayOfTheYear(31, 12, year); end when; // One full year is reached // Reset start day of year // Increment year // Determined actual number of total days of year equation Jprime = dayOfYear / daysOfYear * 2 * pi; delta_J = rad(0.3948 - 23.2559 * cos(Jprime + rad(9.1)) - 0.3915 * cos(2 * Jprime + rad(5.4)) - 0.1764 * cos(3 * Jprime + rad(26))); timeequation_J = 0.0066 + 7.3525 * cos(Jprime + rad(85.9)) + 9.9359 * cos(2 * Jprime + rad(108.9)) + 0.3387 * cos(3 * Jprime + rad(105.2)); // Zeit LZ = time localTime = time; // Convert time into unit hours localTimeHours = localTime / 3600; // Convert time into unit days localTimeDays = localTimeHours / 24; // Convert time from real days into integer days (floor) localDays = integer(floor(localTimeDays)); // Calculate locale mean time LocalMeanTimeHours = localTimeHours - TimeZone + 4 / 60 * longitude * 180 / Modelica.Constants.pi; // cos(latitude)*tan(...) trueMeanTimeHours = LocalMeanTimeHours + timeequation_J / 60; hoursAngle = rad((12 - trueMeanTimeHours) * 15); sunHeight = degree(asin(cos(hoursAngle) * cos(latitude) * cos(delta_J) + sin(latitude) * sin(delta_J))) * (Modelica.Constants.pi / 180); sunAzimuth1 = Modelica.Constants.pi - acos((sin(sunHeight) * sin(latitude) - sin(delta_J)) / (cos(sunHeight) * cos(latitude))); sunAzimuth2 = Modelica.Constants.pi + acos((sin(sunHeight) * sin(latitude) - sin(delta_J)) / (cos(sunHeight) * cos(latitude))); sunAzimuth = if mod(localTimeHours, 24) <= 12 then sunAzimuth1 else sunAzimuth2; angleOfIncidence = acos((-cos(sunHeight) * sin(gamma) * cos(sunAzimuth - azimuth)) + sin(sunHeight) * cos(gamma)); directIrradianceHorizontal = if sunHeight < 0 then 0 else irradianceRef * sin(sunHeight); directIrradianceInclined = if angleOfIncidence > pi / 2 then 0 else if abs(sin(sunHeight)) < 1E-5 then 0 else directIrradianceHorizontal * (cos(angleOfIncidence) / sin(sunHeight)); irradiance = directIrradianceInclined; end Irradiance;
Simple solar irradiance with fixed sun position.
within PhotoVoltaics.Sources.Irradiance; model IrradianceFixedSun "Simple solar irradiance with fixed sun position" import Modelica.Constants.pi; parameter Modelica.Units.SI.Irradiance irradianceRef=1000 "Reference solar irradiance"; parameter Modelica.Units.SI.Angle sunHeight "Sun height"; parameter Modelica.Units.SI.Angle sunAzimuth "Sun azimuth"; Modelica.Units.SI.Angle angleOfIncidence "Angle of incidence between a vector in sun direction and a normal vector"; Modelica.Units.SI.Irradiance directIrradianceHorizontal "Direct irradiance on the horizontal"; Modelica.Units.SI.Irradiance directIrradianceInclined "Direct irradiance on the inclined plane"; Modelica.Blocks.Interfaces.RealOutput irradiance Modelica.Blocks.Interfaces.RealInput gamma Modelica.Blocks.Interfaces.RealInput azimuth equation angleOfIncidence = acos((-cos(sunHeight) * sin(gamma) * cos(sunAzimuth - azimuth)) + sin(sunHeight) * cos(gamma)); directIrradianceHorizontal = if sunHeight < 0 then 0 else irradianceRef * sin(sunHeight); directIrradianceInclined = if angleOfIncidence > pi / 2 then 0 else if abs(sin(sunHeight)) < 1E-5 then 0 else directIrradianceHorizontal * (cos(angleOfIncidence) / sin(sunHeight)); irradiance = directIrradianceInclined; end IrradianceFixedSun;
Simple solar irradiance without considering weather conditions.
within PhotoVoltaics.Sources.Irradiance; model IrradianceVariableLocation "Simple solar irradiance without considering weather conditions" import Modelica.Constants.pi; import PhotoVoltaics.Functions.rad; import PhotoVoltaics.Functions.degree; import PhotoVoltaics.Functions.dayOfTheYear; parameter Integer startDay(final min = 1, final max = 31) = 10 "Day"; parameter Integer startMonth(final min = 1, final max = 12) = 9 "Month"; parameter Integer startYear = 2016 "Year"; parameter Integer TimeZone = 1 "Time zone"; parameter Modelica.Units.SI.Angle longitude=0.2856929452589518 "Longitude"; parameter Modelica.Units.SI.Angle latitude=0.8418964085999744 "Latitude"; parameter Modelica.Units.SI.Irradiance irradianceRef=1000 "Reference solar irradiance"; Integer startDayOfYear(start = dayOfTheYear(startDay, startMonth, startYear)) "Start day of year in simulation"; Integer dayOfYear(final start = dayOfTheYear(startDay, startMonth, startYear)) "Actual day of year"; Integer daysOfYear(final start = dayOfTheYear(31, 12, startYear)) "Total number of days of year"; Integer year(final start = startYear) "Actual year"; Modelica.Units.SI.Angle Jprime(final start=dayOfTheYear( startDay, startMonth, startYear)/dayOfTheYear( 31, 12, startYear)*2*pi) "Equivalent Angle of the day of the year w.r.t. total number of days"; Real delta_J; Real timeequation_J; Modelica.Units.NonSI.Time_day localTimeDays "Local time in days"; Integer localDays "Locale day"; Modelica.Units.SI.Time localTime "Local time"; Modelica.Units.NonSI.Time_hour localTimeHours "Local time in unit hours"; Modelica.Units.NonSI.Time_hour LocalMeanTimeHours "Local mean time in unit hours"; Modelica.Units.NonSI.Time_hour trueMeanTimeHours "True mean time in unit hours"; Modelica.Units.SI.Angle hoursAngle "Hours angle"; Modelica.Units.SI.Angle sunHeight "Sun height"; Modelica.Units.SI.Angle sunAzimuth1 "Sun azimuth before 12 p.m."; Modelica.Units.SI.Angle sunAzimuth2 "Sun azimuth after 12 p.m."; Modelica.Units.SI.Angle sunAzimuth "Sun azimuth"; Modelica.Units.SI.Angle angleOfIncidence "Angle of incidence between a vector in sun direction and a normal vector"; Modelica.Units.SI.Irradiance directIrradianceHorizontal "Direct irradiance on the horizontal in W/m^2"; Modelica.Units.SI.Irradiance directIrradianceInclined "Direct irradiance on the inclined plane in w/m^2"; Modelica.Blocks.Interfaces.RealOutput irradiance "Irradiance of inclined area" Modelica.Blocks.Interfaces.RealInput gamma "Inclination angle of area" Modelica.Blocks.Interfaces.RealInput azimuth "Azimuth of area" algorithm // Calculate ratio of day w.r.t. total number of days of a year as equivalent angle when sample(24 * 3600, 24 * 3600) then dayOfYear := mod(pre(dayOfYear), pre(daysOfYear)) + 1; end when; when startDayOfYear + localDays == daysOfYear + 1 then startDayOfYear := 1; year := pre(year) + 1; daysOfYear := dayOfTheYear(31, 12, year); end when; // One full year is reached // Reset start day of year // Increment year // Determined actual number of total days of year equation Jprime = dayOfYear / daysOfYear * 2 * pi; delta_J = rad(0.3948 - 23.2559 * cos(Jprime + rad(9.1)) - 0.3915 * cos(2 * Jprime + rad(5.4)) - 0.1764 * cos(3 * Jprime + rad(26))); timeequation_J = 0.0066 + 7.3525 * cos(Jprime + rad(85.9)) + 9.9359 * cos(2 * Jprime + rad(108.9)) + 0.3387 * cos(3 * Jprime + rad(105.2)); // Zeit LZ = time localTime = time; // Convert time into unit hours localTimeHours = localTime / 3600; // Convert time into unit days localTimeDays = localTimeHours / 24; // Convert time from real days into integer days (floor) localDays = integer(floor(localTimeDays)); // Calculate locale mean time LocalMeanTimeHours = localTimeHours - TimeZone + 4 / 60 * longitude * 180 / Modelica.Constants.pi; // cos(latitude)*tan(...) trueMeanTimeHours = LocalMeanTimeHours + timeequation_J / 60; hoursAngle = rad((12 - trueMeanTimeHours) * 15); sunHeight = degree(asin(cos(hoursAngle) * cos(latitude) * cos(delta_J) + sin(latitude) * sin(delta_J))) * (Modelica.Constants.pi / 180); sunAzimuth1 = Modelica.Constants.pi - acos((sin(sunHeight) * sin(latitude) - sin(delta_J)) / (cos(sunHeight) * cos(latitude))); sunAzimuth2 = Modelica.Constants.pi + acos((sin(sunHeight) * sin(latitude) - sin(delta_J)) / (cos(sunHeight) * cos(latitude))); sunAzimuth = if mod(localTimeHours, 24) <= 12 then sunAzimuth1 else sunAzimuth2; angleOfIncidence = acos((-cos(sunHeight) * sin(gamma) * cos(sunAzimuth - azimuth)) + sin(sunHeight) * cos(gamma)); directIrradianceHorizontal = if sunHeight < 0 then 0 else irradianceRef * sin(sunHeight); directIrradianceInclined = if angleOfIncidence > pi / 2 then 0 else if abs(sin(sunHeight)) < 1E-5 then 0 else directIrradianceHorizontal * (cos(angleOfIncidence) / sin(sunHeight)); irradiance = directIrradianceInclined; end IrradianceVariableLocation;
Irradiance
within PhotoVoltaics.Sources; package Irradiance "Irradiance" extends Modelica.Icons.Package; end Irradiance;
VehicleInterfaces Library (Version 2.0.1) - Interface definitions and architectures for vehicle system modeling
within ; package VehicleInterfaces "VehicleInterfaces Library (Version 2.0.1) - Interface definitions and architectures for vehicle system modeling" extends Modelica.Icons.Package; import Modelica.Units.SI; end VehicleInterfaces;
Collection of type definitions
within VehicleInterfaces; package Types "Collection of type definitions" extends Modelica.Icons.TypesPackage; type NormalizedReal = Modelica.Icons.TypeReal ( final quantity="", final unit="1", final displayUnit="1", final min=0, final max=1) "Normalized real number"; type Gear = Modelica.Icons.TypeInteger (final quantity="gear") "Gear ...,-2,-1,0,1,2,... = 2nd rear, 1st rear, neutral, 1st, 2nd forward, etc"; package GearMode "Type, constants and menu choices for gear mode, as temporary solution until enumerations are available" // type GearMode = enumeration(Park, Drive, Neutral, Rear, Manual, Limited); constant Integer Park=1; constant Integer Drive=2; constant Integer Neutral=3; constant Integer Rear=4; constant Integer Manual=5; constant Integer Limited=6; type Temp "Temporary type of gear mode with choices for menus (until enumerations are available)" extends Integer(min=1,max=6); end Temp; end GearMode; package IgnitionSetting "Type, constants and menu choices for ignition setting, as temporary solution until enumerations are available" // type IgnitionSetting = enumeration(Off, On, Start); constant Integer Off=1 "Ignition is off"; constant Integer On=2 "Ignition is on"; constant Integer Start=3 "Ignition is on and driver requires to start engine"; type Temp "Temporary type of ignition setting with choices for menus (until enumerations are available)" extends Integer(min=1,max=3); end Temp; end IgnitionSetting; end Types;
Constant torque loss and inertia due to the accessories. Simple accessory model with a single inertia and constant torque loss.
within VehicleInterfaces.Accessories; model MinimalAccessories "Constant torque loss and inertia due to the accessories" extends VehicleInterfaces.Icons.Accessories; extends Interfaces.Base(includeEngineBearing=world.driveTrainMechanics3D); parameter SI.Inertia accessoriesInertia=0.001 "Total effective rotational inertia of the accessories"; parameter SI.Torque accessoriesLoad=2 "Total effective torque load due to the accessories (constant)"; parameter Modelica.Mechanics.MultiBody.Types.Axis axisOfRotation={1,0,0} "Axis of rotation for accessories when including MultiBody effects"; Modelica.Mechanics.MultiBody.Parts.Rotor1D inertia( J=accessoriesInertia, n=axisOfRotation) Modelica.Mechanics.Rotational.Sources.SignTorque torqueLoss( tau_nominal=-accessoriesLoad, useSupport=includeEngineBearing, w0=1) Modelica.Mechanics.MultiBody.Parts.Mounting1D torqueReaction( n=axisOfRotation) if includeEngineBearing protected outer Modelica.Mechanics.MultiBody.World world; equation connect(torqueLoss.flange, inertia.flange_a) connect(inertia.flange_b, engineFlange.flange) connect(torqueReaction.frame_a, engineFlange.bearingFrame) connect(torqueReaction.flange_b,torqueLoss.support) connect(inertia.frame_a, torqueReaction.frame_a) end MinimalAccessories;
Empty accessories. Empty accessories subsystem. Using this empty model in overall vehicle architecture the functionality of accessories subsystem can be eliminated.
within VehicleInterfaces.Accessories; model NoAccessories "Empty accessories" extends VehicleInterfaces.Icons.Accessories; extends VehicleInterfaces.Icons.Empty; extends Interfaces.Base; end NoAccessories;
Collection of accessory subsystem definitions
within VehicleInterfaces; package Accessories "Collection of accessory subsystem definitions" extends Modelica.Icons.VariantsPackage; end Accessories;
Accessories Tutorial.
within VehicleInterfaces.Accessories; class Tutorial "Accessories Tutorial" extends Modelica.Icons.Information; end Tutorial;
Basic interface definition for the accessories. This partial model defines the interfaces required for an accessories subsystem. This class should be extended to form a particular accessory model. See the <a href=\"modelica://VehicleInterfaces.Accessories\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Accessories.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Accessories.Interfaces; partial model Base "Basic interface definition for the accessories" parameter Boolean usingMultiBodyEngine=false "= true, if connecting to a MultiBody engine" protected parameter Boolean includeEngineBearing=false "Include the engine bearing"; public Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing engineFlange( final includeBearingConnector=includeEngineBearing or usingMultiBodyEngine) "Source of drive torque" VehicleInterfaces.Interfaces.ControlBus controlBus "Control signal bus" Mechanics.MultiBody.MultiBodyEnd end_2( final includeBearingConnector=includeEngineBearing or usingMultiBodyEngine) equation connect(end_2.flange, engineFlange) end Base;
Collection of interface definitions for accessories
within VehicleInterfaces.Accessories; package Interfaces "Collection of interface definitions for accessories" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Atmospheres with constant conditions. This is the simplest atmosphere model with constant characteristics.
within VehicleInterfaces.Atmospheres; model ConstantAtmosphere "Atmospheres with constant conditions" extends VehicleInterfaces.Icons.Atmosphere; extends VehicleInterfaces.Atmospheres.Interfaces.Base( redeclare final function windVelocity = constantWindVelocity (windVelocity=v), redeclare final function density = constantDensity (density=rho), redeclare final function temperature = constantTemperature (T0=T), redeclare final function humidity = constantHumidity (h0=h)); parameter SI.Velocity[3] v=zeros(3) "Wind velocity"; parameter SI.AbsolutePressure ambientPressure=101300 "Air pressure"; parameter SI.Temperature T=293.15 "Air temperature"; parameter Real h=0.5 "Air humidity (0-1)"; constant Real R=287.0512249529787 "Gas constant for air"; protected parameter SI.Density rho=ambientPressure/(R*T); function constantWindVelocity extends VehicleInterfaces.Atmospheres.Interfaces.windVelocityBase; input SI.Velocity[3] windVelocity={0,0,0}; algorithm v := windVelocity; end constantWindVelocity; function constantDensity "Determine density" extends VehicleInterfaces.Atmospheres.Interfaces.densityBase; input SI.Density density=1.18 "Density"; algorithm rho := density; end constantDensity; function constantTemperature "Determine temperature" extends VehicleInterfaces.Atmospheres.Interfaces.temperatureBase; input SI.Temperature T0=293 "Constant temperature"; algorithm T := T0; end constantTemperature; function constantHumidity "Determine humidity" extends VehicleInterfaces.Atmospheres.Interfaces.humidityBase; input Real h0=0.5 "Constant humidity"; algorithm h := h0; end constantHumidity; end ConstantAtmosphere;
Collection of atmosphere subsystem definitions
within VehicleInterfaces; package Atmospheres "Collection of atmosphere subsystem definitions" extends Modelica.Icons.VariantsPackage; end Atmospheres;
Atmosphere Tutorial.
within VehicleInterfaces.Atmospheres; class Tutorial "Atmosphere Tutorial" extends Modelica.Icons.Information; //Rest of model definition ... <strong>end</strong> ConstantAtmosphere; </pre></blockquote> </li> <li>Adding these redeclares also means we need to add 4&nbsp;parameters to the model <strong>v</strong>, <strong>rho</strong>, <strong>h</strong> and <strong>T</strong> which are the constant wind velocity, density, humidity and temperature respectively.</li> <li>This model is now complete and can be used. The ConstantAtmosphere definition included in VehicleInterfaces actually has pressure, temperature and wind velocity as it&apos;s parameters and automatically calculates the air density.</li> </ol> </html>")); end Tutorial;
Base model for all atmospheres. Dummy model to demonstrate how the wind velocity model should be defined and included in atmosphere model.
within VehicleInterfaces.Atmospheres.Interfaces; partial model Base "Base model for all atmospheres" replaceable function windVelocity=windVelocityBase "Dummy model for wind velocity" replaceable function density=densityBase "Dummy model for air density" replaceable function temperature=temperatureBase "Dummy model for air temperature" replaceable function humidity=humidityBase "Dummy model for air humidity" end Base;
Determine density. Partial base model for air density. Extend this model appropriately to define final user model.
within VehicleInterfaces.Atmospheres.Interfaces; partial function densityBase "Determine density" extends Modelica.Icons.Function; input SI.Position[3] r=zeros(3) "Position vector from world frame to point, resolved in world frame"; output SI.Density rho=1.18 "Density"; end densityBase;
Determine humidity. Partial base model for air humidity. Extend this model appropriately to define final user model.
within VehicleInterfaces.Atmospheres.Interfaces; partial function humidityBase "Determine humidity" extends Modelica.Icons.Function; input SI.Position[3] r=zeros(3) "Position vector from world frame to point, resolved in world frame"; output Real h=0.5 "Humidity"; end humidityBase;
Collection of interface definitions for atmosphere
within VehicleInterfaces.Atmospheres; package Interfaces "Collection of interface definitions for atmosphere" extends Modelica.Icons.Package; end Interfaces;
Determine temperature. Partial base model for air temperature. Extend this model appropriately to define final user model.
within VehicleInterfaces.Atmospheres.Interfaces; partial function temperatureBase "Determine temperature" extends Modelica.Icons.Function; input SI.Position[3] r=zeros(3) "Position vector from world frame to point, resolved in world frame"; output SI.Temperature T=298 "Temperature"; end temperatureBase;
Determine wind velocity. Partial base model for wind velocity. Extend this model appropriately to define final user model.
within VehicleInterfaces.Atmospheres.Interfaces; partial function windVelocityBase "Determine wind velocity" extends Modelica.Icons.Function; input SI.Position[3] r=zeros(3) "Position vector from world frame to point, resolved in world frame"; output SI.Velocity[3] v=zeros(3) "Wind velocity vector, resolved in world frame"; end windVelocityBase;
Output the normalized input signal u [0..1] in inverted form y [1..0].. This block is used to invert a normalized input signal u from [0..1] to [1..0]. Formally, the output <strong>y</strong> is computed as:
within VehicleInterfaces.Blocks; block InvertNormalizedInput "Output the normalized input signal u [0..1] in inverted form y [1..0]." extends Modelica.Blocks.Interfaces.SISO; equation y = 1 - u; end InvertNormalizedInput;
Collection of input/output fixed causality blocks
within VehicleInterfaces; package Blocks "Collection of input/output fixed causality blocks" extends Modelica.Icons.Package; end Blocks;
Simple proportional (constant gain) braking model for 4 wheeled vehicles. Brakes subsystem model that uses the driver <strong>brakePedalPosition</strong> signal to determine the brake torque demand being requested by the driver.
within VehicleInterfaces.Brakes; model MinimalBrakes "Simple proportional (constant gain) braking model for 4 wheeled vehicles" extends VehicleInterfaces.Icons.Brakes; extends VehicleInterfaces.Brakes.Interfaces.TwoAxleBase(includeWheelBearings=world.driveTrainMechanics3D); parameter SI.Torque maxTorque=1000 "Maximum combined brake torque (for all brakes together)"; Modelica.Blocks.Math.Gain computeTorque(k=maxTorque/4.0) Modelica.Mechanics.Rotational.Components.Brake brake_1( mu_pos=[0,1], useSupport=true, fn_max=1) Modelica.Mechanics.Rotational.Components.Brake brake_2( mu_pos=[0,1], useSupport=true, fn_max=1) Modelica.Mechanics.Rotational.Components.Brake brake_3( mu_pos=[0,1], useSupport=true, fn_max=1) Modelica.Mechanics.Rotational.Components.Brake brake_4( mu_pos=[0,1], useSupport=true, fn_max=1) Modelica.Mechanics.Rotational.Sensors.SpeedSensor wheelSpeed_1 Modelica.Mechanics.Rotational.Sensors.SpeedSensor wheelSpeed_2 Modelica.Mechanics.Rotational.Sensors.SpeedSensor wheelSpeed_3 Modelica.Mechanics.Rotational.Sensors.SpeedSensor wheelSpeed_4 Modelica.Mechanics.MultiBody.Parts.Mounting1D torqueReaction_1(n={0,1,0}) Modelica.Mechanics.MultiBody.Parts.Mounting1D torqueReaction_2(n={0,1,0}) Modelica.Mechanics.MultiBody.Parts.Mounting1D torqueReaction_3(n={0,1,0}) Modelica.Mechanics.MultiBody.Parts.Mounting1D torqueReaction_4(n={0,1,0}) protected outer Modelica.Mechanics.MultiBody.World world; VehicleInterfaces.Interfaces.BrakesBus brakesBus VehicleInterfaces.Interfaces.DriverBus driverBus equation connect(computeTorque.y, brake_1.f_normalized) connect(computeTorque.y, brake_2.f_normalized) connect(computeTorque.y, brake_3.f_normalized) connect(computeTorque.y, brake_4.f_normalized) connect(brake_1.flange_b, wheelHub_1.flange) connect(brake_2.flange_a, wheelHub_2.flange) connect(brake_3.flange_a, wheelHub_3.flange) connect(brake_4.flange_b, wheelHub_4.flange) connect(wheelSpeed_1.flange, brake_1.flange_a) connect(brake_2.flange_b, wheelSpeed_2.flange) connect(wheelSpeed_3.flange, brake_3.flange_b) connect(brake_4.flange_a, wheelSpeed_4.flange) connect(controlBus.driverBus, driverBus) connect(computeTorque.u, driverBus.brakePedalPosition) connect(wheelSpeed_1.w, brakesBus.wheelSpeed_1) connect(wheelSpeed_2.w, brakesBus.wheelSpeed_2) connect(wheelSpeed_3.w, brakesBus.wheelSpeed_3) connect(wheelSpeed_4.w, brakesBus.wheelSpeed_4) connect(controlBus.brakesBus, brakesBus) connect(torqueReaction_1.frame_a, wheelHub_1.bearingFrame) connect(torqueReaction_1.flange_b, brake_1.support) connect(brake_2.support, torqueReaction_2.flange_b) connect(torqueReaction_2.frame_a, wheelHub_2.bearingFrame) connect(torqueReaction_3.flange_b, brake_3.support) connect(torqueReaction_3.frame_a, wheelHub_3.bearingFrame) connect(torqueReaction_4.frame_a, wheelHub_4.bearingFrame) connect(torqueReaction_4.flange_b, brake_4.support) end MinimalBrakes;
Simple proportional (constant gain) braking model for 4 wheeled vehicles, uses the brake pedal connection. Brakes subsystem model that uses the physical pedal connection to determine the brake torque demand being requested by the driver.
within VehicleInterfaces.Brakes; model MinimalBrakesUsingPedal "Simple proportional (constant gain) braking model for 4 wheeled vehicles, uses the brake pedal connection" extends VehicleInterfaces.Icons.Brakes; extends VehicleInterfaces.Brakes.Interfaces.TwoAxleBase( includeBrakePedal=true, includeWheelBearings=world.driveTrainMechanics3D); parameter SI.Torque maxTorque=1000 "Maximum combined brake torque"; Modelica.Blocks.Math.Gain computeTorque(k=maxTorque/4.0) Modelica.Mechanics.Rotational.Components.Brake brake_1( mu_pos=[0,1], useSupport=true, fn_max=1) Modelica.Mechanics.Rotational.Components.Brake brake_2( mu_pos=[0,1], useSupport=true, fn_max=1) Modelica.Mechanics.Rotational.Components.Brake brake_3( mu_pos=[0,1], useSupport=true, fn_max=1) Modelica.Mechanics.Rotational.Components.Brake brake_4( mu_pos=[0,1], useSupport=true, fn_max=1) Modelica.Mechanics.Translational.Sensors.PositionSensor positionSensor Modelica.Mechanics.Rotational.Sensors.SpeedSensor wheelSpeed_1 Modelica.Mechanics.Rotational.Sensors.SpeedSensor wheelSpeed_2 Modelica.Mechanics.Rotational.Sensors.SpeedSensor wheelSpeed_3 Modelica.Mechanics.Rotational.Sensors.SpeedSensor wheelSpeed_4 Modelica.Mechanics.MultiBody.Parts.Mounting1D torqueReaction_2(n={0,1,0}) Modelica.Mechanics.MultiBody.Parts.Mounting1D torqueReaction_4(n={0,1,0}) Modelica.Mechanics.MultiBody.Parts.Mounting1D torqueReaction_3(n={0,1,0}) Modelica.Mechanics.MultiBody.Parts.Mounting1D torqueReaction_1(n={0,1,0}) protected outer Modelica.Mechanics.MultiBody.World world; VehicleInterfaces.Interfaces.BrakesBus brakesBus equation connect(computeTorque.y, brake_4.f_normalized) connect(computeTorque.y, brake_3.f_normalized) connect(computeTorque.y, brake_2.f_normalized) connect(computeTorque.y, brake_1.f_normalized) connect(brake_1.flange_b, wheelHub_1.flange) connect(brake_2.flange_a, wheelHub_2.flange) connect(brake_3.flange_a, wheelHub_3.flange) connect(brake_4.flange_b, wheelHub_4.flange) connect(positionSensor.flange, brakePedal) connect(positionSensor.s, computeTorque.u) connect(wheelSpeed_1.flange, brake_1.flange_a) connect(wheelSpeed_2.flange, brake_2.flange_b) connect(wheelSpeed_3.flange, brake_3.flange_b) connect(wheelSpeed_4.flange, brake_4.flange_a) connect(controlBus.brakesBus, brakesBus) connect(wheelSpeed_1.w, brakesBus.wheelSpeed_1) connect(wheelSpeed_2.w, brakesBus.wheelSpeed_2) connect(wheelSpeed_3.w, brakesBus.wheelSpeed_3) connect(wheelSpeed_4.w, brakesBus.wheelSpeed_4) connect(torqueReaction_1.frame_a, wheelHub_1.bearingFrame) connect(torqueReaction_1.flange_b, brake_1.support) connect(torqueReaction_2.frame_a, wheelHub_2.bearingFrame) connect(brake_2.support, torqueReaction_2.flange_b) connect(torqueReaction_3.frame_a, wheelHub_3.bearingFrame) connect(torqueReaction_3.flange_b, brake_3.support) connect(torqueReaction_4.frame_a, wheelHub_4.bearingFrame) connect(torqueReaction_4.flange_b, brake_4.support) end MinimalBrakesUsingPedal;
Empty brakes model for 4 wheeled vehicles. Zero torque is applied to all the wheelhubs and the reaction paths in to the wheel hubs included if the <strong>driveTrainMechanics3D</strong> flag in the world object is true.
within VehicleInterfaces.Brakes; model NoBrakes "Empty brakes model for 4 wheeled vehicles" extends VehicleInterfaces.Icons.Brakes; extends VehicleInterfaces.Icons.Empty; extends VehicleInterfaces.Brakes.Interfaces.TwoAxleBase(includeWheelBearings=world.driveTrainMechanics3D); protected outer Modelica.Mechanics.MultiBody.World world; end NoBrakes;
Collection of brakes subsystem definitions
within VehicleInterfaces; package Brakes "Collection of brakes subsystem definitions" extends Modelica.Icons.VariantsPackage; end Brakes;
Brakes Tutorial.
within VehicleInterfaces.Brakes; class Tutorial "Brakes Tutorial" extends Modelica.Icons.Information; end Tutorial;
Base interface definition for a brakes. This partial model defines the basic interfaces required for any brakes subsystem. This class should be extended to form a brakes interface definition with the correct number of wheelHub connectors for the type of vehicle being modelled. See the <a href=\"modelica://VehicleInterfaces.Brakes\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Brakes.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Brakes.Interfaces; partial model Base "Base interface definition for a brakes" parameter Boolean usingMultiBodyChassis=false "= true, if connecting to a MultiBody chassis" protected parameter Boolean includeBrakePedal=false "Include the brake pedal connection"; parameter Boolean includeWheelBearings=false "Include the wheel bearing connectors"; public Modelica.Mechanics.Translational.Interfaces.Flange_a brakePedal if includeBrakePedal "Brake pedal connection (optional)" VehicleInterfaces.Interfaces.ControlBus controlBus "Control signal bus" end Base;
Interface definition for the brakes on a 8 wheeled vehicle. This partial model defines the interfaces required for the brakes subsystem of a four axled vehicle within the VehicleInterfaces package. See the <a href=\"modelica://VehicleInterfaces.Brakes\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Brakes.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Brakes.Interfaces; partial model FourAxleBase "Interface definition for the brakes on a 8 wheeled vehicle" extends Base; Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_1( final includeBearingConnector=includeWheelBearings) "Front left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_2( final includeBearingConnector=includeWheelBearings) "Front right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_3( final includeBearingConnector=includeWheelBearings) "Second axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_4( final includeBearingConnector=includeWheelBearings) "Second axle right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_5( final includeBearingConnector=includeWheelBearings) "Third axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_6( final includeBearingConnector=includeWheelBearings) "Third axle right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_7( final includeBearingConnector=includeWheelBearings) "Fourth axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_8( final includeBearingConnector=includeWheelBearings) "Fourth axle right wheel" Mechanics.MultiBody.MultiBodyEnd end_1( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_2( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_3( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_4( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_5( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_6( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_7( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_8( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) equation connect(end_1.flange, wheelHub_1) connect(end_2.flange, wheelHub_2) connect(end_3.flange, wheelHub_3) connect(end_4.flange, wheelHub_4) connect(end_5.flange, wheelHub_5) connect(end_6.flange, wheelHub_6) connect(end_7.flange, wheelHub_7) connect(end_8.flange, wheelHub_8) end FourAxleBase;
Collection of interface definitions for brakes
within VehicleInterfaces.Brakes; package Interfaces "Collection of interface definitions for brakes" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Interface definition for the brakes on a 6 wheeled vehicle. This partial model defines the interfaces required for the brakes subsystem of a three axled vehicle within the VehicleInterfaces package. See the <a href=\"modelica://VehicleInterfaces.Brakes\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Brakes.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Brakes.Interfaces; partial model ThreeAxleBase "Interface definition for the brakes on a 6 wheeled vehicle" extends Base; Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_1( final includeBearingConnector=includeWheelBearings) "Front left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_2( final includeBearingConnector=includeWheelBearings) "Front right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_3( final includeBearingConnector=includeWheelBearings) "Second axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_4( final includeBearingConnector=includeWheelBearings) "Second axle right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_5( final includeBearingConnector=includeWheelBearings) "Third axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_6( final includeBearingConnector=includeWheelBearings) "Third axle right wheel" Mechanics.MultiBody.MultiBodyEnd end_1( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_2( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_3( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_4( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_5( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_6( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) equation connect(end_1.flange, wheelHub_1) connect(end_2.flange, wheelHub_2) connect(end_3.flange, wheelHub_3) connect(end_4.flange, wheelHub_4) connect(end_5.flange, wheelHub_5) connect(end_6.flange, wheelHub_6) end ThreeAxleBase;
Interface definition for the brakes on a 4 wheeled vehicle. This partial model defines the interfaces required for the brakes subsystem of a two axled vehicle within the VehicleInterfaces package. See the <a href=\"modelica://VehicleInterfaces.Brakes\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Brakes.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Brakes.Interfaces; partial model TwoAxleBase "Interface definition for the brakes on a 4 wheeled vehicle" extends Base; Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_1( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Front left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_2( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Front right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_3( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Rear left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_4( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Rear right wheel" Mechanics.MultiBody.MultiBodyEnd end_1( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_2( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_3( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_4( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) equation connect(end_1.flange, wheelHub_1) connect(end_2.flange, wheelHub_2) connect(end_3.flange, wheelHub_3) connect(end_4.flange, wheelHub_4) end TwoAxleBase;
Collection of internal material involving brakes
within VehicleInterfaces.Brakes; package Internal "Collection of internal material involving brakes" extends Modelica.Icons.InternalPackage; end Internal;
Basic chassis model with rigid connection between all 4 wheels. Single degree-of-freedom chassis model with mass and speed dependant drag model.
within VehicleInterfaces.Chassis; model MinimalChassis "Basic chassis model with rigid connection between all 4 wheels" extends VehicleInterfaces.Icons.Chassis; extends VehicleInterfaces.Chassis.Interfaces.TwoAxleBase; parameter SI.Mass vehicleMass=1200 "Vehicle mass"; parameter SI.Radius tyreRadius=0.34 "Tyre rolling radius"; parameter SI.TranslationalDampingConstant drag=1 "Drag force (force = drag*vehicle_speed)"; Modelica.Mechanics.Rotational.Components.IdealRollingWheel tyres( radius=tyreRadius, useSupportT=true, useSupportR=true) Modelica.Mechanics.Translational.Components.Mass body( m=vehicleMass, s(stateSelect=StateSelect.always, start=0, fixed=true)) Modelica.Mechanics.Translational.Components.Damper dragForces( d=drag) Modelica.Mechanics.Translational.Components.Fixed ground Modelica.Mechanics.Translational.Sensors.SpeedSensor longitudinalVelocity protected VehicleInterfaces.Interfaces.ChassisBus chassisBus public Modelica.Mechanics.Rotational.Components.Fixed fixed equation connect(tyres.flangeT, body.flange_a) connect(body.flange_b, dragForces.flange_a) connect(dragForces.flange_b,ground.flange) connect(body.flange_b,longitudinalVelocity.flange) connect(tyres.flangeR, wheelHub_1.flange) connect(tyres.flangeR, wheelHub_2.flange) connect(tyres.flangeR, wheelHub_3.flange) connect(tyres.flangeR, wheelHub_4.flange) connect(controlBus.chassisBus, chassisBus) connect(ground.flange, tyres.supportT) connect(fixed.flange, tyres.supportR) connect(chassisBus.longitudinalVelocity, longitudinalVelocity.v) end MinimalChassis;
Basic chassis model with rigid connection between all 4 wheels, uses chassisFrame connection. Single degree-of-freedom chassis model with mass and speed dependant drag model. Couples the 1d system to a&nbsp;Multibody system to support the other subsystems.
within VehicleInterfaces.Chassis; model MinimalChassis2 "Basic chassis model with rigid connection between all 4 wheels, uses chassisFrame connection" extends VehicleInterfaces.Icons.Chassis; extends VehicleInterfaces.Chassis.Interfaces.TwoAxleBase(includeChassisFrame=true); parameter SI.Mass vehicleMass=1200 "Vehicle mass"; parameter SI.Radius tyreRadius=0.34 "Tyre rolling radius"; parameter SI.TranslationalDampingConstant drag=1 "Drag force (force = drag*vehicle_speed)"; Modelica.Mechanics.Rotational.Components.IdealRollingWheel tyres( useSupportR=true, useSupportT=true, radius=tyreRadius) Modelica.Mechanics.Translational.Components.Damper dragForces( d=drag) Modelica.Mechanics.Translational.Sensors.SpeedSensor longitudinalVelocity Modelica.Mechanics.MultiBody.Parts.Body body(m=vehicleMass) Modelica.Mechanics.MultiBody.Joints.Prismatic constraint( useAxisFlange=true, a(fixed=false), s(fixed=true), v(fixed=false)) Modelica.Mechanics.MultiBody.Parts.Fixed ground protected VehicleInterfaces.Interfaces.ChassisBus chassisBus public Modelica.Mechanics.MultiBody.Parts.Mounting1D mountingR(n=constraint.n) equation connect(tyres.flangeR, wheelHub_2.flange) connect(tyres.flangeR, wheelHub_1.flange) connect(tyres.flangeR, wheelHub_4.flange) connect(tyres.flangeR, wheelHub_3.flange) connect(tyres.flangeT, dragForces.flange_a) connect(longitudinalVelocity.flange, dragForces.flange_a) connect(dragForces.flange_b, constraint.support) connect(dragForces.flange_a, constraint.axis) connect(controlBus.chassisBus, chassisBus) connect(constraint.frame_a, ground.frame_b) connect(mountingR.flange_b, tyres.supportR) connect(constraint.support, tyres.supportT) connect(chassisBus.longitudinalVelocity, longitudinalVelocity.v) connect(body.frame_a, mountingR.frame_a) connect(body.frame_a, constraint.frame_b) connect(body.frame_a, chassisFrame) end MinimalChassis2;
Basic chassis model with rigid connection between all 4 wheels, uses chassisFrame connection, includes wheel bearings. Single degree-of-freedom chassis model with mass and speed dependant drag model. Uses MultiBody wheelHub connections and positions these relative to the vehicle body position.
within VehicleInterfaces.Chassis; model MinimalChassis3 "Basic chassis model with rigid connection between all 4 wheels, uses chassisFrame connection, includes wheel bearings" extends MinimalChassis2(includeWheelBearings=true, body(r_CM={0,0,0})); public Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation(r={0,-1.4, 0}, animation=false) Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation1(r={0, -1.4,0}, animation=false) Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation2(r={0, 0.7,0}, animation=false) Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation3(r={-2.6, 0.7,0}, animation=false) equation connect(fixedTranslation.frame_b, wheelHub_2.bearingFrame) connect(fixedTranslation1.frame_b, wheelHub_4.bearingFrame) connect(fixedTranslation1.frame_a, fixedTranslation3.frame_b) connect(fixedTranslation2.frame_b, fixedTranslation.frame_a) connect(fixedTranslation2.frame_b, wheelHub_1.bearingFrame) connect(fixedTranslation3.frame_b, wheelHub_3.bearingFrame) connect(fixedTranslation2.frame_a, fixedTranslation3.frame_a) connect(body.frame_a, fixedTranslation2.frame_a) end MinimalChassis3;
Empty chassis. Empty chassis model. Using this empty model in overall vehicle architecture the functionality of chassis can be eliminated.
within VehicleInterfaces.Chassis; model NoChassis "Empty chassis" extends VehicleInterfaces.Icons.Chassis; extends VehicleInterfaces.Icons.Empty; extends VehicleInterfaces.Chassis.Interfaces.TwoAxleBase(includeWheelBearings=world.driveTrainMechanics3D); protected outer Modelica.Mechanics.MultiBody.World world; end NoChassis;
Collection of chassis subsystem definitions
within VehicleInterfaces; package Chassis "Collection of chassis subsystem definitions" extends Modelica.Icons.VariantsPackage; end Chassis;
Chassis Tutorial.
within VehicleInterfaces.Chassis; class Tutorial "Chassis Tutorial" extends Modelica.Icons.Information; end Tutorial;
Basic interface definition for a chassis. This partial model defines the basic interfaces required for any chassis subsystem. This class should be extended to form a&nbsp;chassis interface definition with the correct number of wheelHub connectors for the type of vehicle being modelled. See the <a href=\"modelica://VehicleInterfaces.Chassis\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Chassis.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Chassis.Interfaces; partial model Base "Basic interface definition for a chassis" parameter Boolean usingMultiBodyDriveline=false "= true, if connecting to a MultiBody driveline" protected parameter Boolean includeWheelBearings=false "Include wheel bearing connectors"; parameter Boolean includeChassisFrame=false "Include the chassis frame"; parameter Boolean includeSteeringWheel=false "Include the steering wheel connection"; public Modelica.Mechanics.MultiBody.Interfaces.Frame_b chassisFrame if includeChassisFrame "Chassis reference frame (optional)" Modelica.Mechanics.Rotational.Interfaces.Flange_a steeringWheel if includeSteeringWheel "Steering wheel connection (optional)" public VehicleInterfaces.Interfaces.ControlBus controlBus "Control signal bus" end Base;
Interface definition for a chassis of a 8 wheeled vehicle. This partial model defines the interfaces required for the chassis subsystem of a&nbsp;four axled vehicle within the VehicleInterfaces package. See the <a href=\"modelica://VehicleInterfaces.Chassis\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Chassis.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Chassis.Interfaces; partial model FourAxleBase "Interface definition for a chassis of a 8 wheeled vehicle" extends Base; public Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_1( final includeBearingConnector=includeWheelBearings) "Front left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_2( final includeBearingConnector=includeWheelBearings) "Front right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_3( final includeBearingConnector=includeWheelBearings) "Second axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_4( final includeBearingConnector=includeWheelBearings) "Second axle right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_5( final includeBearingConnector=includeWheelBearings) "Third axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_6( final includeBearingConnector=includeWheelBearings) "Third axle right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_7( final includeBearingConnector=includeWheelBearings) "Fourth axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_8( final includeBearingConnector=includeWheelBearings) "Fourth axle right wheel" Mechanics.MultiBody.MultiBodyEnd end_1( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_2( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_3( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_4( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_5( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_6( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_7( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_8( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) equation connect(end_1.flange, wheelHub_1) connect(end_2.flange, wheelHub_2) connect(end_3.flange, wheelHub_3) connect(end_4.flange, wheelHub_4) connect(end_5.flange, wheelHub_6) connect(end_6.flange, wheelHub_5) connect(end_7.flange, wheelHub_8) connect(end_8.flange, wheelHub_7) end FourAxleBase;
Collection of interface definitions for chassis
within VehicleInterfaces.Chassis; package Interfaces "Collection of interface definitions for chassis" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Interface definition for a chassis of a 6 wheeled vehicle. This partial model defines the interfaces required for the chassis subsystem of a&nbsp;three axled vehicle within the VehicleInterfaces package. See the <a href=\"modelica://VehicleInterfaces.Chassis\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Chassis.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Chassis.Interfaces; partial model ThreeAxleBase "Interface definition for a chassis of a 6 wheeled vehicle" extends Base; public Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_1( final includeBearingConnector=includeWheelBearings) "Front left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_2( final includeBearingConnector=includeWheelBearings) "Front right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_3( final includeBearingConnector=includeWheelBearings) "Second axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_4( final includeBearingConnector=includeWheelBearings) "Second axle right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_5( final includeBearingConnector=includeWheelBearings) "Third axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_6( final includeBearingConnector=includeWheelBearings) "Third axle right wheel" Mechanics.MultiBody.MultiBodyEnd end_1( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_2( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_3( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_4( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_5( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_6( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) equation connect(end_1.flange, wheelHub_1) connect(end_2.flange, wheelHub_2) connect(end_3.flange, wheelHub_3) connect(end_4.flange, wheelHub_4) connect(end_6.flange, wheelHub_5) connect(end_5.flange, wheelHub_6) end ThreeAxleBase;
Interface definition for a chassis of a 4 wheeled vehicle. This partial model defines the interfaces required for the chassis subsystem of a&nbsp;two axled vehicle within the VehicleInterfaces package. See the <a href=\"modelica://VehicleInterfaces.Chassis\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Chassis.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Chassis.Interfaces; partial model TwoAxleBase "Interface definition for a chassis of a 4 wheeled vehicle" extends Base; public Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_1( final includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) "Front left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_2( final includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) "Front right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_3( final includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) "Rear left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_4( final includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) "Rear right wheel" Mechanics.MultiBody.MultiBodyEnd end_1( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_2( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_3( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) Mechanics.MultiBody.MultiBodyEnd end_4( includeBearingConnector=includeWheelBearings or usingMultiBodyDriveline) equation connect(end_1.flange, wheelHub_1) connect(end_2.flange, wheelHub_2) connect(end_3.flange, wheelHub_3) connect(end_4.flange, wheelHub_4) end TwoAxleBase;
Collection of internal material involving chassis
within VehicleInterfaces.Chassis; package Internal "Collection of internal material involving chassis" extends Modelica.Icons.InternalPackage; end Internal;
Empty controller. Empty controller model. Using this empty model in overall vehicle architecture the functionality of controller can be eliminated.
within VehicleInterfaces.Controllers; model NoController "Empty controller" extends VehicleInterfaces.Icons.Controller; extends VehicleInterfaces.Icons.Empty; extends Interfaces.Base; end NoController;