Complete the code to calculate the steady-state error for a unit step input.
ess = 1 / (1 + [1]);
The steady-state error for a unit step input depends on the position error constant Kp.
Complete the code to calculate the steady-state error for a ramp input.
ess = 1 / [1];
For a ramp input, the steady-state error is the inverse of the velocity error constant Kv.
Fix the error in the code to compute the steady-state error for a parabolic input.
ess = 1 / ([1]);
The steady-state error for a parabolic input is the inverse of the acceleration error constant Ka.
Fill both blanks to create a dictionary of error constants for steady-state error analysis.
error_constants = {'position': [1], 'velocity': [2]The dictionary maps 'position' to Kp and 'velocity' to Kv, which are used for step and ramp inputs respectively.
Fill all three blanks to create a function that returns steady-state error based on input type.
def steady_state_error(input_type): constants = {'step': [1], 'ramp': [2], 'parabolic': [3] return 1 / constants.get(input_type, 1)
The function uses Kp for step, Kv for ramp, and Ka for parabolic inputs to calculate steady-state error.
