Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
62 lines (52 sloc) 2.07 KB
%% Copyright 2014 MERCIER David
function model_doerner_nix(OPTIONS)
%% Function used to calculate Young's modulus in bilayer system with
% the model of Doerner & Nix (1986)
gui = guidata(gcf);
x = gui.results.t_corr./gui.results.hc;
x = checkValues(x);
% A(1) = Ef_red
% A(2) = alpha
bilayer_model = @(A, x) ...
(1e-9*(((1./(1e9*A(1)))*(1-exp(-A(2)*x))) + ...
((1./gui.data.Es_red)*(exp(-A(2)*x)))).^-1);
% Minimum and maximum boundaries for the constant alpha
min_alpha = gui.config.numerics.alpha_min_DoernerNix;
max_alpha = gui.config.numerics.alpha_max_DoernerNix;
% Make a starting guess
gui.results.A0 = [gui.data.Ef_red; (min_alpha + max_alpha)/2];
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] =...
lsqcurvefit(bilayer_model, gui.results.A0, x, ...
gui.results.Esample_red, ...
[gui.config.numerics.Min_YoungModulus ; min_alpha], ...
[gui.config.numerics.Max_YoungModulus ; max_alpha], ...
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)
A(1) = params(1);
A(2) = params(2);
FittedCurve = (1e-9*(((1./(1e9*A(1)))*(1-exp(-A(2)*x))) + ...
((1./gui.data.Es_red)*(exp(-A(2)*x)))).^-1);
gui.results.residual = FittedCurve - gui.results.Esample_red;
sse = sum(gui.results.residual .^ 2);
end
gui.results.Em_red = ...
(1e-9*(((1./(1e9*gui.results.Ef_red_sol_fit(1)))*...
(1-exp(-gui.results.Ef_red_sol_fit(2)*x))) + ...
((1./gui.data.Es_red)*(exp(-gui.results.Ef_red_sol_fit(2)*x)))).^-1);
gui.results.Ef_red = 1e-9*(((1./(1e9.*gui.results.Esample_red)) - ...
((1./gui.data.Es_red)*(exp(-gui.results.Ef_red_sol_fit(2).*x))))./...
(1-exp(-gui.results.Ef_red_sol_fit(2).*x))).^-1;
guidata(gcf, gui);
end
You can’t perform that action at this time.