number of degenrate states;

"1eVis 1,60219 10^-19 J is 96.458 kJ mol-1  is 8065.5 cm-1;;;;;;";

" k is  1.38066 10^-23 J K-1;;;;";

"R is k Na  is  8.31441 K-1 mol-1";

Clear[k,R,m]

s

K

k=1.38066  10^-23  kg m^2  s^-2     K^-1

m

hh=6.626 10^-34   kg m^2  s^-1

cc=2.99799 10^8  m/s

"This is conversion factor   in J *m  or if energy is in m-1,it is J";

hh  cc

"so if you have cm-1 \!\(\*FractionBox[\(1.9864681740000004`*^-23\\ kg\\ \*SuperscriptBox[\(m\), \(2\)]\\ \\ \\ cm\), SuperscriptBox[\(s\), \(2\)]]\) "

"convert energy kT <--> hcB  from  J<-->cm-1  "

T=298 K

k T/(hh cc)

or 207 cm-1

"SO CONVERSION FACTOR /K is  "

T=1  K

k T/(hh cc)

or 0.695033 cm-1

1/.695033

how to do conversion

298 K *0.6950

"END OF SI UNITS";

ROTATIONAL BOLTZMANN

g=Table[2  j +1,{j,0,15}]

use  B== hcB in cm-1 and T==kT/hc in cm-1;

for T=298.15 stand room temp, corresponding energy  T=207.22cm-1;

298.15 * .695033

tt=Table[ i*10*.695033,{i,0,20}]

"HCl B=10 cm-1 check  yours ;";

B=10.59

"COMPLTETE ROTTIONAL DISTRIBUTION function (w/out dipole transition element)

bt[j_]:=2 j

bt[2]

"BOLTZMAN distribution

Bol[j_,t_]:=(2  j +1) *Exp[-B  j ( j+1) / (t*0.6950)]

where t is the temperature in K

Bol[2.,290]

Plot[Evaluate[Table[Bol[j,t],{j,1,12}]],{t,290,300}]

"note energy of j=0 is zero, start with 1";

Plot[Evaluate[Table[Bol[j,t],{j,1,12}]],{t,1,300},AxesLabel->Automatic]

" for temperature of about 300

Tabley=Table[Bol[j,300.],{j,0,20}]

ListPlot[Tabley,PlotJoined->True]

z=300

Integrate[Bol[j,z],{j,0,20}]

Integrate[(2  j +1) *Exp[-B  j ( j+1) / (300*0.6950)],{j,0,20}]

"The antological distribution presentation as the function of temperature-not normalized

Plot[Evaluate[Table[Bol[j,t],{t,1,300,50}]],{j,0,20},AxesLabel->Automatic,PlotRange->Full,AxesOrigin->{0,0}]

Plot[Evaluate[Table[Bol[j,t]/Integrate[Bol[j,t],{j,0,20}],{t,1.01,300,50}]],{j,1,20},AxesLabel->Automatic,PlotRange->All,AxesOrigin->{0,0}]

Plot[Evaluate[Table[Bol[j,t]/Integrate[Bol[j,t],{j,0,20}],{t,1.01,300,50}]],{j,1,20},AxesLabel->Automatic,PlotRange->All,AxesOrigin->{0,0}]

Plot[Evaluate[Table[Bol[j,t]/Bol[1,t],{t,1,300,50}]],{j,1,20},AxesLabel->Automatic,AxesOrigin->{0,0},PlotRange->All]

"temperature limit: IF MOLECULE SURVIVES AND IS NOT coupled with other degries";

"experimnetal data";

"assigned m now goes to j";

"from experimental

ListPlot[{{2571.04`,63.025`},{2598.04`,60.7376`},{2624.66`,56.5307`},{2651.08`,50.6777`},{2676.72`,42.7661`},{2701.99`,33.696`},{2726.67`,24.567`},{2750.97`,17.7626`},{2774.88`,12.4204`},{2798.03`,9.4842`},{2820.59`,8.4309`},{2842.57`,8.6026`},{2863.79`,11.4713`},{2905.25`,11.4448`},{2924.92`,7.5972`},{2943.82`,6.0691`},{2962.14`,6.1261`},{2979.69`,7.4544`},{2996.66`,10.3977`},{3012.86`,15.1432`},{3028.67`,21.5899`},{3043.52`,28.7497`},{3057.98`,35.8124`},{3071.48`,41.6841`},{3084.21`,46.1068`},{3095.98`,49.3055`},{3131.85`,53.1381`},{3133.77`,53.2278`},{3135.7`,53.2859`},{3137.63`,53.3374`}}]

"put it into "absorbance shape";

"concentrations here are low - assume one layer";

"correct P";" with positive (absolute j" -from ground state!!)

"Also subtract the background -esimate the bacground as a line or a constant

hclP={{13,64-63.025`},{12,64-60.7376`},{11,64-56.5307`},{10,64-50.6777`},{9,64-42.7661`},{8,64-33.696`},{7,64-24.567`},{6,64-17.7626`},{5,64-12.4204`},{4,64-9.4842`},{3,64-8.4309`},{2,64-8.6026`},{1,64-11.4713`}}

ListPlot[hclP]

"similar for R , you can choose one and then another P or R

"correct R";

54-11.4448

hclR={{0,(54-11.4448`)},{1,(54-7.5972`)},{2,(54-6.0691`)},{3,(54-6.1261`)},{4,(54-7.4544`)},{5,(54-10.3977`)},{6,(54-15.1432`)},{7,(54-21.5899`)},{8,(54-28.7497`)},{9,(54-35.8124`)},{10,(54-41.6841`)},{11,(54-46.1068`)},{12,(54-49.3055`)},{13,(54-53.1381`)},{14,(54-53.2278`)},{15,(54-53.2859`)}}

gPex=ListPlot[{hclP},PlotJoined->True]

ListPlot[{hclP,hclR}]

(2  j +1) *Exp[-B  j ( j+1) / (t*0.6950)]

hclR

"FIND FIT";

hclP

"you can normalize so that the first one is 1.00,Boltzman is the ratio between populations --> that will not change the fit results";
"the advantage is that your numbersical scale will be similar (around 1) for all calculations

hclP0={{13,0.9750000000000014`/52.5287`},{12,3.2623999999999995`/52.5287`},{11,7.469299999999997`/52.5287`},{10,13.322299999999998`/52.5287`},{9,21.2339`/52.5287`},{8,30.304000000000002`/52.5287`},{7,39.433`/52.5287`},{6,46.2374`/52.5287`},{5,51.5796`/52.5287`},{4,54.5158`/52.5287`},{3,55.5691`/52.5287`},{2,55.3974`/52.5287`},{1,52.5287`/52.5287`}}

hclP0

ListPlot[hclP0]

"norm with correct T:in order to get the fit closer to the experimental numerical scale domain and make it easier to search,  ";

"if you use j=1 and the temperature t=298K  you will get the norm:

(2  1 + 1) *Exp[-B  1 ( 1 + 1) / (289*0.6950)]

"the sytax for the fitting nonlinear function OF ANY FORM is simple. Here we use only two parameters after we focused the scale closer to the actual numerical values expected (as calculated by the known temperature value t=298 K):

FindFit[hclP0, {a + (1/2.71567) (2  j + 1) *Exp[-B  j ( j + 1) / (t*0.6950)]},{a,t}, j]

B

Indeed, the temperature is 304 K very close to the room tempearture where experiment took place!!!!!!!!!!!!!!
" we added a to allow for the correction factor as we did not take into account the dipole transition element

FindFit[hclP0, { b (1/2.71567) (2  j + 1) *Exp[-B  j ( j + 1) / (t*0.6950)]},{b,t}, j]

273+27

"another norm does not change result significantly

n0=(2  1 + 1) *Exp[-B  1 ( 1 + 1) / (300*0.6950)]

FindFit[hclP0, {a + (1/n0) (2  j + 1) *Exp[- B  j ( j + 1) / (t*0.6950)]},{a,t}, j]

303-273

"log issues;used earlier not that precise, assumption is Exponential behaviour of Boltzman (not !!}

"IF  INTERESTED IN CONCENTRATIONS make sue that you do it right
if you have loged do it on both sides";

hclP0log={{13,Log[0.018561281737412148`]},{12,Log[0.06210700055398286`]},{11,Log[0.1421946478782075`]},{10,Log[0.2536194499387953`]},{9,Log[0.40423425670157453`]},{8,Log[0.5769036736108071`]},{7,Log[0.7506943823090996`]},{6,Log[0.880231187902994`]},{5,Log[0.9819317820543817`]},{4,Log[1.0378288440414478`]},{3,Log[1.0578807394814644`]},{2,Log[1.054612050174476`]},{1,Log[1.`]}}

n00=(2  1 + 1) *Exp[-B  1 ( 1 + 1) / (290*0.6950)]

B=10.5

FindFit[hclP0log, { a* Log[(1/n00) (2  j + 1) *Exp[- B  j ( j + 1) / (t*0.6950)]]},{a,t}, j]

v

FindFit[hclP0log, { a * (1/Log[(n00)]) Log[(2  j + 1) *Exp[- B  j ( j + 1) / (t*0.6950)]]},{a,t}, j]

10^0.6946770830909051`