Simulink Onramp Progress after this session Modules 1–9 of 11  (82%)
📋

Session Overview

Session 07 introduces subsystems — the mechanism that lets Simulink models scale from 5 blocks to 500 blocks while remaining readable. You will create subsystems, name their ports, and navigate a 2-level hierarchy.

The session culminates in a design exercise: sketch a 3-subsystem BEV hierarchy on paper, then build it in Onramp.

🧠
Block A — 15–20 min
Theory: why subsystems, hardware analogy, inports & outports, navigation
🖱️
Blocks B & C — 90 min
Onramp Modules 7–9: create subsystems, name ports, navigate hierarchy
Block D — 15 min
EV task: wrap RPM→rad/s Gain into subsystem; paper BEV 3-subsystem design
Objective
After this session you can create a subsystem from selected blocks, name inports and outports with signal names, navigate into and out of subsystem hierarchy, and design a 3-level BEV model hierarchy on paper.
🔁

Recap from Session 06

What does the Gain block do?
Multiplies the input signal by a constant value.
What Gain value converts RPM to rad/s?
0.1047 (= 2π ÷ 60)
What does the Scope show for a Constant block input?
A flat horizontal line — correct.
What does Stop Time 1800 represent?
Full WLTP drive cycle duration in seconds.
Starting Model
Today you begin with the Session 06 model: Constant (300) → Gain (0.1047) → Display. You will wrap the Gain block into a named subsystem.
📦

Why Subsystems?

A subsystem is a block that contains other blocks. From the outside it looks like any block — named input ports on the left, output ports on the right. On the inside it contains a sub-model.

Diagram — flat model vs subsystem hierarchy
flowchart LR subgraph FLAT["Flat — hard to read at scale"] direction LR F1["Constant"]:::box --> F2["Gain"]:::box --> F3["Sum"]:::box --> F4["Integrator"]:::box --> F5["Scope"]:::box end subgraph HIER["Subsystem model — clean, reusable"] direction LR H1["Constant (throttle)"]:::box --> H2["RPM_to_RadPerSec [subsystem]"]:::sub --> H3["Display"]:::box end classDef box fill:#F8FAFC,stroke:#CBD5E1,color:#1A2B3C classDef sub fill:#EDE9FE,stroke:#7C3AED,color:#4C1D95,font-weight:bold

Benefits

  • Hides internal complexity — shows only inputs & outputs
  • Reuse the same block anywhere in the model
  • Test each component independently
  • Mirrors real hardware structure

Hardware analogy

A battery pack has a positive and negative terminal — you don't see the cells, BMS, or thermal management from outside. A Simulink subsystem works identically: visible ports only, hidden internals.

🔨

Creating a Subsystem

1
Select the blocks to group

Drag a selection rectangle around only the blocks to go inside. Do not include source blocks (Constant) or sink blocks (Display/Scope) that should remain at Level 1.

2
Right-click → Create Subsystem from Selection

Simulink wraps the selected blocks into a new subsystem block. It automatically adds Inport and Outport blocks at the signal boundaries.

3
Name the subsystem block

Click the label under the subsystem block on the canvas. Replace the default name with a meaningful one: RPM_to_RadPerSec.

Undo Error
If you select too many blocks and the subsystem breaks signal connections — press Ctrl+Z immediately. Deselect all, then carefully reselect only the internal blocks before retrying.
🔌

Inports & Outports — Naming the Interface

After creating a subsystem, double-click it to open the interior. You will find Inport and Outport blocks at the boundaries. Renaming these is not optional in professional models.

Inport block

Default name: In1 — rename to the signal name, e.g. rpm_in. The name appears on the subsystem block face on the parent canvas.

Outport block

Default name: Out1 — rename to e.g. rads_out. Anyone opening the model immediately knows what signal the subsystem produces.

Self-Documenting
A subsystem with ports named rpm_in and rads_out tells the next engineer exactly what it does without opening it. A subsystem with ports named In1 and Out1 tells them nothing. In professional Simulink models, unnamed ports are a code quality violation.

BEV 3-Subsystem Hierarchy Design

Diagram — 3-subsystem BEV architecture
flowchart LR T["Throttle Constant Block"]:::input --> BAT["Battery Pack [subsystem]"]:::sub1 --> MTR["Electric Motor [subsystem]"]:::sub2 --> VD["Vehicle Dynamics [subsystem]"]:::sub3 --> WS["Wheel Speed Scope/Display"]:::output classDef input fill:#EEF2FF,stroke:#475569,color:#1E293B,font-weight:bold classDef sub1 fill:#D1FAE5,stroke:#475569,color:#1E293B,font-weight:bold classDef sub2 fill:#EDE9FE,stroke:#7C3AED,color:#4C1D95,font-weight:bold classDef sub3 fill:#FEF3C7,stroke:#D97706,color:#92400E,font-weight:bold classDef output fill:#ECFDF5,stroke:#059669,color:#065F46,font-weight:bold
Industry Reality
This 3-subsystem structure is how production Simulink models at Tata, Mahindra, and BYD are organised at Level 1. Each subsystem is developed and tested independently by a different engineering team before integration.
🔧

Block D — EV Task

Block D ⏱ 15 min Subsystem Wrap + BEV 3-Subsystem Design
1
Wrap the Gain into a subsystem

In Onramp, build Constant (300) → Gain (0.1047) → Display. Select the Gain block only → Right-click → Create Subsystem. Enter the subsystem. Rename Inport to rpm_in, Outport to rads_out. Exit. Rename the subsystem block to RPM_to_RadPerSec. Run — verify Display still ≈ 31.4.

2
Paper — BEV 3-subsystem hierarchy

On paper, design a 3-subsystem BEV model: Battery Pack, Electric Motor, Vehicle Dynamics. For each subsystem, list at least 2 internal blocks you would expect inside. Draw signal flow arrows between subsystems and label each arrow with the signal name and units.

3
Group discussion
Q1 — Why is naming ports (rpm_in, rads_out) better than leaving them as In1 / Out1?
Imagine a colleague opening the model six months later
Q2 — If a BEV model had 10 motor subsystems, what would having a reusable RPM_to_RadPerSec subsystem save?
Copy-paste once vs rebuild 10 times
Q3 — What signal flows from the Battery Pack subsystem into the Electric Motor subsystem?
Think about what the motor needs from the battery to operate
🛠️

Troubleshooting

❌ Subsystem created but signals disconnect
Fix: Press Ctrl+Z immediately. You selected too many blocks. Reselect only the internal blocks and retry.
❌ Can't navigate back to Level 1
Fix: Press Ctrl+Shift+U, or click the breadcrumb trail at the top of the canvas. Do not close the window.
⚠️ Port names not visible on subsystem block face
Fix: Drag the corner of the subsystem block to make it larger, or zoom in. Port names appear when the block is wide enough.
⚠️ Model output changed after subsystem creation
Fix: The subsystem creation should not change model output. Re-run from Level 1. If still wrong, check that the Gain value inside the subsystem is still 0.1047.

Key Takeaways

📦A subsystem hides internal complexity and exposes only named ports — exactly like a real hardware component.
🏷️Always name ports with signal names (rpm_in, rads_out) — never leave default names like In1.
⬆️Use Ctrl+Shift+U to navigate back to the parent level.
▶️Always run the simulation from Level 1 — not from inside a subsystem.
♻️Subsystems are reusable — build once, copy anywhere in the model.

Before Session 08

You have now built subsystems and designed a BEV hierarchy. Session 08 is the final session — you complete the Simulink Onramp, earn the MathWorks certificate, and synthesise all four sessions into an EV reference table.

Ensure you have completed Modules 7–9 before Session 08. The certificate assessment covers all content from Modules 1–11.

Session 08 →