P30+PS+5+solutions

# P30+PS+5+solutions - I would rather have a root canal than...

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: I would rather have a root canal than do physics in Excel. I did this problem in Mathematica: see the included PDF and the course webpage for my Mathematica notebook. Problem 3.24 Multiplicity, entropy and energy (by construction) In[1]:= In[2]:= In[3]:= ￿￿q￿, N￿￿ ￿ S￿q￿, N￿￿ ￿ k Log￿￿￿q, N￿￿; U￿q￿￿ ￿ Ε q; ￿N ￿ 1 ￿ q￿ ￿ q ￿￿￿N ￿ 1￿ ￿ ; Temperature and heat capacity () ￿ derivatives approximated with "small" dq In[4]:= dq ￿ 1; T￿q￿, N￿￿ ￿ S￿q ￿ dq, N￿ ￿ S￿q ￿ dq, N￿ U￿q ￿ dq￿ ￿ U￿q ￿ dq￿ U￿q ￿ dq￿ ￿ U￿q ￿ dq￿ ; ; In[5]:= ￿ Exact derivatives (relying on Mathematica converting factorials to gamma functions) In[7]:= CV￿q￿, N￿￿ ￿ T￿q￿, N￿￿ ￿ T￿q ￿ dq, N￿ ￿ T￿q ￿ dq, N￿ ￿q U￿q￿ ; CV￿q￿, N￿￿ ￿ ￿q S￿q, N￿ ￿q U￿q￿ Plots of energy, entropy, temperature and heat capacity In[9]:= In[10]:= ￿q T￿q, N￿ ; p1 ￿ ParametricPlot￿￿U￿q￿ ￿ Ε, S￿q, 50￿ ￿ k￿, ￿q, 0, 100￿, AxesLabel ￿ ￿"energy ￿ Ε", "entropy ￿ k"￿￿; p2 ￿ ParametricPlot￿￿U￿q￿ ￿ Ε, S￿q, 5000￿ ￿ k￿, ￿q, 0, 100￿, AxesLabel ￿ ￿"energy ￿ Ε", "entropy ￿ k"￿, PlotStyle ￿ Red￿; 2 problem 3.24.nb In[11]:= Show￿p1, p2￿ entropy ￿ k 80 60 Out[11]= 40 20 energy ￿ Ε In[12]:= In[13]:= p3 ￿ ParametricPlot￿￿T￿q, 50￿ ￿ ￿Ε ￿ k￿, CV￿q, 50￿ ￿ ￿50 k￿￿, ￿q, 0, 100￿, AxesLabel ￿ ￿"temperature ￿￿Ε￿k￿", "heat capacity￿Nk"￿, PlotRange ￿ ￿0, 1￿￿; p4 ￿ ParametricPlot￿￿T￿q, 5000￿ ￿ ￿Ε ￿ k￿, CV￿q, 5000￿ ￿ ￿5000￿k￿￿, ￿q, 0, 100￿, AxesLabel ￿ ￿"temperature ￿￿Ε￿k￿", "heat capacity￿Nk"￿, PlotStyle ￿ Red￿; Show￿￿p3, p4￿, PlotRange ￿ All￿ heat capacity￿Nk 1.0 0.8 20 40 60 80 100 In[14]:= 0.6 Out[14]= 0.4 0.2 0.5 1.0 1.5 2.0 2.5 distribution of returns with specified lag (days) 0.5 0.45 0.4 0.35 0.3 number 0.25 0.2 0.15 0.1 0.05 0 -30 -20 -10 0 change (pts) 10 20 30 0 0 1000 2000 3000 500 mean return (pts) 1500 1 10 100 1000 2500 mean return median return 2000 average return over time 1000 4000 5000 6000 lag (days) 7000 8000 9000 10000 variation in return over time 3500 3000 2500 2000 1500 1000 500 0 correlation 80 60 40 20 0 -20 -40 -60 -80 0 10 correlation between day-to-day changes vs time lag std dev of return (pts) mean correlation median correlation 10 1 0 10 20 30 40 50 60 1/2 70 80 90 100 sqrt(lag) (days ) 10 lag (days) 2 10 3 2D and 3D lattice random walk 2D lattice ￿ Multiplicity In[1]:= ￿2￿N￿, ￿￿, n￿￿ ￿ ￿2￿N￿, ￿￿￿ ￿ The sharp maximum in ￿[N, ￿, n] goes away when ￿ gets close to N: In[3]:= p1 ￿ Plot￿Log￿￿2￿100, 0, n￿￿, ￿n, 0, 100￿, AxesLabel ￿ ￿"number of left￿right steps", "S￿k"￿￿; p2 ￿ Plot￿Log￿￿2￿100, 5, n￿￿, ￿n, 5, 100￿￿; p3 ￿ Plot￿Log￿￿2￿100, 25, n￿￿, ￿n, 25, 100￿￿; p4 ￿ Plot￿Log￿￿2￿100, 50, n￿￿, ￿n, 50, 100￿￿; p5 ￿ Plot￿Log￿￿2￿100, 75, n￿￿, ￿n, 75, 100￿￿; Show￿p1, p2, p3, p4, p5￿ 130 120 110 S￿k n￿Abs￿￿￿ ￿ N ￿N ￿ ￿2￿N, ￿, n￿; n￿ ￿￿￿ n￿￿ ￿ ￿￿￿ n￿￿ ￿ ￿ 2 2 N￿ ￿2N￿n ; Out[8]= 100 90 80 20 40 60 80 100 number of left￿right steps ￿ Minima Free energy / kT : In[9]:= In[10]:= G￿Α￿, x￿, N￿￿ ￿ ￿ Α x ￿ Log￿￿2￿100, x￿￿; Sinh￿Α￿ Predicted minima locations : In[11]:= Gplot ￿ Plot￿G￿￿0.5, 1, 2￿, x, 100￿, ￿x, ￿ 100, 100￿, PlotRange ￿ All, AxesLabel ￿ ￿"￿", "Free energy￿kT"￿￿; xmin￿Α￿, N￿￿ ￿ N ￿ ; 1 ￿ Cosh￿Α￿ minplot1 ￿ Graphics￿Line￿￿￿xmin￿0.5, 100￿, ￿ 250￿, ￿xmin￿0.5, 100￿, 200￿￿￿￿; minplot2 ￿ Graphics￿Line￿￿￿xmin￿1, 100￿, ￿ 250￿, ￿xmin￿1, 100￿, 200￿￿￿￿; minplot3 ￿ Graphics￿Line￿￿￿xmin￿2, 100￿, ￿ 250￿, ￿xmin￿2, 100￿, 200￿￿￿￿; 2 3D on-lattice random walk.nb In[14]:= Show￿Gplot, minplot1, minplot2, minplot3￿ Free energy￿kT 200 100 Out[14]= ￿ 100 ￿ 50 ￿ 100 50 100 ￿ ￿ 200 3D lattice ￿ Multiplicity In[15]:= ￿3￿N￿, ￿￿, n￿￿ ￿ ￿3￿N￿, ￿￿￿ ￿ ￿ Minima n￿Abs￿￿￿ ￿ N ￿N ￿ ￿3￿N, ￿, n￿; n￿ ￿￿￿ n￿￿ ￿ ￿￿￿ n￿￿ ￿ ￿ 2 2 N￿ ￿4N￿n ; Free energy / kT : In[17]:= In[18]:= G￿Α￿, x￿, N￿￿ ￿ ￿ Α x ￿ Log￿￿3￿100, x￿￿; Sinh￿Α￿ Predicted minima locations : In[19]:= Gplot ￿ Plot￿G￿￿0.5, 1, 2￿, x, 100￿, ￿x, ￿ 100, 100￿, PlotRange ￿ All, AxesLabel ￿ ￿"￿", "Free energy￿kT"￿￿; xmin￿Α￿, N￿￿ ￿ N ￿ ; 2 ￿ Cosh￿Α￿ minplot1 ￿ Graphics￿Line￿￿￿xmin￿0.5, 100￿, ￿ 250￿, ￿xmin￿0.5, 100￿, 200￿￿￿￿; minplot2 ￿ Graphics￿Line￿￿￿xmin￿1, 100￿, ￿ 250￿, ￿xmin￿1, 100￿, 200￿￿￿￿; minplot3 ￿ Graphics￿Line￿￿￿xmin￿2, 100￿, ￿ 250￿, ￿xmin￿2, 100￿, 200￿￿￿￿; 3D on-lattice random walk.nb 3 In[22]:= Show￿Gplot, minplot1, minplot2, minplot3￿ Free energy￿kT 200 100 Out[22]= ￿ 100 ￿ 50 ￿ 100 50 100 ￿ ￿ 200 ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online