Text description of the model: systems with their blocks, parameters and signal connections, Stateflow data, states and transitions. The rest of the page is the interactive viewer with images, styles and scripts and holds no further model information.
Notation: "A:1 -> B:2, C:1" connects output port 1 of block A to input port 2 of block B and input port 1 of block C, a quoted text is the signal name. Block parameters show the values that differ from the block defaults, plus the main parameters. Transitions read "source -> destination: label" with the label event[condition]{condition action}/{transition action}; [n] is the evaluation order of transitions leaving the same source, the transitions of a state are tested before those of its active substates. States are exclusive (OR) unless a parallel (AND) decomposition is stated. Junctions are numbered J1, J2, ... per chart. "(in X)" names the state or function containing an object, objects without it are at the top level of the chart. Chart inputs and outputs carry their port number, "input 2" is input port 2 of the chart block.
sf_car (Simulink model)
Model version=7.0; Created by=The MathWorks, Inc.; Created=Tue Jun 02 22:12:01 1998; Last modified by=The MathWorks, Inc.; Last modified=Wed Aug 13 06:44:55 2025; Solver=ode5; Stop time=100
Blocks:
- Inputs - SignalEditor
- shift_logic - Chart
- Engine - SubSystem
- Scope1 - Scope
- transmission - SubSystem
- Scope - Scope
- Scope - Scope
- Mux - Mux: Inputs=2
- Vehicle - vehicle model
- Scope2 - Scope
- Scope - Scope
Signals:
- Inputs:1 -> Vehicle:1 "brake"
- Inputs:2 -> Mux:2, Engine:2, shift_logic:1 "throttle"
- shift_logic:1 -> transmission:2 "gear"
- Engine:1 -> transmission:1, Scope1:1 "engine RPM"
- transmission:1 -> Engine:1 "impeller torque"
- transmission:2 -> Vehicle:2 "output torque"
- Mux:1 -> Scope2:1
- Vehicle:1 -> Mux:1, shift_logic:2 "vehicle speed"
- Vehicle:2 -> transmission:3 "transmission speed"
Notes:
- Double-click to open the Signal Editor and select an input maneuver
- Copyright 1997-2025 The MathWorks, Inc.
- Model a Car with Automatic Transmission
Blocks:
- Ti - Inport 1
- throttle - Inport 2
- engine torque - Lookup_n-D
- Sum - Sum: Inputs=-+
- engine + impeller inertia - Gain: Gain=1/Iei
- Integrator - Integrator: InitialCondition=1000; LimitOutput=on; UpperSaturationLimit=6000; LowerSaturationLimit=600
- Ne - Outport 1
Signals:
- Ti:1 -> Sum:1
- throttle:1 -> engine torque:1
- engine torque:1 -> Sum:2
- Sum:1 -> engine + impeller inertia:1
- engine + impeller inertia:1 -> Integrator:1
- Integrator:1 -> engine torque:2, Ne:1
NumberOfTableDimensions=2; BreakpointsForDimension1=thvec; BreakpointsForDimension2=nevec; Table=emap; InterpMethod=Linear point-slope; ExtrapMethod=Linear
Inputs (Signal Editor)
Scenarios:
- Coasting
- Gradual_Acceleration
- Hard_braking
- Passing_Maneuver
Signals:
- Brake: t 0..50, min 0, max 0, final 0
- Throttle: t 0..50, min 1, max 80, final 1
Signals:
- Brake: t 0..50, min 0, max 0, final 0
- Throttle: t 0..50, min 13.4, max 24, final 24
Signals:
- Brake: t 0..50, min 0, max 325, final 325
- Throttle: t 0..50, min 1, max 50, final 1
Signals:
- Brake: t 0..50, min 0, max 0, final 0
- Throttle: t 0..50, min 40, max 100, final 58.82
Signals:
- engine RPM: t 0..100, min 600, max 4041, final 600
Signals:
- vehicle speed: t 0..100, min 0, max 58.01, final 33.63
- throttle: t 0..100, min 0, max 100, final 0
Vehicle (masked subsystem)
Rfd=vehicledata(1); rload0=vehicledata(2); rload2=vehicledata(3); Rw=vehicledata(4); Iv=vehicledata(5); N20=vehicledata(6)/vehicledata(4)*vehicledata(1)
Blocks:
- brake torque - Inport 1
- transmission output torque - Inport 2
- final drive ratio1 - Gain: Gain=Rfd
- Sum - Sum: Inputs=+-
- vehicle inertia - Gain: Gain=1/Iv
- wheel speed - Integrator: InitialCondition=N20/Rfd
- linear speed - Gain: Gain=2*pi*Rw
- mph - Gain: Gain=60/5280
- final drive ratio2 - Gain: Gain=Rfd
- road load - Fcn: Expr=rload0 + rload2*u^2
- Sign - Signum
- Sum1 - Sum: Inputs=++
- signed load - Product: Inputs=2
- vehicle speed - Outport 1
- transmission output speed - Outport 2
Signals:
- brake torque:1 -> Sum1:2
- transmission output torque:1 -> final drive ratio1:1
- final drive ratio1:1 -> Sum:1
- Sum:1 -> vehicle inertia:1
- vehicle inertia:1 -> wheel speed:1
- wheel speed:1 -> linear speed:1, final drive ratio2:1
- linear speed:1 -> mph:1
- mph:1 -> vehicle speed:1, Sign:1, road load:1
- final drive ratio2:1 -> transmission output speed:1
- road load:1 -> Sum1:1
- Sign:1 -> signed load:1
- Sum1:1 -> signed load:2
- signed load:1 -> Sum:2
Notes:
Action language=MATLAB; Update method=DISCRETE; Sample time=0.04
Data:
- TWAIT: parameter, uint8
- up_th: local, double
- down_th: local, double
- throttle: input 1, Inherit: Same as Simulink
- speed: input 2, double
- gear: output 1, Enum: gearType, set to the active child of gear_state
- DOWN: local event (in gear_state)
- UP: local event (in gear_state)
- gear: input, Enum: gearType (in calc_th)
- throttle: input, double (in calc_th)
- down_th: output, Inherit: Same as Simulink (in calc_th)
- up_th: output, Inherit: Same as Simulink (in calc_th)
Types:
- gearType: None=0, first=1, second=2, third=3, fourth=4
Parallel (AND) decomposition
States:
- gear_state (order 1)
- selection_state during: [down_th,up_th] = calc_th(gear,throttle); (order 2)
- first (in gear_state)
- second (in gear_state)
- third (in gear_state)
- fourth (in gear_state)
- steady_state (in selection_state)
- downshifting (in selection_state)
- upshifting (in selection_state)
Functions:
- [down_th,up_th] = calc_th(gear,throttle) (Simulink function) (in selection_state)
Transitions:
- default -> first (in gear_state)
- [1] second -> third: UP (in gear_state)
- [1] third -> fourth: UP (in gear_state)
- first -> second: UP (in gear_state)
- fourth -> third: DOWN (in gear_state)
- [2] third -> second: DOWN (in gear_state)
- [2] second -> first: DOWN (in gear_state)
- default -> steady_state (in selection_state)
- [1] steady_state -> upshifting: [speed > up_th] (in selection_state)
- [2] steady_state -> downshifting: [speed < down_th] (in selection_state)
- [1] downshifting -> steady_state: after(TWAIT,tick) [speed <= down_th] {send(gear_state.DOWN)} (in selection_state)
- [2] downshifting -> steady_state: [speed > down_th] (in selection_state)
- [1] upshifting -> steady_state: after(TWAIT,tick) [speed >= up_th] {send(gear_state.UP)} (in selection_state)
- [2] upshifting -> steady_state: [speed < up_th] (in selection_state)
Blocks:
- gear - Inport 1: OutDataTypeStr=Enum: gearType; PortDimensions=1; SignalType=real
- throttle - Inport 2: OutDataTypeStr=double; PortDimensions=1; SignalType=real
- f - TriggerPort: TriggerType=function-call; StatesWhenEnabling=held; FunctionPrototype=f()
- Look-Up - MATLAB Function
- interp_up - Lookup_n-D
- interp_down - Lookup_n-D
- down_th - Outport 1
- up_th - Outport 2
Signals:
- gear:1 -> Look-Up:1
- throttle:1 -> interp_down:1, interp_up:1
- Look-Up:1 -> interp_down:2, interp_up:2
- interp_up:1 -> up_th:1
- interp_down:1 -> down_th:1
Look-Up (MATLAB Function)
Data:
- gear: input 1, Inherit: Same as Simulink
- out: output 1, Inherit: Same as Simulink
function out = fcn(gear)
%#codegen
table = [1 2 3 4];
switch(gear)
case gearType.fourth;
out=table(4);
case gearType.third;
out=table(3);
case gearType.second;
out=table(2);
otherwise; % gearType.first
out=table(1);
end
end
NumberOfTableDimensions=2; BreakpointsForDimension1=downth; BreakpointsForDimension2=[1:4]; Table=downtab; InterpMethod=Linear point-slope; ExtrapMethod=Linear
NumberOfTableDimensions=2; BreakpointsForDimension1=upth; BreakpointsForDimension2=[1:4]; Table=uptab; InterpMethod=Linear point-slope; ExtrapMethod=Linear
Blocks:
- Ne - Inport 1
- gear - Inport 2
- Nout - Inport 3
- Torque Converter - torque converter
- transmission ratio - SubSystem
- Ti - Outport 1
- Tout - Outport 2
Signals:
- Ne:1 -> Torque Converter:1
- gear:1 -> transmission ratio:2
- Nout:1 -> transmission ratio:3
- Torque Converter:1 -> Ti:1
- Torque Converter:2 -> transmission ratio:1 "turbine torque"
- transmission ratio:1 -> Tout:1
- transmission ratio:2 -> Torque Converter:2
speedratio=converter_data(:,1); Kfactor=converter_data(:,2); Torkratio=converter_data(:,3)
Blocks:
- Ne - Inport 1
- Nin - Inport 2
- speed ratio - Product: Inputs=*/
- K factor - Lookup_n-D
- quotient - Product: Inputs=*/
- impeller - Fcn: Expr=u^2
- Torque ratio - Lookup_n-D
- turbine - Product: Inputs=2
- Ti - Outport 1
- Tt - Outport 2
Signals:
- Ne:1 -> speed ratio:2, quotient:1
- Nin:1 -> speed ratio:1
- speed ratio:1 -> Torque ratio:1, K factor:1
- K factor:1 -> quotient:2
- quotient:1 -> impeller:1
- impeller:1 -> turbine:1, Ti:1
- Torque ratio:1 -> turbine:2
- turbine:1 -> Tt:1
Notes:
NumberOfTableDimensions=1; BreakpointsForDimension1=speedratio; Table=Kfactor; InterpMethod=Linear point-slope; ExtrapMethod=Linear
NumberOfTableDimensions=1; BreakpointsForDimension1=speedratio; Table=Torkratio; InterpMethod=Linear point-slope; ExtrapMethod=Linear
Blocks:
- Tin - Inport 1
- gear - Inport 2
- Nout - Inport 3
- Look-Up Table - MATLAB Function
- Product - Product: Inputs=2
- Product1 - Product: Inputs=2
- Tout - Outport 1
- Nin - Outport 2
Signals:
- Tin:1 -> Product:1
- gear:1 -> Look-Up Table:1
- Nout:1 -> Product1:2
- Look-Up Table:1 -> Product1:1, Product:2
- Product:1 -> Tout:1
- Product1:1 -> Nin:1
Data:
- gear: input 1, Inherit: Same as Simulink
- out: output 1, Inherit: Same as Simulink
function out = fcn(gear)
%#codegen
table = [2.393 1.450 1.000 0.677];
switch(gear)
case gearType.fourth
out=table(4);
case gearType.third
out=table(3);
case gearType.second
out=table(2);
otherwise % gearType.first
out=table(1);
end
end
Signals:
- output torque: t 0..100, min 0.0567, max 1427, final 0.06099