Week 6 · State Transition and System Responses

English translation

Before practice

01 Effect of the starting state

The same object responds differently when starting at rest and when already moving. How can this difference be reflected in the calculation?

Description
  • Specify the starting position and velocity as the initial state. Different initial states produce different responses even with the same subsequent input.
  • State transition describes how this initial state evolves over time.

02 Distinguish the causes of motion

How could separating the object's initial motion from the effect of subsequently applied force help you understand the response?

Description
  • Decompose a linear model into responses due to the initial state and the input
  • Calculate the total response by adding the input response with initial state 0

Practice

1. Calculate state transitions

  • Before running the general model below, calculate by hand the simple case with A=[−100−2]A=\begin{bmatrix}-1&0\\0&-2\end{bmatrix}, 𝐱0=[21]\mathbf x_0=\begin{bmatrix}2\\1\end{bmatrix}, and u(t)=0u(t)=0.
  • For a diagonal matrix, Φ(t)=diag⁡(ea1t,ea2t)\Phi(t)=\operatorname{diag}(e^{a_1t},e^{a_2t}).
  • Write Φ(t)\Phi(t) and 𝐱(t)=Φ(t)𝐱0\mathbf x(t)=\Phi(t)\mathbf x_0 symbolically and check whether they equal their initial values at t=0t=0.
  • In the total-response equation, identify the term due to the initial state and the integral term due to the input. Explain which term is 0 here.
  • At t=1t=1, evaluate x(t) and leave its components in exponential form. Then assign the hand-calculation model to the separate variables A_check=diag([-1 -2]) and x0_check=[2;1], and compare the resulting state vector with expm(A_check)*x0_check.
  • Use this calculation as the baseline prediction for the “2. State Transition Matrix” code in the practice Live Script.

2. State Transition Matrix

  1. Using the same A in the “2. State Transition Matrix” code in the practice Live Script, obtain Phi=expm(A*t) at t∈{0,0.5,1}t\in\{0,0.5,1\} and record the matrix.
  2. Calculate norm(expm(A)-expm(A*0.5)*expm(A*0.5)) and record the residual. Check whether it is near 0 and compare with Φ(1)=Φ(0.5)Φ(0.5)\Phi(1)=\Phi(0.5)\Phi(0.5).
  3. Relate your explanation to Phi-exp(A*0.5) calculated at the same t=0.5t=0.5, and explain why state transition uses expm instead of exp.

3. Compare state trajectories

  1. Using the same A and time axis, change the initial state from [1;0] to [0;1] and recalculate X.
  2. Plot the curves before and after the change for position X(1,:) and linear velocity X(2,:). Label the initial states in the legend.
  3. Explain why position changes later despite an initial position of 0, relating this to the initial linear velocity.

4. Decompose the total response

  1. Using sys,t defined in the total-response decomposition code, calculate each of the following cases.
    • Input u=2*ones(size(t)), baseline initial state x0=[1;0].
    • u=2*ones(size(t)) with input magnitude kept at 2, initial state x0=[0;1].
  2. For each case, calculate the total output lsim(sys,u,t,x0), the output due to the initial state initial(sys,x0,t), and the output due to the input lsim(sys,u,t).
  3. Record max(abs(yTotal-yInitial-yInput)) and explain the relation among the three outputs.
  4. Compare the total output with only the input doubled against twice the baseline total output. Separately determine whether the output due to the initial state also doubles.

Submission and saving

Include code, actual outputs and plots, and your own interpretation. Submit through KLAS; check the semester schedule and latest announcements for the deadline.

Filename: Name_StudentID_Week6.mlx.

Restart the runtime, run all code from the top, then save.

Optional practice

Example: Entering the initial state as a row vector

  1. Using the same A in the “2. State Transition Matrix” code in the practice Live Script, test expm(A*0.5)*[1 0] on a separate line and record both matrices’ dimensions and the error message.
  2. Change only the initial state to the column vector [1;0] and calculate. Write both components of the result and replace the incorrect input line with the corrected line.