Exemplo n.º 1
0
	x=graph.linaxis(min=0, max=3, painter=mypainter, parter=None, title="$\omega$"),
	y=graph.linaxis(min=0, max=3, painter=mypainter, parter=None, title="$Z$")
	)
	)

g2 = c.insert(graph.graphxy(
	width=10, x2=None, y2=None, key=graph.key(pos="tr"), xpos=g1.width+0.5,
	x=graph.linaxis(min=0, max=3, painter=mypainter, parter=None, title="$\omega$"),
	y=graph.linaxis(min=0, max=3, painter=mypainter, parter=None, title="$Z$")
	)
	)

L = 0.8 
C = 3

g1.plot(graph.function("y="+str(L)+"*x", title=r"$\omega L$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.black]))
g1.plot(graph.function("y=1/("+str(C)+"*x)", title=r"$1/\omega C$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.red]))
g1.plot(graph.function("y=abs("+str(L)+"*x-1/("+str(C)+"*x))", title=r"$|Z_{Serie}|$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.blue, linewidth.Thick]))

g1.finish()

x1, y1 = g1.pos(1/(sqrt(L*C)), 0)
g1.text(x1-.4, y1-.2, r"$\omega_0$")

g2.plot(graph.function("y="+str(L)+"*x", title=r"$\omega L$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.black]))
g2.plot(graph.function("y=1/("+str(C)+"*x)", title=r"$1/\omega C$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.red]))
g2.plot(graph.function("y=abs(1/("+str(L)+"*x-1/("+str(C)+"*x)))", title=r"$|Z_{Parallel}|$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.blue, linewidth.Thick]))

g2.finish()

x1, y1 = g2.pos(1/(sqrt(L*C)), 0)
from math import exp
from pyx import *
from pyx.style import linewidth, linestyle
from pyx.graph import graphxy, linaxis, axispainter, function, line

mypainter = graph.axispainter(basepathattrs=[deco.earrow.normal],
                        zeropathattrs=None, titlepos=1, titledirection=None)

g = graph.graphxy(
	width=8, x2=None, y2=None, key=graph.key(pos="tr"),
	x=graph.linaxis(min=0, max=10, painter=mypainter, parter=None, title="$t$"),
	y=graph.linaxis(min=0, max=1.65, painter=mypainter, parter=None, title="$u,i$")
	)
g.plot(graph.function("y=1.5*exp(-x/3)", title=r"$i$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.black]))
g.plot(graph.function("y=exp(-x/3)", title=r"$u_R$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.red]))
g.plot(graph.function("y=1-exp(-x/3)", title=r"$u_C$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.blue]))
g.finish()

x1, y1 = g.pos(0, 1.5);
x2, y2 = g.pos(0, 1);
x3, y3 = g.pos(10, 1);
x4, y4 = g.pos(3,0);

g.stroke(path.line(x2, y2, x3, y3), [linestyle.dashed])
g.stroke(path.line(x2, y2, x4, y4), [linestyle.dashed])

g.text(x1-.9, y1-.2, r"$U_{0}/R$")
g.text(x2-.6, y2-.2, r"$U_0$")
g.text(x4-.6, y4-.35, r"$\tau=RC$")

g.writetofile("serie_RC_an_spannungsquelle")
g = graph.graphxy(width=8,
                  x2=None,
                  y2=None,
                  key=graph.key(pos="tr"),
                  x=graph.linaxis(min=0,
                                  max=10,
                                  painter=mypainter,
                                  parter=None,
                                  title="$t$"),
                  y=graph.linaxis(min=0,
                                  max=1.65,
                                  painter=mypainter,
                                  parter=None,
                                  title="$u,i$"))
g.plot(graph.function("y=1.5*exp(-x/3)", title=r"$i$", context=locals()),
       line(lineattrs=[linestyle.solid, color.rgb.black]))
g.plot(graph.function("y=exp(-x/3)", title=r"$u_R$", context=locals()),
       line(lineattrs=[linestyle.solid, color.rgb.red]))
g.plot(graph.function("y=1-exp(-x/3)", title=r"$u_C$", context=locals()),
       line(lineattrs=[linestyle.solid, color.rgb.blue]))
g.finish()

x1, y1 = g.pos(0, 1.5)
x2, y2 = g.pos(0, 1)
x3, y3 = g.pos(10, 1)
x4, y4 = g.pos(3, 0)

g.stroke(path.line(x2, y2, x3, y3), [linestyle.dashed])
g.stroke(path.line(x2, y2, x4, y4), [linestyle.dashed])

g.text(x1 - .9, y1 - .2, r"$U_{0}/R$")
from pyx.graph import graphxy, linaxis, axispainter, function, line

mypainter = graph.axispainter(basepathattrs=[deco.earrow.normal],
                        zeropathattrs=None, titlepos=1, titledirection=None)

g = graph.graphxy(
	width=8, x2=None, y2=None, key=graph.key(pos="tr"),
	x=graph.linaxis(min=0, max=12, painter=mypainter, parter=None, title="$t$"),
	y=graph.linaxis(min=0, max=2.2, painter=mypainter, parter=None, title="$u,i$")
	)

I_q = 2 
R = 2 
C = 1.5 

g.plot(graph.function("y="+str(I_q)+ "/"+ str(R)+"*(1-exp(-x/("+ str(C)+ "*"+ str(R)+")))", title=r"$u$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.black]))
g.plot(graph.function("y="+str(I_q)+"*(1-exp(-x/("+ str(C)+ "*"+ str(R)+")))", title=r"$i_R$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.red]))
g.plot(graph.function("y="+str(I_q)+"*exp(-x/("+ str(C)+ "*"+ str(R)+"))", title=r"$i_C$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.blue]))
g.finish()

x1, y1 = g.pos(0, I_q)
x2, y2 = g.pos(12, I_q)
x3, y3 = g.pos(0, I_q/R)
x4, y4 = g.pos(12, I_q/R)
x5, y5 = g.pos(C*R,0)

g.stroke(path.line(x1, y1, x2, y2), [linestyle.dashed])
g.stroke(path.line(x3, y3, x4, y4), [linestyle.dashed])
g.stroke(path.line(x1, y1, x5, y5), [linestyle.dashed])

g.text(x1-.6, y1-.2, r"$I_{0}$")
Exemplo n.º 5
0
g = graph.graphxy(width=10,
                  x2=None,
                  y2=None,
                  key=graph.key(pos="tr"),
                  x=graph.linaxis(min=-1,
                                  max=9,
                                  painter=mypainter,
                                  parter=None,
                                  title="$t$"),
                  y=graph.linaxis(min=-1.5,
                                  max=3,
                                  painter=mypainter,
                                  parter=None))

g.plot(graph.function("y=1.2*sin(x)", title=r"$u(t)$", context=locals()),
       line(lineattrs=[linestyle.solid, color.rgb.black]))
g.plot(graph.function("y=1.4*sin(x-0.45)", title=r"$i(t)$", context=locals()),
       line(lineattrs=[linestyle.solid, color.rgb.red]))
g.plot(
    graph.function("y=1.2*sin(x)*1.4*sin(x-0.45)",
                   title=r"$p(t)=u(t)\cdotp i(t)$",
                   context=locals()),
    line(lineattrs=[linewidth.Thick, linestyle.solid, color.rgb.blue]))

g.finish()

x1, y1 = g.pos(0, 1.2)
x2, y2 = g.pos(pi / 2, 1.2)
x3, y3 = g.pos(0, 1.4)
x4, y4 = g.pos(pi / 2 + .45, 1.4)
x5, y5 = g.pos(-1, 1.45)
Exemplo n.º 6
0
mypainter2 = graph.axispainter(basepathattrs=[deco.earrow.normal],
                        zeropathattrs=None, titlepos=1, titledirection=None)

c = canvas.canvas()

g1 = c.insert(graph.graphxy(
	width=10, y2=None,
	x=graph.logaxis(min=0.01, max=100, painter=mypainter2, title=r"$\log f$"),
	y=graph.linaxis(min=-45, max= 0, painter=mypainter2, title=r"$v^\ast$")
	)
	)

R = 5
C = 0.2

g1.plot(graph.function("y=20*log10(1/(sqrt(1+("+str(R)+"*x*"+str(C)+")^2)))", title="", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.black, linewidth.Thick]))
g1.finish()

tanparter = graph.linparter(["45","90"])

g2 = c.insert(graph.graphxy(
	width=10, x2=None, y2=None, xpos=g1.width+1.5,
	x=graph.logaxis(min=0.01, max=1000, painter=mypainter2, title=r"$\log f$"),
	y=graph.linaxis(min=-95, max= 0, painter=mypainter2, parter=tanparter, title=r"$\varphi$")
	)
	)

g2.plot(graph.function("y=-180*atan((x*R*C))/pi", title="", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.black, linewidth.Thick]))
g2.finish()

Exemplo n.º 7
0
        width=10,
        y2=None,
        x2=None,
        x=graph.logaxis(min=0.01, max=100, painter=mypainter, parter=myparter, title=r"$\log f$"),
        y=graph.linaxis(min=-45, max=0, painter=mypainter, title=r"$v^\ast[dB]$"),
    )
)

R = 5
C = 0.2

g1.plot(
    graph.function(
        "y=20*log10(" + str(R) + "/(sqrt(" + str(R) + "^2+1/(x*" + str(C) + ")^2)))", title="", context=locals()
    ),
    line(lineattrs=[linestyle.solid, color.rgb.black, linewidth.Thick]),
)
g1.finish()

tanparter = graph.linparter(["45", "90"])

g2 = c.insert(
    graph.graphxy(
        width=10,
        x2=None,
        y2=None,
        xpos=g1.width + 2,
        x=graph.logaxis(min=0.01, max=1000, painter=mypainter2, title=r"$\log f$"),
        y=graph.linaxis(min=0, max=95, painter=mypainter2, parter=tanparter, title=r"$\varphi$"),
    )
)
Exemplo n.º 8
0
from pyx.graph import graphxy, linaxis, axispainter, function, line

mypainter = graph.axispainter(basepathattrs=[deco.earrow.normal],
                        zeropathattrs=None, titlepos=1, titledirection=None)

g = graph.graphxy(
	width=8, x2=None, y2=None, key=graph.key(pos="tr"),
	x=graph.linaxis(min=0, max=12, painter=mypainter, parter=None, title="$t$"),
	y=graph.linaxis(min=0, max=2.2, painter=mypainter, parter=None, title="$u,i$")
	)

U_q = 2 
R = 2 
L = 9 

g.plot(graph.function("y="+str(U_q)+ "/"+ str(R)+"*(1-exp(-x/("+ str(L)+ "/"+ str(R)+")))", title=r"$i$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.black]))
g.plot(graph.function("y="+str(U_q)+"*(1-exp(-x/("+ str(L)+ "/"+ str(R)+")))", title=r"$u_R$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.red]))
g.plot(graph.function("y="+str(U_q)+"*exp(-x/("+ str(L)+ "/"+ str(R)+"))", title=r"$u_L$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.blue]))
g.finish()

x1, y1 = g.pos(0, U_q)
x2, y2 = g.pos(12, U_q)
x3, y3 = g.pos(0, U_q/R)
x4, y4 = g.pos(12, U_q/R)
x5, y5 = g.pos(L/R,0)

g.stroke(path.line(x1, y1, x2, y2), [linestyle.dashed])
g.stroke(path.line(x3, y3, x4, y4), [linestyle.dashed])
g.stroke(path.line(x1, y1, x5, y5), [linestyle.dashed])

g.text(x1-.6, y1-.2, r"$U_{0}$")
from math import exp,pi, sqrt, log, atan
from pyx import *
from pyx.style import linewidth, linestyle
from pyx.graph import graphxy, linaxis, axispainter, function, line

mypainter = graph.axispainter(basepathattrs=[deco.earrow.normal],
                        zeropathattrs=None, titlepos=1, titledirection=None)

g = graph.graphxy(
	width=10, y2=None, x2=None,
	x=graph.linaxis(min=0, max=1, painter=mypainter, title=r""),
	y=graph.linaxis(min=0, max=1, painter=mypainter, title=r"")
	)

g.plot(graph.function("y=-x*log(x)/log(2)-(1-x)*log(1-x)/log(2)", title=""), line(lineattrs=[linestyle.solid, color.rgb.black, linewidth.Thick]))
g.finish()

g.writetofile("binaere_entropiefkt")
Exemplo n.º 10
0
from math import exp
from pyx import *
from pyx.style import linewidth, linestyle
from pyx.graph import graphxy, linaxis, axispainter, function, line

mypainter = graph.axispainter(basepathattrs=None,
                        zeropathattrs=[deco.earrow.normal], titlepos=1, titledirection=None)

g = graph.graphxy(
	width=8, x2=None, y2=None,
	x=graph.linaxis(min=-10, max=10, painter=mypainter, parter=None, title="$U$"),
	y=graph.linaxis(min=-10, max=10, painter=mypainter, parter=None, title="$I$")
	)
g.plot(graph.function("y=25+x", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.black]))
g.finish()

x1, y1 = g.pos(-8, 0);
x2, y2 = g.pos(-9, -10);
x3, y3 = g.pos(0, 0);
x4, y4 = g.pos(1,10);

g.stroke(path.line(x2, y2, x1, y1), [linewidth.Thick, linestyle.solid])
g.stroke(path.line(x1, y1, x3, y3), [linewidth.Thick, linestyle.solid])
g.stroke(path.line(x3, y3, x4, y4), [linewidth.Thick, linestyle.solid])

g.text(x1-.4, y1+.2, r"$Z_D$")

g.writetofile("zenerdiode.eps")
Exemplo n.º 11
0
from math import exp,pi
from pyx import *
from pyx.style import linewidth, linestyle
from pyx.graph import graphxy, linaxis, axispainter, function, line

mypainter = graph.axispainter(basepathattrs=None,
                        zeropathattrs=[deco.earrow.normal], titlepos=1, titledirection=None)

g = graph.graphxy(
	width=10, x2=None, y2=None, key=graph.key(pos="tr"),
	x=graph.linaxis(min=-1, max=9, painter=mypainter, parter=None, title="$t$"),
	y=graph.linaxis(min=-1.5, max=3, painter=mypainter, parter=None)
	)

g.plot(graph.function("y=1.2*sin(x)", title=r"$u(t)$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.black]))
g.plot(graph.function("y=1.4*sin(x-0.45)", title=r"$i(t)$", context=locals()), line(lineattrs=[linestyle.solid, color.rgb.red]))
g.plot(graph.function("y=1.2*sin(x)*1.4*sin(x-0.45)", title=r"$p(t)=u(t)\cdotp i(t)$", context=locals()), line(lineattrs=[linewidth.Thick, linestyle.solid, color.rgb.blue]))

g.finish()

x1, y1 = g.pos(0, 1.2)
x2, y2 = g.pos(pi/2, 1.2)
x3, y3 = g.pos(0, 1.4)
x4, y4 = g.pos(pi/2+.45,1.4)
x5, y5 = g.pos(-1, 1.45)
x6, y6 = g.pos(9, 1.45)

g.stroke(path.line(x1, y1, x2, y2), [linestyle.solid])
g.stroke(path.line(x3, y3, x4, y4), [linestyle.solid])
#g.stroke(path.line(x5, y5, x6, y6), [linestyle.dashed])
#g.stroke(path.line(x1, y1, x3, y3), [linestyle.solid])