vidarsko / ComFiT

A python library for simulating field theories with topological defects
MIT License
3 stars 3 forks source link

`TypeError` in `tutorial/bose_einstein_condensate_comoving_frame_and_defect_tracking.ipynb` #16

Closed flokno closed 1 month ago

flokno commented 1 month ago

When running the solutions in tutorial/bose_einstein_condensate_comoving_frame_and_defect_tracking.ipynb, I get

image
vidarsko commented 1 month ago

Yes, the problem is that ax should be passed as a keyword argument. It should be

#task 4
vel_x = 0.40

N= 800

for n in range(N):
    psi_prev = np.copy(bec.psi)

    bec.evolve_comoving_dGPE(10,vel_x,method='ETD4RK')

    dt_psi = (bec.psi - psi_prev)/(bec.dt*10)
    nodes = bec.calc_vortex_nodes(dt_psi=dt_psi)

    fig,ax=bec.plot_field(np.abs(bec.psi)**2,cmap_symmetric=False,colormap = 'gray')

    bec.plot_vortex_nodes(nodes,ax=ax)
    cf.tool_save_plot(n)

cf.tool_make_animation_gif(n)

I have fixed the tutorial and pushed the changes.

flokno commented 1 month ago

👍