Week 7 · Does Changing the Model Representation Preserve the Response?
English translation
Before practice
01 Represent the same system differently
The motion of the same object can be expressed in different units or coordinates. When can changing the representation help the calculation?
Description
Changing units or coordinates can rescale numerical values or simplify relations for calculation.
In this exercise, check whether changing state coordinates preserves the physical response.
02 What remains unchanged when the representation changes
Can different numbers and matrices represent the same system? What must remain the same to establish this?
Description
The same physical initial state and input must produce the same output.
For the new coordinates, change not only the model matrices but also the initial state and output relation.
Practice
1. Model conversion and coordinate transformation
The model is , , , and .
Read the given model's and write the two state equations by hand.
Set the initial conditions to 0 and take the Laplace transform of both state equations. From the first equation, express in terms of and substitute it into the second equation to obtain . For , use the relationship between and to express the result as . Then describe how the output equation changes for .
Then compare with the tf result.
Use for the coordinate transformation and for the initial state.
Before running the matrix-transformation code, substitute and into , and multiply both sides by . Find the matrices corresponding to in .
Into , also substitute and find 's .
For the initial state, use to find . Match the three matrices you derived to Az, Bz and Cz in the “3. Rescale the state coordinates” code in the practice Live Script, and the initial state to z0 in the “4. Correct an initial-value transformation error” code in the practice Live Script. Record hand and code calculations in two adjacent columns, then note whether corresponding entries agree in each matrix or vector.
2. Responses before and after transformation
Keep A,B,D in the “2. Responses before and after transformation” code in the practice Live Script, change to C=[0 1], then rebuild sys and G=tf(sys).
Calculate step(sys,t) and step(G,t) on the same time axis, and record the maximum absolute difference between their outputs. Determine whether it is less than .
Write the output equations and DC gains before and after the change side by side. Explain why changing the selected state changes the output and DC gain.
3. Rescale the state coordinates
Change to P=diag([3 2]), recalculate Az,Bz,Cz using Az=P\(A*P), Bz=P\B, and Cz=C*P, and record the matrix.
Calculate the step responses of the original and transformed models on the same time axis, and record the maximum absolute difference between their outputs. Determine whether it is less than .
Explain why the output stays the same despite different matrix elements, using the relationship between and the output equation.
4. Correct an initial-value transformation error
Set the initial state to , , and in turn. Keep the model, coordinate-transformation matrix and time vector used in “3. Rescale the state coordinates” above. After changing the initial state, rerun the “4. Correct an initial-value transformation error” code in the practice Live Script.
At each , find initial(sys,x0,t) for the original model and initial(transformed,P\x0,t) for the transformed model. Also calculate the output when x0 is used unchanged in the same transformed model.
For each initial state, record two columns: the maximum absolute difference between the correctly transformed and original outputs, and that between the output using the unchanged initial value and the original output. Explain why these cases differ, relating your explanation to .
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_Week7.mlx.
Restart the runtime, run all code from the top, then save.
Optional practice
Example: applying an incorrect coordinate transformation to the transformed input matrix
Keep A,B,C,P,Az,Cz in the “3. Rescale the state coordinates” code in the practice Live Script unchanged. In a separate model, calculate the difference from the original model’s step output when Bz=P*B is used incorrectly.
Record the maximum absolute difference at t=(0:0.01:10)'. Change only the definition of Bz to P\B, recalculate the same difference, and compare the two values.