Plot the function y(x)=e–0.5x sin(2x) for 100 values of x between 0 and 10. Use a 2- point-wide solid blue line for this function. Then plot the function y(x)=e–0.5x cos(2x) on the same axes. Use a 3-point-wide dashed red line for this function. Be sure to include a legend, title, axis labels, and grid on the plots

Respuesta :

Answer:

The plot is attached.

Step-by-step explanation:

Plot the function y(x)=e^–0.5x sin(2x) for 100 values of x between 0 and 10. Use a 2- point-wide solid blue line for this function.

The step value for x is (10-0)/100=0.1.

Plot the function y(x)=e–0.5x cos(2x) on the same axes. Use a 3-point-wide dashed red line for this function.

The step value for x is the same as the previous function.

The plot is attached.

Ver imagen mtosi17

Answer:

import numpy as np

import matplotlib.pyplot as plt

x = np.linspace(0,10,100)

plt.figure(figsize = (10,3))

plt.plot(x,np.e-0.5*x*np.sin(2*x),label = "y = e-0.5x(sin(2*x))",color = "b")

plt.scatter(x,np.e-0.5*x*np.cos(2*x),label = "y = e-0.5x(cos(2*x))", color = "r")

plt.legend(loc = "best")

Step-by-step explanation:

Using python you could use the matplotlib library and the numpy library, when you use are writing the code for the plot you just write color = "b" and color = "r". And that is it. For the blue line you can just use plt.plot and for the dashed red line you just use plt.scatter.

Also do not forget that you have to add the plt.legend(loc = "best") for your labels to display. This is a possible solution.

import numpy as np

import matplotlib.pyplot as plt

x = np.linspace(0,10,100)

plt.figure(figsize = (10,3))

plt.plot(x,np.e-0.5*x*np.sin(2*x),label = "y = e-0.5x(sin(2*x))",color = "b")

plt.scatter(x,np.e-0.5*x*np.cos(2*x),label = "y = e-0.5x(cos(2*x))", color = "r")

plt.legend(loc = "best")

Ver imagen cdchavezq
RELAXING NOICE
Relax