PlasmaControl / DESC

Stellarator Equilibrium and Optimization Suite
MIT License
97 stars 26 forks source link

Normalization of plot_2d() #1371

Open mohawk811 opened 3 hours ago

mohawk811 commented 3 hours ago

plot_2d(eq_out,'J',log=False, norm_F=True)

Is there a way to normalize to grad B and not grad B^2?

Screenshot 2024-11-15 at 12 41 29 PM
YigitElma commented 2 hours ago

You can use norm_name argument to adjust the normalization. Something like,

plot_2d(eq,'J',log=False, norm_F=True, norm_name="grad(|B|)")

But this might not give proper results, since (as far as I know) we don't have a compute function for "|grad(|B|)|" or something similar.

mohawk811 commented 1 hour ago

Is there a way to still have the 1/2mu0 ?

YigitElma commented 4 minutes ago

If you want to use plot_2d function, I don't think you can because we don't have a compute function for $|\nabla B|/2\mu_0$. If you want you can write your own compute function following this page. But probably the easiest way is to compute $|\nabla B|$ and then divide it by $\mu_0$ and plot it using plt.contourf instead of plot_2d.