Question: ** python can I get a help to run this? Assumptions: (As the question does not contain the previous lab question) 1. User will enter
** python
can I get a help to run this?
Assumptions: (As the question does not contain the previous lab question)
1. User will enter the value of t, f and zeta constant ( )
Here is the code for your problem:
# importig math module to calculate the cos values import math # storing the value of pi in a variable for further use pi = math.pi # function to calculate the the value of function X def x(t, f): """ The equation to calculate the value of function X is: zeta_value * cos( 2*pi*f*t ) """ print(" ...Evaluating the X function... ") # Assuming that user will give the value of constant zeta zeta = float(input( "Enter the value of zeta constanst: (for function X its value must be between ( -1, 1 )): ")) # checking if zeta value provided by user is in bound or not if(zeta = 1): print("Invalid input for zeta...") else: # first, calculating the value of cos(2*pi*f*t) cos_value = math.cos(2*pi*f*t) # then multiplying the cos_value with zeta constant which is our answer for function X ans = zeta*cos_value print("-------------------------------------") print("Value of function X for given inputs is:", ans) print("-------------------------------------") def y(t, f): """ The equation to calculate the function Y is: cos( 2*pi*f*t + zeta_value ) """ print(" ...Evaluating the Y function... ") zeta = input( "Enter the value of zeta constanst: (for function Y its value must be between ( -pi, pi )): ") """ here you can write -pi to denote the symbol pi as there is no provision to display that function For example: you can write pi/2 """ # as the value of zeta given by the user is in string format, we first need to # convert it in a number value # so firstly striping the given string so that unusual tabs or spaces # at the begining and at the end gets removed zeta = zeta.strip() # then spliting this string by separator '/' # as the value of zeta is in the range (-pi, pi) there are only two possibilites # first one is that the user enters 0 in this case the zeta value is zero. # second one is that the user enters a string having pi, '/' division and a number # for example : pi/2 l = zeta.split('/') # the first case if(zeta == '0'): zeta_value = 0 # checking if user has entered a valid value elif(len(l) 
Programming Problem Modify your previous lab to do the following: 1. Using Python, work Ex 9.4 in the lecture notes (Lecture #31, Page 301). Use to = 8 [ms] and f = 60 [Hz]. X(t, 3) = {cos(2nft) where? Uniform( -1, + 1) and Y(t,5) = cos(2nft + ) where I ~ Uniform( - 1,+1) Note: For the Random Process is: X(t, 3) = {cos (2nft) The Random Waveform for 3 = 50 = 0.5 is: X(t, 50 = 0.5) = 0.5cos(2nft) The Random Variable at time t = to = 8 [ms] is: X(t = to = 8 [ms], 5) = {cos(2160x8x10-3) For the Random Process is: Y(t, 3) = cos(2nft + 3) The Random Waveform for 3 = 30 =/2 is: Y(t, 50 =1/2) = cos(2nft +n/2) The Random Variable at time t = to = 8 [ms] is: Y(t = to = 8 [ms], 5) = cos(2160x8x10-3+5) Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
