Mathematica tool HCl FTIR

How to get data from files, put your file path  instead!!!!!!!

1- Change the file path:
SetDirectory["C:\PC07f"]

SetDirectory["C:\Documents and Settings\Chemistry\Desktop"]

2- reade the original file hcl from FTIR experiment

hcl=Import["hcl.txt", "Table"]

3- check if the file has unusual characters, blanks, {}  ---> IF YES delete them

hcl={{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`}}

4-

5a - call packet regression

<<LinearRegression`;

5- test regress, and other fit functions

Regress[{{1,2},{3,5},{4,9}},{x},{x}]

6-  convert your data pairs into m (J quantum number vs energy pairs (see textbook J--> M, graphs)

-->we have x and y values, may  include repeated observations 
--> CAREFUL what is x what is y

hcl

First raw data

dplot=ListPlot[hcl,Ticks->{Automatic,Automatic},PlotRange->All,AxesLabel->{"x","Y"},PlotJoined->False]

Now go and read what you need for the HCl - and  quantum numbers

Prepare your HCl and DCl files for analysis

MAKE HCL  M 0file,   where pairs are {m-number, energy}   , check your m assigned values by comparing the transitions on the graph from experiment

hclm=Import["hclm.txt", "Table"]

Dimensions[hclm]

8- Plot the hclm pairs and eliminate points that may be out of the "well-bbehaved analytical function"

dplota=ListPlot[hclm,Ticks->{Automatic,Automatic},PlotRange->All,AxesLabel->{"m","frequency in cm-1"},PlotJoined->False]

In this example last for points are not part of the analitical continuous behavior

hclmc=Import["hclmc.txt", "Table"]

9- this is now the clean file hclmc for the model fit, such as  of equation (10 ) textbook

dplotb=ListPlot[hclmc,Ticks->{Automatic,Automatic},PlotRange->All,AxesLabel->{"m","frequency in cm-1"},PlotJoined->False]

10- Clearly function is not linear- line, so try polynomia

func1= Fit[hclmc, {1,x, x^2}, x]

Or you may try a longer model, higher order polynom

func2=Fit[hclmc,{1,x,x^2,x^3,x^4},x]

When analyzing results you also want to have uncertainties (errors), standard error (standard deviation of mean), t-statistics, - we start with the first model and its two parameters

hclmc

regressx=Regress[hclmc,{1,x,x^2},x]
Chop[regressx,10^(-6)]

also, you want predicted values, standard error for values and confidence intervals for predicted values

regress2 = Regress[hclmc, {1, x^2}, x,
RegressionReport ->
 {FitResiduals, SinglePredictionCITable,
 ParameterConfidenceRegion}]

11-   BUT YOUR TEXTBOOK suggest a 3rd order model (equation 10)

Similar approach is used for the second  (complete)model(see texbook, what is the order of fitting polynom?)

regresmodel=Regress[hclmc,{1,m,m^2,m^3},m];
Chop[regressc,10^(-6)]

YOU NOW HAVE quantitative values and uncertainties that you can associate with the model variables (eq 10)

regressmodel = Regress[hclmc, {1,m,m^2,m^3}, m,
RegressionReport ->
 {FitResiduals, SinglePredictionCITable,
 ParameterConfidenceRegion}]

YOU NOW HAVE quantitative values an d uncertainties that you can associate with the points

13- From these values you can calculate other physical variables, B, I, k, etc.

*some previous efforts , check what is correct

vo= 2884.85 cm^-1

a=0.303849 cm^-1

b = ((20.5496 + 2*0.303849)/2 ) cm^-1

d= 0.00206003/4 cm^-1

h = (6.626  * 10^-34) J * s

c = (2.998 * 10^10) cm/s

pi = 3.1415

\[Placeholder] (Subscript[I, m])= ((h)/(8*b*(pi^2)*c))

m1= 1.672622 *10^-27 kg

m2 = 5.888704 *10^-26 kg

m1+m2

μ = (m1 *m2)/(m1+m2)

r = (Sqrt[((Subscript[I, m])/μ)])

(Subscript[v, e ])= 2987.87 cm^-1

vx= 51.5129 cm^-1

k= (((Subscript[v, e ])* 2*pi*c)^2)* μ

(Subscript[v, e ])

μDCl = 3.1619 * 10^-27 kg

c

k DCl = ((vx * 2*pi*c)^2) * μDCl

IDCl = 2.647118 *10^-47 J*s^2

r2 = (Sqrt[(IDCl /μDCl)])

a = 0.0724494 cm^-1

b = 5.38695 cm^-1

d =