Holooly Plus Logo

Question 10.2: Again consider the system defined in Example 10.1. However, ......

Again consider the system defined in Example 10.1. However, this time do not assume that an explicit formula for output y(t) is available.

(a) Find C on [1, 2] so that y(t) is forced as close as possible to\ z_{des}(t) = \frac{1}{2} for time t on [0, 1]. Assume an input of x(t) = 1. In other words, repeat Example 10.1 (b), but this time do solve it numerically.

(b) Find C on [0, 4] so that y(t) is forced as close as possible to\ z_{des}(t) = 4 for time t on [0, 1]. Assume an input\ x(t) = 5(1 + \sin  t).

(c) Find C on [0, 4] so that y(t) is forced as close as possible to\ z_{des}(t) = 4 for time t on [0, 1]. Assume an input\ x(t) = 5(1 + \sin  t) + 2  RND – 1 . This is a repeat of part (b), but this time with a white noise input.

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

A numerical solution requires a nested loop. The outer loop calculates C while the inner loop integrates over time for the specific C-value. Only the values of C and\ f(C) =f(t_{max},C) are required, so there is no print inside the inner loop.

(a) The key equations for part (a) are the objective update Equation (10.6) and Euler’s update equation\ y^{(new)} = y + hC(1-y) from Equation (10.2). These are incorporated in Listing 10.1. Both f and y are initially f(0) = 0 and y(0) = 0. The results of this simulation are shown in Figure 10.4, where numerical results are given for both the n = 10 (h = 0.1) and n = 100 (h = 0.01) approximations.

\ \dot{y}+Cy=C,\\y(0)=0.                         (10.2)

The accuracy for n = 100 is practically identical to that of the ideal solution, but the minimum point\ C_{min} is practically the same in both instances:\ C_{min} =1.225. In a practical situation, the input will more than likely be noisy. Figure 10.4 also shows the result of an ideal input\ x_1(t) = 1 contaminated with additive white noise with unit variance:\ x(k) = 1 + \sqrt{3}(2  RND – 1) . In this case, there is no choice but to perform the simulation numerically. Note that even though the input is stationary over the entire time interval [0, 1], the objective function appears more “noisy” for larger C values. Since C seems to magnify the noise, it seems as though there is yet another reason to maintain a small C.

(b) If the input is\ x(t) = 5(1 + \sin  t) , the output can still be found by elementary means. However, it should come as no surprise that an analytical formula for the objective is not a particularly good idea, since Equation (10.6) is rather involved, even though it is still linear. A numerical simulation is  produced using the algorithm in Listing 10.1 by letting\ x_1(t) = 5(1 + \sin  t)  and  z_{des}(t) = 4 . From the results sketched in Figure 10.5, there is a relative minimum for C at approximately\ C_{min} = 2.65.

\ t = hk+t_0,\\f(k+1)=f(k)+h[z_{des}(t)-y(k)]^2,\\ f(0)=0.                                                              (10.6)

(c) The addition of noise to an ideal input signal complicates things. In order to find a minimum, it is first necessary to get past all the high-frequency noise. If we do not take care to eliminate the noise, the absolute minimum might be due to the noise rather than the underlying ideal signal. Also, any algorithm that we might create to find that minimum would likely get trapped in a “well” that is an artifact.

Implementation of the noisy input\ x(t) = 5(1 + \sin  t + 2  RND – 1) is handled just like the ideal input of part (b), but the results are quite different. Figure 10.5 illustrates the problem. Given the noisy objective function, it is not obvious what the  underlying function even is visually, let alone what sort of algorithm would mechanically produce a useful result.

The answer to this dilemma is to once again apply a low-pass filter (LPF). Recall that one of the basic LPFs is defined by the equation

\ \tau \dot{z}+z=f(C)            (10.7)

where f(C) is the objective function that is input to the filter, z is the filter output, and τ is an LPF parameter yet to be chosen. Equation (10.7) can be handled digitally by the update formula\ z^{(new)} = z + h(f – z)/\tau . This update should be imbedded in Listing 10.1 just before the objective f is updated, since z requires the “current”f and not the new f. Since z is a linear filter, any initial condition will work in principle. This is because after the transients die out, all that remains is the ideal signal and the filtered noise, which is stationary. However, it is best to note that since z approximates f, the transients can effectively be eliminated all together by simply initializing z to the same value as f. It is apparent from Figure 10.5 that z(0) = 16 would be an excellent choice, since there are virtually no transients.

The only real question in implementing the LPF of Equation (10.7) is what the parameter τ should be. There are good theoretical reasons to consider a family of exponentially related filters. For instance, Figure 10.6 gives the filtered results for τ = 2, 20, 100, and 200. This results from observing τ = 2 to be far too noisy and τ = 200 to be about right, then backing off to τ = 100 to find the best shape-preserving curve that is at the same time smooth enough to provide a unique minimum point. The results of this filter should be compared against the graph of part (b), where it is evident that this is an excellent choice for parameter τ. From this curve, the minimum\ C_{min} can be estimated visually or an algorithm (to be discussed shortly) can be implemented by which to  accomplish the task automatically.

-input signals

x (t) = 1
\ z_{des}(t) = 1/2

-simulation

\ C_{min} =1
\ C_{max} =2
\ t_{min} =0
\ t_{max} =1
m = 100
n = 100
\ \delta=(C_{max}-C_{min})/m
\ h=(t_{max}-t_{min}) /n
for  i = 0  to  m

\ C=C_{min}+\delta   i
f = 0
y = 0
for  k = 1  to  n

t = hk
\ f = f+h[z_{des}(t)-y]^2
y = y + hC[x (t) – y]

next  k
print  C,  f

next  i

LISTING 10.1 Simulation of Example 10.1 using the Euler method.

104
105
106

Related Answered Questions

Question: 10.6

Verified Answer:

Recalling Equations (10.9), (10.12), and (10.15), ...