Clear["Global`*"];

(* import data from Desktop *)
path="C:\\Users\\evansr2\\";
SetDirectory[path<>"\\Desktop"];
FileNames[];
Data=Import["Improving the Quantitative Interpretation of diffusion-ordered NMR spectra - all data.xlsx"];

Clear[model, data, ρeff, Dexp,temp, T, visc, MW, MWs, α]
kB=1.380662 10^-23;
nA=6.022045 10^23;
nsolvents=5;

(*preparation for the presentation of data*)
imagesize={500,500};

square=Graphics[{EdgeForm[Thick],White,Polygon[{{-.01,-.01},{.01,-.01},{.01,.01},{-.01,.01}}]}];
squareR=Graphics[{Red, Polygon[{{-.01,-.01},{.01,-.01},{.01,.01},{-.01,.01}}]}];
squareR2=Graphics[{EdgeForm[Thin],LightRed,Polygon[{{-.01,-.01},{.01,-.01},{.01,.01},{-.01,.01}}]}];
squareO=Graphics[{Orange, Polygon[{{-.01,-.01},{.01,-.01},{.01,.01},{-.01,.01}}]}];
squareB=Graphics[{Black, Polygon[{{-.01,-.01},{.01,-.01},{.01,.01},{-.01,.01}}]}];
squareBl=Graphics[{Blue, Polygon[{{-.01,-.01},{.01,-.01},{.01,.01},{-.01,.01}}]}];
diamond=Graphics[{EdgeForm[Thick],White,Polygon[{{-.01,.0},{.0,.01},{.01,.0},{.0,-.01}}]}];
diamondBl=Graphics[{Black,Polygon[{{-.01,.0},{.0,.01},{.01,.0},{.0,-.01}}]}];
diamondP=Graphics[{Purple,Polygon[{{-.01,.0},{.0,.01},{.01,.0},{.0,-.01}}]}];
diamondB=Graphics[{Blue,Polygon[{{-.01,.0},{.0,.01},{.01,.0},{.0,-.01}}]}];
circle=Graphics[{EdgeForm[{Thick,Black}],Thickness[0.33],Circle[{0,0},1]}];
circleB=Graphics[{Black,Disk[{0,0},1]}];
triangle=Graphics[{EdgeForm[Thick],White,Polygon[{{0,1},{Sin[2 Pi/3],Cos[2 Pi/3]},{Sin[4 Pi/3],Cos[4 Pi/3]}}]}];
triangleB=Graphics[{Black,Polygon[{{0,1},{Sin[2 Pi/3],Cos[2 Pi/3]},{Sin[4 Pi/3],Cos[4 Pi/3]}}]}];
solidsquare=Graphics[Polygon[{{-.01,-.01},{.01,-.01},{.01,.01},{-.01,.01}}]];
soliddiamond=Graphics[Polygon[{{-.01,.0},{.0,.01},{.01,.0},{.0,-.01}}]];

plotmarkersD={diamondB,0.025};
plotmarkersDRE={squareR,0.02};
plotmarkersD2={squareR2,0.02};
plotmarkersDRE2={squareB,0.02};
plotmarkersDvsD={{diamondB,0.025}, {squareR,0.02}};
plotmarkersCDCl3={diamond, 0.025};
plotmarkersD2O={square, 0.018};
plotmarkersTOL={circle, 0.02};
plotmarkersDMSO={triangle, 0.02};
plotmarkersPURE={squareB,0.02};
plotmarkersBENZ={triangleB, 0.02};
plotmarkersTHF={circleB, 0.02};
plotmarkersCYC={diamondBl, 0.02};
plotmarkersC298D2O={squareO,0.018};
plotmarkersC303D2O={squareR,0.018};
plotmarkersC298CDCl3={diamondB, 0.025};
plotmarkersC303CDCl3={diamondP, 0.025};
plotmarkersC={{squareO,0.018}, {squareR,0.018}, {diamondB, 0.025}, {diamondP, 0.025}};
plotmarkersV={{diamond,.023},{square,.023},{triangle,.03},{solidsquare,.022},{soliddiamond,.03}};

drange={{0,50},{0,50}};
deldrange={{0,1500},{-70,70}};
deldrange2={{0,50},{-70,70}};
dvrange={{0,25},{0,25}};
dvranges={{0,2.5 10^1},{0,2.5 10^1}};

slope45=Plot[Tooltip[x,"theoretical line"],{x,0,50},AspectRatio->1,ImageSize->imagesize,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.003],LabelStyle->18];
line25mw=Plot[Tooltip[25,"theoretical line"],{x,0,1500},AspectRatio->1,ImageSize->imagesize,PlotStyle->{Black,Dashed,Thickness[0.003]},AxesStyle->Thickness[0.003],LabelStyle->18];
linem25mw=Plot[Tooltip[-25,"theoretical line"],{x,0,1500},AspectRatio->1,ImageSize->imagesize,PlotStyle->{Black,Dashed,Thickness[0.003]},AxesStyle->Thickness[0.003],LabelStyle->18];
line25d=Plot[Tooltip[25,"theoretical line"],{x,0,50},AspectRatio->1,ImageSize->imagesize,PlotStyle->{Black,Dashed,Thickness[0.003]},AxesStyle->Thickness[0.003],LabelStyle->18];
linem25d=Plot[Tooltip[-25,"theoretical line"],{x,0,50},AspectRatio->1,ImageSize->imagesize,PlotStyle->{Black,Dashed,Thickness[0.003]},AxesStyle->Thickness[0.003],LabelStyle->18];


(*optimising rho_eff from original data set*)

(*original Dexp*)
Dexp={Data[[1, 2, 12]]};
For[i=3, i≤109,i++, Dexp=AppendTo[Dexp, Data[[1, i, 12]]]];

(*original T data*)
T={Data[[1, 2, 4]]};
For[i=3, i≤109,i++, T=AppendTo[T, Data[[1, i, 4]]]];
T;

(*original visc data*)
visc={Data[[1, 2, 8]]};
For[i=3, i≤109,i++, visc=AppendTo[visc, Data[[1, i, 8]]]];
visc;

(*original MW data*)
MW={Data[[1, 2, 6]]};
For[i=3, i≤109,i++, MW=AppendTo[MW, Data[[1, i, 6]]]];
MW;

(*original MWs data*)
MWs={Data[[1, 2, 7]]};
For[i=3, i≤109,i++, MWs=AppendTo[MWs, Data[[1, i, 7]]]];
MWs;

α={(MWs[[1]]/MW[[1]])^(1/3)};
For[i=2, i≤108,i++, α=AppendTo[α, (MWs[[i]]/MW[[i]])^(1/3)]];

data={{MW[[1]], MWs[[1]], visc[[1]], T[[1]], Dexp[[1]]}};
For[i=2, i≤108,i++,data=AppendTo[data, { MW[[i]], MWs[[i]], visc[[i]],T[[i]], Dexp[[i]]}]];
data;
nd=Length[data];


Clear[model]
α=(mws/mw)^(1/3);
model=10^10(kB temp((1.5α)+(1/(1+α))))/(6 Pi η (0.003mw/(4000 Pi ρeff nA))^(1/3));
Print["original model"]
model;


Print["fitting to find effective density, in g (cm^(-3)), using the original data set"];
sol=NonlinearModelFit[data,model, ρeff,{mw, mws,η, temp} ,MaxIterations->5000];
sol["BestFitParameters"];
sol["ParameterTable"] ;

Print["reducing (Dexp-Dcalc)/Dcalc) - this is the effective density optimised for the original data set of 108 measurements"];
ratiovar=Sum[(((data[[i,5]]-model/.{mw-> data[[i,1]] ,mws-> data[[i,2]],η->  data[[i,3]], temp->  data[[i,4]]})/( model/.{mw-> data[[i,1]],mws->  data[[i,2]],η->  data[[i,3]], temp->  data[[i,4]]})))^2,{i,1,Length[data]}];

minmodel=FindMinimum[ratiovar,ρeff];
ρeffoptorig=ρeff/.minmodel[[2]]  


Print["-----------------------------------------





"]
(*optimising rho_eff from complete data set*)

Clear[Dexp, T, visc, MW, MWs, α, data]
(*complete Dexp*)
Dexp={Data[[1, 2, 12]]};
For[i=3, i≤667,i++, Dexp=AppendTo[Dexp, Data[[1, i, 12]]]];

(*complete T data*)
T={Data[[1, 2, 4]]};
For[i=3, i≤667,i++, T=AppendTo[T, Data[[1, i, 4]]]];
T;

(*complete visc data*)
visc={Data[[1, 2, 8]]};
For[i=3, i≤667,i++, visc=AppendTo[visc, Data[[1, i, 8]]]];
visc;

(*complete MW data*)
MW={Data[[1, 2, 6]]};
For[i=3, i≤667,i++, MW=AppendTo[MW, Data[[1, i, 6]]]];
MW;

(*complete MWs data*)
MWs={Data[[1, 2, 7]]};
For[i=3, i≤667,i++, MWs=AppendTo[MWs, Data[[1, i, 7]]]];
MWs;

α={(MWs[[1]]/MW[[1]])^(1/3)};
For[i=2, i≤666,i++, α=AppendTo[α, (MWs[[i]]/MW[[i]])^(1/3)]];

data={{MW[[1]], MWs[[1]], visc[[1]], T[[1]], Dexp[[1]]}};
For[i=2, i≤666,i++,data=AppendTo[data, { MW[[i]], MWs[[i]], visc[[i]],T[[i]], Dexp[[i]]}]];
data;
nd=Length[data];


Clear[model]
α=(mws/mw)^(1/3);
model=10^10(kB temp((1.5α)+(1/(1+α))))/(6 Pi η (0.003mw/(4000Pi ρeff nA))^(1/3));
Print["original model"]
model;


Print["fitting to find effective density, in g (cm^(-3)),  using the complete data set - this should be higher than for the original one"];
sol=NonlinearModelFit[data,model, ρeff,{mw, mws,η, temp} ,MaxIterations->5000];
sol["BestFitParameters"];
sol["ParameterTable"] ;

Print["reducing (Dexp-Dcalc)/Dcalc) - this is the effective density optimised for the complete data set of 666 measurements"];
ratiovar2=Sum[(((data[[i,5]]-model/.{mw-> data[[i,1]] ,mws-> data[[i,2]],η->  data[[i,3]], temp->  data[[i,4]]})/( model/.{mw-> data[[i,1]],mws->  data[[i,2]],η->  data[[i,3]], temp->  data[[i,4]]})))^2,{i,1,Length[data]}];

minmodel2=FindMinimum[ratiovar2,ρeff];
ρeffoptfull=ρeff/.minmodel2[[2]] 
Print["-----------------------------------------

"]

(*D vs D plots using rho_eff from original data set*)

Clear[plotmarkers, names, legendmarkers]
plotmarkers={{diamond,.023},{square,.023},{triangle,.03},{solidsquare,.022},{soliddiamond,.03}};

names=Graphics[{{Text[Style["(Subscript[CDCl, 3])",SingleLetterItalics->False,18,FontFamily->Helvetica],{37.7,17}],
Text[Style["(Subscript[D, 2])O",18,SingleLetterItalics->False,FontFamily->Helvetica],{36.6,14}],Text[Style["[(Subscript[d, 6])]DMSO",18,SingleLetterItalics->False,FontFamily->Helvetica],{39.7,11}],Text[Style["[(Subscript[d, 8])]toluene",18,SingleLetterItalics->False,FontFamily->Helvetica],{39.9,8}],Text[Style["[(Subscript[d, 4])]methanol",18,SingleLetterItalics->False,FontFamily->Helvetica],{40.6,5}]}}];
legendmarkers=ListPlot[Table[{{33,20-(i+1)*3}},{i,0,4}],PlotRange->drange,AspectRatio->1,ImageSize->imagesize,PlotMarkers->plotmarkers,PlotStyle->{Thickness[0.003]},Axes->None];


(*subset of original data*)
Dcalcorig= {{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤108,i++, AppendTo[Dcalcorig,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

(*subset of original data, sorted by solvent*)
atestfitdataRE=Array[testfitdataRE,nsolvents];

j=0;  prevmw=0;
For[i=1,i≤nd,i++,If[data[[i,2]]!=prevmw,j++;testfitdataRE[j]= {{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] , temp->  data[[i,4]],ρeff->ρeffoptorig},data[[i,5]]}};,AppendTo[testfitdataRE[j],{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] , temp->  data[[i,4]],ρeff->ρeffoptorig},data[[i,5]]}];];prevmw=data[[i,2]];];

(*rest of literature data*)
Dcalclit= {{model/.{mw->data[[110,1]]  ,mws->data[[110,2]] ,η->  data[[110,3]] , temp->  data[[110,4]],ρeff->ρeffoptorig},data[[110,5]]}};
For[i=110,i≤666,i++, AppendTo[Dcalclit,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

DvsD=ListPlot[Dcalclit, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersD,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

DvsDRE=ListPlot[Dcalcorig,PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersDRE,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}}, FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];


DvsDRE2=ListPlot[Tooltip[atestfitdataRE],PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkers,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]}, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

Print["Plot of estimated D vs experimental D - original data set purging trimesic acid, new density, new viscosities, sorted by solvents - Figure not in manuscript
			This corresponds to the red data points in the image below"]
DvsDRE2plot=Show[DvsDRE2,slope45,legendmarkers,names]


namesDvsD=Graphics[{{Text[Style["original data set",24,FontFamily->"Helvetica"],{36.5,8.93}],Text[Style["literature data set",24,SingleLetterItalics->False,FontFamily->"Helvetica"],{37.25,6.13}]}}];
legendmarkersDvsD=ListPlot[Table[{{25,3.33+(i+1)*2.8}},{i,0,1}],PlotRange->drange,AspectRatio->1,ImageSize->imagesize,PlotMarkers->plotmarkersDvsD,PlotStyle->{Thickness[0.003]},Axes->None];
Print["Plot of calculated vs expected diffusion using model optimised with original data set - Figure 1 "]
DvDplot=Show[DvsD, DvsDRE, namesDvsD, legendmarkersDvsD, slope45]
Export["DvsD.jpg",DvDplot];
Export["DvsD.tiff",DvDplot];

Clear[allDcalc, dratios];
allDcalc= {{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤108,i++, AppendTo[allDcalc,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

dratios=Table[allDcalc[[i,2]]/allDcalc[[i,1]],{i,1,Length[allDcalc]}];

Print[Style["Summary of RMS errors for subsets of data",18,FontFamily->Helvetica]];

Print["RMS percentage deviation from ratio fit model using density optimised from original data set, applied to original data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[allDcalc]}]/Length[allDcalc])^(1/2)];

Clear[allDcalc, dratios];
allDcalc= {{model/.{mw->data[[109,1]]  ,mws->data[[109,2]] ,η->  data[[109,3]] , temp->  data[[109,4]],ρeff->ρeffoptorig},data[[109,5]]}};
For[i=110,i≤666,i++, AppendTo[allDcalc,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

dratios=Table[allDcalc[[i,2]]/allDcalc[[i,1]],{i,1,Length[allDcalc]}];

Print["RMS percentage deviation from ratio fit model using density optimised from original data set, applied to literature data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[allDcalc]}]/Length[allDcalc])^(1/2)];

Clear[allDcalc, dratiosALL];
allDcalc= {{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤666,i++, AppendTo[allDcalc,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

dratiosALL=Table[allDcalc[[i,2]]/allDcalc[[i,1]],{i,1,Length[allDcalc]}];

Print["RMS percentage deviation from ratio fit model using density optimised from original data set, applied to complete data set ",100 (Sum[(dratiosALL[[i]]-1)^2,{i,1,Length[allDcalc]}]/Length[allDcalc])^(1/2)];
Print["      


"]
(*draws TOC image*)
DvsD=ListPlot[Dcalclit, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersD2,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];


DvsDRE=ListPlot[Dcalcorig,PlotRange->drange,AspectRatio->0.88,ImageSize->{600,600}, PlotMarkers->plotmarkersDRE2,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}}, FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

legendmarkersDvsD=ListPlot[Table[{{25,3.33+(i+1)*2.8}},{i,0,1}],PlotRange->drange,AspectRatio->1,ImageSize->imagesize,PlotMarkers->plotmarkersDvsD,PlotStyle->{Thickness[0.003]},Axes->None];
Print["Plot of calculated vs expected diffusion using model optimised with original data set - for TOC"]
DvDplotTOC=Show[DvsD, DvsDRE, slope45]
Export["DvsDTOC.jpg",DvDplotTOC];
Export["DvsDTOC.tiff",DvDplotTOC];




(*draws delD/D vs MW and D plots*)

Clear[dratiosORIG, dratiosLIT, delDORIG, delDvsMWRE, dratiosALL];

dratiosORIG=Table[allDcalc[[i,2]]/allDcalc[[i,1]],{i,1,108}];
delDORIG=(dratiosORIG-1)*100; 

dratiosLIT=Table[allDcalc[[i,2]]/allDcalc[[i,1]],{i,109,666}];
delDLIT=(dratiosLIT-1)*100; 

dratiosALL=Table[allDcalc[[i,2]]/allDcalc[[i,1]],{i,1,666}];
delDALL=(dratiosALL-1)*100; 

Clear[MWRE, MW, DexpRE, Dexp]

(*obtain relevant data again*)
MWRE={Data[[1, 2, 6]]};
For[i=3, i≤109,i++, MWRE=AppendTo[MWRE, Data[[1, i, 6]]]];
MW={Data[[1, 110, 6]]};
For[i=111, i≤667,i++, MW=AppendTo[MW, Data[[1, i, 6]]]];
DexpRE={Data[[1, 2, 12]]};
For[i=3, i≤109,i++, DexpRE=AppendTo[DexpRE, Data[[1, i, 12]]]];
Dexp={Data[[1, 110, 12]]};
For[i=111, i≤667,i++, Dexp=AppendTo[Dexp, Data[[1, i, 12]]]];


delDvsMWRE=Partition[Riffle[MWRE, delDORIG], 2];
delDvsMW=Partition[Riffle[MW, delDLIT], 2];


delDvsMW=ListPlot[delDvsMW, PlotRange->deldrange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersD,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{ Style[ "MW", Italic], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

delDREvsMW=ListPlot[delDvsMWRE, PlotRange->deldrange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersDRE,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{Style[ "MW", Italic], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesDvsD=Graphics[{{Text[Style["literature data set",24,FontFamily->"Helvetica"],{1117.5,-56.6}],Text[Style["original data set",24,SingleLetterItalics->False,FontFamily->"Helvetica"],{1095,-48.2}]}}];

legendmarkersDvsD=ListPlot[Table[{{750,-65+(i+1)*8.4}},{i,0,1}],PlotRange->drange,AspectRatio->1,ImageSize->imagesize,PlotMarkers->plotmarkersDvsD,PlotStyle->{Thickness[0.003]},Axes->None];
Print["Plot of delta D vs molecular weight - Figure 2 upper"]
delDvMplot=Show[delDvsMW, delDREvsMW, namesDvsD, legendmarkersDvsD, line25mw, linem25mw]
Export["delDvM.jpg",delDvMplot];
Export["delDvM.tiff",delDvMplot];

delDvsDRE=Partition[Riffle[DexpRE, delDORIG], 2];
delDvsD=Partition[Riffle[Dexp, delDLIT], 2];

delDvsD=ListPlot[delDvsD, PlotRange->deldrange2,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersD,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}}, FrameLabel->{Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

delDvsDRE=ListPlot[delDvsDRE, PlotRange->deldrange2,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersDRE,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}}, FrameLabel->{Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesDvsD=Graphics[{{Text[Style["literature data set",24,FontFamily->"Helvetica"],{37.25,-56.6}],Text[Style["original data set",24,SingleLetterItalics->False,FontFamily->"Helvetica"],{36.5,-48.2}]}}];

legendmarkersDvsD=ListPlot[Table[{{25,-65+(i+1)*8.4}},{i,0,1}],PlotRange->drange,AspectRatio->1,ImageSize->imagesize,PlotMarkers->plotmarkersDvsD,PlotStyle->{Thickness[0.003]},Axes->None];
Print["Plot of delta D vs experimental D - Figure 2 lower"]
delDvDplot=Show[delDvsD, delDvsDRE, namesDvsD, legendmarkersDvsD, line25d, linem25d]
Export["delDvD.jpg",delDvDplot];
Export["delDvD.tiff",delDvDplot];

(*Histogram of data*)
HistHistAxes=Histogram[delDLIT, {-50,50,10}, AspectRatio->1,ImageSize->imagesize, ChartStyle->Black, PlotRange->{{-100,100},All}, Axes->{True,True}, AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];
HistREAxes=Histogram[delDORIG,{-50,50,10} , AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];
HistALLAxes=Histogram[delDALL,{-50,50,10}, AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

Print["histogram of delta D information - comparison of original and literature data sets - Figure SI.6"]
Hist=Show[HistHistAxes, HistREAxes]
Export["Hist.jpg",Hist];
Export["Hist.tiff",Hist];

Print["histogram of all delta D information - Figure not in manuscript"]
HistAll=Show[HistALLAxes]
Export["HistALL.jpg",HistAll];
Export["HistALL.tiff",HistAll];


Print["-----------------------------------------


"] 

(*D vs D plot for rho_eff from complete data set*)
(*currently not used in manuscript - see discussion section*)

(*subset of original data*)
DcalclitRE ={{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptfull},data[[1,5]]}};
For[i=2,i≤109,i++, AppendTo[DcalclitRE ,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptfull},data[[i,5]]}];];

(*rest of literature data*)
Dcalclit= {{model/.{mw->data[[110,1]]  ,mws->data[[110,2]] ,η->  data[[110,3]] , temp->  data[[110,4]],ρeff->ρeffoptfull},data[[110,5]]}};
For[i=110,i≤666,i++, AppendTo[Dcalclit,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptfull},data[[i,5]]}];];

DvsD=ListPlot[Dcalclit, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersD,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];


DvsDRE=ListPlot[DcalclitRE,PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersDRE,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}}, FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesDvsD=Graphics[{{Text[Style["original data set",24,FontFamily->"Helvetica"],{36.5,8.93}],Text[Style["literature data set",24,SingleLetterItalics->False,FontFamily->"Helvetica"],{37.25,6.13}]}}];
legendmarkersDvsD=ListPlot[Table[{{25,3.33+(i+1)*2.8}},{i,0,1}],PlotRange->drange,AspectRatio->1,ImageSize->imagesize,PlotMarkers->plotmarkersDvsD,PlotStyle->{Thickness[0.003]},Axes->None];
Print["Plot of calculated vs expected diffusion using model optimised with complete data set - Figure not currently used"]
DvDplotFULL=Show[DvsD, DvsDRE, namesDvsD, legendmarkersDvsD, slope45]
Export["DvsD_fullopt.jpg",DvDplotFULL];
Export["DvsD_fullopt.tiff",DvDplotFULL];

Clear[allDcalc, allDcalc2, dratios];
allDcalc2= {{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptfull},data[[1,5]]}};
For[i=2,i≤666,i++, AppendTo[allDcalc2,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptfull},data[[i,5]]}];];

dratios=Table[allDcalc2[[i,2]]/allDcalc2[[i,1]],{i,1,Length[allDcalc2]}];

Print["RMS percentage deviation from ratio fit model, using optimised density from complete data set, and complete data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[allDcalc2]}]/Length[allDcalc2])^(1/2)];

Print["-----------------------------------------

"]

(*individual D vs D plots for most common solvents*)
(*strip out individual subset of data for CDCl3*)

(*CDCl3 Dexp*)
CDCl3Dexp={Data[[1, 2, 12]]};
For[i=3, i≤25,i++, CDCl3Dexp=AppendTo[CDCl3Dexp, Data[[1, i, 12]]]];
For[i= 199, i≤ 203,i++, CDCl3Dexp=AppendTo[CDCl3Dexp, Data[[1, i, 12]]]];
For[i= 343, i≤ 374,i++, CDCl3Dexp=AppendTo[CDCl3Dexp, Data[[1, i, 12]]]];
For[i= 516, i≤ 667,i++, CDCl3Dexp=AppendTo[CDCl3Dexp, Data[[1, i, 12]]]];



(*CDCl3 T data*)
CDCl3T={Data[[1, 2, 4]]};
For[i=3, i≤25,i++, CDCl3T=AppendTo[CDCl3T, Data[[1, i, 4]]]];
For[i= 199, i≤ 203,i++, CDCl3T=AppendTo[CDCl3T, Data[[1, i,4]]]];
For[i= 343, i≤ 374,i++, CDCl3T=AppendTo[CDCl3T, Data[[1, i,4]]]];
For[i= 516, i≤ 667,i++, CDCl3T=AppendTo[CDCl3T, Data[[1, i, 4]]]];


(*CDCl3 visc data*)
CDCl3visc={Data[[1, 2, 8]]};
For[i=3, i≤25,i++, CDCl3visc=AppendTo[CDCl3visc, Data[[1, i, 8]]]];
For[i= 199, i≤ 203,i++, CDCl3visc=AppendTo[CDCl3visc, Data[[1, i,8]]]];
For[i= 343, i≤ 374,i++, CDCl3visc=AppendTo[CDCl3visc, Data[[1, i,8]]]];
For[i= 516, i≤ 667,i++, CDCl3visc=AppendTo[CDCl3visc, Data[[1, i, 8]]]];


(*CDCl3 MW data*)
CDCl3MW={Data[[1, 2, 6]]};
For[i=3, i≤25,i++, CDCl3MW=AppendTo[CDCl3MW, Data[[1, i, 6]]]];
For[i= 199, i≤ 203,i++, CDCl3MW=AppendTo[CDCl3MW, Data[[1, i,6]]]];
For[i= 343, i≤ 374,i++,CDCl3MW=AppendTo[CDCl3MW, Data[[1, i,6]]]];
For[i= 516, i≤ 667,i++, CDCl3MW=AppendTo[CDCl3MW, Data[[1, i, 6]]]];


(*original MWs data*)
CDCl3MWs={Data[[1, 2, 7]]};
For[i=3, i≤25,i++, CDCl3MWs=AppendTo[CDCl3MWs, Data[[1, i, 7]]]];
For[i= 199, i≤ 203,i++, CDCl3MWs=AppendTo[CDCl3MWs, Data[[1, i,7]]]];
For[i= 343, i≤ 374,i++,CDCl3MWs=AppendTo[CDCl3MWs, Data[[1, i,7]]]];
For[i= 516, i≤ 667,i++, CDCl3MWs=AppendTo[CDCl3MWs, Data[[1, i, 7]]]];

Clear[data]
ndCDCl3=Length[CDCl3MWs];
data={{CDCl3MW[[1]], CDCl3MWs[[1]], CDCl3visc[[1]], CDCl3T[[1]], CDCl3Dexp[[1]]}};
For[i=2, i≤ndCDCl3,i++,data=AppendTo[data, { CDCl3MW[[i]], CDCl3MWs[[i]], CDCl3visc[[i]],CDCl3T[[i]], CDCl3Dexp[[i]]}]];


(*CDCl3*)
DiffusionDataCDCl3 ={{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤ndCDCl3,i++, AppendTo[DiffusionDataCDCl3,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];


PlotCDCl3=ListPlot[DiffusionDataCDCl3, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersCDCl3,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}} ,FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesCDCl3=Graphics[{{Text[Style["(a) (Subscript[CDCl, 3])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{10,45}]}}];
Print["Plot of estimated D vs experimental D - (Subscript[CDCl, 3]) - Figure SI.7a"]
DCDCl3=Show[PlotCDCl3,  slope45, namesCDCl3]
Export["DvsDCDCl3.jpg",DCDCl3];
Export["DvsDCDCl3.tiff",DCDCl3];

Clear[dratios, dratiosCDCl3]
dratiosCDCl3=Table[DiffusionDataCDCl3 [[i,2]]/DiffusionDataCDCl3 [[i,1]],{i,1,Length[DiffusionDataCDCl3 ]}];
delDCDCl3=(100*(dratiosCDCl3-1));

HistDCDCl3=Histogram[delDCDCl3,{-50,50,10} , AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

labelCDCl3=Graphics[{{Text[Style["(a) (Subscript[CDCl, 3])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{50,75}]}}];
HistCDCl3=Show[HistDCDCl3, labelCDCl3]
Export["HistCDCl3.jpg",HistCDCl3];
Export["HistCDCl3.tiff",HistCDCl3];

Print["RMS percentage deviation from ratio fit model for CDCl3 using optimisation to original data set ",100 (Sum[(dratiosCDCl3[[i]]-1)^2,{i,1,Length[DiffusionDataCDCl3 ]}]/Length[DiffusionDataCDCl3 ])^(1/2)];
Print["-----------------------------------------

"]
(*strip out individual subset of data for D2O*)

(*D2O Dexp*)
D2ODexp={Data[[1, 26, 12]]};
For[i=27, i≤43,i++, D2ODexp=AppendTo[D2ODexp, Data[[1, i, 12]]]];
For[i= 110, i≤ 113,i++, D2ODexp=AppendTo[D2ODexp, Data[[1, i, 12]]]];
For[i= 117, i≤ 119,i++, D2ODexp=AppendTo[D2ODexp, Data[[1, i, 12]]]];
For[i= 121, i≤ 122,i++, D2ODexp=AppendTo[D2ODexp, Data[[1, i, 12]]]];
For[i= 124, i≤ 136,i++, D2ODexp=AppendTo[D2ODexp, Data[[1, i, 12]]]];
For[i= 169, i≤ 175,i++, D2ODexp=AppendTo[D2ODexp, Data[[1, i, 12]]]];
For[i= 180, i≤ 189,i++, D2ODexp=AppendTo[D2ODexp, Data[[1, i, 12]]]];
For[i= 468, i≤515,i++, D2ODexp=AppendTo[D2ODexp, Data[[1, i, 12]]]];
D2ODexp=AppendTo[D2ODexp, Data[[1, 377, 12]]];
D2ODexp=AppendTo[D2ODexp, Data[[1, 466, 12]]];


(*D2O T data*)
D2OT={Data[[1, 26, 4]]};
For[i=27, i≤43,i++, D2OT=AppendTo[D2OT, Data[[1, i,4]]]];
For[i= 110, i≤ 113,i++, D2OT=AppendTo[D2OT, Data[[1, i, 4]]]];
For[i= 117, i≤ 119,i++, D2OT=AppendTo[D2OT, Data[[1, i, 4]]]];
For[i= 121, i≤ 122,i++, D2OT=AppendTo[D2OT, Data[[1, i, 4]]]];
For[i= 124, i≤ 136,i++, D2OT=AppendTo[D2OT, Data[[1, i, 4]]]];
For[i= 169, i≤ 175,i++, D2OT=AppendTo[D2OT, Data[[1, i, 4]]]];
For[i= 180, i≤ 189,i++, D2OT=AppendTo[D2OT, Data[[1, i, 4]]]];
For[i= 468, i≤515,i++, D2OT=AppendTo[D2OT, Data[[1, i, 4]]]];
D2OT=AppendTo[D2OT, Data[[1, 377, 4]]];
D2OT=AppendTo[D2OT, Data[[1, 466, 4]]];

(*D2O visc data*)
D2Ovisc={Data[[1,26, 8]]};
For[i=27, i≤43,i++, D2Ovisc=AppendTo[D2Ovisc, Data[[1, i, 8]]]];
For[i= 110, i≤ 113,i++, D2Ovisc=AppendTo[D2Ovisc, Data[[1, i,  8]]]];
For[i= 117, i≤ 119,i++, D2Ovisc=AppendTo[D2Ovisc, Data[[1, i,  8]]]];
For[i= 121, i≤ 122,i++, D2Ovisc=AppendTo[D2Ovisc, Data[[1, i,  8]]]];
For[i= 124, i≤ 136,i++, D2Ovisc=AppendTo[D2Ovisc, Data[[1, i,  8]]]];
For[i= 169, i≤ 175,i++, D2Ovisc=AppendTo[D2Ovisc, Data[[1, i,  8]]]];
For[i= 180, i≤ 189,i++, D2Ovisc=AppendTo[D2Ovisc, Data[[1, i,  8]]]];
For[i= 468, i≤515,i++, D2Ovisc=AppendTo[D2Ovisc, Data[[1, i,  8]]]];
D2Ovisc=AppendTo[D2Ovisc, Data[[1, 377,  8]]];
D2Ovisc=AppendTo[D2Ovisc, Data[[1, 466,  8]]];

(*D2O MW data*)
D2OMW={Data[[1, 26, 6]]};
For[i=27, i≤43,i++, D2OMW=AppendTo[D2OMW, Data[[1, i, 6]]]];
For[i= 110, i≤ 113,i++, D2OMW=AppendTo[D2OMW, Data[[1, i,  6]]]];
For[i= 117, i≤ 119,i++, D2OMW=AppendTo[D2OMW, Data[[1, i,  6]]]];
For[i= 121, i≤ 122,i++, D2OMW=AppendTo[D2OMW, Data[[1, i,  6]]]];
For[i= 124, i≤ 136,i++, D2OMW=AppendTo[D2OMW, Data[[1, i,  6]]]];
For[i= 169, i≤ 175,i++, D2OMW=AppendTo[D2OMW, Data[[1, i,  6]]]];
For[i= 180, i≤ 189,i++, D2OMW=AppendTo[D2OMW, Data[[1, i,  6]]]];
For[i= 468, i≤515,i++, D2OMW=AppendTo[D2OMW, Data[[1, i,  6]]]];
D2OMW=AppendTo[D2OMW, Data[[1, 377,  6]]];
D2OMW=AppendTo[D2OMW, Data[[1, 466,  6]]];


(*D2O MWs data*)
D2OMWs={Data[[1, 26, 7]]};
For[i=27, i≤43,i++, D2OMWs=AppendTo[D2OMWs, Data[[1, i, 7]]]];
For[i= 110, i≤ 113,i++, D2OMWs=AppendTo[D2OMWs, Data[[1, i,  7]]]];
For[i= 117, i≤ 119,i++, D2OMWs=AppendTo[D2OMWs, Data[[1, i,  7]]]];
For[i= 121, i≤ 122,i++, D2OMWs=AppendTo[D2OMWs, Data[[1, i, 7]]]];
For[i= 124, i≤ 136,i++, D2OMWs=AppendTo[D2OMWs, Data[[1, i,  7]]]];
For[i= 169, i≤ 175,i++, D2OMWs=AppendTo[D2OMWs, Data[[1, i,  7]]]];
For[i= 180, i≤ 189,i++, D2OMWs=AppendTo[D2OMWs, Data[[1, i,  7]]]];
For[i= 468, i≤515,i++, D2OMWs=AppendTo[D2OMWs, Data[[1, i,  7]]]];
D2OMWs=AppendTo[D2OMWs, Data[[1, 377,  7]]];
D2OMWs=AppendTo[D2OMWs, Data[[1, 466, 7]]];

Clear[nd];
nd=Length[D2ODexp];
Clear[data];
data={{D2OMW[[1]], D2OMWs[[1]],D2Ovisc[[1]], D2OT[[1]], D2ODexp[[1]]}};
For[i=2, i≤nd,i++,data=AppendTo[data, { D2OMW[[i]], D2OMWs[[i]],D2Ovisc[[i]],D2OT[[i]], D2ODexp[[i]]}]];


(*D2O calcualted data*)
DiffusionDataD2O={{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤nd,i++, AppendTo[DiffusionDataD2O,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

PlotD2O=ListPlot[DiffusionDataD2O, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersD2O,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}} ,FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesD2O=Graphics[{{Text[Style["(b) (Subscript[D, 2])O",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{10,45}]}}];

Print["Plot of estimated D vs experimental D (Subscript[D, 2])O - Figure SI.7b"]
DD2O=Show[PlotD2O,  slope45, namesD2O]
Export["DvsDD2O.jpg",DD2O];
Export["DvsDD2O.tiff",DD2O];

dratios=Table[DiffusionDataD2O [[i,2]]/DiffusionDataD2O [[i,1]],{i,1,Length[DiffusionDataD2O ]}];
delDD2O=(100*(dratios-1));

HistD2O=Histogram[delDD2O,{-50,50,10} , AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

labelD2O=Graphics[{{Text[Style["(b) D2O",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{50,75}]}}];
HistD2O=Show[HistD2O, labelD2O]
Export["HistD2O.jpg",HistD2O];
Export["HistD2O.tiff",HistD2O];

Print["RMS percentage deviation from ratio fit model for D2O using optimisation to original data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[DiffusionDataD2O ]}]/Length[DiffusionDataD2O ])^(1/2)];
Print["-----------------------------------------

"]
(*strip out individual subset of data for DMSOd6*)

(*DMSOd6 Dexp*)
DMSOd6Dexp={Data[[1, 44, 12]]};
For[i=45, i≤68,i++, DMSOd6Dexp=AppendTo[DMSOd6Dexp, Data[[1, i, 12]]]];
For[i= 247, i≤ 280,i++, DMSOd6Dexp=AppendTo[DMSOd6Dexp, Data[[1, i, 12]]]];
DMSOd6Dexp=AppendTo[DMSOd6Dexp, Data[[1, 123, 12]]];


(*DMSOd6 T data*)
DMSOd6T={Data[[1, 44, 4]]};
For[i=45, i≤68,i++, DMSOd6T=AppendTo[DMSOd6T, Data[[1, i,4]]]];
For[i= 247, i≤ 280,i++, DMSOd6T=AppendTo[DMSOd6T, Data[[1, i, 4]]]];
DMSOd6T=AppendTo[DMSOd6T, Data[[1, 123, 4]]];


(*DMSOd6 visc data*)
DMSOd6visc={Data[[1,44, 8]]};
For[i=45, i≤68,i++, DMSOd6visc=AppendTo[DMSOd6visc, Data[[1, i, 8]]]];
For[i= 247, i≤ 280,i++, DMSOd6visc=AppendTo[DMSOd6visc, Data[[1, i,  8]]]];
DMSOd6visc=AppendTo[DMSOd6visc, Data[[1, 123,  8]]];

(*DMSOd6 MW data*)
DMSOd6MW={Data[[1, 44, 6]]};
For[i=45, i≤68,i++, DMSOd6MW=AppendTo[DMSOd6MW, Data[[1, i, 6]]]];
For[i= 247, i≤ 280,i++, DMSOd6MW=AppendTo[DMSOd6MW, Data[[1, i,  6]]]];
DMSOd6MW=AppendTo[DMSOd6MW, Data[[1, 123,  6]]];


(*DMSOd6 MW data*)
DMSOd6MWs={Data[[1, 44, 7]]};
For[i=45, i≤68,i++, DMSOd6MWs=AppendTo[DMSOd6MWs, Data[[1, i, 7]]]];
For[i= 247, i≤ 280,i++, DMSOd6MWs=AppendTo[DMSOd6MWs, Data[[1, i,  7]]]];
DMSOd6MWs=AppendTo[DMSOd6MWs, Data[[1, 123,  7]]];

Clear[nd];
nd=Length[DMSOd6Dexp];
Clear[data];
data={{DMSOd6MW[[1]], DMSOd6MWs[[1]],DMSOd6visc[[1]], DMSOd6T[[1]], DMSOd6Dexp[[1]]}};
For[i=2, i≤nd,i++,data=AppendTo[data, { DMSOd6MW[[i]], DMSOd6MWs[[i]],DMSOd6visc[[i]],DMSOd6T[[i]], DMSOd6Dexp[[i]]}]];


(*DMSOd6 calculated data*)
DiffusionDataDMSOd6={{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤nd,i++, AppendTo[DiffusionDataDMSOd6,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

PlotDMSOd6=ListPlot[DiffusionDataDMSOd6, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersDMSO,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}} ,FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesDMSOd6=Graphics[{{Text[Style["(c) DMSO-(Subscript[d, 6])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{10,45}]}}];

Print["Plot of estimated D vs experimental D - DMSO-(Subscript[d, 6]) - Figure SI.7c"]
DDMSOd6=Show[PlotDMSOd6,  slope45, namesDMSOd6]
Export["DvsDDMSOd6.jpg",DDMSOd6];
Export["DvsDDMSOd6.tiff",DDMSOd6];

Clear[dratios]
dratios=Table[DiffusionDataDMSOd6 [[i,2]]/DiffusionDataDMSOd6 [[i,1]],{i,1,Length[DiffusionDataDMSOd6 ]}];
delDDMSOd6=(100*(dratios-1)); 

HistDMSOd6=Histogram[delDDMSOd6,{-50,50,10} , AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

labelDMSOd6=Graphics[{{Text[Style["(c) DMSO-(Subscript[d, 6])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{50,75}]}}];
HistDMSOd6=Show[HistDMSOd6, labelDMSOd6]
Export["HistDMSOd6.jpg",HistDMSOd6];
Export["HistDMSOd6.tiff",HistDMSOd6];

Print["RMS percentage deviation from ratio fit model for DMSO-(Subscript[d, 6]) using optimisation to original data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[DiffusionDataDMSOd6 ]}]/Length[DiffusionDataDMSOd6])^(1/2)];
Print["-----------------------------------------

"]

(*strip out individual subset of data for Told8*)

(*Told8 Dexp*)
Told8Dexp={Data[[1,69, 12]]};
For[i=70, i≤89,i++, Told8Dexp=AppendTo[Told8Dexp, Data[[1, i, 12]]]];
For[i= 137, i≤ 152,i++, Told8Dexp=AppendTo[Told8Dexp, Data[[1, i, 12]]]];
For[i= 176, i≤ 179,i++, Told8Dexp=AppendTo[Told8Dexp, Data[[1, i, 12]]]];
For[i= 190, i≤ 193,i++, Told8Dexp=AppendTo[Told8Dexp, Data[[1, i, 12]]]];
For[i= 239, i≤ 246,i++, Told8Dexp=AppendTo[Told8Dexp, Data[[1, i, 12]]]];
Told8Dexp=AppendTo[Told8Dexp, Data[[1, 390, 12]]];

(*Told8 T data*)
Told8T={Data[[1,69, 4]]};
For[i=70, i≤89,i++, Told8T=AppendTo[Told8T, Data[[1, i, 4]]]];
For[i= 137, i≤ 152,i++, Told8T=AppendTo[Told8T, Data[[1, i, 4]]]];
For[i= 176, i≤ 179,i++, Told8T=AppendTo[Told8T, Data[[1, i, 4]]]];
For[i= 190, i≤ 193,i++, Told8T=AppendTo[Told8T, Data[[1, i, 4]]]];
For[i= 239, i≤ 246,i++, Told8T=AppendTo[Told8T, Data[[1, i, 4]]]];
Told8T=AppendTo[Told8T, Data[[1, 390, 4]]];

(*Told8 visc data*)
Told8visc={Data[[1, 69, 8]]};
For[i=70, i≤89,i++, Told8visc=AppendTo[Told8visc, Data[[1, i, 8]]]];
For[i= 137, i≤ 152,i++, Told8visc=AppendTo[Told8visc, Data[[1, i, 8]]]];
For[i= 176, i≤ 179,i++, Told8visc=AppendTo[Told8visc, Data[[1, i, 8]]]];
For[i= 190, i≤ 193,i++, Told8visc=AppendTo[Told8visc, Data[[1, i, 8]]]];
For[i= 239, i≤ 246,i++, Told8visc=AppendTo[Told8visc, Data[[1, i, 8]]]];
Told8visc=AppendTo[Told8visc, Data[[1, 390, 8]]];

(*Told8 MW data*)
Told8MW={Data[[1,69, 6]]};
For[i=70, i≤89,i++, Told8MW=AppendTo[Told8MW, Data[[1, i, 6]]]];
For[i= 137, i≤ 152,i++, Told8MW=AppendTo[Told8MW, Data[[1, i, 6]]]];
For[i= 176, i≤ 179,i++, Told8MW=AppendTo[Told8MW, Data[[1, i,6]]]];
For[i= 190, i≤ 193,i++, Told8MW=AppendTo[Told8MW, Data[[1, i, 6]]]];
For[i= 239, i≤ 246,i++, Told8MW=AppendTo[Told8MW, Data[[1, i,6]]]];
Told8MW=AppendTo[Told8MW, Data[[1, 390, 6]]];

(*Told8 MWs data*)
Told8MWs={Data[[1, 69, 7]]};
For[i=70, i≤89,i++, Told8MWs=AppendTo[Told8MWs, Data[[1, i, 7]]]];
For[i= 137, i≤ 152,i++, Told8MWs=AppendTo[Told8MWs, Data[[1, i, 7]]]];
For[i= 176, i≤ 179,i++, Told8MWs=AppendTo[Told8MWs, Data[[1, i,7]]]];
For[i= 190, i≤ 193,i++, Told8MWs=AppendTo[Told8MWs, Data[[1, i, 7]]]];
For[i= 239, i≤ 246,i++, Told8MWs=AppendTo[Told8MWs, Data[[1, i,7]]]];
Told8MWs=AppendTo[Told8MWs, Data[[1, 390, 7]]];

Clear[nd];
nd=Length[Told8Dexp];
Clear[data];
data={{Told8MW[[1]], Told8MWs[[1]],Told8visc[[1]], Told8T[[1]], Told8Dexp[[1]]}};
For[i=2, i≤nd,i++,data=AppendTo[data, { Told8MW[[i]], Told8MWs[[i]],Told8visc[[i]],Told8T[[i]], Told8Dexp[[i]]}]];


(*Told8 calcualted data*)
DiffusionDataTold8={{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤nd,i++, AppendTo[DiffusionDataTold8,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

PlotTold8=ListPlot[DiffusionDataTold8, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersTOL,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}} ,FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesTold8=Graphics[{{Text[Style["(d) toluene-(Subscript[d, 8])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{10,45}]}}];

Print["Plot of estimated D vs experimental D - toluene-(Subscript[d, 8]) - Figure SI.7d"]
DTold8=Show[PlotTold8,  slope45, namesTold8]
Export["DvsDTold8.jpg",DTold8];
Export["DvsDTold8.tiff",DTold8];

Clear[dratios]
dratios=Table[DiffusionDataTold8 [[i,2]]/DiffusionDataTold8[[i,1]],{i,1,Length[DiffusionDataTold8 ]}];
delDTold8=(100*(dratios-1));

HistTold8=Histogram[delDTold8,{-50,50,10} , AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

labelTold8=Graphics[{{Text[Style["(d) toluene-(Subscript[d, 8])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{50,75}]}}];
HistTold8=Show[HistTold8, labelTold8]
Export["HistTold8.jpg",HistTold8];
Export["HistTold8.tiff",HistTold8];

Print["RMS percentage deviation from ratio fit model for toluene-(Subscript[d, 8]) using optimisation to original data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[DiffusionDataTold8]}]/Length[DiffusionDataTold8])^(1/2)];
Print["-----------------------------------------

"]

(*strip out individual subset of data for Benzene-d6*)

(*Benzd6 Dexp*)
Benzd6Dexp={Data[[1, 194, 12]]};
For[i=195, i≤198,i++,Benzd6Dexp=AppendTo[Benzd6Dexp, Data[[1, i, 12]]]];
For[i= 311, i≤342,i++,Benzd6Dexp=AppendTo[Benzd6Dexp, Data[[1, i, 12]]]];
Benzd6Dexp=AppendTo[Benzd6Dexp, Data[[1, 388, 12]]];
Benzd6Dexp=AppendTo[Benzd6Dexp, Data[[1, 467, 12]]];



(*Benzd6 T*)
Benzd6T={Data[[1, 194, 4]]};
For[i=195, i≤198,i++,Benzd6T=AppendTo[Benzd6T, Data[[1, i, 4]]]];
For[i= 311, i≤342,i++,Benzd6T=AppendTo[Benzd6T, Data[[1, i, 4]]]];
Benzd6T=AppendTo[Benzd6T, Data[[1,388, 4]]];
Benzd6T=AppendTo[Benzd6T, Data[[1, 467, 4]]];



(*Benzd6 visc*)
Benzd6visc={Data[[1, 194, 8]]};
For[i=195, i≤198,i++,Benzd6visc=AppendTo[Benzd6visc, Data[[1, i, 8]]]];
For[i= 311, i≤342,i++,Benzd6visc=AppendTo[Benzd6visc, Data[[1, i, 8]]]];
Benzd6visc=AppendTo[Benzd6visc, Data[[1, 388, 8]]];
Benzd6visc=AppendTo[Benzd6visc, Data[[1, 467, 8]]];

(*Benzd6 MW data*)
Benzd6MW={Data[[1, 194, 6]]};
For[i=195, i≤198,i++,Benzd6MW=AppendTo[Benzd6MW, Data[[1, i, 6]]]];
For[i= 311, i≤342,i++,Benzd6MW=AppendTo[Benzd6MW, Data[[1, i, 6]]]];
Benzd6MW=AppendTo[Benzd6MW, Data[[1, 388, 6]]];
Benzd6MW=AppendTo[Benzd6MW, Data[[1, 467, 6]]];

(*Benzd6 MWs data*)
Benzd6MWs={Data[[1, 194, 7]]};
For[i=195, i≤198,i++,Benzd6MWs=AppendTo[Benzd6MWs, Data[[1, i, 7]]]];
For[i= 311, i≤342,i++,Benzd6MWs=AppendTo[Benzd6MWs, Data[[1, i, 7]]]];
Benzd6MWs=AppendTo[Benzd6MWs, Data[[1, 388, 7]]];
Benzd6MWs=AppendTo[Benzd6MWs, Data[[1, 467, 7]]];

Clear[nd];
nd=Length[Benzd6Dexp];
Clear[data];
data={{Benzd6MW[[1]], Benzd6MWs[[1]],Benzd6visc[[1]], Benzd6T[[1]], Benzd6Dexp[[1]]}};
For[i=2, i≤nd,i++,data=AppendTo[data, { Benzd6MW[[i]], Benzd6MWs[[i]],Benzd6visc[[i]],Benzd6T[[i]], Benzd6Dexp[[i]]}]];


(*Benzd6 calcualted data*)
DiffusionDataBenzd6={{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤nd,i++, AppendTo[DiffusionDataBenzd6,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

PlotBenzd6=ListPlot[DiffusionDataBenzd6, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersBENZ,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}} ,FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesBenzd6=Graphics[{{Text[Style["(e) benzene-(Subscript[d, 6])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{12.5,45}]}}];

Print["Plot of estimated D vs experimental D - benzene-(Subscript[d, 6]) - Figure SI.7e"]
DBenzd6=Show[PlotBenzd6,  slope45, namesBenzd6]
Export["DvsDBenzd6.jpg",DBenzd6];
Export["DvsDBenzd6.tiff",DBenzd6];

dratios=Table[DiffusionDataBenzd6 [[i,2]]/DiffusionDataBenzd6[[i,1]],{i,1,Length[DiffusionDataBenzd6]}];
delDBenzd6=(100*(dratios-1));

HistBenzd6=Histogram[delDBenzd6,{-50,50,10} , AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

labelBenzd6=Graphics[{{Text[Style["(e) benzene-(Subscript[d, 6])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{50,75}]}}];
HistBenzd6=Show[HistBenzd6, labelBenzd6]
Export["HistBenzd6.jpg",HistBenzd6];
Export["HistBenzd6.tiff",HistBenzd6];

Print["RMS percentage deviation from ratio fit model for benzene-(Subscript[d, 6]) using optimisation to original data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[DiffusionDataBenzd6]}]/Length[DiffusionDataBenzd6])^(1/2)];
Print["-----------------------------------------

"] 

(*strip out individual subset of data for THF-d8*)

(*THFd8 Dexp data*)
THFd8Dexp={Data[[1,153, 12]]};
For[i=154, i≤168,i++,THFd8Dexp=AppendTo[THFd8Dexp, Data[[1, i, 12]]]];
For[i= 391, i≤403,i++,THFd8Dexp=AppendTo[THFd8Dexp, Data[[1, i, 12]]]];
THFd8Dexp=AppendTo[THFd8Dexp, Data[[1, 389, 12]]];

(*THFd8 T*)
THFd8T={Data[[1,153, 4]]};
For[i=154, i≤168,i++,THFd8T=AppendTo[THFd8T, Data[[1, i, 4]]]];
For[i= 391, i≤403,i++,THFd8T=AppendTo[THFd8T, Data[[1, i, 4]]]];
THFd8T=AppendTo[THFd8T, Data[[1, 389, 4]]];

(*THFd8 visc*)
THFd8visc={Data[[1,153, 8]]};
For[i=154, i≤168,i++,THFd8visc=AppendTo[THFd8visc, Data[[1, i, 8]]]];
For[i= 391, i≤403,i++,THFd8visc=AppendTo[THFd8visc, Data[[1, i, 8]]]];
THFd8visc=AppendTo[THFd8visc, Data[[1, 389,8]]];

(*THFd8 MW data*)
THFd8MW={Data[[1,153, 6]]};
For[i=154, i≤168,i++,THFd8MW=AppendTo[THFd8MW, Data[[1, i, 6]]]];
For[i= 391, i≤403,i++,THFd8MW=AppendTo[THFd8MW, Data[[1, i, 6]]]];
THFd8MW=AppendTo[THFd8MW, Data[[1, 389,6]]];

(*THFd8 MW data*)
THFd8MWs={Data[[1,153, 7]]};
For[i=154, i≤168,i++,THFd8MWs=AppendTo[THFd8MWs, Data[[1, i, 7]]]];
For[i= 391, i≤403,i++,THFd8MWs=AppendTo[THFd8MWs, Data[[1, i, 7]]]];
THFd8MWs=AppendTo[THFd8MWs, Data[[1, 389,7]]];

Clear[nd];
nd=Length[THFd8Dexp];
Clear[data];
data={{THFd8MW[[1]], THFd8MWs[[1]],THFd8visc[[1]], THFd8T[[1]], THFd8Dexp[[1]]}};
For[i=2, i≤nd,i++,data=AppendTo[data, { THFd8MW[[i]], THFd8MWs[[i]],THFd8visc[[i]],THFd8T[[i]], THFd8Dexp[[i]]}]];


(*THFd8 calcualted data*)
DiffusionDataTHFd8={{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤nd,i++, AppendTo[DiffusionDataTHFd8,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

PlotTHFd8=ListPlot[DiffusionDataTHFd8, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersTHF,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}} ,FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesTHFd8=Graphics[{{Text[Style["(f) THF-(Subscript[d, 8])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{12.5,45}]}}];

Print["Plot of estimated D vs experimental D - THF-(Subscript[d, 8]) - Figure SI.7f"]
DTHFd8=Show[PlotTHFd8,  slope45, namesTHFd8]
Export["DvsDDTHFd8.jpg",DTHFd8];
Export["DvsDDTHFd8.tiff",DTHFd8];

Clear[dratios]
dratios=Table[DiffusionDataTHFd8 [[i,2]]/DiffusionDataTHFd8[[i,1]],{i,1,Length[DiffusionDataTHFd8]}];
delDTHFd8=(100*(dratios-1));

HistTHFd8=Histogram[delDTHFd8,{-50,50,10} , AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

labelTHFd8=Graphics[{{Text[Style["(f) THF-(Subscript[d, 8])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{50,75}]}}];
HistTHFd8=Show[HistTHFd8, labelTHFd8]
Export["HistTHFd8.jpg",HistTHFd8];
Export["HistTHFd8.tiff",HistTHFd8];

Print["RMS percentage deviation from ratio fit model for THF-(Subscript[d, 8]) using optimisation to original data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[DiffusionDataTHFd8]}]/Length[DiffusionDataTHFd8])^(1/2)];
Print["-----------------------------------------

"]  


(*strip out individual subset of data for cyclohexane-d12*)

(*Cycd12 Dexp*)
Cycd12Dexp={Data[[1, 281, 12]]};
For[i=282, i≤310,i++,Cycd12Dexp=AppendTo[Cycd12Dexp, Data[[1, i, 12]]]];

(*Cycd12 T*)
Cycd12T={Data[[1, 281, 4]]};
For[i=282, i≤310,i++,Cycd12T=AppendTo[Cycd12T, Data[[1, i, 4]]]];

(*Cycd12 visc*)
Cycd12visc={Data[[1,281, 8]]};
For[i=282, i≤310,i++,Cycd12visc=AppendTo[Cycd12visc, Data[[1, i, 8]]]];

(*Cycd12 MW data*)
Cycd12MW={Data[[1, 281, 6]]};
For[i=282, i≤310,i++,Cycd12MW=AppendTo[Cycd12MW, Data[[1, i, 6]]]];

(*Cycd12 MWs data*)
Cycd12MWs={Data[[1, 281, 7]]};
For[i=282, i≤310,i++,Cycd12MWs=AppendTo[Cycd12MWs, Data[[1, i, 7]]]];

Clear[nd];
nd=Length[Cycd12Dexp];
Clear[data];
data={{Cycd12MW[[1]], Cycd12MWs[[1]],Cycd12visc[[1]], Cycd12T[[1]], Cycd12Dexp[[1]]}};
For[i=2, i≤nd,i++,data=AppendTo[data, { Cycd12MW[[i]], Cycd12MWs[[i]],Cycd12visc[[i]],Cycd12T[[i]], Cycd12Dexp[[i]]}]];


(*Cycd12 calcualted data*)
DiffusionDataCycd12={{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤nd,i++, AppendTo[DiffusionDataCycd12,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

PlotCycd12=ListPlot[DiffusionDataCycd12, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersCYC,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}} ,FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesCycd12=Graphics[{{Text[Style["(g) cyclohexane-(Subscript[d, 12])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{15,45}]}}];

Print["Plot of estimated D vs experimental D - cyclohexane-(Subscript[d, 12]) - Figure SI.7g"]
DCycd12=Show[PlotCycd12,  slope45, namesCycd12]
Export["DvsDCycd12.jpg",DCycd12];
Export["DvsDCycd12.tiff",DCycd12];

dratios=Table[DiffusionDataCycd12[[i,2]]/DiffusionDataCycd12[[i,1]],{i,1,Length[DiffusionDataCycd12]}];
delDCycd12=(100*(dratios-1));

HistCycd12=Histogram[delDCycd12,{-50,50,10} , AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

labelCycd12=Graphics[{{Text[Style["(g) cyclohexane-(Subscript[d, 12])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{50,75}]}}];
HistCycd12=Show[HistCycd12, labelCycd12]
Export["HistCycd12.jpg",HistCycd12];
Export["HistCycd12.tiff",HistCycd12];


Print["RMS percentage deviation from ratio fit model for cyclohexane-(Subscript[d, 12]) using optimisation to original data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[DiffusionDataCycd12]}]/Length[DiffusionDataCycd12])^(1/2)];
Print["-----------------------------------------

"] 
(*strip out individual subset of data for methanol-d4*)
(*Methd4 Dexp*)
Methd4Dexp={Data[[1, 90, 12]]};
For[i=91, i≤109,i++,Methd4Dexp=AppendTo[Methd4Dexp, Data[[1, i, 12]]]];
For[i=114, i≤116,i++,Methd4Dexp=AppendTo[Methd4Dexp, Data[[1, i, 12]]]];
Methd4Dexp=AppendTo[Methd4Dexp, Data[[1, 120, 12]]];

(*Methd4 T*)
Methd4T={Data[[1,  90, 4]]};
For[i=91, i≤109,i++,Methd4T=AppendTo[Methd4T, Data[[1, i, 4]]]];
For[i=114, i≤116,i++,Methd4T=AppendTo[Methd4T, Data[[1, i, 4]]]];
Methd4T=AppendTo[Methd4T, Data[[1, 120, 4]]];

(*Methd4 visc*)
Methd4visc={Data[[1,90, 8]]};
For[i=91, i≤109,i++,Methd4visc=AppendTo[Methd4visc, Data[[1, i, 8]]]];
For[i=114, i≤116,i++,Methd4visc=AppendTo[Methd4visc, Data[[1, i, 8]]]];
Methd4visc=AppendTo[Methd4visc, Data[[1, 120, 8]]];

(*Methd4 MW data*)
Methd4MW={Data[[1, 90, 6]]};
For[i=91, i≤109,i++,Methd4MW=AppendTo[Methd4MW, Data[[1, i, 6]]]];
For[i=114, i≤116,i++,Methd4MW=AppendTo[Methd4MW, Data[[1, i, 6]]]];
Methd4MW=AppendTo[Methd4MW, Data[[1, 120, 6]]];

(*Methd4 MWs data*)
Methd4MWs={Data[[1,90,7]]};
For[i=91, i≤109,i++,Methd4MWs=AppendTo[Methd4MWs, Data[[1, i, 7]]]];
For[i=114, i≤116,i++,Methd4MWs=AppendTo[Methd4MWs, Data[[1, i, 7]]]];
Methd4MWs=AppendTo[Methd4MWs, Data[[1, 120, 7]]];

Clear[nd];
nd=Length[Methd4Dexp];
Clear[data];
data={{Methd4MW[[1]], Methd4MWs[[1]],Methd4visc[[1]], Methd4T[[1]],Methd4Dexp[[1]]}};
For[i=2, i≤nd,i++,data=AppendTo[data, { Methd4MW[[i]], Methd4MWs[[i]],Methd4visc[[i]],Methd4T[[i]], Methd4Dexp[[i]]}]];

(*Methd4 calcualted data*)
DiffusionDataMethd4={{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤nd,i++, AppendTo[DiffusionDataMethd4,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

PlotMethd4=ListPlot[DiffusionDataMethd4, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersCYC,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}} ,FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesMethd4=Graphics[{{Text[Style["(h) methanol-(Subscript[d, 4])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{15,45}]}}];

Print["Plot of estimated D vs experimental D - methanol-(Subscript[d, 4]) - Figure SI.7h"]
DMethd4=Show[PlotMethd4,  slope45, namesMethd4]
Export["DvsDMethd4.jpg",DMethd4];
Export["DvsDMethd4.tiff",DMethd4];

Clear[dratios]
dratios=Table[DiffusionDataMethd4[[i,2]]/DiffusionDataMethd4[[i,1]],{i,1,Length[DiffusionDataMethd4]}];
delDMethd4=(100*(dratios-1));

HistMethd4=Histogram[delDMethd4,{-50,50,10} , AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

labelMethd4=Graphics[{{Text[Style["(h) methanol-(Subscript[d, 4])",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{50,75}]}}];
HistMethd4=Show[HistMethd4, labelMethd4]
Export["HistMethd4.jpg",HistMethd4];
Export["HistMethd4.tiff",HistMethd4];


Print["RMS percentage deviation from ratio fit model for methanol-(Subscript[d, 4]) using optimisation to original data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[DiffusionDataMethd4]}]/Length[DiffusionDataMethd4])^(1/2)];
Print["-----------------------------------------

"] 

(*strip out individual subset of data for pure liquids*)
(*Pure Dexp*)
PureDexp={Data[[1, 204, 12]]};
For[i=205, i≤238,i++,PureDexp=AppendTo[PureDexp, Data[[1, i, 12]]]];
For[i=375, i≤376,i++,PureDexp=AppendTo[PureDexp, Data[[1, i, 12]]]];
For[i=378, i≤387,i++,PureDexp=AppendTo[PureDexp, Data[[1, i, 12]]]];

(*Pure T*)
PureT={Data[[1,204, 4]]};
For[i=205, i≤238,i++,PureT=AppendTo[PureT, Data[[1, i, 4]]]];
For[i=375, i≤376,i++,PureT=AppendTo[PureT, Data[[1, i, 4]]]];
For[i=378, i≤387,i++,PureT=AppendTo[PureT, Data[[1, i, 4]]]];

(*Pure visc*)
Purevisc={Data[[1, 204, 8]]};
For[i=205, i≤238,i++,Purevisc=AppendTo[Purevisc, Data[[1, i, 8]]]];
For[i=375, i≤376,i++,Purevisc=AppendTo[Purevisc, Data[[1, i, 8]]]];
For[i=378, i≤387,i++,Purevisc=AppendTo[Purevisc, Data[[1, i, 8]]]];

(*Pure MW data*)
PureMW={Data[[1, 204, 6]]};
For[i=205, i≤238,i++,PureMW=AppendTo[PureMW, Data[[1, i, 6]]]];
For[i=375, i≤376,i++,PureMW=AppendTo[PureMW, Data[[1, i, 6]]]];
For[i=378, i≤387,i++,PureMW=AppendTo[PureMW, Data[[1, i, 6]]]];

(*Pure MWs data*)
PureMWs={Data[[1, 204, 7]]};
For[i=205, i≤238,i++,PureMWs=AppendTo[PureMWs, Data[[1, i, 7]]]];
For[i=375, i≤376,i++,PureMWs=AppendTo[PureMWs, Data[[1, i, 7]]]];
For[i=378, i≤387,i++,PureMWs=AppendTo[PureMWs, Data[[1, i, 7]]]];

Clear[nd];
nd=Length[PureDexp];
Clear[data];
data={{PureMW[[1]],PureMWs[[1]],Purevisc[[1]], PureT[[1]],PureDexp[[1]]}};
For[i=2, i≤nd,i++,data=AppendTo[data, { PureMW[[i]], PureMWs[[i]],Purevisc[[i]],PureT[[i]], PureDexp[[i]]}]];


(*Pure calcualted data*)
DiffusionDataPure={{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤nd,i++, AppendTo[DiffusionDataPure,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

PlotPure=ListPlot[DiffusionDataPure, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersCYC,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}} ,FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesPure=Graphics[{{Text[Style["(i) pure liquids ",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{15,45}]}}];

Print["Plot of estimated D vs experimental D - pure liquids - Figure SI.7i"]
DPure=Show[PlotPure,  slope45, namesPure]
Export["DvsDPure.jpg",DPure];
Export["DvsDPure.tiff",DPure];

Clear[dratios]
dratios=Table[DiffusionDataPure[[i,2]]/DiffusionDataPure[[i,1]],{i,1,Length[DiffusionDataPure]}];
delDPure=(100*(dratios-1));

HistPure=Histogram[delDPure,{-50,50,10} , AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

labelPure=Graphics[{{Text[Style["(i) pure liquids",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{50,75}]}}];
HistPure=Show[HistPure, labelPure]
Export["HistPure.jpg",HistPure];
Export["HistPure.tiff",HistPure];


Print["RMS percentage deviation from ratio fit model for pure liquids using optimisation to original data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[DiffusionDataPure]}]/Length[DiffusionDataPure])^(1/2)];
Print["-----------------------------------------

"] 

(*strip out remainder of data - non-NMR in acetonitrile, DMSO and DMF, 3 x acetonitrile-d3*)
(*Rem Dexp*)
RemDexp={Data[[1, 404, 12]]};
For[i=405, i≤465,i++,RemDexp=AppendTo[RemDexp, Data[[1, i, 12]]]];


(*Rem T*)
RemT={Data[[1, 404, 4]]};
For[i=405, i≤465,i++,RemT=AppendTo[RemT, Data[[1, i, 4]]]];

(*Pure visc*)
Remvisc={Data[[1,  404, 8]]};
For[i=405, i≤465,i++,Remvisc=AppendTo[Remvisc, Data[[1, i, 8]]]];

(*Pure MW data*)
RemMW={Data[[1,  404, 6]]};
For[i=405, i≤465,i++,RemMW=AppendTo[RemMW, Data[[1, i, 6]]]];

(*Pure MWs data*)
RemMWs={Data[[1,  404, 7]]};
For[i=405, i≤465,i++,RemMWs=AppendTo[RemMWs, Data[[1, i, 7]]]];

Clear[nd];
nd=Length[RemDexp];
Clear[data];
data={{RemMW[[1]],RemMWs[[1]],Remvisc[[1]],RemT[[1]],RemDexp[[1]]}};
For[i=2, i≤nd,i++,data=AppendTo[data, { RemMW[[i]], RemMWs[[i]],Remvisc[[i]],RemT[[i]], RemDexp[[i]]}]];


(*Rem calcualted data*)
DiffusionDataRem={{model/.{mw->data[[1,1]]  ,mws->data[[1,2]] ,η->  data[[1,3]] , temp->  data[[1,4]],ρeff->ρeffoptorig},data[[1,5]]}};
For[i=2,i≤nd,i++, AppendTo[DiffusionDataRem,{model/.{mw->data[[i,1]]  ,mws->data[[i,2]] ,η->  data[[i,3]] ,temp->  data[[i,4]], ρeff->ρeffoptorig},data[[i,5]]}];];

PlotRem=ListPlot[DiffusionDataRem, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersCYC,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}} ,FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesRem=Graphics[{{Text[Style["(j) remaining data ",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{15,45}]}}];

Print["Plot of estimated D vs experimental D - remaining data - Figure SI.7i"]
DRem=Show[PlotRem,  slope45, namesRem]
Export["DvsDRem.jpg",DRem];
Export["DvsDRem.tiff",DRem];

Clear[dratios]
dratios=Table[DiffusionDataRem[[i,2]]/DiffusionDataRem[[i,1]],{i,1,Length[DiffusionDataRem]}];
delDRem=(100*(dratios-1));

HistRem=Histogram[delDRem,{-50,50,10} , AspectRatio->1,ImageSize->imagesize, ChartStyle->Red, PlotRange->{{-100, 100},All}, Axes->{True, True},AxesOrigin->{-100,0},AxesLabel-> {"\!\(\*TagBox[
RowBox[{"   ", 
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}]}],
DisplayForm]\) / %"},AxesStyle->Thick,TicksStyle->Thick, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

labelRem=Graphics[{{Text[Style["(j) remaining data",24,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{50,75}]}}];
HistRem=Show[HistRem, labelRem]
Export["HistRem.jpg",HistRem];
Export["HistRem.tiff",HistRem];


Print["RMS percentage deviation from ratio fit model for remaining data using optimisation to original data set ",100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[DiffusionDataRem]}]/Length[DiffusionDataRem])^(1/2)];
Print["-----------------------------------------

"] 


(*Analysis of Crutchfield Data*)
Print["analysis of data taken from Crutchfield paper"]

(*Crutchfield diffusion data*)
DexpC298D2O={Data[[1, 468,12]]};
For[i=469, i≤491,i++, DexpC298D2O=AppendTo[DexpC298D2O, Data[[1, i,12]]]];
DexpC303D2O={Data[[1, 492,12]]};
For[i=493, i≤515,i++, DexpC303D2O=AppendTo[DexpC303D2O, Data[[1, i,12]]]];
DexpC298CDCl3={Data[[1, 516,12]]};
For[i=517, i≤591,i++, DexpC298CDCl3=AppendTo[DexpC298CDCl3, Data[[1, i,12]]]];
DexpC303CDCl3={Data[[1, 592,12]]};
For[i=593, i≤667,i++, DexpC303CDCl3=AppendTo[DexpC303CDCl3, Data[[1, i,12]]]];

(*Crutchfield T data*)
TC298D2O={Data[[1,  468,4]]};
For[i=469, i≤491,i++, TC298D2O=AppendTo[TC298D2O, Data[[1, i,4]]]];
TC303D2O={Data[[1, 492,4]]};
For[i=493, i≤515,i++, TC303D2O=AppendTo[TC303D2O, Data[[1, i,4]]]];
TC298CDCl3={Data[[1, 516,4]]};
For[i=517, i≤591,i++, TC298CDCl3=AppendTo[TC298CDCl3, Data[[1, i,4]]]];
TC303CDCl3={Data[[1,592,4]]};
For[i=593, i≤667,i++, TC303CDCl3=AppendTo[TC303CDCl3, Data[[1, i,4]]]];

(*Crutchfield visc data*)
viscC298D2O={Data[[1, 468,8]]};
For[i=469, i≤491,i++, viscC298D2O=AppendTo[viscC298D2O, Data[[1, i,8]]]];
viscC303D2O={Data[[1, 492,8]]};
For[i=493, i≤515,i++, viscC303D2O=AppendTo[viscC303D2O, Data[[1, i,8]]]];
viscC298CDCl3={Data[[1, 516,8]]};
For[i=517, i≤591,i++, viscC298CDCl3=AppendTo[viscC298CDCl3, Data[[1, i,8]]]];
viscC303CDCl3={Data[[1,592,8]]};
For[i=593, i≤667,i++, viscC303CDCl3=AppendTo[viscC303CDCl3, Data[[1, i,8]]]];

(*Crutchfield MW data*)
MWC298D2O={Data[[1, 468,6]]};
For[i=469, i≤491,i++, MWC298D2O=AppendTo[MWC298D2O, Data[[1, i,6]]]];
MWC303D2O={Data[[1, 492,6]]};
For[i=493, i≤515,i++, MWC303D2O=AppendTo[MWC303D2O, Data[[1, i,6]]]];
MWC298CDCl3={Data[[1, 516,6]]};
For[i=517, i≤591,i++, MWC298CDCl3=AppendTo[MWC298CDCl3, Data[[1, i,6]]]];
MWC303CDCl3={Data[[1,592,6]]};
For[i=593, i≤667,i++, MWC303CDCl3=AppendTo[MWC303CDCl3, Data[[1, i,6]]]];

(*Crutchfield MWs data*)
MWsC298D2O={Data[[1, 468,7]]};
For[i=469, i≤491,i++, MWsC298D2O=AppendTo[MWsC298D2O, Data[[1, i,7]]]];
MWsC303D2O={Data[[1, 492,7]]};
For[i=493, i≤515,i++, MWsC303D2O=AppendTo[MWsC303D2O, Data[[1, i,7]]]];
MWsC298CDCl3={Data[[1,516,7]]};
For[i=517, i≤591,i++, MWsC298CDCl3=AppendTo[MWsC298CDCl3, Data[[1, i,7]]]];
MWsC303CDCl3={Data[[1,592,7]]};
For[i=593, i≤667,i++, MWsC303CDCl3=AppendTo[MWsC303CDCl3, Data[[1, i,7]]]];

Clear[data298D2O, data303D2O, data303CDCl3, data298CDCl3];
Clear[ndD2O, ndCDCl3];
ndD2O=Length[MWsC298D2O];
ndCDCl3=Length[MWsC298CDCl3];

data298D2O={{MWC298D2O[[1]], MWsC298D2O[[1]],viscC298D2O[[1]], TC298D2O[[1]],DexpC298D2O[[1]]}};
For[i=2, i≤ndD2O,i++,data298D2O=AppendTo[data298D2O, { MWC298D2O[[i]], MWsC298D2O[[i]],viscC298D2O[[i]],TC298D2O[[i]],DexpC298D2O[[i]]}]];

data303D2O={{MWC303D2O[[1]], MWsC303D2O[[1]],viscC303D2O[[1]], TC303D2O[[1]],DexpC303D2O[[1]]}};
For[i=2, i≤ndD2O,i++,data303D2O=AppendTo[data303D2O, { MWC303D2O[[i]], MWsC303D2O[[i]],viscC303D2O[[i]],TC303D2O[[i]],DexpC303D2O[[i]]}]];

data298CDCl3={{MWC298CDCl3[[1]], MWsC298CDCl3[[1]],viscC298CDCl3[[1]], TC298CDCl3[[1]],DexpC298CDCl3[[1]]}};
For[i=2, i≤ndCDCl3,i++,data298CDCl3=AppendTo[data298CDCl3, { MWC298CDCl3[[i]], MWsC298CDCl3[[i]],viscC298CDCl3[[i]],TC298CDCl3[[i]],DexpC298CDCl3[[i]]}]];

data303CDCl3={{MWC303CDCl3[[1]], MWsC303CDCl3[[1]],viscC303CDCl3[[1]], TC303CDCl3[[1]],DexpC303CDCl3[[1]]}};
For[i=2, i≤ndCDCl3,i++,data303CDCl3=AppendTo[data303CDCl3, { MWC303CDCl3[[i]], MWsC303CDCl3[[i]],viscC303CDCl3[[i]],TC303CDCl3[[i]],DexpC303CDCl3[[i]]}]];



Clear[DiffusionData298D2O, DiffusionData303D2O,DiffusionData298CDCl3, DiffusionData303CDCl3 , data]
DiffusionData298D2O={{model/.{mw->data298D2O[[1,1]]  ,mws->data298D2O[[1,2]] ,η->data298D2O[[1,3]] , temp->data298D2O[[1,4]],ρeff->ρeffoptorig},data298D2O[[1,5]]}};
For[i=2,i≤ndD2O,i++, AppendTo[DiffusionData298D2O,{model/.{mw->data298D2O[[i,1]]  ,mws->data298D2O[[i,2]] ,η->data298D2O[[i,3]] ,temp->data298D2O[[i,4]], ρeff->ρeffoptorig},data298D2O[[i,5]]}];];
DiffusionData303D2O={{model/.{mw->data303D2O[[1,1]]  ,mws->data303D2O[[1,2]] ,η->  data303D2O[[1,3]] , temp->  data303D2O[[1,4]],ρeff->ρeffoptorig},data303D2O[[1,5]]}};
For[i=2,i≤ndD2O,i++, AppendTo[DiffusionData303D2O,{model/.{mw->data303D2O[[i,1]]  ,mws->data303D2O[[i,2]] ,η->  data303D2O[[i,3]] ,temp->  data303D2O[[i,4]], ρeff->ρeffoptorig},data303D2O[[i,5]]}];];
DiffusionData298CDCl3={{model/.{mw->data298CDCl3[[1,1]]  ,mws->data298CDCl3[[1,2]] ,η-> data298CDCl3[[1,3]] , temp-> data298CDCl3[[1,4]],ρeff->ρeffoptorig},data298CDCl3[[1,5]]}};
For[i=2,i≤ndCDCl3,i++, AppendTo[DiffusionData298CDCl3,{model/.{mw->data298CDCl3[[i,1]]  ,mws->data298CDCl3[[i,2]] ,η->  data298CDCl3[[i,3]] ,temp->data298CDCl3[[i,4]], ρeff->ρeffoptorig},data298CDCl3[[i,5]]}];];
DiffusionData303CDCl3={{model/.{mw->data303CDCl3[[1,1]]  ,mws->data303CDCl3[[1,2]] ,η-> data303CDCl3[[1,3]] , temp->data303CDCl3[[1,4]],ρeff->ρeffoptorig},data303CDCl3[[1,5]]}};
For[i=2,i≤ndCDCl3,i++, AppendTo[DiffusionData303CDCl3,{model/.{mw->data303CDCl3[[i,1]]  ,mws->data303CDCl3[[i,2]] ,η-> data303CDCl3[[i,3]] ,temp-> data303CDCl3[[i,4]], ρeff->ρeffoptorig},data303CDCl3[[i,5]]}];];

DvsDC298D2O=ListPlot[DiffusionData298D2O, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC298D2O,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}} ,FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];
DvsDC303D2O=ListPlot[DiffusionData303D2O, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC303D2O,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];
DvsDC298CDCl3=ListPlot[DiffusionData298CDCl3, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC298CDCl3,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];
DvsDC303CDCl3=ListPlot[DiffusionData303CDCl3, PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC303CDCl3,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]}, LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesC=Graphics[{{Text[Style["in (Subscript[D, 2])O, 298 K",18,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{37,15}],Text[Style["in (Subscript[D, 2])O, 303 K",18,Black, SingleLetterItalics->False,FontFamily->"Helvetica", SingleLetterItalics->False],{37,12.5}], Text[Style["in (Subscript[CDCl, 3]), 298 K",18,Black, FontFamily->"Helvetica"],{37.8,10}], Text[Style["in (Subscript[CDCl, 3]), 303 K",18,Black, FontFamily->"Helvetica"],{37.8,7.5}]}}];

legendmarkersC=ListPlot[Table[{{29,20-(i+1)*2.5}},{i,1,4}],PlotRange->drange,AspectRatio->1,ImageSize->imagesize,PlotMarkers->plotmarkersC,PlotStyle->{Thickness[0.003]},Axes->None];

Print["Plot of estimated D vs experimental D - Crutchfield data - Figure 3 and SI.8.1"]
CrutchDvsD=Show[DvsDC298D2O, DvsDC303D2O, DvsDC298CDCl3, DvsDC303CDCl3,namesC,legendmarkersC, slope45] 

Clear[delDC298D2O, delDC303D2O, delDC298CDCl3, delDC303CDCl3]
(*generate del D*)
dratiosC298D2O=Table[DiffusionData298D2O[[i,2]]/DiffusionData298D2O[[i,1]],{i,1,ndD2O}];
delDC298D2O=(100*(dratiosC298D2O-1));
dratiosC303D2O=Table[DiffusionData303D2O[[i,2]]/DiffusionData303D2O[[i,1]],{i,1,ndD2O}];
delDC303D2O=(100*(dratiosC303D2O-1));
dratiosC298CDCl3=Table[DiffusionData298CDCl3[[i,2]]/DiffusionData298CDCl3[[i,1]],{i,1,ndCDCl3}];
delDC298CDCl3=(100*(dratiosC298CDCl3-1));
dratiosC303CDCl3=Table[DiffusionData303CDCl3[[i,2]]/DiffusionData303CDCl3[[i,1]],{i,1,ndCDCl3}];
delDC303CDCl3=(100*(dratiosC303CDCl3-1));

(*delD vs MW plot*)
(*generate paired data*)
delDvsMWC298D2O=Partition[Riffle[MWC298D2O, delDC298D2O], 2];
delDvsMWC303D2O=Partition[Riffle[MWC303D2O, delDC303D2O], 2];
delDvsMWC298CDCl3=Partition[Riffle[MWC298CDCl3, delDC298CDCl3], 2];
delDvsMWC303CDCl3=Partition[Riffle[MWC303CDCl3, delDC303CDCl3], 2];

(*delD vs MW plots of Crutchfield data*)
delDvsMW298D2O=ListPlot[delDvsMWC298D2O, PlotRange->deldrange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC298D2O,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{ Style[ "MW", Italic], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];
delDvsMW303D2O=ListPlot[delDvsMWC303D2O, PlotRange->deldrange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC303D2O,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{ Style[ "MW", Italic], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];
delDvsMW298CDCl3=ListPlot[delDvsMWC298CDCl3, PlotRange->deldrange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC298CDCl3,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{ Style[ "MW", Italic], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];
delDvsMW303CDCl3=ListPlot[delDvsMWC303CDCl3, PlotRange->deldrange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC303CDCl3,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{ Style[ "MW", Italic], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

legendmarkersCMW=ListPlot[Table[{{870,-32-(i)*7}},{i,1,4}],PlotRange->drange,AspectRatio->1,ImageSize->imagesize,PlotMarkers->plotmarkersC,PlotStyle->{Thickness[0.003]},Axes->None];

namesCMW=Graphics[{{Text[Style["in (Subscript[D, 2])O, 298 K",18,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{1110,-39}],Text[Style["in (Subscript[D, 2])O, 303 K",18,Black, SingleLetterItalics->False,FontFamily->"Helvetica", SingleLetterItalics->False],{1110,-46}], Text[Style["in (Subscript[CDCl, 3]), 298 K",18,Black, FontFamily->"Helvetica"],{1134,-53}], Text[Style["in (Subscript[CDCl, 3]), 303 K",18,Black, FontFamily->"Helvetica"],{1134,-60}]}}];


Print["Plot of delD vs MW - Crutchfield data - Figure SI.8.2 upper"]
CdelDvMW=Show[delDvsMW298D2O,delDvsMW303D2O, delDvsMW298CDCl3, delDvsMW303CDCl3,  namesCMW, legendmarkersCMW, line25mw, linem25mw]

(*delD vs Dexp plot*)
(*generate paired data*)
delDvsDC298D2O=Partition[Riffle[DexpC298D2O, delDC298D2O], 2];
delDvsDC303D2O=Partition[Riffle[DexpC303D2O, delDC303D2O], 2];
delDvsDC298CDCl3=Partition[Riffle[DexpC298CDCl3, delDC298CDCl3], 2];
delDvsDC303CDCl3=Partition[Riffle[DexpC303CDCl3, delDC303CDCl3], 2];

(*delD vs Dexp plots of Crutchfield data*)
delDvsD298D2O=ListPlot[delDvsDC298D2O, PlotRange->deldrange2,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC298D2O,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{ Style[ "(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];
delDvsD303D2O=ListPlot[delDvsDC303D2O, PlotRange->deldrange2,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC303D2O,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{ Style[ "(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];
delDvsD298CDCl3=ListPlot[delDvsDC298CDCl3, PlotRange->deldrange2,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC298CDCl3,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{ Style[ "(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];
delDvsD303CDCl3=ListPlot[delDvsDC303CDCl3, PlotRange->deldrange2,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkersC303CDCl3,PlotStyle->{Black,Thickness[0.003]}, Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{ Style[ "(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False], Style["\!\(\*TagBox[
RowBox[{"(", 
RowBox[{
StyleBox[
RowBox[{"Δ", 
StyleBox["D",
StripOnInput->False,
FontSlant->Italic]}]], "/", SubscriptBox[
StyleBox["D",
StripOnInput->False,
FontSlant->Italic], "est"]}], ")"}],
DisplayForm]\) / %",SingleLetterItalics->False]},LabelStyle->{24,Black, FontFamily->"Helvetica"}];

namesC=Graphics[{{Text[Style["in (Subscript[D, 2])O, 298 K",18,Black, FontFamily->"Helvetica", SingleLetterItalics->False],{37,-39}],Text[Style["in (Subscript[D, 2])O, 303 K",18,Black, SingleLetterItalics->False,FontFamily->"Helvetica", SingleLetterItalics->False],{37,-46}], Text[Style["in (Subscript[CDCl, 3]), 298 K",18,Black, FontFamily->"Helvetica"],{37.7,-53}], Text[Style["in (Subscript[CDCl, 3]), 303 K",18,Black, FontFamily->"Helvetica"],{37.7,-60}]}}];

legendmarkersC=ListPlot[Table[{{29,-32-(i)*7}},{i,1,4}],PlotRange->drange,AspectRatio->1,ImageSize->imagesize,PlotMarkers->plotmarkersC,PlotStyle->{Thickness[0.003]},Axes->None];

Print["Plot of delD vs experimental D - Crutchfield data - Figure SI.8.2 lower"]
CdelDvD=Show[delDvsD298D2O,delDvsD303D2O, delDvsD298CDCl3,delDvsD303CDCl3,  namesC, legendmarkersC, line25mw, linem25mw]

Export["CrutchDvsD.jpg",CrutchDvsD];
Export["CrutchDvsD.tiff",CrutchDvsD];
Export["CdelDvMW.jpg",CdelDvMW];
Export["CdelDvMW.tiff",CdelDvMW];
Export["CdelDvD.jpg",CdelDvD];
Export["CdelDvD.tiff",CdelDvD];



(*fit allowing all radii to vary independently*)
(*back to start to find appropriate data from original data set*)
Clear[Dexp,visc,MW, plotmarkers, rparamwater, rparamCHCl3, rparamDMSO, rparamtoluene, rparammethanol, names];

plotmarkers={{diamond,.023},{square,.023},{triangle,.03},{solidsquare,.022},{soliddiamond,.03}};

names=Graphics[{{Text[Style["(Subscript[CDCl, 3])",18,SingleLetterItalics->False,FontFamily->Helvetica],{37.7,17}],Text[Style["(Subscript[D, 2])O",SingleLetterItalics->False,18,FontFamily->Helvetica],{36.6,14}],Text[Style["[(Subscript[d, 6])]DMSO",18,SingleLetterItalics->False,FontFamily->Helvetica],{39.7,11}],Text[Style["[(Subscript[d, 8])]toluene",18,SingleLetterItalics->False,FontFamily->Helvetica],{39.9,8}],Text[Style["[(Subscript[d, 4])]methanol",18,SingleLetterItalics->False,FontFamily->Helvetica],{40.6,5}]}}];
legendmarkers=ListPlot[Table[{{33,20-(i+1)*3}},{i,0,4}],PlotRange->drange,AspectRatio->1,ImageSize->imagesize,PlotMarkers->plotmarkers,PlotStyle->{Thickness[0.003]},Axes->None];

nsolvents=5;
temp=298.15;
(*original Dexp*)
Dexp={Data[[1, 2, 12]]};
For[i=3, i≤109,i++, Dexp=AppendTo[Dexp, Data[[1, i, 12]]]];

(*original visc data*)
visc={Data[[1, 2, 8]]};
For[i=3, i≤109,i++, visc=AppendTo[visc, Data[[1, i, 8]]]];
visc;

(*original MW data*)
MW={Data[[1, 2, 6]]};
For[i=3, i≤109,i++, MW=AppendTo[MW, Data[[1, i, 6]]]];
MW;

(*original MW data*)
MWs={Data[[1, 2, 7]]};
For[i=3, i≤109,i++, MWs=AppendTo[MWs, Data[[1, i, 7]]]];
MWs;

solventrparams=10^-10 Flatten[{Table[rparamCHCl3,{i,24}],Table[rparamwater,{i,18}],Table[rparamDMSO,{i,25}],Table[rparamtoluene,{i,21}],Table[rparammethanol,{i,20}]}];

α=restd/((3 mw/(4 π 10^3 ρeff nA))^(1/3));
model=10^10 kB temp((3 α/2)+1/(1+α))/(6 π η (3 mw/(400π  ρeff nA))^(1/3)); 


fitdata=Transpose[{MW 10^-3,MWs 10^-3, solventrparams,visc,Dexp }];
ndp=Length[fitdata];
TableForm[fitdata];

Print["model optimised with effective density (/ 10 g (cm^(-3))) and five solvent radii allowed to vary"]
ratiovar=Sum[(((fitdata[[i,5]]-model/.{mw-> fitdata[[i,1]] ,restd-> fitdata[[i,3]],η->  fitdata[[i,4]]})/( model/.{mw-> fitdata[[i,1]],restd->  fitdata[[i,3]],η->  fitdata[[i,4]]})))^2,{i,1,Length[fitdata]}];
minmodel=FindMinimum[ratiovar,{ρeff,rparamCHCl3,rparamwater,rparamDMSO,rparamtoluene, rparammethanol},Method->"Automatic"]

minmodel[[2]];
ρeffopt=ρeff/.minmodel[[2]];

atestfitdata=Array[testfitdata,nsolvents];
j=0;  prevmw=0;
For[i=1,i≤ndp,i++,If[fitdata[[i,2]]!=prevmw,j++;testfitdata[j]= {{model/.{mw->fitdata[[i,1]] ,restd->fitdata[[i,3]]/.minmodel[[2]]  ,η->  fitdata[[i,4]]  ,ρeff->ρeffopt},fitdata[[i,5]]}};,AppendTo[testfitdata[j],{model/.{mw->fitdata[[i,1]]  ,restd->fitdata[[i,3]]/.minmodel[[2]] ,η->  fitdata[[i,4]]  ,ρeff->ρeffopt},fitdata[[i,5]]}];];prevmw=fitdata[[i,2]];];

atestfitdataplot=ListPlot[Tooltip[atestfitdata],PlotRange->drange,AspectRatio->0.88,ImageSize->imagesize, PlotMarkers->plotmarkers,PlotStyle->{Black,Thickness[0.003]},AxesStyle->Thickness[0.01],Frame->{{True,True},{True,True}},FrameStyle->{{Thick, Thick},{Thick, Thick}},FrameLabel->{Style["(Subscript[D, est]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False],Style["(Subscript[D, exp]) / (10^(-10)) (m^2) (s^(-2))   ⟶",SingleLetterItalics->False]}, LabelStyle->{24,Black, FontFamily->"Helvetica"}];
Print[Style["Test fit of experimental D ratio, original data set,  to model with 5 freely varying solvent radii",18,FontFamily->Helvetica]];

Print["Plot of estimated D vs experimental D - original data set, 5 varying radii - Figure SI.9"]
vary5radii=Show[atestfitdataplot,slope45,legendmarkers,names]

Export["DvsDvary5radii.tiff", vary5radii];
Export["DvsDvary5radii.jpg", vary5radii];

expvspredall=Flatten[atestfitdata,1];
expvspredall[[1]]; 
dratios=Table[expvspredall[[i,2]]/expvspredall[[i,1]],{i,1,Length[expvspredall]}];
Print["RMS percentage for 5 variable radii approach  ",      

100 (Sum[(dratios[[i]]-1)^2,{i,1,Length[expvspredall]}]/Length[expvspredall])^(1/2)];