📄 cars.mdl
字号:
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 Integrator
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
IgnoreLimit off
ZeroCross on
}
Block {
BlockType Lookup
InputValues "[-4:5]"
OutputValues " rand(1,10)-0.5"
LookUpMeth "Interpolation-Extrapolation"
OutDataTypeMode "Same as input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
LUTDesignTableMode "Redesign Table"
LUTDesignDataSource "Block Dialog"
LUTDesignFunctionName "sqrt(x)"
LUTDesignUseExistingBP on
LUTDesignRelError "0.01"
LUTDesignAbsError "1e-6"
}
Block {
BlockType Lookup2D
RowIndex "[0 1]"
ColumnIndex "[0 1]"
OutputValues "[0 0;0 0]"
LookUpMeth "Interpolation-Extrapolation"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
LUTDesignTableMode "Redesign Table"
LUTDesignDataSource "Block Dialog"
LUTDesignFunctionName "sqrt(x)"
LUTDesignUseExistingBP on
LUTDesignRelError "0.01"
LUTDesignAbsError "1e-6"
}
Block {
BlockType Math
Operator "exp"
OutputSignalType "auto"
SampleTime "-1"
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
}
Block {
BlockType SignalViewerScope
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"
Disabled off
ScrollMode on
}
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 PMIOPort
}
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 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 "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType Signum
ZeroCross on
SampleTime "-1"
}
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 TransferFcn
Numerator "[1]"
Denominator "[1 2 1]"
AbsoluteTolerance "auto"
Realization "auto"
}
Block {
BlockType Trigonometry
Operator "sin"
OutputSignalType "auto"
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 "Cars"
Location [106, 79, 992, 654]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Constant
Name "Constant"
Position [60, 135, 90, 165]
}
Block {
BlockType Constant
Name "Constant1"
Position [65, 305, 95, 335]
}
Block {
BlockType Reference
Name "Driveline\nEnvironment"
Ports [0, 0, 0, 0, 0, 1]
Position [180, 55, 220, 75]
Orientation "left"
SourceBlock "driveline/Solver &\nInertias/Driveline\nEnviron"
"ment"
SourceType "Driveline Environment"
ShowPortLabels off
PortType "p1"
BlockClass "Solver"
PhysicalDomain "driveline_domain"
MachineID "0"
MachineSetup "off"
SimulationMode "Dynamics"
ModeIteration off
DefaultUseAutoClutchVelocityTolerance on
DefaultClutchVelocityTolerance "1e-3"
}
Block {
BlockType Reference
Name "Driveline\nEnvironment1"
Ports [0, 0, 0, 0, 0, 1]
Position [185, 225, 225, 245]
Orientation "left"
SourceBlock "driveline/Solver &\nInertias/Driveline\nEnviron"
"ment"
SourceType "Driveline Environment"
ShowPortLabels off
PortType "p1"
BlockClass "Solver"
PhysicalDomain "driveline_domain"
MachineID "0"
MachineSetup "off"
SimulationMode "Dynamics"
ModeIteration off
DefaultUseAutoClutchVelocityTolerance on
DefaultClutchVelocityTolerance "1e-3"
}
Block {
BlockType Reference
Name "Gasoline Engine"
Ports [1, 0, 0, 0, 0, 0, 1]
Position [135, 110, 215, 190]
SourceBlock "driveline/Vehicle\nComponents/Gasoline Engine"
SourceType "Gasoline Engine"
ShowPortLabels on
power_max "150000"
speed_at_power_max "4500"
speed_max "6000"
}
Block {
BlockType Reference
Name "Gasoline Engine1"
Ports [1, 0, 0, 0, 0, 0, 1]
Position [140, 280, 220, 360]
SourceBlock "driveline/Vehicle\nComponents/Gasoline Engine"
SourceType "Gasoline Engine"
ShowPortLabels on
power_max "150000"
speed_at_power_max "4500"
speed_max "6000"
}
Block {
BlockType Reference
Name "Simple Gear"
Ports [0, 0, 0, 0, 0, 1, 1]
Position [290, 295, 340, 345]
SourceBlock "driveline/Gears/Simple Gear"
SourceType "Simple Gear"
ShowPortLabels on
PortType "p1"
BlockClass "SimpleGear"
PhysicalDomain "driveline_domain"
Reversing off
Ratio "2"
}
Block {
BlockType Terminator
Name "Terminator"
Position [490, 140, 510, 160]
}
Block {
BlockType Terminator
Name "Terminator1"
Position [590, 310, 610, 330]
}
Block {
BlockType SubSystem
Name "Vehicle"
Ports [0, 1, 0, 0, 0, 1]
Position [310, 124, 415, 176]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "Vehicle"
Location [193, 112, 939, 469]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Constant
Name "Constant"
Position [230, 190, 260, 220]
Value "0"
}
Block {
BlockType Reference
Name "Differential"
Ports [0, 0, 0, 0, 0, 1, 2]
Position [80, 53, 220, 317]
SourceBlock "driveline/Gears/Differential"
SourceType "Differential"
ShowPortLabels on
R "1"
ValidatorFcn "drive_differentialgearblock"
SimDrivelineLibraryVersion "1.1"
}
Block {
BlockType Reference
Name "Inertia"
Ports [0, 0, 0, 0, 0, 0, 1]
Position [240, 267, 270, 293]
SourceBlock "driveline/Solver &\nInertias/Inertia"
SourceType "Inertia"
ShowPortLabels on
PortType "p1"
BlockClass "Inertia"
PhysicalDomain "driveline_domain"
I "1"
Ip "[]"
Iv "[]"
ShowLeft off
ShowRight on
}
Block {
BlockType Reference
Name "Inertia1"
Ports [0, 0, 0, 0, 0, 0, 1]
Position [240, 72, 270, 98]
SourceBlock "driveline/Solver &\nInertias/Inertia"
SourceType "Inertia"
ShowPortLabels on
PortType "p1"
BlockClass "Inertia"
PhysicalDomain "driveline_domain"
I "1"
Ip "[]"
Iv "[]"
ShowLeft off
ShowRight on
}
Block {
BlockType Reference
Name "Longitudinal\nVehicle Dynamics"
Ports [3, 3]
Position [335, 140, 415, 220]
SourceBlock "driveline/Vehicle\nComponents/Longitudinal"
"\nVehicle Dynamics"
SourceType "Longitudinal Vehicle Dynamics"
ShowPortLabels on
m "1200"
a "1.4"
b "1.6"
h "0.5"
FA "3"
C_d "0"
v0 "0"
}
Block {
BlockType Terminator
Name "Terminator"
Position [635, 65, 655, 85]
}
Block {
BlockType Terminator
Name "Terminator1"
Position [635, 195, 655, 215]
}
Block {
BlockType Reference
Name "Tire"
Ports [2, 2, 0, 0, 0, 1]
Position [500, 184, 580, 266]
SourceBlock "driveline/Vehicle\nComponents/Tire"
SourceType "Tire"
ShowPortLabels on
r_e "0.3"
F_z "3000"
F_x_max "3500"
kappa_max "10"
sigma_k "0.2"
}
Block {
BlockType Reference
Name "Tire1"
Ports [2, 2, 0, 0, 0, 1]
Position [515, 54, 595, 136]
SourceBlock "driveline/Vehicle\nComponents/Tire"
SourceType "Tire"
ShowPortLabels on
r_e "0.3"
F_z "3000"
F_x_max "3500"
kappa_max "10"
sigma_k "0.2"
}
Block {
BlockType PMIOPort
Name "Diff"
Position [15, 178, 45, 192]
Port "1"
Side "Left"
}
Block {
BlockType Outport
Name "Car Speed"
Position [515, 23, 545, 37]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
LineType "Connection"
SrcBlock "Differential"
SrcPort RConn1
Points [0, 0; 60, 0]
Branch {
ConnectType "DEST_SRC"
DstBlock "Tire1"
DstPort LConn1
}
Branch {
ConnectType "DEST_DEST"
SrcBlock "Inertia1"
SrcPort RConn1
Points [10, 0; 0, 35]
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -