loganbvh / py-tdgl

2D time-dependent Ginzburg-Landau in Python
MIT License
37 stars 13 forks source link

Magnetization output using number of vortices #45

Closed Kyroba closed 1 year ago

Kyroba commented 1 year ago

Is it possible to have an option to output the 'total magnetic moment' of the thin film using the number of vortices? The end goal would be to plot moment against applied field for direct comparison with experimental results.

I think having moment vs field, Jc vs field, and IV curves as easily usable functions would improve prototyping.

In "pyTDGL: Time-dependent Ginzburg-Landau in Python" there is a section on the nanoSQUID figure 5. A current-voltage-flux plot is provided but there is no clear way of how this was done in the documents. Would you need to have run hundreds of simulations with varying fields in order to obtain that plot? That would result in an extremely large file, im hoping there is a more elegant solution.

loganbvh commented 1 year ago

Is it possible to have an option to output the 'total magnetic moment' of the thin film

Yes, that's a good idea. I can just directly calculate the moment from the sheet current density:

image

I will work on adding a method to tdgl.Solution that does this calculation.

I think having moment vs field, Jc vs field, and IV curves as easily usable functions would improve prototyping.

I will think about whether it makes sense to add this type of thing to the package. Maybe in a tdgl.experiments subpackage.

A current-voltage-flux plot is provided but there is no clear way of how this was done in the documents. Would you need to have run hundreds of simulations with varying fields in order to obtain that plot?

Yes, I simulated each IV curve with a different applied field on a different CPU in a cluster. I can share the script if you'd like. If you are just interested in finding the critical current as efficiently as possible, you could try using something like adaptive instead of performing a linear IV sweep.

If you would like to map out I_c vs. applied field quickly, I would recommend doing a full IV curve at some value of the applied field (e.g. zero), then for nearby applied fields simulate an IV curve at a much narrower set of currents near the critical current found in the first sweep. If you are just interested in, for example, the periodicity vs. applied field (or the effective area), you could do an applied field sweep for some constant bias current just above the critical current.

That would result in an extremely large file, im hoping there is a more elegant solution.

If you are just interested in the dynamics of the voltage, you don't need to save the full state of the system. You can set options.output_file = None, then just save the Solution manually after the simulation is done. This will save the full Solution.dynamics plus the final state of the system.

loganbvh commented 1 year ago

PR for total magnetic moment https://github.com/loganbvh/py-tdgl/pull/46

loganbvh commented 1 year ago

As an example, here is the magnetic moment vs. time for the zero_current_solution in the Quickstart notebook. You can clearly see the dipole moment increase when vortices start to enter the film around time = 80 tau_0

image
loganbvh commented 1 year ago

Merged https://github.com/loganbvh/py-tdgl/pull/46