function LpvsPcurve = DoOnceThrough_FigLrho(varparams, Lmax)% DoOnceThrough executes one curvf fit iteration of the DoMuMatchFitLSQRd % routine and generates figures, %Initialization %close all; %Set the biconcave shape template, enter material constants and cell dimensions: INPUTS = make_INPUTS_FitMud; % INPUTS{1} is the AREA _TEMPLATE % INPUTS{2} is PROPS % INPUTS{3} is dims % INPUTS{4} is INDEX (# of points in different cell regions) % INPUTS{5} is rstart % INPUTS{6} is lam0 dims = INPUTS{3}; Lp = dims{1}; Rp = dims{3}; nvals = size(Lp); PROPS = INPUTS{2}; PROPS{2} = Lmax; % substitute the current value of Lmax into PROPS % Adjust the lammax distribution distr_s0 = PROPS{7}; lammax = Lmax./distr_s0(1,:); distr_lmax = [lammax; distr_s0(2,:)]; PROPS{8} = distr_lmax; PROPS{5} = varparams(1); INPUTS{2} = PROPS; INPUTS_rev = INPUTS; %Stuff everything into INPUTS_rev to pass forward. % The cell data to be fit are loaded in Make inputs via a call to load cell % data. The following could be used for plotting, but for now are commented % out to avoid confusion. There are three different experimental days. % These are data points from 6/18, 6/19 and 6/20/90, corrected data (See MUTEST.xls) % For 620, Dp = 1.7 um; For 6/19 and 6/18, Dp = 1.1 um % PRpdata620 = [10.3618 12.4342 14.5065 16.5789 20.7236 24.8684 20.7236 16.5789 14.5065 12.4342 10.3618 8.2895 6.2171]; % LoRpdata620 = [1.2742 1.3762 1.4911 1.5989 1.7500 1.9875 1.8435 1.6672 1.6036 1.4543 1.2899 1.1992 0.9612]; % LoRpErr620 = [0.2405 0.2087 0.2001 0.1843 0.1693 0.1699 0.1479 0.1577 0.0586 0.1501 0.1197 0.1343 0.1211]; % PRpdata620 = [10.3618 12.4342 14.5065 16.5789 20.7236 24.8684 ]; % LoRpdata620 = [1.2742 1.3762 1.4911 1.5989 1.7500 1.9875 ]; % LoRpErr620 = [0.2405 0.2087 0.2001 0.1843 0.1693 0.1699 ]; % For 6/19, Dp = 1.1 um % % PRpdata619 = [13.734 16.4808 19.2276 21.9744 27.468 21.9744 16.4808 10.9872 8.2404]; % LoRpdata619 = [1.22679 1.42679 1.55536 1.68929 1.90357 1.72143 1.52321 1.19107 0.97024]; % LoRpErr619 = [0.06469 0.08685 0.10762 0.113 0.11269 0.135 0.14037 0.1243 0.1171]; PRpdata619 = [13.734 16.4808 19.2276 21.9744 27.468 ]; LoRpdata619 = [1.22679 1.42679 1.55536 1.68929 1.90357 ]; LoRpErr619 = [0.06469 0.08685 0.10762 0.113 0.11269 ]; % % % For 6/18, Dp = 1.1 um % % PRpdata618 = [8.31397 11.0853 13.85662 16.6280 19.3993 22.1706 27.7133 22.1706 16.6280 11.0853]; % LoRpdata618 = [1.16056 1.32491 1.49178 1.6182 1.75727 1.9115 2.03894 1.86549 1.66119 1.33755]; % LoRpErr618 = [0.11911 0.1365 0.11593 0.13279 0.10204 0.07782 0.12415 0.08072 0.09389 0.16409]; % 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 ]; % %varparam = [bovers0, sigap]; LoRp = Lp./Rp; %Set values for b, sigap: %varparams = [5.59, 10.26]; [sumsqerr, PxRp_th] = SumSqrErr_plotsLrho(LoRp,varparams,INPUTS_rev); disp(['Fitted values: b, sigap, SSQERR = ', num2str(varparams),' ',num2str(sumsqerr)]); % % BD = zeros(nvals(2),4); % Area_target = zeros(1,50); % count = 0; % for j = 1:nvals(2) % count = count+1; % BD(count,1)= Rp; % BD(count,2) = Lp(j); % resall = DoCellMu_MatchBD(INPUTS,j); % BD(count,3) = resall(3,1); % the value of taum at the tip of the projection. % BD(count,4) = resall(7,1); % the value of lamda at the tip of the projection. % leg = ['Rp = ',num2str(Rp),' Lammax = ',num2str(Lammax), ' b/s0 = ', num2str(PROPS(5))]; % % Curves data contains lamda at the tip in the first row, lamda m at the % % base of the pipette in the second row, the A0 at the base of the pipette % % in the third row, and lamda f at the base of the pipette in the fourth % % row. % % outname = ['CurveData' num2str(j)]; % % curvedata = Curves'; % % dlmwrite(outname,curvedata); % fignumgap = 3*(count-1); % figure(2+fignumgap); % hold on; % plot(resall(1,:),resall(7,:), resall(1,:), resall(8,:)); % xlabel ('s'); % ylabel('lamm/lamf'); % figure(3+fignumgap); % hold on; % plot(resall(1,:),resall(10,:)); % xlabel ('s'); % ylabel('rho'); % figure(4+fignumgap); % hold on; % plot(resall(5,:),resall(4,:)); % plot(resall(5,:), -resall(4,:)); % xlabel ('z'); % ylabel('r'); % axis equal; % % contourtop = [resall(5,:); resall(4,:)]; % % contourbot = [resall(5,:); -resall(4,:)]; % % dlmwrite('ContourData.txt', contourtop'); % % dlmwrite('ContourData.txt', contourbot', '-append'); % end % BDout = BD'; % disp('DATA SUMMARY'); % disp(['For lamda max = ', num2str(Lammax)]); % disp(' Rp , Lp, tau at tip, lam0'); % for n = 1:count % disp([num2str(BDout(1,n)), ', ',num2str(BDout(2,n)), ' , ',num2str(BDout(3,n)), ', ',num2str(BDout(4,n))]); % end % % LoRp = BDout(2,:)./BDout(1,:); % PxRp = 2*BDout(3,:); figure(5); hold on; Lmax = PROPS{2}; x = PxRp_th; y = LoRp; %plot(x,y,'b'); sigap = varparams(2); rho = PROPS{6}; leg = strcat('6/19/90: Rp = ',num2str(Rp), ' sigap = ',num2str(sigap),' b = ', ... num2str(varparams(1)),' rho = ',num2str(rho),' Lmax = ',num2str(Lmax)); plot(x,y,'k','LineWidth',2.0); % errorbar(PRpdata620,LoRpdata620,LoRpErr620,'rs') %, ... % 'MarkerEdgeColor',[.5,1,.5], ... % 'MarkerFaceColor',[.5,1,.5]); errorbar(PRpdata619,LoRpdata619,LoRpErr619,'bs') % errorbar(PRpdata618,LoRpdata618,LoRpErr618,'rs'); xlabel('PxRp'); ylabel('Lp/Rp'); title(leg); % % Additional curves % PxRp_approx = [11.2859401 13.02672382 15.73856731 18.65670614 21.9319743 27.36343706 33.1128095 42.49113289]; % LpRp_approx = [1.1 1.2 1.35 1.5 1.65 1.85 2 2.15]; % PxRp_bs0_075 = [6.5096 8.7316 11.758 14.884 18.02 22.4816 25.8218 29.887 31.087]; % LpRp_bs0_075 = [1.1 1.2 1.35 1.5 1.65 1.85 2 2.15 2.2]; % plot(PxRp_approx, LpRp_approx, 'b', 'LineWidth', 2); % plot(PxRp_bs0_075, LpRp_bs0_075, 'r', 'LineWidth', 2); LpvsPcurve = [x',y'];