Waveforms

A current waveform with period $2T_s$ is given below. If $I=10\,$A and $d=0.5$, determine the RMS value of the waveform. ($T=2T_s=20\,$msec)
In [1]:
from IPython.display import Image
Image(filename =r'waveforms_10_fig_1.png', width=400)
Out[1]:
No description has been provided for this image
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
Ts = T/2
I = 10.0
d = 0.5

I1 = I/2

T1 = (1.0-d)*Ts
T2 = Ts
T3 = (2.0-d)*Ts

n_div = 5000
t = np.linspace(0.0, 2*T, (n_div+1))

l1 = []
for i, t1a in enumerate(t):
    t1 = t1a % T

    if t1 < T1:
        i1 = I1
    elif t1 < T2:
        i1 = I
    elif t1 < T3:
        i1 = I1
    else:
        i1 = 0.0
    l1.append(i1)

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[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:  5.0010E+00
rms value:  6.1241E+00
No description has been provided for this image

This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.

In [ ]: