Bird
Raised Fist0
Simulinkdata~20 mins

Mixed continuous-discrete models in Simulink - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Mixed Models Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2:00remaining
Output of a simple mixed continuous-discrete Simulink model

Consider a Simulink model with a continuous integrator block connected to a discrete zero-order hold (ZOH) block with a sample time of 0.1 seconds. The input to the integrator is a constant signal of value 2. What is the output of the ZOH block at time t = 0.3 seconds?

Simulink
Integrator input: constant 2
Integrator initial condition: 0
ZOH sample time: 0.1 seconds
Calculate output at t=0.3 seconds.
A0.6
B0.2
C0.3
D0.0
Attempts:
2 left
💡 Hint

Remember the integrator output is the integral of the input over time. The ZOH holds the value sampled at discrete intervals.

❓ data_output
intermediate
1:30remaining
Number of discrete samples in a mixed model simulation

A Simulink model runs a simulation for 5 seconds. It contains a discrete block with a sample time of 0.2 seconds. How many discrete samples will this block produce during the simulation?

Simulink
Simulation time: 5 seconds
Discrete block sample time: 0.2 seconds
Calculate number of samples generated.
A20
B24
C25
D26
Attempts:
2 left
💡 Hint

Divide total simulation time by sample time and consider the initial sample at time zero.

❓ visualization
advanced
2:30remaining
Plot behavior of a mixed continuous-discrete system

You have a continuous-time integrator with input u(t) = 1, connected to a discrete sampler with sample time 0.5 seconds. Sketch or describe the expected output plot of the discrete sampler over 3 seconds.

Simulink
Input: u(t) = 1 (constant)
Integrator initial condition: 0
Discrete sampler sample time: 0.5 seconds
Simulation time: 3 seconds
AA constant zero output for all times
BA continuous smooth curve from 0 to 3 over 3 seconds
CA stepwise increasing plot with values 0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0 at sample times 0, 0.5, ..., 3.0
DA sinusoidal wave oscillating between 0 and 1
Attempts:
2 left
💡 Hint

The integrator output increases linearly over time. The discrete sampler samples this output at fixed intervals, holding the value until next sample.

🔧 Debug
advanced
2:00remaining
Identify the error in a mixed continuous-discrete Simulink model setup

A user sets up a Simulink model with a continuous integrator block feeding into a discrete unit delay block with sample time set to -1 (inherited). The simulation runs but the discrete block output remains constant zero. What is the most likely cause?

AThe integrator block is not connected to the discrete block.
BThe discrete block sample time is not properly defined, causing it not to update outputs.
CThe input to the integrator is zero, so output stays zero.
DThe simulation stop time is too short to see output changes.
Attempts:
2 left
💡 Hint

Check the sample time settings of discrete blocks when connected to continuous blocks.

🚀 Application
expert
3:00remaining
Design a mixed continuous-discrete model for a temperature control system

You want to model a temperature control system where the temperature changes continuously but the controller updates its output every 1 second. Which Simulink blocks and configuration best represent this mixed continuous-discrete system?

AUse a continuous integrator block for temperature dynamics and a discrete PID controller block with sample time 1 second.
BUse two discrete blocks both with sample time 1 second for temperature and controller.
CUse a discrete integrator block with sample time 1 second and a continuous controller block.
DUse only continuous blocks for both temperature and controller with no discrete blocks.
Attempts:
2 left
💡 Hint

Think about which parts of the system are continuous and which are discrete in time.

Practice

(1/5)
1. What does a mixed continuous-discrete model in Simulink represent?
easy
A. A system combining smooth continuous changes and stepwise discrete changes
B. A system with only continuous changes
C. A system with only discrete changes
D. A system that cannot be simulated in Simulink

Solution

  1. Step 1: Understand model types in Simulink

    Continuous models change smoothly over time, discrete models change at specific time steps.
  2. Step 2: Define mixed continuous-discrete model

    It combines both smooth continuous changes and stepwise discrete changes in one system.
  3. Final Answer:

    A system combining smooth continuous changes and stepwise discrete changes -> Option A
  4. Quick Check:

    Mixed model = continuous + discrete changes [OK]
Hint: Mixed models combine smooth and step changes [OK]
Common Mistakes:
  • Thinking mixed means only continuous
  • Confusing discrete with continuous
  • Believing Simulink can't simulate mixed models
2. Which Simulink block is used to represent discrete-time memory in mixed models?
easy
A. Integrator
B. Unit Delay
C. Gain
D. Sum

Solution

  1. Step 1: Identify discrete memory blocks

    Discrete memory stores previous values at discrete time steps.
  2. Step 2: Match block to function

    Unit Delay block holds the input value for one discrete time step, acting as memory.
  3. Final Answer:

    Unit Delay -> Option B
  4. Quick Check:

    Discrete memory = Unit Delay [OK]
Hint: Unit Delay stores previous discrete values [OK]
Common Mistakes:
  • Choosing Integrator which is continuous
  • Confusing Gain with memory
  • Selecting Sum which adds signals
3. Consider a Simulink model with an Integrator block connected to a Unit Delay block. If the input is a step signal starting at 0 and stepping to 1 at time 1s, what is the output of the Unit Delay block at time 1.5s?
medium
A. 0.5
B. 0
C. 1
D. Undefined

Solution

  1. Step 1: Understand signal timing

    The step input changes from 0 to 1 at 1s.
  2. Step 2: Analyze Unit Delay output at 1.5s

    Unit Delay outputs the input value from the previous discrete time step. Assuming sample time 1s, at 1.5s it outputs input at 1s, which is 1 after the step.
  3. Final Answer:

    1 -> Option C
  4. Quick Check:

    Unit Delay outputs previous step input [OK]
Hint: Unit Delay outputs previous step input value [OK]
Common Mistakes:
  • Assuming Unit Delay outputs current input
  • Ignoring sample time effect
  • Confusing Integrator output with Unit Delay
4. You have a mixed model with an Integrator and Unit Delay connected, but the simulation shows unexpected zero output from the Unit Delay. What is the most likely cause?
medium
A. Sample time of Unit Delay is not set correctly
B. Integrator block is not connected to Unit Delay
C. Step input is constant zero
D. Gain block is missing

Solution

  1. Step 1: Check connections

    If Integrator not connected, output would be undefined, not zero.
  2. Step 2: Verify Unit Delay sample time

    If sample time is incorrect or continuous, Unit Delay may output zero because it never updates.
  3. Final Answer:

    Sample time of Unit Delay is not set correctly -> Option A
  4. Quick Check:

    Incorrect sample time causes zero output [OK]
Hint: Check Unit Delay sample time for updates [OK]
Common Mistakes:
  • Assuming connection issue without checking sample time
  • Ignoring input signal values
  • Thinking Gain block affects Unit Delay output
5. You want to model a system where a continuous temperature sensor feeds into a controller that updates every 0.1 seconds using discrete logic. Which approach correctly combines continuous and discrete parts in Simulink?
hard
A. Use only continuous blocks and ignore discrete timing
B. Use only discrete blocks with sample time 0.1s for both sensor and controller
C. Use a Unit Delay for temperature and Integrator for controller
D. Use an Integrator for temperature and a Unit Delay with sample time 0.1s for controller updates

Solution

  1. Step 1: Identify continuous and discrete parts

    Temperature sensor is continuous, controller logic updates discretely every 0.1s.
  2. Step 2: Choose appropriate blocks

    Integrator models continuous sensor output; Unit Delay with sample time 0.1s models discrete controller updates.
  3. Final Answer:

    Use an Integrator for temperature and a Unit Delay with sample time 0.1s for controller updates -> Option D
  4. Quick Check:

    Continuous sensor + discrete controller = Integrator + Unit Delay [OK]
Hint: Integrator for continuous, Unit Delay for discrete timing [OK]
Common Mistakes:
  • Using only discrete blocks for continuous sensor
  • Ignoring sample time for discrete controller
  • Reversing block roles
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard