Republic of the Philippines
BATANGAS STATE UNIVERSITY
The National Engineering University
Alangilan Campus
Golden Country Homes, Alangilan Batangas City, Batangas, Philippines 4200
Tel Nos.: (+63 43) 425-0139 local 2121 / 2221
E-mail Address:[Link]@[Link] | Website Address: [Link]
CHAPTER 3 - CONVERSION OF TRASNFER FUNCTION TO STATE-SPACE
PRE-LABORATORY SIMULATION (MATLAB OFFLINE)
Procedures:
1. Open the script in MATLAB and identify the initial values for the Thermowell Wall Lag (
τ1init) and the Internal RTD Lag (τ2init).
2. Navigate to Part 1 to convert the 2nd-order transfer function into a State-Space
representation. Calculate the normalized coefficients K_norm = 1 / (tau1_init *
tau2_init); and B_norm = (tau1_init + tau2_init) / (tau1_init * tau2_init);.
3. Construct the Transfer Function numerator num = [0, 0, K_norm]; and denominator den
= [1, B_norm, K_norm];.
4. Use the tf2ss() command to automatically convert these arrays into the State-Space
matrices [A_sys, B_sys, C_sys, D_sys].
5. Run the script to execute the code and launch the "Thermowell Digital Twin" dashboard.
6. Click the "HEAT" or "COOL" buttons in the "Dynamic Thermal Execution" panel to
initiate a thermal step response.
7. Use the sliders in the "Physical Sensor Properties" panel to change τ1 and τ2. Observe
how these changes affect the "Coefficient Flow" text, the "S-Plane Bridge" plot, and the
3D/2D thermal animations.
Guide Questions:
1. Using the sliders to adjust the sensor properties, how does increasing the "Internal RTD
Lag (τ2)" alter the position of the blue SS Eigenvalues relative to the red TF Poles on the
"S-Plane Bridge"?
2. Based on the "Coefficient Flow" equations panel, how does the A matrix mathematically
incorporate the coefficients generated by the Transfer Function's denominator?
Republic of the Philippines
BATANGAS STATE UNIVERSITY
The National Engineering University
Alangilan Campus
Golden Country Homes, Alangilan Batangas City, Batangas, Philippines 4200
Tel Nos.: (+63 43) 425-0139 local 2121 / 2221
E-mail Address:[Link]@[Link] | Website Address: [Link]
LABORATORY SIMULATION (MATLAB ONLINE)
Procedures:
1. Open the script within your MATLAB Online workspace.
2. Review STEP 1 to observe how the numerator (num_c) and denominator (den_c)
polynomial arrays are defined to represent the controller's transfer function.
3. Navigate to STEP 2 to examine the state realization command:
[A, B, C, D] = tf2ss(num_c, den_c);
Note how this single command extracts four distinct matrices from the two polynomial
arrays.
4. Check STEP 3 to understand how the extracted matrices are repackaged into a formal
State-Space LTI model using the ss() function.
5. Run the script and review your MATLAB Command Window to visually compare the
printed Transfer Function Gc(s) against the numerical values generated inside the
extracted A, B, C, and D matrices.
Guide Questions:
1. In STEP 1, the denominator array is defined as den_c = [1, 4, 0]; to represent the
2
polynomial 𝑠 + 4𝑠. How would you mathematically modify this specific array of
2
numbers if the transfer function's denominator was changed to 𝑠 + 4𝑠 + 10?
2. Based on the numerical output printed in the Command Window from STEP 2, what are
the specific mathematical dimensions (rows × columns) of the extracted system matrix
A, and how does this dimension directly correlate to the highest power of s (the order) in
your defined denominator polynomial?