exam1 - ylabel('Magnetization M\cdot cos\phi')

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 10
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
0.6360
Background image of page 12
clear Nt=200; Nh=400; thetas=linspace(0,pi/2,Nt); hs=linspace(1,-1,Nh); tt=1; for theta=thetas hh=1; for h=hs %find root of: phi1=fzero(@(phi) 0.5*sin(2*(phi-theta))+h*sin(phi), theta); %is it a stable extremum? if ((cos(phi1-theta)+h*cos(phi1))>0) %did it switch? break; else H(hh,tt)=h; M(hh,tt)=cos(phi1); hh=hh+1; end end end tt=tt+1; end figure(1); plot(H,M,'.'); hold on; plot(-H,-M,'.');hold off; axis([-1.5 1.5 -1.1 1.1]) xlabel('Reduced Magnetic Field h')
Background image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ylabel('Magnetization M\cdot cos\phi') legend(int2str(180/pi*thetas')); figure(2) Mtot=zeros(1,length(hs)); for ii=1:(length(hs)-1) for jj=1:length(thetas) if H(ii,jj)~=0 Mtot(ii)=Mtot(ii)+M(ii,jj); else %it switched Mtot(ii)=Mtot(ii)-M(length(hs)-ii,jj); end end end plot(hs,Mtot);hold on; plot(-hs, -Mtot); hold off; xlabel('Reduced Magnetic Field h') ylabel('Magnetization M\cdot cos\phi')...
View Full Document

This note was uploaded on 12/29/2011 for the course PHYSICS 731 taught by Professor Appelbaum during the Fall '11 term at Maryland.

Page1 / 13

exam1 - ylabel('Magnetization M\cdot cos\phi')

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online