Code covered by the BSD License  

Highlights from
nanoind_data_analysis

image thumbnail

nanoind_data_analysis

by

 

06 Sep 2013 (Updated )

A MATLAB GUI to plot and to analyze (nano)indentation data (obtained with conical indenters)

plot_exp_vs_mod_setvariables.m
%% Copyright 2013 MERCIER David
%% Script used to set variables for the plot exp. vs. mod.
if flag_data == 0
    helpdlg('Import data first !','!!!');
    
    %% Initialization
else
    set(MainWindows, 'CurrentAxes', AxisPlot_GUI);
    clear Ef_sol;
    clear Ef_mean;
    if num_thinfilm == 1 % Only a bulk material
        clear Ef_red;
        clear Em_red;
        
        %Preallocation
        Ef_red = NaN(length(h), 1);
        Em_red = NaN(length(h), 1);
        
        for ii = 1:1:length(h)
            Ef_red(ii) = 0;
            Ef_red    = Ef_red.';
            Em_red(ii) = 0;
            Em_red    = Em_red.';
        end
        
        t = max(h)+1;
        Ef_sol_fit = 0;
        
    end
    
    if val4 == 4
        % Preallocation
        Ef_mean = NaN(length(h), 1);
        
        for ii = 1:1:length(h)
            if h(ii) < t && num_thinfilm == 1
                Ef_mean(ii) = Ef_red(ii);
                
            elseif h(ii) < t && num_thinfilm ~= 1
                Ef_mean(ii) = Ef(ii);
                
            end
        end
        Ef_sol = mean(Ef_mean);
    end
    
    %% Setting of the plot - Defintion of variables
    if val3 == 1
        x2plot = h;
        xlabelstr = 'Displacement (nm)';
        xmax = round(max(h));
        xmin = 0;
        title_str = strcat('Max displacement = ', num2str(round(max(h))), 'nm');
        
    elseif val3 == 2
        x2plot = ac./t;
        xlabelstr = 'Contact Radius/Film Thickness';
        xmax = round(max(ac./t));
        xmin = round(min(ac./t));
        title_str = strcat('Max displacement = ', num2str(round(max(h))), 'nm');
        
    elseif val3 == 3
        x2plot = h/t;
        xlabelstr = 'Displ./Film Thickness';
        xmax = round(max(h/t));
        xmin = 0;
        title_str = strcat('Max displacement = ', num2str(round(max(h))), 'nm');
        
    end
    
    
    if val4 == 1
        y2plot = P;
        delta_y2plot = delta_P;
        y2plot_2 = P_fit;
        ylabelstr = 'Load (mN)';
        ymax = round(max(P.*1000)./10)./100;
        title_str = strcat('Loading work (W)  = ', num2str(W), 'J', ' / ', ' Exposant of the power law fit  = ', num2str(exp_fit));
        
    elseif val4 == 2
        y2plot = S;
        delta_y2plot = delta_S;
        ylabelstr = 'Stiffness(mN/nm)';
        ymax = round(max(S.*1000)./10)./100;
        title_str = [];
        
    elseif val4 == 3
        y2plot = Esample_red;
        delta_y2plot = 0;
        y2plot_2 = Em_red;
        ylabelstr = 'Reduced Young''s modulus (sample) (GPa)';
        ymax = mean(Esample_red) + 0.3*mean(Esample_red);
        
    elseif val4 == 4
        y2plot = Esample_red;
        delta_y2plot = 0;
        y2plot_2 = Ef_red;
        ylabelstr = 'Reduced Young''s modulus (film) vs. Young''s modulus(film + substrate) (GPa)';
        ymax = mean(Esample_red)+0.3*mean(Esample_red);
        
    elseif val4 == 5
        y2plot = H;
        delta_y2plot = 0;
        ylabelstr = 'Hardness (GPa)';
        ymax = mean(H)+0.3*mean(H);
        title_str = strcat('Mean Hardness = ', num2str(round(mean(H.*1000)./10)./100), 'GPa');
        
    end
    
end

Contact us