📄 sim36.mdl
字号:
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 RelationalOperator
Operator ">="
InputSameDT on
LogicOutDataTypeMode "Logical (see Configuration Parameters: Optimiza"
"tion)"
LogicDataType "uint(8)"
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Saturate
UpperLimit "0.5"
LowerLimit "-0.5"
LinearizeAsGain on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Scope
Floating off
ModelBased off
TickLabels "OneTimeTick"
ZoomMode "on"
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Signum
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Step
Time "1"
Before "0"
After "1"
SampleTime "-1"
VectorParams1D on
ZeroCross on
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
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"
}
Block {
BlockType Terminator
}
Block {
BlockType TriggerPort
TriggerType "rising"
StatesWhenEnabling "inherit"
ShowOutputPort off
OutputDataType "auto"
SampleTimeType "triggered"
SampleTime "1"
ZeroCross on
}
Block {
BlockType UnitDelay
X0 "0"
SampleTime "1"
StateMustResolveToSignalObject off
RTWStateStorageClass "Auto"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "Helvetica"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "Sim36"
Location [0, 82, 1012, 743]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType SubSystem
Name "Combustion"
Ports [2, 1]
Position [435, 175, 490, 255]
DropShadow on
NamePlacement "alternate"
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Combustion"
Location [27, 489, 932, 704]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "Air Charge"
Position [45, 25, 65, 45]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "N"
Position [160, 130, 180, 150]
Port "2"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Mux
Name "Mux"
Ports [4, 1]
Position [225, 17, 230, 158]
BackgroundColor "black"
ShowName off
DisplayOption "bar"
}
Block {
BlockType Constant
Name "Spark Advance\n(degrees BTDC)"
Position [50, 94, 85, 116]
Value "15.0"
}
Block {
BlockType Gain
Name "Stoichiometric Fuel"
Position [125, 56, 175, 84]
Gain "1/14.6"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [810, 85, 830, 105]
ShowName off
IconShape "round"
}
Block {
BlockType Fcn
Name "Torque Gen"
Position [280, 50, 795, 80]
Expr "-181.3 + 379.36*u[1] + 21.91*u[1]/u[2] - (0"
".85*u[1]*u[1])/(u[2]*u[2]) + 0.26*u[3] - 0.0028*u[3]*u[3] "
}
Block {
BlockType Fcn
Name "Torque Gen2"
Position [280, 103, 795, 137]
Expr "0.027*u[4] - 0.000107*u[4]*u[4] + 0.00048*u"
"[4]*u[3] + 2.55*u[3]*u[1] - 0.05*u[3]*u[3]*u[1]"
}
Block {
BlockType Outport
Name "Torque"
Position [855, 85, 875, 105]
IconDisplay "Port number"
BusOutputAsStruct off
InitialOutput "0"
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Torque"
DstPort 1
}
Line {
SrcBlock "Torque Gen"
SrcPort 1
Points [20, 0]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Torque Gen2"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Mux"
SrcPort 1
Points [20, 0]
Branch {
Points [0, 30]
DstBlock "Torque Gen2"
DstPort 1
}
Branch {
Points [0, -25]
DstBlock "Torque Gen"
DstPort 1
}
}
Line {
SrcBlock "Air Charge"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "Mux"
DstPort 1
}
Branch {
Points [0, 35]
DstBlock "Stoichiometric Fuel"
DstPort 1
}
}
Line {
SrcBlock "N"
SrcPort 1
DstBlock "Mux"
DstPort 4
}
Line {
SrcBlock "Spark Advance\n(degrees BTDC)"
SrcPort 1
DstBlock "Mux"
DstPort 3
}
Line {
SrcBlock "Stoichiometric Fuel"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
}
}
Block {
BlockType SubSystem
Name "Compression"
Ports [1, 2, 0, 1]
Position [310, 171, 365, 264]
DropShadow on
TreatAsAtomicUnit on
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Compression"
Location [5, 437, 358, 654]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "mass(k+1)"
Position [40, 35, 60, 55]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType TriggerPort
Name "Trigger"
Ports [0, 1]
Position [50, 105, 70, 125]
TriggerType "either"
ShowOutputPort on
}
Block {
BlockType InitialCondition
Name "Init"
Position [90, 25, 130, 65]
Value "0.152"
}
Block {
BlockType UnitDelay
Name "Unit Delay"
Position [160, 22, 180, 68]
X0 "0.152"
SampleTime "-1"
}
Block {
BlockType Outport
Name "mass(k)"
Position [220, 35, 240, 55]
IconDisplay "Port number"
BusOutputAsStruct off
InitialOutput "0.152"
}
Block {
BlockType Outport
Name "trigger"
Position [180, 105, 200, 125]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
InitialOutput "-1"
}
Line {
SrcBlock "Trigger"
SrcPort 1
DstBlock "trigger"
DstPort 1
}
Line {
SrcBlock "Unit Delay"
SrcPort 1
DstBlock "mass(k)"
DstPort 1
}
Line {
SrcBlock "mass(k+1)"
SrcPort 1
DstBlock "Init"
DstPort 1
}
Line {
SrcBlock "Init"
SrcPort 1
DstBlock "Unit Delay"
DstPort 1
}
Annotation {
Position [236, 82]
}
}
}
Block {
BlockType SubSystem
Name "Drag Torque"
Ports [0, 1]
Position [435, 269, 490, 301]
DropShadow on
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Drag Torque"
Location [234, 396, 478, 573]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Step
Name "Step"
Position [20, 25, 40, 45]
Time "2"
Before "25"
After "20"
SampleTime "0"
}
Block {
BlockType Step
Name "Step1"
Position [20, 90, 40, 110]
Time "8"
After "5"
SampleTime "0"
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [110, 60, 130, 80]
ShowName off
IconShape "round"
}
Block {
BlockType Outport
Name "Load"
Position [185, 60, 205, 80]
IconDisplay "Port number"
BusOutputAsStruct off
InitialOutput "0"
}
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "Load"
DstPort 1
}
Line {
SrcBlock "Step"
SrcPort 1
Points [75, 0]
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "Step1"
SrcPort 1
Points [75, 0]
DstBlock "Sum1"
DstPort 2
}
}
}
Block {
BlockType Scope
Name "Engine\nSpeed\n(rpm)"
Ports [1]
Position [695, 216, 725, 254]
NamePlacement "alternate"
Location [197, 480, 556, 681]
Open off
NumInputPorts "1"
TickLabels "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "1500"
YMax "3500"
SaveToWorkspace on
SaveName "N"
DataFormat "Structure"
LimitDataPoints off
}
Block {
BlockType Integrator
Name "Intake"
Ports [2, 1, 0, 0, 1]
Position [230, 235, 265, 295]
DropShadow on
ExternalReset "either"
ShowStatePort on
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [625, 332, 630, 363]
BackgroundColor "black"
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Terminator
Name "Terminator"
Position [285, 258, 300, 272]
ShowName off
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -