-
Notifications
You must be signed in to change notification settings - Fork 0
td wslda examples
Gabriel Wlazłowski edited this page Feb 20, 2024
·
3 revisions
[[TOC]]
Target: find a time evolution of the unitary Fermi gas confined in a harmonic trap:
where
The initial external potential is
Code: st-wslda-1d
Settings:
Output:
Code: td-wslda-2d
Settings:
- trap-2d-alpha0.0_predefines.h
- trap-2d-alpha0.0_problem-definition.h
- trap-2d-alpha0.0_logger.h
- trap-2d-alpha0.0_input.txt
Output:

Energy evolution:
import numpy as np
import matplotlib.pyplot as plt
data = np.loadtxt("trap-2d-alpha0.0.wlog", usecols=(1,4,5))
fig, ax = plt.subplots()
ax.plot(data[:,0], data[:,2], color='red', label=r'energy', lw=3.0)
ax.set(xlabel=r'$t\varepsilon_F$', ylabel=r'$E/E_{ffg}$')
ax2 = ax.twinx() # instantiate a second axes that shares the same x-axis
ax2.plot(data[:,0], data[:,1], color='blue', label=r'particle number', lw=2.0, ls="--") # plot last frame [-1]
ax2.set(ylabel=r'$N$')
fig.legend(loc="upper left", bbox_to_anchor=(0.3,0.3), bbox_transform=ax.transAxes)
fig.savefig("energy-conservation.png")