; ; SUMMATIONS Phir=dPhi/dr,Phith=dPhi/dth,and Phiph=dPhi/dphi ; NOTE: Hr & dHr here include the effect of various models ; pro brtp,Nmax,apar,r,sthj,Hr,dHr,Pj,dPj,Gfi,dGfi,Br,Bt,Bp,N0=n0 if keyword_set(n0) then n1=0 else n1=1 Phir = double(0.0) Phith = double(0.0) Phiph = double(0.0) for n=n1, Nmax do begin for m=0, n do begin Phir= Phir + dHr(n)*Pj(n,m)*Gfi(n,m) Phith= Phith + Hr(n)*dPj(n,m)*Gfi(n,m) Phiph= Phiph + Hr(n)*Pj(n,m)*dGfi(n,m) endfor endfor Br = -1.* Phir Bt = -1.* Phith/r Bp = -1.* Phiph/r/sthj end