{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# exam1 - ylabel'Magnetization M\cdot cos\phi...

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

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

View Full Document

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

View Full Document

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

View Full Document

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

View Full Document

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

View Full Document

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

View Full Document
0.6360
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? if (hh>1 && cos(phi1)>M(hh-1,tt)) 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')
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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern