Loop correction of program. Zeeman Energy

8 次查看(过去 30 天)
Attach please find the code for correction. All the details of errors are defined in the code for easy understanding. Graph result should be like black line in the attached jpg figure. Your help will be highly appreciated........
Regards
  1 个评论
Walter Roberson
Walter Roberson 2015-9-13
Note for readers: the code attached does not produce any error messages, but does not produced the desired value.

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2015-9-13
Your initial_magnetization can be shown to be 2.2 * mu_b * nrowscols^2 . As mu_b starts as 9.2700e-24 and nrowscol is small (3), the initial magnetization is only 1.8355e-22. To calculate the new_energy, that value is multiplied by mag_field_reverse which is maximum 2, and by cosd() of something real-valued which is between -2.5 and +2.5 degrees. The cosd is therefore between 0.9990 and 1. And the negative is taken of all of this. Your new_energy is therefore between -3.6709e-22 and -3.6672e-22. The black line in your sample plot implies you expect values approaching 1.
But what is being plotted? It is Magnetization. Which is calculated as initial_magnetization * cosd() of the angle at which new_energy was minimum or which was accepted probabilistically. So each Magnetization is going to be initial_magnetization (1.8355e-22) times something that is between 0.9990 and 1.0 . You are not going to see much on a plot, even if you multiply by 1E22.

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by