matlab和simulink代写-ME 2043
时间:2021-02-20
ME 2043 Due February 24th, 2021 at 11:59 PM ET Spring 2021
Student Name Pitt Login
Academic Integrity
This work is subject to the Swanson School of Engineering Academic Integrity Policy. For this assignment, you may
consult with other students in the course to discuss solution strategies and seek help, but do not present work that
is not your own. You may use online references and resources, and course notes and materials provided by the
instructors. Don’t copy solutions from others. If you can’t explain all the steps required to solve the problem the
following day without seeing the solution, you probably need to reconsider your methods.
Submission
Please submit the assignment via Canvas. Label your files clearly. Submit any code files along with any written
work. MATLAB Live Scripts or Publish could be a good way to go.
Clearly mark your answers for each sub-problem. Please put a box around your answer and label it with the
sub-problem, e.g ”2B”.
Homework 2 (60 pts total)
Problems:
In this assignment, we will design a few different iterative learning controllers for a simple first-order heater system
subject to convective heat transfer. Consider the system:
mcp
dT
dt
= hA(T∞ − T ) + pin (1)
Here, T∞ is the ambient temperature, 296.15 K. h is the convection coefficient at 10 W/(m2*K),m is the mass at 0.001
kg, cp is the heat capacity at 100 J/(kg*K), and A is the effective area at 12/1002 m2. We also have α as a gain from
our heater input control voltage to our heater wattage, at α = 0.01 W/V, and the heater input power, pin = αVin.
Ignoring the radiation effects,
dT
dt
=
(
1
mcp
)
[hA(T∞ − T ) + αVin] (2)
This a first order, linear, time-invariant differential equation. We can consider the ambient temperature T∞ as a
disturbance to the system and Vin our controllable input. If we make the substitutions kc = hAmcp and kα =
α
mcp
, and
let T = x (our state), and output y = x,
x˙ = kcT∞ − kcx+ kdVin (3)
Taking the Laplace Transform and ignoring I.C.’s,
sX(s) = kcT∞(s)− kcX(s) + kdVin (4)
Therefore,
(s+ kc)X(s) = kcT∞(s) + kdVin (5)
So, now we have a nice continuous time model of the system in the Laplace domain. We can do a lot with it starting
here.
Problem 1 (25 pts):
Your Tasks:
1. (5 pts) Derive the two important transfer functions, HV (s) = X(s)/Vin(s)|T∞(s)=0 (the input transfer function)
and HD(s) = X(s)/T∞(s)|Vin=0 (the disturbance transfer function).
University of Pittsburgh - ©2021 Nikhil Bajaj Page 1
ME 2043 Due February 24th, 2021 at 11:59 PM ET Spring 2021
2. (10 pts) You may wish to convert to or consider the discrete time, state-space formulation for this part, but
derive the condition for stability of the ILC for this plant given the PD-type. Show your work.
3. (10 pts) Without considering the disturbance transfer function, but rather, treating the ambient temperature as
a constant, implement an open-loop ILC controller in MATLAB similar to that done in the class programming
examples. It must do the following:
(a) Be of a PD-type.
(b) The sampling period will be 1 second and the overall time period is 0 to 599 seconds.
(c) It must track the trajectory: x(t) = T∞ + t − (t − 100)u(t − 100) + (t − 200)u(t − 200) − (t − 300)u(t −
300)− (t− 400)u(t− 400).
(d) You will want to use lsim() and the discrete-time (z-domain) version of the plant to more easily simulate
what is going on.
You must provide your code and show plots indicating convergence over time, and what the initial, final,
and some intermediate trajectories (e.g. at different iteration j values) are.
University of Pittsburgh - ©2021 Nikhil Bajaj Page 2
ME 2043 Due February 24th, 2021 at 11:59 PM ET Spring 2021
Problem 2 (45 pts):
In this problem, we’re going to use the same plant, but apply a very simple feedback controller to it. We’ll then use
ILC in series with the controller. Recall that this allows the ILC to basically just “pick up the slack” that the feedback
controller doesn’t get - this way convergence can be much faster, and we have less to worry about in our initial runs
in terms of performance. We’ll be a bit lazy and design a continuous time controller, and just translate the entire
feedback system to discrete time for the ILC to interface with.
Recall that this is doable when the sampling rate is 10-20+ times the time constant of the plant. Your Tasks:
1. (5 pts) Verify, with a step response, the time constant of the plant. Relative to the 1 second sampling period,
is it reasonable to approximate a continuous time controller? Show a plot of the step response with the time
constant on it (you can use MATLAB tools for the time constant). Create a controller using MATLAB’s transfer
function tools, C(s) = s+1s , such that the feedback loop results in a closed-loop transfer function of HCL(s) =
CHV (s)/(1 + CHV (s) where G(s) is the plant transfer function. Verify closed-loop behavior with a step
response and describe it. What type of system is it?
2. (10 pts) For the purposes of this ILC, we now assume the plant is the discrete time convertedHCL(s). You may
wish to convert to or consider the discrete time, state-space formulation for this part, but derive the condition
for stability of the ILC for this plant given a PD-type ILC. Show your work.
3. (10 pts) Without considering the disturbance transfer function, but rather, treating the ambient temperature as
a constant, implement an ILC controller in MATLAB similar to that done in the class programming examples.
It must do the following:
(a) Be of a PD-type.
(b) The sampling period will be 1 second and the overall time period is 0 to 599 seconds.
(c) It must track the trajectory: x(t) = T∞ + t − (t − 100)u(t − 100) + (t − 200)u(t − 200) − (t − 300)u(t −
300)− (t− 400)u(t− 400).
(d) You will want to use lsim() and the discrete-time (z-domain) version of the closed-loop plant to more
easily simulate what is going on.
4. (10 pts) Now, instead of the PD-type, implement a plant-inversion type ILC (using the closed-loop system
plant) with an additional P-type term to help it along. You should pick a very conservative value for the P-
type learning rate. Hint: lsim() with a transfer function and an input is the convolution of the time-sequence
versions (e.g. you can use lsim() to produce the action of the Q-filter).
5. (10 pts) Now, what happens if we have a disturbance? In this case, we have another input, the ambient
temperature T∞. Looking back to the previous problem, find the disturbance transfer function, and include it
in the computation of the system response, where T∞(t) = 40u(t − 150) − 40u(t − 250). Note that you’ll still
want to add on T∞,0, the initial ambient temperature, later so there’s no associated transient. Simulate and
show how this disturbance effects the performance.
You must provide your code and show plots indicating convergence over time, and what the initial, final,
and some intermediate trajectories (e.g. at different iteration j values) are.
University of Pittsburgh - ©2021 Nikhil Bajaj Page 3








































































































学霸联盟


essay、essay代写
essay、essay代写