Abstract Data Type Assignment | Essay Help Services

EEE127—Assignment—2019/20
1 Background
A common control technique often employed in large chemical and other plants uses a predictive model of
the system:
^yt+1 = f(yt; yt1; yt2; : : : ; ytn) (1)
where the system state is sampled every t = ti ti1 8i : i > 0 ^ i 2 N. yt is the value of the system’s
state at time t, yt1 the value at time t1 (i.e. at time tt), etc. ^tt+1 is the prediction of the system’s
state at one time step into the future—the so-called one-step-ahead (OSA) estimate. This is a function of
the previous n state values thus taking into account the ‘memory’ (or ‘inertia’) of the system. f is some
predictive function—either linear or nonlinear—and finding this is generally a challenging task that need
not concern you here. Assume it just exists.
For systems that respond slowly to inputs, a predictive controller based on (1) makes it possible to
optimise future inputs1 to the system to control it successfully. For that, we need predictions of the system
response up to m time steps into the future. In other words, we need the set of values:
f^yt+1; ^yt+2; ^yt+3; : : : ; ; ^yt+mg
How to obtain these quantities given that (1) only gives a prediction one step ahead? Usually, (1) is
used to predict ^yt+2 by ‘shifting along’ the inputs, as in:
^yt+2 = f(^yt+1; yt; yt1; yt2; : : : ; ytn+1) (2)
In other words, f is used to predict ^yt+2 employing an estimated value ^yt+1 and the n known values
of y. Notice that to estimate ^yt+2, ytn drops out of the set on input values. Similarly, ^yt+3 is predicted
from:
^yt+3 = f(^yt+2; ^yt+1; yt; : : : ; ytn+2) (3)
and so on; here both ytn+1 and ytn drop out of the set of input values. Finally, we predict ^yt+m from:
^yt+m = f(^yt+m1; ^yt+m1; ^yt+m2; : : : ; ^yt+mn) (4)
although whether the rightmost inputs are estimated quantities (decorated with ‘hats’) or observed (no
‘hats’) depends on the relative values of n and m. That does not really matter since the ‘hat’ decoration
is just a notation—ultimately, we use the ‘best’ value available.
Once we have predicted all m points into the future, we can calculate the next optimal input (by some
means—you do not need to bother with how), and we advance to the next time step. We then repeat.
This process of:
1. Estimating all the m future states
2. Finding the optimal next input
3. Advancing to the next time step
continues forever because we want to control the system for all times in the future.
(You may find it useful to draw a suitable diagram to illustrate this process for estimating future values
of y.)
1Note that for the sake of simplicity, inputs have been ignored. In practice, the y’s would actually be a vector comprising
both inputs and outputs. For the sake of this exercise, it is sufficient to consider y as a scalar real.
© P.Rockett, 2020 1
2 The Programming Assignment
The assignment is to design and implement a suitable abstract data type (ADT) to manage the set of
variables:
f^yt+m; ^yt+m1; ^yt+m2; : : : ; ^yt+2; ^yt+1yt; yt1; yt2; : : : ; ytng
for the process described in Section 1. You can assume that the predictive model f is available to generate
estimates for the next time step given the previous (n + 1) values (either observed or estimated). In
addition, you should assume that:
• The values of n and m are fixed and do not change. They may, however, have different values.
Task 1 Identify the (interface) functions that will you will need to implement in order to support the
control algorithm described in Section 1. Ignore all details of interfacing with the predictive function
f—just assume that you need to provide/receive the individual y-values.
Task 2 Write down a formal specification (using appropriate discrete mathematics) describing the functionality
of the interfaces for your ADT that you identified under Task 1. (Hint: When faced with this
sort of task, many students assume that what is required is some really complicated, difficult piece of
mathematics. . . and give up! A specification might be complicated or it might be really simple and just a
statement of the obvious: regardless, what it must be is correct and complete. Bugs in code arise when
programmers forget to consider all possible cases!)
Task 3 Based on the formal specifications you have developed above, write down a set of tests you would
need to successfully run to ensure that you final code implementation meets your specifications.
Task 4 Consider how to implement the required ADT. Describe at least two possible data structure
implementations, and list the positive and negative properties of each design. Discuss any big-oh runtime
implications of each choice. Justify your final design choice of data structure. Explain how your design
internally implements required functionality.
Task 5 Write suitable C code to implement the design you have proposed under Task 4 above. Implement
the ADT as a separate compilation unit (i.e. as a .h header file and accompanying .c implementation file)
together with a main program that implements the tests you have identified under Task 3. Demonstrate
that you code passes all the tests you have defined.
Each task will be marked out of 20% to reflect the fact that there is much more to programming than just
writing code!
3 The Report
The report should be a maximum of four pages excluding appendices; you should include all your code
in appendices. All of the above five tasks should be addressed in the report under separate sections.
Note: Code should not be included as images—any report submissions with code as images will be
rejected and you will be asked to resubmit with the code properly formatted as searchable text2. It is,
however, acceptable to include screenshots of your program’s output to demonstrate that it passes your
defined tests.
The report should be submitted via Blackboard by Sunday, 17 May 2020.
2In fact, this is a general departmental requirement. Your report will automatically be checked by TurnItIn for evidence
of collusion and plagiarism, and TurnItIn cannot compare images.
© P.Rockett, 2020 2

Don’t include anything about yourself unless it’s crucial, like mentioning how long writing essay services you’ve been studying education or the number of credits you have earned.

Don't use plagiarized sources. Get Your Custom Essay on
Abstract Data Type Assignment | Essay Help Services
For $10/Page 0nly
Order Essay
Calculator

Calculate the price of your paper

Total price:$26

Need a better grade?
We've got you covered.

Order your paper