y1 = cos(x)
y2 = cos(2x)
y3 = cos(3x)
Plot specifications:
y1 = cos(x)
y2 = cos(2x)
y3 = cos(3x)
Plot specifications:
Code:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
x = np.arange(-np.pi, np.pi+0.1,0.1) #0.1 will make enough
points
# so that curve looks smooth
y1 = np.cos(x)
y2 = np.cos(2*x)
y3 = np.cos(3*x)
fig=plt.figure(figsize=(16, 6 ))
fig.suptitle('3 cosine variations', fontsize=16)
fig.add_subplot(1,3 , 1)
plt.plot(x ,y1, 'r--', linewidth= 2, label = "cos(x)")
plt.xlabel('x')
plt.ylabel('cos(x)')
plt.legend()
fig.add_subplot(1,3 , 2)
plt.plot(x ,y2, 'b-', linewidth= 2, label = "cos(2x)")
plt.xlabel('x')
plt.ylabel('cos(2x)')
plt.legend()
fig.add_subplot(1,3 , 3)
plt.plot(x ,y2, 'k-.', linewidth= 2, label = "cos(3x)")
plt.xlabel('x')
plt.ylabel('cos(3x)')
plt.legend()
Output:

(10 pts) Write a single .py file program to plot the following functions on the same...
Given y1, y2, and y3 as a function of x. In the same graph plot the three functions for x ?[-3,3] . Follow the form given below. function y1 Line style: solid, color: blue function y2 Line style: dashed, color: black function y3 Line style: dotted, color: red Label the x and y axis; x axis as (x), and the y axis as (y1,y2,y3), title the graph as (problem5), add a legend on the plot. y1=x^4-e^(-x) y2=x^2-x^3+25 y3=30-12x,
Problem 31: (34 points) 1. (10 points) A pulse width modulated (PWM) signal fPwM(t) in Figure 2. The symbol D represents a duty cycle, a number between zero and one. Determine the compact trigonometric Fourier series coefficients (Co C,11 %) of the signal f(t). 2. (10 points) One use of PWM is to generate variable DC voltages. While the PWM signal is not DC, you should be able to see from your results in part 1 that it hss a...
A group of physics students collected data from a test of the projectile motion problem that was analyzed in a previous lab exercise (L5). In their test, the students varied the angle and initial velocity Vo at which the projectile was launched, and then measured the resulting time of flight (tright). Note that tright was the dependent variable, while and Vo were independent variables. The results are listed below. (degrees) Time of Flight (s) Initial Velocity V. (m/s) 15 20...
Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate the number of test scores the user enters; have scores fall into a normal distribution for grades -Display all of the generated scores - no more than 10 per line -Calculate and display the average of all scores -Find and display the number of scores above the overall average (previous output) -Find and display the letter grade that corresponds to the average above (overall...