File:3 Phase Rectification 2.svg
3 phase rectification 2.png
[ ]
SVG development Source code
.svg:
-
English .svg
-
Russian .svg
.png:
-
English .png
-
int .png
-
int .png
.jpg:
-
int .jpg
-
int .jpg
-
int .jpg
This plot was created with Matplotlib.
Python code
Source code |
---|
from matplotlib.pyplot import *
from numpy import *
f, Vpeak, cycles = 50., 1., 1.5
fs, Tlim = 2.*f, cycles/f
Vavg, Vrms = Vpeak*2./pi, Vpeak/sqrt(2.)
t = linspace(0,Tlim,fs*cycles)
w = 2.*pi*f # 50Hz AC
signal = lambda x,p: sin(w*x+p*2.*pi/3.)
def halfWave(time):
s1, s2, s3 = signal(time,0.), signal(time,1.), signal(time,2.)
if s1 > s2 and s1 > s3:
if s2 > s3:
return s1, s2
else:
return s1, s3
elif s2 > s1 and s2 > s3:
if s1 > s3:
return s2, s1
else:
return s2, s3
else:
if s1 > s2:
return s3, s1
else:
return s3, s2
def fullWave(time):
s1, s2, s3 = abs(signal(time,0.)), abs(signal(time,1.)), \
abs(signal(time,2.))
if s1 > s2 and s1 > s3:
if s2 > s3:
return s1, s2
else:
return s1, s3
elif s2 > s1 and s2 > s3:
if s1 > s3:
return s2, s1
else:
return s2, s3
else:
if s1 > s2:
return s3, s1
else:
return s3, s2
xTickPts = []
for time in t:
s1, s2, s3 = abs(signal(time,0.)), abs(signal(time,1.)), \
abs(signal(time,2.))
if s1 == s2:
xTickPts = append(xTickPts, time)
print time
elif s2 == s3:
xTickPts = append(xTickPts, time)
print time
elif s3 == s1:
xTickPts = append(xTickPts, time)
print time
def myAxes(this):
this.grid(True)
this.set_xlim(0,Tlim)
this.set_xticks(arange(0,cycles+.25,.25)/f)
this.set_xticklabels([])
this.set_ylabel(r"Voltage (V)",fontsize=12)
this.set_ylim(-2.*Vpeak-.1,2.*Vpeak+.1)
this.set_yticks([-1.73*Vpeak,-Vpeak,0,Vpeak,1.73*Vpeak])
this.set_yticklabels([r"$-\sqrt{3}V_{\mathrm{peak} }$",r"$-V_{\mathrm{peak} }$",\
r"0",r"$V_{\mathrm{peak} }$",r"$\sqrt{3}V_{\mathrm{peak} }$"])
fig = figure(figsize=(7,12))
ax = fig.add_subplot(311)
ax.plot(t,signal(t,0),'b',linewidth=2,label=r"$\phi=0^\circ$")
ax.plot(t,signal(t,1),'r',linewidth=2,label=r"$\phi=120^\circ$")
ax.plot(t,signal(t,2),'g',linewidth=2,label=r"$\phi=240^\circ$")
myAxes(ax)
ax.set_title(r'3-Phase signals',fontsize=12)
ax.legend(loc=1, \
bbox_to_anchor=(.8,.35),\
frameon=False,handletextpad=.05)
ax = fig.add_subplot(312)
S, H = [], []
for time in t:
s, h = halfWave(time)
S = append(S,s)
H = append(H,h)
ax.plot(t,S,'k',linewidth=2.)
ax.plot(t,signal(t,0),'b--',linewidth=1.)
ax.plot(t,signal(t,1),'r--',linewidth=1.)
ax.plot(t,signal(t,2),'g--',linewidth=1.)
myAxes(ax)
ax.set_title(r"Half-wave rectification", fontsize=12)
ax = fig.add_subplot(313)
S, H = [], []
for time in t:
s, h = fullWave(time)
S = append(S,s)
H = append(H,h)
ax.plot(t,S+H,'k',linewidth=2.)
ax.plot(t,(signal(t,0)),'b--',linewidth=1.)
ax.plot(t,(signal(t,1)),'r--',linewidth=1.)
ax.plot(t,(signal(t,2)),'g--',linewidth=1.)
myAxes(ax)
ax.set_title(r"Full-wave rectification", fontsize=12)
myLabel = []
for i in arange(0,cycles+.25,.25):
myLabel = append(myLabel,r"%.2fT"%i)
# myLabel = append(myLabel,r"${}^{%.1fT}_{\pi/%.1f}$"%(i,(i*2)))
ax.set_xticklabels(myLabel,fontsize=10)
ax.set_xlabel(r"Time",fontsize=14)
#fig.suptitle("3-phase AC rectification",fontsize=16)
fig.savefig("3_phase_rectification_2.svg",bbox_inches="tight",\
pad_inches=.15)
|
Licensing
I, the copyright holder of this work, hereby publish it under the following licenses:
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License. |
You may select the license of your choice.