EE 353 Pennsylvania State University Signals and Systems Worksheet

User Generated

wnpxyi1999

Engineering

EE 353

Pennsylvania State University

EE

Description

Unformatted Attachment Preview

Problem Set 2, 6 problems (105 points) EE 353, Sp 2020 Readings: Chapter 2, sections 3 Problem 15 (20 points) MATLAB is an important tool that is widely used in industry to analyze dynamic systems. This problem set contains exercises that introduces various features of MATLAB. You can access MATLAB in the EE computer laboratory in 208 Engineering Unit B. You can also access Matlab on your own computer through the Penn State WebApps; the link for this is https://webapps.psu.edu. Matlab is also available to students for free installation on their own computers. See https://software.psu.edu/mathworkslicense/-8474. When using MATLAB, you can learn about a specific MATLAB function by typing the command help followed by the MATLAB function name. Typing the command help by itself will display a long list of topics for which help is available. Start MATLAB and set the Current Folder to your working directory. Select New Script under the File tab and save the following MATLAB m-file as go.m in your directory. Execute the m-file by typing go at the command prompt, alternatively, press F5 when the cursor is positioned in the MATLAB editor window containing the file go.m. % go.m is an example m file script showing some plotting commands. % Name: "Put your name here." % Section "Put your section number here." % Date last modified: 2/1/20 (You should update this as well.) close all % Plot the sinc(x) function, where sinc(t) = sin(t) / t t = linspace(-15,15,301); % generate a time vector y1 = sin(t) ./ t; % compute the sinc function for the time vector. figure(1) clf plot(t,y1,’-k’) xlabel(’Time (sec)’) ylabel(’Amplitude’) % Now plot an exponentially weighted sinusoid y2 = exp(-abs(t/4)) .* cos(t); hold on plot(t,y2,’--r’) title(’EE 353 Problem Set 2 Example’) xlabel(’Time (sec)’) ylabel(’Amplitude’) legend(’sinc(t) = sin(t)/t’, ’e^{-|t|/4} cos(t)’) A. (2 points) Three of the lines in the m-file end with a semicolon. What is the function of the semicolon in MATLAB? B. (2 points) What are the dimensions of the vectors t, y1, and y2 generated by the example mfile? {Hint: Use the MATLAB command whos or size.} C. (2 points) Explain why you must use the operator ./ and .* in calculating the signals y1 and y2? D. (2 points) What happens if the command hold on is removed from the m-file? E. (2 points) What do the commands figure(1) and clf accomplish? {Hint: Try replacing the command figure(1) with figure(3).} F. (10 points) Type help subplot at the MATLAB command line to learn about the function subplot. Modify the given code by adding to the example m-file so that it plots the decaying sinusoids 𝑦𝑦(𝑡𝑡) = 3𝑒𝑒 𝑥𝑥(𝑡𝑡) = 3𝑒𝑒 −3𝑡𝑡 2 sin(2𝜋𝜋𝜋𝜋)𝑢𝑢(𝑡𝑡) −3𝑡𝑡 2 cos(2𝜋𝜋𝜋𝜋) 𝑢𝑢(𝑡𝑡) in the upper subplot of a new figure, figure 2, and in the lower subplot of figure 2, plots y versus x. Use a time vector that contains 400 uniformly spaced points on the range 0≤ t ≤6. For the upper subplot, show y as a solid black curve and x as a dash-dot blue curve using a single plot command line. Label the two curves in the upper subplot using the legend command. For the lower subplot, use a solid magenta curve and follow the plot command with the command axis equal. Explain in your code comments the functionality the command axis equal provides. To receive credit • • • • • • Turn in figures 1 and 2 along with a copy of your m-file. Include your name and section at the top of the m-file as comment lines. Use the MATLAB command gtext to place your name and section number within each figure. Make sure that you appropriately label the x and y axes; no credit is given for MATLAB plots whose axes are unlabeled. Use the legend command to distinguish multiple curves in a single plot. Add an appropriate title to each figure. Problem 16 (20 points) The ability to manipulate complex numbers is important in the analysis of circuits and systems. In EE 210 you used complex numbers known as phasors to quickly determine the sinusoidal steady-state response of an electric circuit. Please carefully read Background Section B.1 in Lathi before attempting the following review problems. Except for the MATLAB questions, solve the equations by hand, do not use a calculator. To receive credit for the MATLAB questions, include an m-file with your name and section that shows the MATLAB commands used to answers parts 4 and 5. 1 A. (2 points) Without using a calculator, express the complex number 𝑗𝑗 3 in rectangular form a + jb, where a and b are real. B. (2 points) Without using a calculator, express the following complex number (1 + 𝑗𝑗)�7√3 + 𝑗𝑗7� 𝑗𝑗 3 �1 + 𝑗𝑗√3� in polar form 𝑟𝑟𝑒𝑒 𝑗𝑗𝑗𝑗 , where 𝑟𝑟 and 𝜃𝜃 (in degrees) are real numbers. C. (6 points) Given s, u, v, and w are arbitrary complex numbers with nonzero magnitude, establish the following results: (a) (2 points) 𝑠𝑠 ∙ 𝑠𝑠 ∗ = |𝑠𝑠|2 (b) (2 points) 𝑠𝑠 + 𝑠𝑠 ∗ = 2𝑅𝑅𝑅𝑅{𝑠𝑠} (c) (2 points) 𝑠𝑠 − 𝑠𝑠 ∗ = 2𝑗𝑗𝑗𝑗𝑗𝑗{𝑠𝑠} D. (6 points) You can determine the roots of the equation 𝑥𝑥 𝑛𝑛 + 𝑎𝑎𝑛𝑛−1 𝑥𝑥 𝑛𝑛−1 + ⋯ + 𝑎𝑎1 𝑥𝑥 + 𝑎𝑎0 = 0 using the MATLAB command roots. For example, to find the roots of 𝑥𝑥 3 + 4𝑥𝑥 2 + 𝑥𝑥 − 3 = 0 at the Matlab command prompt enter >> roots([1, 4, 1,−3]) and MATLAB will return the roots. First determine the roots of the equation 𝑥𝑥 5 + 1 = 0 by hand and sketch their location in the complex plane. Verify your results using the MATLAB command roots. E. (4 points) The MATLAB command conv finds the product of two polynomials. For example, suppose that 𝑝𝑝(𝑥𝑥) = 𝑥𝑥 4 + 3𝑥𝑥 3 + 2𝑥𝑥 2 + 3𝑥𝑥 − 8 𝑞𝑞(𝑥𝑥) = 𝑥𝑥 5 + 6𝑥𝑥 2 + 𝑥𝑥 + 15 and we wish to determine the product𝑠𝑠(𝑥𝑥) = 𝑝𝑝(𝑥𝑥) ∙ 𝑞𝑞(𝑥𝑥). Use the MATLAB commands >> p = [1, 3, 2, 3, −8]; >> q = [1, 0, 0, 6, 1, 15]; >> s = conv(p, q) In this case s = [1, 3, 2, 9, 11, 30, 65, -15, 37, -120] and so 𝑠𝑠(𝑥𝑥) = 𝑥𝑥 9 + 3𝑥𝑥 8 + 2𝑥𝑥 7 + 9𝑥𝑥 6 + 11𝑥𝑥 5 + 30𝑥𝑥 4 + 65𝑥𝑥 3 − 15𝑥𝑥 2 + 37𝑥𝑥 − 120 Determine the product (𝑥𝑥 3 + 3𝑥𝑥 + 12)(𝑥𝑥 2 + 6𝑥𝑥 + 1)(𝑥𝑥 4 + 5𝑥𝑥 2 + 2) using the MATLAB command conv. Hint: You will need to use the command more than once. Problem 17 (20 points) Consider a set of three systems with input f(t) and output y(t) that are represented by the following ODEs for t ≥ 0: System 1: (𝐷𝐷 3 + 6𝐷𝐷 2 + 18𝐷𝐷 + 27)𝑦𝑦(𝑡𝑡) = 𝑓𝑓(𝑡𝑡) System 2: (𝐷𝐷 3 + 4𝐷𝐷 2 + 𝐷𝐷 − 6)𝑦𝑦(𝑡𝑡) = 𝑓𝑓(𝑡𝑡) System 3: (𝐷𝐷 3 + 3𝐷𝐷 2 + 4𝐷𝐷 + 12)𝑦𝑦(𝑡𝑡) = 𝑓𝑓(𝑡𝑡) A. (3 points) Use the MATLAB command roots to obtain the characteristic roots for each system and sketch these roots in the λ-plane. (This just a complex number plane where real numbers are on the x-axis and imaginary numbers are on the y-axis.) B. (3 points) Based on the location of the characteristic roots, state whether the system is asymptotically stable, marginally stable, or unstable. C. (4 points) For the asymptotically stable and unstable systems, justify your answer in part B by stating the form of the homogeneous solution for these systems for t ≥ 0. If the system has complex-valued characteristic roots, express the homogeneous solution in terms of real-valued sinusoidal terms, rather than complex-valued exponentials. D. 4. (10 points) a. (2 points) Given 𝑓𝑓1 (𝑡𝑡) = 𝑢𝑢(𝑡𝑡), find 𝑦𝑦1 (𝑡𝑡), the zero state of system 3. Using your results from part A, state the form of the homogeneous and particular solutions in terms of undetermined coefficients; you don’t need to solve for these coefficients. As time approaches infinity, will the response 𝑦𝑦1 (𝑡𝑡) remain bounded? b. Given 𝑓𝑓2 (𝑡𝑡) = cos(2𝑡𝑡) 𝑢𝑢(𝑡𝑡), find 𝑦𝑦2 (𝑡𝑡), the zero state of system 3. Using your results from part 1, state the form of the homogeneous and particular solutions in terms of undetermined coefficients; you don’t need to solve for these coefficients. As time approaches infinity, will the response 𝑦𝑦2 (𝑡𝑡) remain bounded? c. (6 points) Verify your qualitative results in parts (a) and (b) by using MATLAB to numerically calculate the zero-state response. As an example, consider a system with input f(t) and output y(t) that has the ODE representation (𝐷𝐷 2 + 30𝐷𝐷 + 200)𝑦𝑦(𝑡𝑡) = (8𝐷𝐷 + 400)𝑓𝑓(𝑡𝑡) This system can be represented in MATLAB by the row vectors >> Q = [1, 30, 200];P = [8, 400]; Suppose we desire to find the zero-state response of the system to two separate inputs 𝑓𝑓1 (𝑡𝑡) = 4𝑢𝑢(𝑡𝑡) and 𝑓𝑓2 (𝑡𝑡) = (4 + 2𝑒𝑒 −𝑡𝑡 )𝑢𝑢(𝑡𝑡) over the time range 0 ≤ t ≤ 2 using a time vector of 401 points. Construct the time vector using the command linspace >> t = linspace(0, 2, 401); while the input functions are generated as >> f1 = 4 * (t >= 0)); and >> f2 = 4 + 2 * exp(−t); Find the zero-state responses with the command lsim as >> y1 = lsim(P,Q, f1, t); and >> y2 = lsim(P,Q, f2, t); Using this example as a guide, write an m-file that calculates and plots the zero-state response of system 3 system to the inputs 𝑓𝑓1 (𝑡𝑡) = 4𝑢𝑢(𝑡𝑡) and 𝑓𝑓2 (𝑡𝑡) = (4 + 2𝑒𝑒 −𝑡𝑡 )𝑢𝑢(𝑡𝑡) over the time range 0 ≤ t ≤ 100 using a time vector of 10,001 points. To receive credit: • • • • • • Turn in a copy of your m-file that generates the results for parts A and D. Include your name and section number in the m-file. Plot the zero-state responses for part d in two separate subplots on a single page, with the response to f1(t) in the upper subplot and the response to f2(t) in the lower subplot. Use the MATLAB command gtext to place your name and section number within the figure. Make sure that you appropriately label the x and y axes; no credit is given for MATLAB plots whose axes are unlabeled. Add an appropriate title to the figure, for example, Problem Set 2 Problem 17, part D. Problem 18 (25 points) Do problem 1.4-5, parts a, b, f, g and h, from the course text.. Hint: for parts a and b, make sure you pay attention to the variable of integration and the impact this has on the result. Problem 19 (10 points) Do problem 1.4-8 from the course text. Problem 20 (10 points) Do problem 1.4-9 from the course text.
Purchase answer to see full attachment
Explanation & Answer:
NA
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Find the attached solutions and the codes

Problem 15:
A. When a line in an m-file end with a semicolon, it is used to suppress the output obtained
due to execution of the corresponding line.
B. t is a row vector of size 1 x 301, y1 is a row vector of size 1 x 301, y2 is a row vector of size
1 x 301.

C. When element by element multiplication is needed then operator .* is used and element by
element right division is needed then operator ./ is used.
D. The hold on command is used to retain the plot in the current axes when new plot is
added to the axes. Utilizing the hold on command do not delete the existing plot.

E. figure(1) makes the figure identified by 1 as the current figure. Through this command
the current figure is visible and raised above all other figures (if there are more than one
figures) on the screen. The clf command clears all the graphic objects from the current
figure whose handle visibility property is on.
F. The figure is attached here:

The MATLAB code is attached here:
% Name: "Guoliang Lyu"
% Section "001"
% Date last modified: 2/14/2020
close all
% Plot the 3exp(-3t/2)sin(2pi*t) function
t = linspace(0,6,400); % generate a time vector
y = 3*exp(-3*t/2).*sin(2*pi*t); % compute the sinc function for
the time vector.
figure(2)
subplot(2,1,1)
plot(t,y,'-k')
xlabel('Time (sec)')
ylabel('Amplitude')
% Plot the 3exp(-3t/2)cos(2pi*t) function
x = 3*exp(-3*t/2).*cos(2*pi*t);
hold on
plot(t,x,'-.b')
title('Variation of decaying sinusoid with time')
xlabel('Time (sec)')
ylabel('Amplitude')
legend('3exp(-3t/2)sin(2pi*t)', '3exp(-3t/2)cos(2pi*t)')
gtext('Guoliang Lyu, Section:001')
hold off
subplot(2,1,2)
plot(x,y,'-m')
title('Relation between decaying sinusoids as time progress')
xlabel('Decaying sine function of time')
ylabel('Decaying cosine function of time')
axis equal % Aspect ratio of data units are same in every
direction
gtext('Guoliang Lyu, Section:001')

Problem 16:
A. The roots of the given complex number is found by using De Moivre’s theorem which
is:
𝜃 + 2𝜋𝑘
𝜃 + 2𝜋𝑘
)
𝑧1/𝑛 = 𝑟 1/𝑛 (𝑐𝑜𝑠
+ 𝑖𝑠𝑖𝑛
𝑛
𝑛
where, 𝑧 = 𝑟𝑒 𝑖𝜃
The given complex number is 𝑧 = 𝑗 = 1𝑒 𝑖𝜋/2
The three roots of the 𝑗 1/3 = 11/3 (𝑐𝑜𝑠

𝜋/2+2𝜋𝑘
3

+ 𝑖𝑠𝑖𝑛

𝜋/2+2𝜋𝑘
3

)

where, 𝑘 = 0, 1, 2
𝜋/2 + 0
𝜋/2 + 0
𝜋
𝜋
) = (𝑐𝑜𝑠 + 𝑖𝑠𝑖𝑛 ) = 0.866 + 0.5𝑖
+ 𝑖𝑠𝑖𝑛
3
3
6
6
𝜋/2 + 2𝜋
𝜋/2 + 2𝜋
5𝜋
5𝜋
) = (𝑐𝑜𝑠
𝑧2 = 1 (𝑐𝑜𝑠
+ 𝑖𝑠𝑖𝑛
+ 𝑖𝑠𝑖𝑛 ) = −0.866 + 0.5𝑖
3
3
6
6
𝜋/2 + 4𝜋
𝜋/2 + 4𝜋
3𝜋
3𝜋
) = (𝑐𝑜𝑠
𝑧3 = 1 (𝑐𝑜𝑠
+ 𝑖𝑠𝑖𝑛
+ 𝑖𝑠𝑖𝑛 ) = 0 − 𝑖
3
3
2
2
𝑧1 = 1 (𝑐𝑜𝑠

B. The given expression is
(1 + 𝑗)(7√3 + 𝑗7)
𝑗 3 (1 + 𝑗√3)
Representing each part into polar form
(1 + 𝑗) = √2∠45°
(7√3 + 𝑗7) = 14∠30°
𝑗 3 = 1∠270
(1 + 𝑗√3) = 2∠60°
(1 + 𝑗)(7√3 + 𝑗7) √2∠45° ∗ 14∠30°
=
= 7√2∠(−255)°
1∠270 ∗ 2∠60°
𝑗 3 (1 + 𝑗√3)

C. Let 𝑠 = 𝑎 + 𝑗𝑏
a. 𝑠 ∙ 𝑠 ∗ = (𝑎 + 𝑗𝑏)(𝑎 + 𝑗𝑏)∗ = (𝑎 + 𝑗𝑏)(𝑎 − 𝑗𝑏) = 𝑎2 + 𝑗𝑏𝑎 − 𝑗𝑎𝑏 − 𝑗 2 𝑏 2 =
𝑎2 + 𝑏 2
b. 𝑠 + 𝑠 ∗ = (𝑎 + 𝑗𝑏) + (𝑎 + 𝑗𝑏)∗ = (𝑎 + 𝑗𝑏) + (𝑎 − 𝑗𝑏) = 2𝑎 = 2𝑅𝑒(𝑠)
c. 𝑠 − 𝑠 ∗ = (𝑎 + 𝑗𝑏) − (𝑎 + 𝑗𝑏)∗ = (𝑎 + 𝑗𝑏) − (𝑎 − 𝑗𝑏) = 𝑗2𝑏 = 𝑗2𝐼𝑚(𝑠)

D. The roots of the equations 𝑥 5 + 1 = 0 are 𝑥 = (−1)1/5
𝜋 + 2𝜋𝑘
𝜋 + 2𝜋𝑘
)
𝑥 = 1 (𝑐𝑜𝑠...


Anonymous
Goes above and beyond expectations!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
Similar Content
Related Tags