### Usaremos A T Dentro Del Intervalo - 2 Pi, 2 Pi

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

28/2/22, 18:21 Untitled70 - Jupyter Notebook

In [43]:  import matplotlib.pyplot as plt


import numpy as np
from numpy import pi
from numpy import sin as sen
from numpy import cos as cos
from numpy import exp as e

In [32]:  ### usaremos a t dentro del intervalo -2*pi ,2*pi


t =np.linspace(-2*np.pi,2*np.pi,1000)

In [33]:  # definimos las fuciones escalon unitario


def Upi(x):
u = np.zeros(len(x))
for i in range(0,len(x)):
if x[i] <0:
u[i] = 0
else:
u[i]=pi
return u

def U2pi(x):
u = np.zeros(len(x))
for i in range(0,len(x)):
if x[i] <0:
u[i] = 0
else:
u[i]=2*pi
return u

In [34]:  upi = Upi(t)


u2pi=U2pi(t)

In [37]:  y1 = cos(2*t)+ (1/4)*(1-cos(2*(t-pi)))*upi - (1/4)*(1-cos(2*(t-2*pi)))*u2pi

localhost:8889/notebooks/Untitled70.ipynb?kernel_name=python3# 1/3
28/2/22, 18:21 Untitled70 - Jupyter Notebook

In [47]:  fig = plt.figure(figsize=(11,6))



plt.plot(t,y1,color ="blue",linewidth=2.0,label = "y(t) ")
plt.grid()
plt.title("Gráfica 1",fontsize=16)

######################
ax = plt.gca()

ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.spines['bottom'].set_position(('data', 0))
ax.spines['left'].set_position(('data', 0))


plt.legend(bbox_to_anchor=(1.05, 1.0), loc='upper left',fontsize=14)


Out[47]: <matplotlib.legend.Legend at 0x262f186b370>

In [53]:  y2 = e(-(t-pi))*sen(t-pi)*upi

localhost:8889/notebooks/Untitled70.ipynb?kernel_name=python3# 2/3
28/2/22, 18:21 Untitled70 - Jupyter Notebook

In [54]:  fig = plt.figure(figsize=(11,6))



plt.plot(t,y2,color ="blue",linewidth=2.0,label = "y(t) ")
plt.grid()
plt.title("Gráfica 2",fontsize=16)
######################
ax = plt.gca()

ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.spines['bottom'].set_position(('data', 0))
ax.spines['left'].set_position(('data', 0))


plt.legend(bbox_to_anchor=(1.05, 1.0), loc='upper left',fontsize=14)


Out[54]: <matplotlib.legend.Legend at 0x262f1f34940>

In [ ]:  ​

localhost:8889/notebooks/Untitled70.ipynb?kernel_name=python3# 3/3

You might also like