Exemplo n.º 1
0
def plot_u3(show=False, save=False):

    fig = plt.figure()
    ax = fig.add_subplot(111)

    fit40 = sb.FitCurve(sb.f_line, u3.I_40**2, u3.U_c)
    ax.plot(*fit40.curve(), ":", c="grey")
    ax.plot(u3.I_40**2, u3.U_c, "x", c="grey", label="$r = \SI{20}{mm}$")

    fit60 = sb.FitCurve(sb.f_line, u3.I_60**2, u3.U_c)
    ax.plot(*fit60.curve(), ":", c="C3")
    ax.plot(u3.I_60**2, u3.U_c, "x", c="C3", label="$r = \SI{30}{mm}$")

    fit80 = sb.FitCurve(sb.f_line, u3.I_80**2, u3.U_c)
    ax.plot(*fit80.curve(), ":", c="C1")
    ax.plot(u3.I_80**2, u3.U_c, "x", c="C1", label="$r = \SI{40}{mm}$")

    fit100 = sb.FitCurve(sb.f_line, u3.I_100**2, u3.U_c)
    ax.plot(*fit100.curve(), ":", c="C0")
    ax.plot(u3.I_100**2, u3.U_c, "x", c="C0", label="$r = \SI{50}{mm}$")

    ax.set_xlabel(r"$I_{mag}^2$ [A]")
    ax.set_ylabel(r"$U_c$ [V]")

    ax.legend()
    fig.tight_layout()

    if show:
        plt.show()
    if save:
        fig.savefig("../fig/u3.pdf")

    plt.close(fig)

    return fit40, fit60, fit80, fit100
Exemplo n.º 2
0
def plot_u3_436(show=False, save=False):
    fig = plt.figure()
    ax = fig.add_subplot(111)

    dropped = u3.I436.dropna()
    y = sp.zeros((dropped.size)) + dropped.min()

    lower = 21
    upper = 26
    fit = sb.FitCurve(sb.f_line, u3.U[lower:upper], u3.I436[lower:upper])

    ax.plot(u3.U[:dropped.size], y, c="grey", label="Nasycená hodnota proudu")
    ax.plot(u3.U, u3.I436, "k", label="Naměřená závislost")
    ax.plot(*fit.curve(overrun=(1.4)),
            c="red",
            label=r"Lineární fit v oblasti $U = \num{1.05} - \SI{1.25}{V}$")

    ax.set_xlabel(r"U[V]")
    ax.set_ylabel(r"I[nA]")
    ax.legend()
    fig.tight_layout()

    if show:
        plt.show()
    if save:
        fig.savefig("../plot/u3_436.pdf")
Exemplo n.º 3
0
def plot_planck(show=False, save=False):
    fig = plt.figure()
    ax = fig.add_subplot(111)

    fit = sb.FitCurve(sb.f_line, list(V.keys()), list(V.values()), sigma=0.1)

    ax.plot(*fit.curve(), ":", c="grey", label="Lineární fit")
    ax.plot(V.keys(), V.values(), "kx", label="Spočtené hodnoty $U_0$")

    ax.set_xlabel(r"$\nu[\si{\per\second}]$")
    ax.set_ylabel(r"$U_0[V]$")
    ax.legend()
    fig.tight_layout()

    if show:
        plt.show()
    if save:
        fig.savefig("../plot/planck.pdf")

    return fit
Exemplo n.º 4
0
def plot_u2(show=False, save=False):

    fig = plt.figure()
    ax = fig.add_subplot(111)

    fit = sb.FitCurve(sb.f_line, u2.I_mag**2, u2.U_kr)

    ax.plot(*fit.curve(), ":", c="gray", label="lineární fit")
    ax.plot(u2.I_mag**2, u2.U_kr, "kx", label="kritická napětí")

    ax.set_xlabel(r"$ I_{mag}^2 [\si{\ampere\squared}] $")
    ax.set_ylabel(r"$ U_{kr}$ [V]")
    ax.legend()
    fig.tight_layout()

    if show:
        plt.show()
    if save:
        fig.savefig("../fig/u2.pdf")

    plt.close(fig)

    return fit
Exemplo n.º 5
0
def plot_u1_1(show=False, save=False):

    fig = plt.figure()
    ax = fig.add_subplot(111)

    fit = sb.FitCurve(sb.f_line, x[1:-1], y[1:-1])

    ax.plot(*fit.curve(), ":", c="grey")
    ax.plot(x, y, "kx", label="hodnoty")

    ax.set_xlabel(r"x label")
    ax.set_ylabel(r"y label")
    ax.legend()
    fig.tight_layout()

    if show:
        plt.show()
    if save:
        fig.savefig("../fig/u1_1.pdf")

    plt.close(fig)

    return fit