From 8645de60d626bc8b79c6336a5c32e539453e2939 Mon Sep 17 00:00:00 2001 From: sakul-45 <81963567+sakul-45@users.noreply.github.com> Date: Mon, 2 Aug 2021 18:52:22 +0200 Subject: [PATCH] Added warning for Triplett population fit boundary < 0 --- simulation_TREPR.m | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/simulation_TREPR.m b/simulation_TREPR.m index a01f35e..8479cd9 100644 --- a/simulation_TREPR.m +++ b/simulation_TREPR.m @@ -329,14 +329,20 @@ uiwait(fig) %get previous simulation parameters (manual or saved) Sys0 = eventdata.simSys; Exp0 = eventdata.simExp; + %check if Temperature can run into negative + for nT = 1:3 + if Sys0.Temperature(nT) - Vary.Temperature(nT) < 0 + warndlg('Triplett population boundary < 0!','Warning'); + end + end %perform fit [BestSys,BestSpc] = esfit('thyme',params.max_mean,Sys0,Vary,Exp0,[],FitOpt); plot(ax,0.1*params.Field_Vector,params.max_mean,'r',... - 0.1*params.Field_Vector,BestSpc,'b','LineWidth',1.2) - xlabel 'Magnetic Field / mT' - ylabel 'EPR signal / A. U.' - legend('experimental','simulation') - axis tight + 0.1*params.Field_Vector,BestSpc,'b','LineWidth',1.2); + xlabel(ax,'Magnetic Field / mT'); + ylabel(ax,'EPR signal / A. U.'); + legend(ax,'experimental','simulation'); + axis(ax,'tight'); %normalize Triplett population Tsum = sum(BestSys.Temperature); BestSys.Temperature = BestSys.Temperature ./ Tsum;