Waveforms
The RMS value of the periodic waveform given below is $10\,$A. If $D=0.5$ and $I = 14\,$A, determine $\Delta I$. ($T_s=20\,$msec)In [1]:
from IPython.display import Image
Image(filename =r'waveforms_2_fig_1.png', width=350)
Out[1]:
In [2]:
import numpy as np
import matplotlib.pyplot as plt
import gseim_calc as calc
from setsize import set_size
T = 20.0e-3
D = 0.5
I = 14.0
delI = 6.5 # to be changed by user
n_div = 2000
t = np.linspace(0.0, 2*T, (n_div+1))
DT = D*T
slope = (2.0*delI)/DT
I0 = I - delI
l1 = []
for i, u in enumerate(t):
t1 = u % T
if t1 < DT:
I1 = I0 + slope*t1
l1.append(I1)
else:
l1.append(0.0)
x = np.array(l1)
l_x = calc.avg_rms_2(t, x, 0.0, 2.0*T, 1.0e-5*T)
x1 = np.array(l_x[0])
print('average value:', "%11.4E"%l_x[1][0])
print('rms value:', "%11.4E"%l_x[2][0])
color1='blue'
fig, ax = plt.subplots()
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(5, 2.5, ax)
plt.grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
ax.plot(t*1e3, x, color=color1, linewidth=1.0, label="$x$")
ax.plot(x1*1e3, l_x[1], color=color1, linewidth=1.0, label="$x^{avg}$", linestyle='--', dashes=(5,3))
ax.plot(x1*1e3, l_x[2], color=color1, linewidth=1.0, label="$x^{rms}$", linestyle='-.')
ax.set_xlim(0.0, 40.0)
plt.xlabel('time (msec)', fontsize=11)
ax.legend(loc = 'upper right',frameon = True, fontsize = 10, title = None,
markerfirst = True, markerscale = 1.0, labelspacing = 0.5, columnspacing = 2.0,
prop = {'size' : 12},)
plt.tight_layout()
plt.show()
average value: 6.9935E+00 rms value: 1.0240E+01
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.
In [ ]: