File: spin_half_gaussian_distribution.py

package info (click to toggle)
pycode-browser 1%3A1.02%2Bgit20181006-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,088 kB
  • sloc: python: 2,779; xml: 152; makefile: 71
file content (12 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
# Plot sigma(M,N) vs M/u  

import numpy as np
import pylab

M = np.linspace(-50,50.,4000)  #  Create a magnetic moment axis [-50,50] with 4K equally spaced points. u=1, so M/u = M
N = 100 # number of spins
sigma = np.exp(-1*(1./(2*N))*(M**2))

pylab.plot(M,sigma ,'-r') # Plot kBT/e vs Cv
pylab.xlabel('M/u'); pylab.ylabel('Sigma= e^(-1*(1./(2*N))*(M**2))')
pylab.show()