Bird
Raised Fist0
Simulinkdata~10 mins

First-order system simulation in Simulink - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the transfer function of a first-order system with gain K and time constant T.

Simulink
sys = tf([[1]], [T 1])
Drag options to blanks, or click blank then click option'
AK
BT
C1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using time constant T in numerator instead of gain K
Using 1 or 0 incorrectly in numerator
2fill in blank
medium

Complete the code to simulate the step response of the system 'sys' for 10 seconds.

Simulink
step(sys, [1])
Drag options to blanks, or click blank then click option'
A5
B20
C15
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect simulation time
Omitting the simulation time argument
3fill in blank
hard

Fix the error in the code to correctly define the time vector for simulation from 0 to 10 seconds with 0.1s step.

Simulink
t = [1];
Drag options to blanks, or click blank then click option'
Arange
B0:0.1:10
Clinspace
Darange
Attempts:
3 left
💡 Hint
Common Mistakes
Using Python functions like range or arange
Using vector syntax incorrectly
4fill in blank
hard

Fill both blanks to create a transfer function with gain 5 and time constant 2.

Simulink
sys = tf([[1]], [[2] 1])
Drag options to blanks, or click blank then click option'
A5
B2
C1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping gain and time constant
Using 1 or 0 incorrectly in numerator or denominator
5fill in blank
hard

Fill all three blanks to simulate the step response of 'sys' over time vector 't' and plot the result.

Simulink
y = step(sys, [1]);
plot([2], [3]);
xlabel('Time (s)');
ylabel('Output');
title('Step Response');
Drag options to blanks, or click blank then click option'
At
By
Dsys
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing order of plot arguments
Using system object instead of output or time vector

Practice

(1/5)
1. What does a first-order system simulation in Simulink typically show?
easy
A. How the system output changes over time after an input
B. The exact solution of differential equations analytically
C. The internal code of Simulink blocks
D. The hardware specifications of the computer running Simulink

Solution

  1. Step 1: Understand the purpose of first-order system simulation

    It models how the output of a simple system changes over time when given an input.
  2. Step 2: Identify what simulation shows in Simulink

    Simulink simulates the system response graphically, showing output behavior over time.
  3. Final Answer:

    How the system output changes over time after an input -> Option A
  4. Quick Check:

    Simulation = output change over time [OK]
Hint: Simulation shows output change over time [OK]
Common Mistakes:
  • Confusing simulation with code details
  • Thinking simulation shows hardware specs
  • Assuming simulation gives exact analytic solutions
2. Which of the following is the correct way to represent a first-order transfer function in Simulink's Transfer Function block?
easy
A. Numerator: [5], Denominator: [1 0]
B. Numerator: [1 5], Denominator: [1]
C. Numerator: [1], Denominator: [1 5]
D. Numerator: [1], Denominator: [5 1]

Solution

  1. Step 1: Recall first-order transfer function form

    A first-order system has denominator of form s + a, so denominator coefficients are [1 a].
  2. Step 2: Match numerator and denominator arrays

    Numerator is usually constant [1], denominator [1 5] means s + 5, correct for first-order.
  3. Final Answer:

    Numerator: [1], Denominator: [1 5] -> Option C
  4. Quick Check:

    Denominator = [1 a] for first-order [OK]
Hint: Denominator starts with 1 for s term [OK]
Common Mistakes:
  • Swapping numerator and denominator
  • Using wrong order of coefficients
  • Using zero in denominator leading coefficient
3. Given the Simulink Transfer Function block with Numerator = [2] and Denominator = [1 3], and a step input of magnitude 1, what is the steady-state output value?
medium
A. 2
B. 0.67
C. 0.5
D. 3

Solution

  1. Step 1: Calculate steady-state gain from transfer function

    Steady-state gain = numerator constant / denominator constant = 2 / 3 ≈ 0.67.
  2. Step 2: Apply step input magnitude

    Step input is 1, so output steady-state = 0.67 * 1 = 0.67.
  3. Final Answer:

    0.67 -> Option B
  4. Quick Check:

    Gain = 2/3 = 0.67 [OK]
Hint: Steady-state = numerator/denominator constant term [OK]
Common Mistakes:
  • Using numerator over denominator reversed
  • Ignoring step input magnitude
  • Confusing transient with steady-state
4. You created a first-order system in Simulink with Numerator = [1] and Denominator = [1 0], but the simulation shows no response. What is the likely error?
medium
A. Denominator [1 0] represents an integrator, not a first-order system
B. Numerator should be zero for first-order systems
C. Step input magnitude is missing
D. Scope block is not connected

Solution

  1. Step 1: Analyze denominator [1 0]

    Denominator [1 0] means s + 0 = s, which is an integrator, not a first-order system with constant term.
  2. Step 2: Understand simulation behavior

    Integrator causes output to ramp, but if input is zero or setup wrong, no visible response occurs.
  3. Final Answer:

    Denominator [1 0] represents an integrator, not a first-order system -> Option A
  4. Quick Check:

    Denominator must have constant term for first-order [OK]
Hint: Denominator must have constant term, not zero [OK]
Common Mistakes:
  • Assuming zero constant term is valid
  • Ignoring block connections
  • Forgetting to set step input
5. You want to simulate a first-order system with time constant 4 seconds and gain 3 in Simulink. Which numerator and denominator coefficients should you use in the Transfer Function block?
hard
A. Numerator: [1], Denominator: [1 0.25]
B. Numerator: [3], Denominator: [4 1]
C. Numerator: [3], Denominator: [1 0.25]
D. Numerator: [3], Denominator: [1 4]

Solution

  1. Step 1: Write transfer function formula for first-order system

    Transfer function = gain / (time_constant * s + 1) = 3 / (4s + 1).
  2. Step 2: Convert to Simulink coefficients

    Numerator [3], Denominator [1 4] for s + 4.
  3. Final Answer:

    Numerator: [3], Denominator: [1 4] -> Option D
  4. Quick Check:

    Denominator = [1 tau] for first-order [OK]
Hint: Denominator coefficients = [1 tau] [OK]
Common Mistakes:
  • Swapping numerator and denominator
  • Using time constant as denominator constant
  • Not normalizing denominator leading coefficient to 1
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