Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (56 sloc) 2.89 KB
%% Copyright 2014 MERCIER David
function model_perriot_barthel(OPTIONS)
%% Function used to calculate Young's modulus in bilayer system with
% the model of Perriot et al. (2004)
gui = guidata(gcf);
x = gui.results.t_corr./gui.results.ac;
x = checkValues(x);
% Coefficient 'n_perriot' between 1.06 and 1.32 function of the ratio Es/Ef !!!
bilayer_model = @(Ef_red_sol, x) (1e-9*((1e9*Ef_red_sol(1)) + ...
((gui.data.Es_red-(1e9*Ef_red_sol(1)))./ ...
(1+(x.*(10.^(-0.093+0.792.*log10(gui.data.Es_red./(1e9*Ef_red_sol(1))) + ...
0.05.*(log10(gui.data.Es_red./(1e9*Ef_red_sol(1))).^2)))).^Ef_red_sol(2)))));
% Minimum and maximum boundaries for the constant alpha
min_n = gui.config.numerics.n_min_Perriot;
max_n = gui.config.numerics.n_max_Perriot;
% Make a starting guess at the solution (Ef in GPa)
gui.results.A0 = [gui.data.Ef_red; (min_n + max_n)/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] =...
minimizationProcess(bilayer_model, gui.results.A0, x, ...
gui.results.Esample_red, ...
[gui.config.numerics.Min_YoungModulus; min_n], ...
[gui.config.numerics.Max_YoungModulus; max_n], ...
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);
Ef_red_sol(2) = params(2);
FittedCurve = (1e-9*((1e9*Ef_red_sol(1)) + ...
((gui.data.Es_red-(1e9*Ef_red_sol(1)))./ ...
(1+(x.*(10.^(-0.093+0.792.*log10(gui.data.Es_red./(1e9*Ef_red_sol(1))) + ...
0.05.*(log10(gui.data.Es_red./(1e9*Ef_red_sol(1))).^2)))).^Ef_red_sol(2)))));
gui.results.residual = FittedCurve - gui.results.Esample_red;
sse = sum(gui.results.residual .^ 2);
end
gui.results.Em_red = 1e-9*((1e9*gui.results.Ef_red_sol_fit(1))+...
((gui.data.Es_red-(1e9*gui.results.Ef_red_sol_fit(1))) ./ ...
(1+(x.*(10.^(-0.093+0.792.*log10(gui.data.Es_red./(1e9*gui.results.Ef_red_sol_fit(1))) + ...
0.05 .* (log10(gui.data.Es_red./(1e9*gui.results.Ef_red_sol_fit(1))).^2)))).^gui.results.Ef_red_sol_fit(2))));
gui.results.Ef_red = 1e-9*(((1e9.*gui.results.Esample_red)-...
(gui.data.Es_red./(1+(x.*(10.^(-0.093+0.792.*log10(gui.data.Es_red./(1e9*gui.results.Ef_red_sol_fit(1))) + ...
0.05 .* (log10(gui.data.Es_red./(1e9*gui.results.Ef_red_sol_fit(1))).^2)))).^gui.results.Ef_red_sol_fit(2)))) ./ ...
(1-(1./(1+(x.*(10.^(-0.093+0.792.*log10(gui.data.Es_red./(1e9*gui.results.Ef_red_sol_fit(1))) + ...
0.05 .* (log10(gui.data.Es_red./(1e9*gui.results.Ef_red_sol_fit(1))).^2)))).^gui.results.Ef_red_sol_fit(2)))));
guidata(gcf, gui);
end
You can’t perform that action at this time.