Exemplo n.º 1
0
def squarepot(VV = np.array([0,1,0]), xx = np.array([-2, -1, 1, 2]), neigs = 40):
    """
    Compute resonances of a one-dimensional piecewise-constant potential.
    The value of the potential will be VV(i) on the interval ( xx(i), xx(i+1) ).

    Input:
      VV    -- Value of the potential on each interval
      xx    -- Coordinates of the interval endpoints
      neigs -- Max eigenvalues or resonances to be computed (default: 40)

    Output:
      l     -- Vector of resolved resonance poles in the lambda (wave number) plane
    """

    elt = square_well(xx, VV)

    f, axarr = plt.subplots(2)
    plot_potential1( VV, xx, axarr[0] )

    l = checked_resonances(elt, neigs)

    # #TODO: Fix plot point sizes
    l_full = checked_resonances(elt)
    axarr[1].scatter(l_full.real, l_full.imag)
    axarr[1].set_title('Pole locations')
    # plt.axis('equal')
    plt.show()

    return l
Exemplo n.º 2
0
 def data_gen():
     t = 0.0
     for pot in potentials:
         elt = square_well(ab=[-pot])
         (x,V) = plot_potential(elt)
         l = checked_resonances(elt, 20)
         yield x, V, l.real, l.imag
Exemplo n.º 3
0
def plot_resonance(elt, neigs=0):
    fig, (ax1, ax2) = plt.subplots(2,1)
    (x,V) = plot_potential(elt)
    l = checked_resonances(elt, neigs)
    ax1.plot(x, V, marker='o', linestyle='-',color='r')
    ax1.set_title("Potential")
    ax2.plot(l.real, l.imag, marker='o', linestyle='',color='b')
    ax2.set_title("Pole locations")
    plt.show()