close all; clear all; clc % load data from papers in data.m and sigma data; sigma_ap=3.2; % initial guess l0=50; Lc=150; p=20; alph=0; options = optimoptions('lsqcurvefit','FiniteDifferenceType','central','Display','iter'); % 2 sets of data in paper b Mohandas, N., & Evans, E % xx=bblackx; % yy=bblacky; % xx=bwhitex; % yy=bwhitey; % Richard Waugh's data % xx=jun20x; % yy=jun20y; %xx=jun19x; %yy=jun19y; xx=jun18xloading; yy=jun18yloading; PRpdata618 = [8.31397 11.0853 13.85662 16.6280 19.3993 22.1706 27.7133 ]; LoRpdata618 = [1.16056 1.32491 1.49178 1.6182 1.75727 1.9115 2.03894 ]; LoRpErr618 = [0.11911 0.1365 0.11593 0.13279 0.10204 0.07782 0.12415 ]; % 3 sets of data in paper a Svetina, Saša, et al %xx=ablackx; %yy=ablacky; %xx=aredx; %yy=aredy; %xx=abluex; %yy=abluey; % Rp in loadconstants need to be changed due to defferent data xx=xx+sigma_ap; % least-square fit using the model lb=[72,193,5]; ub=[83,210,25]; x = lsqcurvefit(@T3fit,[l0 Lc p]',yy,xx,lb,ub,options); % x11 = lsqcurvefit(@T3fit1,[l0 0.3 p]',yy,xx,[0,0.1,10],[100,1,25],options); xa2 = lsqcurvefit(@T3fitarea2,[l0 Lc p alph]',yy,xx,[lb 0],[ub 0],options); %alpha=alph*K % xa3 = lsqcurvefit(@T3fitarea3,[l0 Lc p alph]',yy,xx,[lb -1],[ub 1],options); %alpha=alph(1-2K) % xa33 = lsqcurvefit(@T3fitarea33,[Lc p 0]',yy,xx,[],[],options); % % xa4=lsqcurvefit(@T3fitarea4,[l0 Lc p]',yy,xx,lb,ub,options); % given alpha=(1-2K)/Kc^2 % xa44=lsqcurvefit(@T3fitarea44,[l0 Lc p 0]',yy,xx,lb,ub,options); % given alpha=(1-2K)/Kc^2 xa=xa2; %x(1)=70; %x(2)=165; %x(3)=25; %xa(1)=70; %xa(2)=165; %xa(3)=25; %xa(4)=0; figure(1); errorbar(PRpdata618,LoRpdata618,LoRpErr618,'bs','MarkerSize',14,'linewidth',4); hold on x1 = [min(yy)*0.9:0.01:max(yy)*1.02]; %plot(xx,yy,'o',T3fit(x,x1),x1,T3fitarea3(xa,x1),x1,'MarkerSize',14,'linewidth',4) %plot plot(T3fit(x,x1)-sigma_ap,x1,'MarkerSize',14,'linewidth',4) %plot % plot(xx,yy,'o',T3fitarea3(xa3,x1),x1,T3fitarea4(xa4,x1),x1,'MarkerSize',12,'linewidth',4); %plot % plot(xx,yy,'o',T3fit(x,x1),x1,T3fitarea2(xa,x1),x1); %plot %calculate initial modulus l0=xa(1)*1e-9; Lc=xa(2)*1e-9; p=xa(3)*1e-9; loadconstants; mu2=mu0; l0=x(1)*1e-9; Lc=x(2)*1e-9; p=x(3)*1e-9; % alph=xa(4); % la=sqrt(alph+1); loadconstants; mu1=mu0; % plot set % plot set set(gca,'FontSize',36) %set labels ylabel('L_p/R_p','FontSize',36) % x-axis label xlabel('\DeltaP R_p (pN/\mum)','FontSize',36) % y-axis label % modelx=sprintf('Model mu_0=%0.2f (pN/um), l_0=%0.2f (nm), L_{max}=%0.2f (nm), p=%0.2f (nm)',mu0,x(1),x(2),x(3)); % modelx2=sprintf('Model mu_0=%0.2f (pN/um), alpha =%0.3f',mu0,alph); % lgnd=legend({'Experiment Jun 19',modelx}); % lgnd=legend({'Mohandas, N., & Evans, E','Model \mu_0=%0.2f (pN/um)',mu0,'m','Model \mu_0=%0.2f (pN/um)',mu0,'m'}) % set(lgnd,'Interpreter','latex'); %legends %lgnd=legend({['Svetina, et al. 2016'], ... %['Model \mu_0=', num2str(mu1, '%1.2f'),'pN/\mum, l_0=',num2str(x(1),'%1.2f'),'nm',', L_{c}=',num2str(x(2),'%1.2f'),'nm, p=',num2str(x(3),'%1.2f'),'nm, \alpha_{0}=0'], ... %['Model \mu_0=',num2str(mu2,'%1.2f'),'pN/\mum, l_0=',num2str(xa(1),'%1.2f'),'nm',', L_{c}=',num2str(xa(2),'%1.2f'),'nm, p=',num2str(xa(3),'%1.2f'),'nm, \alpha_{0}=',num2str(alph,'%1.4f')]}); % lgnd=legend({['June 18, 1990, R_{p}=0.56\mum'], ... % ['Model \mu_0=', num2str(mu3, '%1.2f'),'pN/\mum, L_0_{eff}=',num2str(sd(1),'%1.2f'),'nm',', L_{c}=',num2str(xq(1),'%1.2f'),'nm, p=',num2str(xq(2),'%1.2f'),'nm, \alpha_{0}=0'], ... % ['Model \mu_0=',num2str(mu2,'%1.2f'),'pN/\mum, l_0=',num2str(xa(1),'%1.2f'),'nm',', L_{c}=',num2str(xa(2),'%1.2f'),'nm, p=',num2str(xa(3),'%1.2f'),'nm, \alpha_{0}=',num2str(alph,'%1.4f')]}); lgnd=legend({['Experiment, R_{p}=0.56 \mum'], ... ['Model, \mu_0=', num2str(mu1, '%1.2f'),' pN/\mum, s_0=',num2str(x(1),'%1.2f'),'nm',char(10),'s_{max}=',num2str(x(2),'%1.2f'),' nm, p=',num2str(x(3),'%1.2f'),' nm, \sigma_{ap}=',num2str(sigma_ap,'%1.2f'), ' pN/\mum']}); %lgnd=legend({['June 18, 1990, R_{p}=0.56\mum'], ... % lgnd=legend({['June 18, 1990, R_{p}=0.56\mum, \sigma_{ap}= ',num2str(sigma_ap, '%1.2f')], ... % ['Model \mu_0=', num2str(mu1, '%1.2f'),'pN/\mum, l_0=',num2str(xa3(1),'%1.2f'),'nm',', L_{c}=',num2str(xa3(2),'%1.2f'),'nm, p=',num2str(xa3(3),'%1.2f'),'nm, \alpha=0'], ... % ['Model \mu_0=',num2str(mu2,'%1.2f'),'pN/\mum, l_0=',num2str(xa4(1),'%1.2f'),'nm',', L_{c}=',num2str(xa4(2),'%1.2f'),'nm, p=',num2str(xa4(3),'%1.2f'),'nm']}); set(lgnd,'FontSize',36); set(lgnd,'FontName','Arial','Location','southeast');