📄 pv_characteristic.mdl
字号:
}
Block {
BlockType Fcn
Expr "sin(u[1])"
SampleTime "-1"
}
Block {
BlockType Gain
Gain "1"
Multiplication "Element-wise(K.*u)"
ParameterDataTypeMode "Same as input"
ParameterDataType "sfix(16)"
ParameterScalingMode "Best Precision: Matrix-wise"
ParameterScaling "2^0"
OutDataTypeMode "Same as input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType SignalConversion
OverrideOpt off
}
Block {
BlockType InitialCondition
Value "1"
SampleTime "-1"
}
Block {
BlockType Inport
Port "1"
UseBusObject off
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
LatchByDelayingOutsideSignal off
LatchByCopyingInsideSignal off
Interpolate on
}
Block {
BlockType Lookup
}
Block {
BlockType MinMax
Function "min"
Inputs "1"
InputSameDT on
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType MultiPortSwitch
Inputs "4"
zeroidx off
InputSameDT on
OutDataTypeMode "Inherit via internal rule"
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Mux
Inputs "4"
DisplayOption "none"
UseBusObject off
BusObject "BusObject"
NonVirtualBus off
}
Block {
BlockType Outport
Port "1"
UseBusObject off
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Product
Inputs "2"
Multiplication "Element-wise(.*)"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Zero"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Reference
}
Block {
BlockType Saturate
UpperLimit "0.5"
LowerLimit "-0.5"
LinearizeAsGain on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType SignalSpecification
Dimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
TreatAsAtomicUnit off
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Switch
Criteria "u2 >= Threshold"
Threshold "0"
InputSameDT on
OutDataTypeMode "Inherit via internal rule"
RndMeth "Floor"
SaturateOnIntegerOverflow on
ZeroCross on
SampleTime "-1"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Arial"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "Arial"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "pv_characteristic"
Location [371, 504, 878, 716]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "cyan"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Reference
Name "I-V characteristic"
Ports [2]
Position [375, 65, 405, 100]
SourceBlock "simulink/Sinks/XY Graph"
SourceType "XY scope."
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
xmin "0"
xmax "25"
ymin "0"
ymax "6"
st "-1"
}
Block {
BlockType Reference
Name "Insolation"
Ports [0, 1]
Position [50, 155, 80, 185]
SourceBlock "simulink/Sources/Repeating\nSequence\nStair"
SourceType "Repeating Sequence Stair"
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
OutValues "[200 400 600 800 1000].'"
tsamp "1"
OutputDataTypeScalingMode "Specify via dialog"
OutDataType "float('double')"
ConRadixGroup "Best Precision: Vector-wise"
OutScaling "2^-12"
LockScale off
}
Block {
BlockType Reference
Name "PV power"
Ports [2]
Position [455, 20, 485, 55]
SourceBlock "simulink/Sinks/XY Graph"
SourceType "XY scope."
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
xmin "0"
xmax "25"
ymin "0"
ymax "100"
st "-1"
}
Block {
BlockType SubSystem
Name "PV1"
Ports [2, 2]
Position [190, 132, 300, 183]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
MaskDescription "PV module model based on module data-sheet para"
"meters. This model has Vpv input, which is suitable for parallel connections "
"of modules. Limitations: no temperature dependance, static model"
MaskPromptString "Short-circuit current|Open-circuit voltage|Curr"
"ent at Pmax|Voltage at Pmax|By-pass diode?"
MaskStyleString "edit,edit,edit,edit,checkbox"
MaskTunableValueString "on,on,on,on,on"
MaskCallbackString "||||"
MaskEnableString "on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on"
MaskToolTipString "on,on,on,on,on"
MaskVarAliasString ",,,,"
MaskVariables "Isc=@1;Voc=@2;Ir=@3;Vr=@4;Diode=@5;"
MaskInitialization "% calculation of PV module parameters\n% limita"
"tion: constant temperature\nNs = round(Voc/0.61); % default number of cells i"
"n series\nVt = 26e-3; % thermal voltage\nG = Isc/1000; % irradiation to short"
"-circuit current gain\nVmpc = Vr/Ns; % cell voltage at rated Pmax\nVocc = Voc"
"/Ns; % cell open-circuit voltage\nRmpp = Vmpc/Ir; % cell load resistance at P"
"max\n%\nRp = 100*Vocc/Isc; % initial value for Rp\nVdm = Vocc; % initial valu"
"e for Vdm\n%\n% iterative solution for model parameters: Io, Rs, Rp\nfor i=1:"
"10\n%\n Idm = Isc - Ir - Vdm/Rp; % pn-junction (diode) current at MPP\n Io = "
"(Isc-Vocc/Rp)/(exp(Vocc/Vt)-1); % pn-junction reverse saturation current\n Vd"
"m = Vt*log(Idm/Io+1); % pn-junction (diode) voltage at MPP\n Rs = (Vdm-Vmpc)/"
"Ir; % cell series resistance\n Rd = (Rmpp - Rs)*Rp/(Rp-Rmpp+Rs); % diode incr"
"emental resistance at MPP\n Idm = Vt/Rd; % diode current at MPP based on incr"
"emental resistance\n Rp = Vdm/(Isc-Ir-Idm); % cell parallel resistance\n%\nen"
"d\n%"
MaskDisplay "plot([0.3 0.4],[0.4 0.8]);\nplot([0.4 0.5],[0.4"
" 0.8]);\nplot([0.5 0.6],[0.4 0.8]);\nplot([0.6 0.7],[0.4 0.8]);\nplot([0.3 0."
"6],[0.4 0.4]);\nplot([0.325 0.625],[0.5 0.5]);\nplot([0.35 0.65],[0.6 0.6]);"
"\nplot([0.375 0.675],[0.7 0.7]);\nplot([0.4 0.7],[0.8 0.8]);\ntext(0.5,0.9,'P"
"V module (V)','horizontalAlignment', 'center');\n"
MaskIconFrame on
MaskIconOpaque off
MaskIconRotate "none"
MaskIconUnits "normalized"
MaskValueString "5.45|22.2|4.95|17.2|on"
MaskTabNameString ",,,,"
Port {
PortNumber 1
Name "Ipv"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
System {
Name "PV1"
Location [484, 343, 1048, 541]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Inport
Name "Vpv"
Position [15, 13, 45, 27]
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "Insolation"
Position [20, 128, 50, 142]
Port "2"
IconDisplay "Port number"
}
Block {
BlockType Reference
Name "Algebraic Constraint"
Ports [1, 1]
Position [370, 95, 450, 125]
SourceBlock "simulink/Math\nOperations/Algebraic Constra"
"int"
SourceType "Algebraic Constraint"
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
z0 "0"
}
Block {
BlockType SubSystem
Name "PV module (I)"
Ports [2, 2]
Position [150, 97, 260, 148]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
System {
Name "PV module (I)"
Location [164, 268, 1200, 729]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Inport
Name "Ipv"
Position [25, 168, 55, 182]
IconDisplay "Port number"
Port {
PortNumber 1
Name "Ipv"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Inport
Name "Insolation"
Position [25, 273, 55, 287]
Port "2"
IconDisplay "Port number"
}
Block {
BlockType Gain
Name "1/Rp"
Position [445, 390, 490, 420]
Orientation "left"
Gain "1/Rp"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "Vd/Rp"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Reference
Name "Algebraic Constraint"
Ports [1, 1]
Position [410, 265, 490, 295]
SourceBlock "simulink/Math\nOperations/Algebraic Con"
"straint"
SourceType "Algebraic Constraint"
ShowPortLabels "on"
SystemSampleTime "-1"
FunctionWithSeparateData "off"
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
z0 "0"
Port {
PortNumber 1
Name "Vd"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Fcn
Name "By-pass diode"
Position [420, 67, 550, 103]
Expr "-Vt*log((u/Io)+1)"
}
Block {
BlockType Constant
Name "Constant"
Position [745, 190, 775, 220]
Value "Diode"
VectorParams1D on
SamplingMode "Sample based"
OutDataTypeMode "Inherit from 'Constant value'"
OutDataType "sfix(16)"
ConRadixGroup "Use specified scaling"
OutScaling "2^0"
SampleTime "inf"
FramePeriod "inf"
}
Block {
BlockType Gain
Name "Insolation to \ncurrent gain"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -