Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The drep Function Representation You can represent a generalized delta function

ID: 2247948 • Letter: T

Question

The drep Function Representation You can represent a generalized delta function in Octave as a single element row vector. This is called the drep representation of the function. For example the drep representation of x(t) = 4 delta_2 (t-6) is xrep = [4 2 -6]. A sum of N generalized delta functions is represented by a N times 3 matrix. The drep representation of x(t) = 4 delta_2 (t-6) -2 delta_2 (t + 10) + delta_1 (t) is: xrep = [4 2 -6: -2 2 10 1 1 0] The Octave function drep_func can be used to evaluate a function from its drep representation at a vector of time points. For example the following code will evaluate x(t) between -2 and 4 seconds at 0.01 second intervals. The plot function is then used to plot the result. t = -2: 0.01: 4: x = drep_func (t, xrep): plot (t, x): Determine the drep representation of the impulse response h(t) shown in Figure 1. Write an Octave script to re-create the graph shown in Figure 1 (as closely as possible) from the representation. Convolution of drep Representations The Octave function drep_conv can be used to compute the drep representation of the convolution of two functions from their drep representations: yrep = drep_conv (hrep, xrep);

Explanation / Answer

load(fullfile(matlabroot, 'toolbox', 'ident', 'iddemos', 'data', 'dcmotordata'));
z = iddata(y, u, 0.1, 'Name', 'DC-motor');
set(z, 'InputName', 'Voltage', 'InputUnit', 'V');
set(z, 'OutputName', {'Angular position', 'Angular velocity'});
set(z, 'OutputUnit', {'rad', 'rad/s'});
set(z, 'Tstart', 0, 'TimeUnit', 's');

model = tfest(z,2);
[y,t,~,ysd] = impulse(model,2);

% Plot 3 std uncertainty
subplot(211)
plot(t,y(:,1), t,y(:,1)+3*ysd(:,1),'k:', t,y(:,1)-3*ysd(:,1),'k:')
subplot(212)
plot(t,y(:,2), t,y(:,2)+3*ysd(:,2),'k:', t,y(:,2)-3*ysd(:,2),'k:')

% Plot 3 std uncertainty
subplot(211)
plot(t,y(:,1), t,y(:,1)+3*ysd(:,1),'k:', t,y(:,1)-3*ysd(:,1),'k:')
subplot(212)
plot(t,y(:,2), t,y(:,2)+3*ysd(:,2),'k:', t,y(:,2)-3*ysd(:,2),'k:')

a = [-0.5572 -0.7814;0.7814 0];
b = [1 -1;0 2];
c = [1.9691 6.4493];
sys = ss(a,b,c,0);
impulse(sys)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote