Help:=proc(): print(` PlotON(m), PlotO(), Onsager(nu), LarsNg(m,w,nu)`): end: #Symbolic approach (using transfter matrix) HelpOld:=proc(): print(` Ising1(z,w,t), Vecs(m), WtV(v,z,w), WtH(v1,v2,z)`): print(`Isingm(z,w,t,m), OnsagerN(m,z), LarsN(m,nu)`): end: #Ising1(z,w,t): The generating function, in t, for # add(gPF(1,n,z,w)*t^n,t=1..infinity) #weight enumerator of ALL vectors in {-1,1} with weight #z^(sum of products of neighbors)*w^(sum of entries)*t^(lenght) #(of length>=1) Ising1:=proc(z,w,t) local f,g,var,eq: #f (g) : weight-enumerator of vectors that start with 1 (-1) eq:={f=w*t+t*w*z*f+ t*w*z^(-1)*g, g=w^(-1)*t+ t*w^(-1)*z^(-1)*f+ t*w^(-1)*z*g}: var:={f,g}: var:=solve(eq,var): normal(subs(var,f)+subs(var,g)): end: # #All {-1,1} vectors of length m Vecs:=proc(m) local K,J,j: if m=0 then RETURN({[]}): fi: J:=Vecs(m-1): {seq([op(j),-1] , j in J)} union {seq([op(j),1] , j in J)}: end: #WtV(v,z,w): the vertical weight of the vector v WtV:=proc(v,z,w) local i: w^convert(v,`+`)*z^( add(v[i]*v[i+1],i=1..nops(v)-1) +v[nops(v)]*v[1] ): end: WtH:=proc(v1,v2,z) local i: z^(add(v1[i]*v2[i],i=1..nops(v1))): end: Isingm:=proc(z,w,t,m) local eq,var,Luis, f,v: option remember: Luis:=Vecs(m): var:={seq(f[op(i)],i in Luis)}: eq:={}: for v in Luis do eq:=eq union {f[op(v)]-WtV(v,z,w)*t*(1+ add(f[op(u)]*WtH(v,u,z), u in Luis))}: od: var:=solve(eq,var): normal(add( subs(var,f[op(v)]), v in Luis)): end: #OnsagerN(m,nu): the Onsager explicit solution for numeric z #(and numeric integer m, m=number of rows) OnsagerN:=proc(m,nu) local k: evalf((2*sinh(2*nu))^(m/2)* exp( add (arccosh(cosh(2*nu)*coth(2*nu)-cos(Pi*(2*k-1)/m)),k=1..m)/2)): end: #LarsN(m,z): our solution with numeric nu LarsN:=proc(m,nu) local z,f,t: f:=Isingm(z,1,t,m): f:=subs(z=exp(nu),f): f:=denom(f): 1/min(solve(f,t)): end: ###end Apr. 23, 2009####### PlotON:=proc(m) local nu,f: f:= log(OnsagerN(m,nu))/m: plot(f,nu=0..evalf(1/2)): end: #Onsager(nu): the Onsager explicit solution for numeric z #(and numeric integer m, m=number of rows) Onsager:=proc(nu) local k: evalf(1/2*log(2*sinh(2*nu))) + evalf(1/2/Pi)* evalf(int (arccosh(cosh(2*nu)*coth(2*nu)-cos(theta)),theta=0..Pi)): end: PlotO:=proc() local nu: plot(Onsager(nu),nu=0..1): end: #LarsNg(m,z): our solution with numeric nu LarsNg:=proc(m,w,nu) local z,f,t: f:=Isingm(z,w,t,m): f:=subs(z=exp(nu),f): f:=denom(f): 1/min(solve(f,t)): end: