Question: I need help with all the lab problems, not the practice problems. Thanks in advance! Euler's formula: el = cos 0+sin e 2 = x





I need help with all the lab problems, not the practice problems. Thanks in advance!
Euler's formula: el = cos 0+sin e 2 = x + jy = relo Relationship of Polar to the Rectangular Form: x = Re{z} = r cos e y = Im{z} = r sine Relationship of Rectangular to Polar Form: z(t)= Ae(0,1) = Acos(0,1+0)+ jAsin(@,t+) r= Vx + y2 and 0 = arctan Read the help on the following functions: Lower case i, lower case ), pi Primary MATLAB Functions we will be using for this lab are real(z); imag(z); abs(z); angle(z), exp(z), sqrt(z), atan(z) Practice Problems: #1: Write a MATLAB script to convert from cartesian to polar coordinates for Z = 1 - 1 2-1-j abs (2) angle (2) Ans = 1.4142 for magnitude and ans = -0.7854 for phase, so it would be 1.4142e-1(0.7854) in polar coordinates #2: Using MATLAB Plot subroutine polarplot to plot the static phasor, 1.4142e-|(0.7854) in #1, in the polar plane. SO 120 60 polarplot(-.7854,1.41,'r*') 150 30 180 210 240 300 270 #3: Using MATLAB Plot the Z = 1-j in cartesian coordinates plot(2,'r*') axis([-1 1-1 1]) grid on 0.61 02 #4: Example for plotting a cos signal and calculating phase shift of half pi. time=0:0.0001:0.0025 f = 400 signal = cos(2*pi*f*time); plot(time, signal, 'b'); % default is blue color signalplushalfpi = cos(2*pi*f*time+pi/2); hold on; signalminushalfpi = cos(2*pi*f*time-pi/2); plot(time, signalplushalfpi, 'r') % this will plot signal in red plot(time, signalminushalfpi, 'g') % this will plot signal in green xlabel('Time sec') ylabel('Amplitude') 01 Amplitude V 15 2 Lab Problems: Part 1, Static Phasor (60 points) 1. Write a MATLAB script to convert from cartesian to polar coordinates. Ask the user to enter the real (x) and the imaginary (y) components of Z from keyboard (Z = 1 - j). The static phasor in problems 2-5 will be the user created one in this problem (5 points) Hint: Sample code for part of this problem is provided in Practice #1. 2. Following Problem 1, write MATLAB Code that calculates the magnitude and phase of the input static phasor, by using the mathematical equations shown in class. (5 points) Hint: Use Practice #1 as example, mathematically the magnitude would be sqrt{(1)+(-1)^)=sqrt(2)=1.4142, and the phase or angle would be arctan(-1/1)=-0.7854 3. Using MATLAB Plot subroutine polarplot to plot in the polar plane: (5 points) Hint: Sample code for part of this problem is provided in Practice #2. 4. Using MATLAB Plot in cartesian coordinates (10 points) Hint: Sample code for part of this problem is provided in Practice #3. 5. Using the hold on commend to add plots in the figure. What are the polar coordinates of Z+X and Z+Y if X=2+3j and Y=2-3j? and plot each on the cartesian and polar plots: (5 points) REMEMBER: when adding signals it is easier to add in cartesian coordinates where you add the real and add the imaginary components so T = 2 + X = (1 - i) + (2+3j) = 1+2 -1+3j = 3+2j 6. Now let's say you have a signal = 1.41 * exp(j*(-0.784)). In MATLAB create signal = 1.41 * expli*(-0.784)). What are the real and imaginary parts using Matlab and the Euler's formula? Put your answers after % right after the codes (10 points) REMEMBER el = cos 0+j sin 0, 7. In MATLAB, calculate the real and imaginary parts of the following signals, and plot them on the polar plot. Now you are going from polar to cartesian (10 points) a) XX = 0.5e02) b) YY = 3el(+2/2) ZZ = 1.5e(/5) c) Example: Z = 2el-in) and ej@ = cos 0+; sin 0, so the real part of Z will be 2*cos(-1)=-2, and the imaginary part will be 2*sin(-1) =-2.4493e-16 ~O. So in MATLAB write 2*exp(-1*pi) it will return -2.0000 - 0.0000 8. For the following static phasors, calculate , write MATLAB code for your answer in cartesian and polar coordinates and create a figure in MATLAB of X, Y and Z similar to the plot below. (10 points) Hint: Plot([0,X]) to form a line. Imaginary Real 8. For the following static phasors, calculate 2, write MATLAB code for your answer in cartesian and polar coordinates and create a figure in MATLAB of X, Y and Z similar to the plot below. (10 points) Hint: Plot([0,X]) to form a line. Imaginary Real X = 3.61 Z-0.98rad Y = 4.47 Z-2.68rad Z = X+Y Part 2: Dynamic Phasor (10 points) If you have the following signal x(t) notice how there's a time t variable now. x(t) = 5eln/3e-100 nt |z(t)= Ae (0,5+0) remember: = Acos(0,t+) + jAsin(@t+0) 1. What is the period of the signal? (Write in MATLAB) (5 points) 2. How would you plot this signal over 1 period for the real portion of the signal. The real portion is the x axis which is the cos function so 5cos(-100 7 t+1/3) (5 points) Part 3 Multiplication of static Phasors (5 points) Write MATLAB code to calculate C = a*b if a= 10je *1/2 and b=4je in /4 (5 points) Hint: Remember for multiplication you multiple the magnitudes and add the phases. So if x = 2e^/3 and y= 4e in/4, z= x*y = 16.1201 +16.12011 = 22.7972 theta 0.7854 Part 4: time and phase shifting (10 points) Create MATLAB code that will shift a cos signal, 2cos(0.4 1 t), by pi/2 using a delay and an advance. In the comments section, describe how delaying and advancing your signal impacts your signal. Plot the signal for 2 periods. (10 points) Hint: Sample code for part of this problem is provided in Practice #4. Part 5: Resolution of time (15 points) Write MATLAB Code to solve each of the following and answer each question using comment after %. (15 points, 3 points each) 1. Create a time series for 1 cycle of a 400 Hz cosine function where the increment is 0.001 2. Plot the signal in blue (remember to keep the 'hold on') 3. Now decrease the increment to 0.0005 and plot the signal in red 4. Now decrease the increment to 0.00005 and plot the signal in green 5. Discuss what happens to your signal and why? Euler's formula: el = cos 0+sin e 2 = x + jy = relo Relationship of Polar to the Rectangular Form: x = Re{z} = r cos e y = Im{z} = r sine Relationship of Rectangular to Polar Form: z(t)= Ae(0,1) = Acos(0,1+0)+ jAsin(@,t+) r= Vx + y2 and 0 = arctan Read the help on the following functions: Lower case i, lower case ), pi Primary MATLAB Functions we will be using for this lab are real(z); imag(z); abs(z); angle(z), exp(z), sqrt(z), atan(z) Practice Problems: #1: Write a MATLAB script to convert from cartesian to polar coordinates for Z = 1 - 1 2-1-j abs (2) angle (2) Ans = 1.4142 for magnitude and ans = -0.7854 for phase, so it would be 1.4142e-1(0.7854) in polar coordinates #2: Using MATLAB Plot subroutine polarplot to plot the static phasor, 1.4142e-|(0.7854) in #1, in the polar plane. SO 120 60 polarplot(-.7854,1.41,'r*') 150 30 180 210 240 300 270 #3: Using MATLAB Plot the Z = 1-j in cartesian coordinates plot(2,'r*') axis([-1 1-1 1]) grid on 0.61 02 #4: Example for plotting a cos signal and calculating phase shift of half pi. time=0:0.0001:0.0025 f = 400 signal = cos(2*pi*f*time); plot(time, signal, 'b'); % default is blue color signalplushalfpi = cos(2*pi*f*time+pi/2); hold on; signalminushalfpi = cos(2*pi*f*time-pi/2); plot(time, signalplushalfpi, 'r') % this will plot signal in red plot(time, signalminushalfpi, 'g') % this will plot signal in green xlabel('Time sec') ylabel('Amplitude') 01 Amplitude V 15 2 Lab Problems: Part 1, Static Phasor (60 points) 1. Write a MATLAB script to convert from cartesian to polar coordinates. Ask the user to enter the real (x) and the imaginary (y) components of Z from keyboard (Z = 1 - j). The static phasor in problems 2-5 will be the user created one in this problem (5 points) Hint: Sample code for part of this problem is provided in Practice #1. 2. Following Problem 1, write MATLAB Code that calculates the magnitude and phase of the input static phasor, by using the mathematical equations shown in class. (5 points) Hint: Use Practice #1 as example, mathematically the magnitude would be sqrt{(1)+(-1)^)=sqrt(2)=1.4142, and the phase or angle would be arctan(-1/1)=-0.7854 3. Using MATLAB Plot subroutine polarplot to plot in the polar plane: (5 points) Hint: Sample code for part of this problem is provided in Practice #2. 4. Using MATLAB Plot in cartesian coordinates (10 points) Hint: Sample code for part of this problem is provided in Practice #3. 5. Using the hold on commend to add plots in the figure. What are the polar coordinates of Z+X and Z+Y if X=2+3j and Y=2-3j? and plot each on the cartesian and polar plots: (5 points) REMEMBER: when adding signals it is easier to add in cartesian coordinates where you add the real and add the imaginary components so T = 2 + X = (1 - i) + (2+3j) = 1+2 -1+3j = 3+2j 6. Now let's say you have a signal = 1.41 * exp(j*(-0.784)). In MATLAB create signal = 1.41 * expli*(-0.784)). What are the real and imaginary parts using Matlab and the Euler's formula? Put your answers after % right after the codes (10 points) REMEMBER el = cos 0+j sin 0, 7. In MATLAB, calculate the real and imaginary parts of the following signals, and plot them on the polar plot. Now you are going from polar to cartesian (10 points) a) XX = 0.5e02) b) YY = 3el(+2/2) ZZ = 1.5e(/5) c) Example: Z = 2el-in) and ej@ = cos 0+; sin 0, so the real part of Z will be 2*cos(-1)=-2, and the imaginary part will be 2*sin(-1) =-2.4493e-16 ~O. So in MATLAB write 2*exp(-1*pi) it will return -2.0000 - 0.0000 8. For the following static phasors, calculate , write MATLAB code for your answer in cartesian and polar coordinates and create a figure in MATLAB of X, Y and Z similar to the plot below. (10 points) Hint: Plot([0,X]) to form a line. Imaginary Real 8. For the following static phasors, calculate 2, write MATLAB code for your answer in cartesian and polar coordinates and create a figure in MATLAB of X, Y and Z similar to the plot below. (10 points) Hint: Plot([0,X]) to form a line. Imaginary Real X = 3.61 Z-0.98rad Y = 4.47 Z-2.68rad Z = X+Y Part 2: Dynamic Phasor (10 points) If you have the following signal x(t) notice how there's a time t variable now. x(t) = 5eln/3e-100 nt |z(t)= Ae (0,5+0) remember: = Acos(0,t+) + jAsin(@t+0) 1. What is the period of the signal? (Write in MATLAB) (5 points) 2. How would you plot this signal over 1 period for the real portion of the signal. The real portion is the x axis which is the cos function so 5cos(-100 7 t+1/3) (5 points) Part 3 Multiplication of static Phasors (5 points) Write MATLAB code to calculate C = a*b if a= 10je *1/2 and b=4je in /4 (5 points) Hint: Remember for multiplication you multiple the magnitudes and add the phases. So if x = 2e^/3 and y= 4e in/4, z= x*y = 16.1201 +16.12011 = 22.7972 theta 0.7854 Part 4: time and phase shifting (10 points) Create MATLAB code that will shift a cos signal, 2cos(0.4 1 t), by pi/2 using a delay and an advance. In the comments section, describe how delaying and advancing your signal impacts your signal. Plot the signal for 2 periods. (10 points) Hint: Sample code for part of this problem is provided in Practice #4. Part 5: Resolution of time (15 points) Write MATLAB Code to solve each of the following and answer each question using comment after %. (15 points, 3 points each) 1. Create a time series for 1 cycle of a 400 Hz cosine function where the increment is 0.001 2. Plot the signal in blue (remember to keep the 'hold on') 3. Now decrease the increment to 0.0005 and plot the signal in red 4. Now decrease the increment to 0.00005 and plot the signal in green 5. Discuss what happens to your signal and why
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
