Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (50 sloc) 2.16 KB
%% Copyright 2014 MERCIER David
function model_bec(OPTIONS)
%% Function used to calculate Young's modulus in bilayer system with
% the model of Bec et al. (2006)
gui = guidata(gcf);
x = gui.data.h;
x = checkValues(x);
bilayer_model = @(Ef_red_sol, x) ...
(1e-9*(((2.*gui.results.ac)./(1+2.*(gui.results.t_corr)./(pi.*gui.results.ac))) .* ...
(((gui.results.t_corr)./(pi.*gui.results.ac.^2.*1e9*Ef_red_sol) + ...
(1./(2.*gui.results.ac.*gui.data.Es_red))))).^-1);
% Make a starting guess
gui.results.A0 = gui.data.Ef_red;
if gui.config.licenceOpt_Flag
[gui.results.Ef_red_sol_fit, ...
gui.results.resnorm, ...
gui.results.residual, ...
gui.results.exitflag, ...
gui.results.output, ...
gui.results.lambda, ...
gui.results.jacobian] =...
minimizationProcess(bilayer_model, gui.results.A0, x, ...
gui.results.Esample_red, ...
gui.config.numerics.Min_YoungModulus, ...
gui.config.numerics.Max_YoungModulus, ...
OPTIONS);
else
model = @LMS;
gui.results.Ef_red_sol_fit = fminsearch(model, gui.results.A0, OPTIONS);
warning('No Optimization toolbox available !');
end
function [sse, FittedCurve] = LMS(params)
Ef_red_sol(1) = params(1);
FittedCurve = (1e-9*(((2.*gui.results.ac)./(1+2.*(gui.results.t_corr)./(pi.*gui.results.ac))) .* ...
(((gui.results.t_corr)./(pi.*gui.results.ac.^2.*1e9*Ef_red_sol) + ...
(1./(2.*gui.results.ac.*gui.data.Es_red))))).^-1);
gui.results.residual = FittedCurve - gui.results.Esample_red;
sse = sum(gui.results.residual .^ 2);
end
gui.results.Em_red = 1e-9 * ...
(((2.*gui.results.ac)./(1+2.*(gui.results.t_corr)./(pi.*gui.results.ac))) .* ...
((gui.results.t_corr./(pi.*gui.results.ac.^2.*(1e9*gui.results.Ef_red_sol_fit)) ...
+ (1./(2.*gui.results.ac*gui.data.Es_red))))).^-1;
gui.results.Ef_red = 1e-9 * ...
(((pi.*gui.results.ac.^2)./(gui.results.t_corr)) .* ...
(((1./(1e9.*gui.results.Esample_red)) .* ...
(((1+2.*(gui.results.t_corr)./(pi.*gui.results.ac)))./(2.*gui.results.ac))) - ...
(1./(2.*gui.results.ac.*gui.data.Es_red)))).^-1;
guidata(gcf, gui);
end
You can’t perform that action at this time.