diff --git a/triangle_analysis.m b/triangle_analysis.m index d20b4e5fa65f4bbd6933972a84721872447805de..5cd064dd2563dbfddce90d6a3d9d2d2b5c66bdf6 100644 --- a/triangle_analysis.m +++ b/triangle_analysis.m @@ -210,12 +210,24 @@ fitList=Map[NonlinearModelFit[#[[2]],Exp[-(t-t0)/tmix]+c,{{tmix,1000},{t0,10000} (* Use fit["BestFitParameters"] to get parameters *) (* Use fit[t] to get fit value *) fitFuncsT=Map[#[t]&,fitList]; +tmixList=Map[tmix/.#["BestFitParameters"]&,fitList]; timeplot1=ListPlot[coarseData,Joined->True,PlotRange->{0*minCount,maxCount},DataRange->{0,measureSkip*maxTime},PlotStyle->Opacity[0.5]]; Show[timeplot1,Plot[fitFuncsT,{t,1,maxTime},PlotRange->All]] +(* Log version of exponential fits *) +fitAverages=Map[c/.#["BestFitParameters"]&,fitList]; +shiftedFitFuncsT=MapIndexed[#1[t]-fitAverages[[#2[[1]]]]&,fitList]; +shiftedCoarseData=MapIndexed[MovingAverage[#1[[2]],1000][[1;;-1;;skipPts]]-fitAverages[[#2[[1]]]]&,selectedData]; + + +(* Plot log version *) +timeplot2=ListLogPlot[shiftedCoarseData[[1;;5]],Joined->True,PlotRange->{0*minCount+0.1,maxCount},DataRange->{0,measureSkip*maxTime},PlotStyle->Opacity[0.5]]; +Show[timeplot2,LogPlot[Evaluate[shiftedFitFuncsT[[1;;5]]],{t,1,maxTime},PlotRange->All,PlotStyle->Dotted]] + + (* ::Subsection:: *) (*Plot success rate over "time"*)