📖 Scenario: You are working on a car simulation project. The car has different parts like engine, transmission, and brakes. Each part is modeled separately in Simulink as a referenced model. You want to combine these parts into one main model to see how the whole car works together.
🎯 Goal: Build a main Simulink model that references three separate models: engine, transmission, and brakes. This will help you simulate the entire car system by combining these referenced models.
📋 What You'll Learn
Create three separate Simulink models named engine, transmission, and brakes with simple input-output blocks.
Create a main Simulink model named car_system that references the three models.
Connect the referenced models properly in the main model to simulate data flow.
Run the simulation and observe the combined output.
💡 Why This Matters
🌍 Real World
In real-world engineering, large systems are broken into smaller parts modeled separately. Referenced models help manage complexity and reuse parts.
💼 Career
Understanding referenced models is essential for system engineers and simulation specialists working with complex systems in automotive, aerospace, and robotics industries.
Progress0 / 4 steps
1
Create the engine model
Open Simulink and create a new model named engine. Add a Constant block with value 100 and connect it to an Out1 block. Save the model.
Simulink
Hint
Use new_system to create the model, add_block to add blocks, and add_line to connect them.
2
Create the transmission model
Create a new model named transmission. Add a Gain block with gain 2 and connect its input to an In1 block and output to an Out1 block. Save the model.
Simulink
Hint
Remember to add In1 and Out1 blocks and connect them through the Gain block.
3
Create the main car_system model with referenced models
Create a new model named car_system. Add three Model blocks referencing engine, transmission, and brakes models. Connect the output of engine to the input of transmission. Save the model.
Simulink
Hint
Use Model blocks to reference other models. Connect the output port 1 of engine_ref to input port 1 of transmission_ref.
4
Run the simulation and display output
Load the car_system model and run the simulation. Use simOut to store the simulation output. Print the simulation output for the transmission_ref block.
Simulink
Hint
Use sim to run the model and disp to print the output.
Practice
(1/5)
1. What is the main purpose of using Referenced models in Simulink?
easy
A. To reuse parts of models and simplify large projects
B. To create new Simulink blocks from scratch
C. To export models as images
D. To run simulations faster by skipping blocks
Solution
Step 1: Understand the role of referenced models
Referenced models allow you to include one model inside another, making reuse possible.
Step 2: Connect reuse to project management
By reusing parts, you keep big projects organized and easier to update.
Final Answer:
To reuse parts of models and simplify large projects -> Option A
Quick Check:
Referenced models = reuse and simplify [OK]
Hint: Think reuse and organization for big Simulink projects [OK]
Common Mistakes:
Confusing referenced models with creating new blocks
Thinking referenced models speed up simulation by skipping
Assuming referenced models export images
2. Which of the following is the correct way to add a referenced model in Simulink?
easy
A. Drag a Model block and set its Model name parameter to the referenced model file
B. Use the MATLAB command add_block('model') without parameters
C. Copy and paste the entire model into the current model
D. Create a new subsystem and name it after the referenced model
Solution
Step 1: Recall how to include referenced models
Simulink uses Model blocks to include referenced models by specifying the model file name.
Step 2: Check options for correctness
Drag a Model block and set its Model name parameter to the referenced model file correctly describes dragging a Model block and setting its Model name parameter.
Final Answer:
Drag a Model block and set its Model name parameter to the referenced model file -> Option A
Quick Check:
Model block + Model name = referenced model [OK]
Hint: Use Model block and set model name to reference [OK]
Common Mistakes:
Using add_block without parameters causes errors
Copy-pasting duplicates instead of referencing
Naming subsystems does not create references
3. Given a Simulink model with a Model block referencing subsystemA, what happens if subsystemA is updated externally and saved before simulation?
medium
A. Simulation fails with an error about missing blocks
B. The main model ignores changes and uses the old version
C. The main model uses the updated subsystemA during simulation
D. The referenced model is duplicated inside the main model automatically
Solution
Step 1: Understand referenced model behavior on update
Referenced models reflect changes made externally when saved before simulation.
Step 2: Analyze simulation effect
The main model uses the latest saved version of the referenced model during simulation.
Final Answer:
The main model uses the updated subsystemA during simulation -> Option C
Quick Check:
Referenced models update = main model uses latest [OK]
Hint: Referenced models always use saved latest version at simulation [OK]
Common Mistakes:
Assuming main model caches old referenced model version
Thinking simulation fails if referenced model changes