2 * g * rho_max /
    (m * R**2))  # Trap frequency  corresponding to desired density and radius
mu = g * rho_max  # Desired chemical potential of the groundstate
N_2D = pi * rho_max * R**2 / 2  # Thomas Fermi estimate of atom number for given chemical potential.
healing_length = 1 / np.sqrt(8 * pi * a * rho_max)

# Total spatial region over all MPI processes:
x_min = -5
x_max = 5

# Number of DVR basis functions per element:
N = 10

# Finite elements:
n_elements = 5
elements = FiniteElements1D(N, n_elements, x_min, x_max)

x = elements.points

alpha = 30

N_interp = 10000
x_interp = np.linspace(x_min, x_max, N_interp * n_elements)


def plot_vector(vector, *args, **kwargs):
    x_interp, vec_interp = elements.interpolate_vector(vector, N_interp)
    plt.plot(x_interp, vec_interp, *args, **kwargs)
    for j in range(n_elements):
        for i, point in enumerate(elements.points[j, :]):
            if 0 < i < N - 1:
Exemplo n.º 2
0
}

# Convert to float colours:
colors = {
    name: [chan / 255 for chan in value]
    for name, value in colors_rgb.items()
}

from FEDVR import FiniteElements1D

pi = np.pi

N = 10
n_elements = 2
x_max = 18
elements = FiniteElements1D(N, n_elements, 0, x_max)

FIG_WIDTH = 4.25
FIG_HEIGHT = 2.25

fig = plt.figure(figsize=(FIG_WIDTH, FIG_HEIGHT))
# gs = gridspec.GridSpec(1, 1, left=0.2, bottom=0.1,
#                        right=0.8, top=0.95, wspace=0.2, hspace=0.075)

# ax = plt.axes()
dx_av = x_max / (n_elements * (N - 1))

for i in range(n_elements):
    for j in range(N):
        psi = np.zeros((n_elements, N), dtype=complex)
        psi[i, j] = 1  # np.sqrt(element.weights[i])