%% TP en Conversion d'Énergie
%% Session 2. Uncertainty calculation. Recall the equation for the type B uncertainty calculation
%% U=\pm \sqrt{{\left(\hat{x} \cdot k_% \right)}^2 +{\left(\textrm{digits}\right)}^2 }
%
%% 1 Direct measurement trough the ohmmeter with auto-range

% Fill the fields below with your measurements
% #### Be careful to be consistent with the units ####

% Initialization
close all;
clear all; 
clc;

% Measured resistance
x       =   ;           % unit = ?

% Instrument coverage factor
k       =   2.6;        % unit = N/A   

% Ohmmeter range
range   =   ;           % unit = ?

% Ohmmeter resolution
res     =   ;           % unit = ?

% percentage of reading
perc    =   /100;       % unit = ?

% number of digits
nod     =   *res;       % unit = ?

% Calculate here the expanded uncertainty
U1      =                                   % unit = ?

% Calculate here the standard uncertainty
u1      =   U1/k                            % unit = ?

%
%% 2 Direct measurement trough the ohmmeter with range 40\;k\Omega

% Fill the fields below with your measurements
% #### Be careful to be consistent with the units ####

% Measured resistance
x       =   ;           % unit = ?

% Instrument coverage factor
k       =   2.6;        % unit = N/A   

% Ohmmeter range
range   =   ;           % unit = ?

% Ohmmeter resolution
res     =   ;           % unit = ?

% percentage of reading
perc    =   /100;       % unit = ?

% number of digits
nod     =   *res;       % unit = ?

% Calculate here the expanded uncertainty
U2      =                                   % unit = ?   

% Calculate here the standard uncertainty
u2      =   U2/k                            % unit = ?

%
%% 3 Indirect measurement trough the voltmeter-ammeter method. 10\;A current input

% Fill the fields below with your measurements
% #### Be careful to be consistent with the units ####

%% 3.1 Current measurement

% Measured current
xc      =   ;           % unit = ?

% Instrument coverage factor
k       =   2.6;        % unit = N/A   

% Ammeter range
range   =   ;           % unit = ?

% Ammeter resolution
res     =   ;           % unit = ?

% percentage of reading
perc    =   /100;       % unit = ?

% number of digits
nod     =   *res;       % unit = ?

% Calculate here the expanded uncertainty
U3c     =                                   % unit = ?   

% Calculate here the standard uncertainty
u3c     =   U3c/k                           % unit = ?

%% 3.2 Voltage measurement

% Measured voltage
xv      =   ;           % unit = ?

% Instrument coverage factor
k       =   2.6;        % unit = N/A   

% Voltmeter range
range   =   ;           % unit = ?

% Voltmeter resolution
res     =   ;           % unit = ?

% percentage of reading
perc    =   /100;       % unit = ?

% number of digits
nod     =   *res;       % unit = ?

% Calculate here the expanded uncertainty
U3v     =                                   % unit = ?   

% Calculate here the standard uncertainty
u3v     =   U3v/k                           % unit = ?

%% 3.3 Resistance calculation and propagation of the uncertainty

% Calculate here the resistance
R       =               % unit = ?

% Calculate here the expanded uncertainty
U3      =                                   % unit = ?   

% Calculate here the standard uncertainty
ur3      =   U3/k                           % unit = ?

%% 4 Indirect measurement trough the voltmeter-ammeter method. \textrm{mA}/\mu A current input

% Fill the fields below with your measurements
% #### Be careful to be consistent with the units ####

%% 4.1 Current measurement

% Measured current
xc      =   ;           % unit = ?

% Instrument coverage factor
k       =   2.6;        % unit = N/A   

% Ammeter range
range   =   ;           % unit = ?

% Ammeter resolution
res     =   ;           % unit = ?

% percentage of reading
perc    =   /100;       % unit = ?

% number of digits
nod     =   *res;       % unit = ?

% Calculate here the expanded uncertainty
U4c     =                                   % unit = ?   

% Calculate here the standard uncertainty
u4c     =   U4c/k                           % unit = ?

%% 4.2 Voltage measurement

% Measured voltage
xv      =   ;           % unit = ?

% Instrument coverage factor
k       =   2.6;        % unit = N/A   

% Voltmeter range
range   =   ;           % unit = ?

% Voltmeter resolution
res     =   ;           % unit = ?

% percentage of reading
perc    =   /100;       % unit = ?

% number of digits
nod     =   *res;       % unit = ?

% Calculate here the expanded uncertainty
U4v     =                                   % unit = ?   

% Calculate here the standard uncertainty
u4v     =   U4v/k                           % unit = ?

%% 3.3 Resistance calculation and propagation of the uncertainty

% Calculate here the resistance
R       =               % unit = ?

% Calculate here the expanded uncertainty
U4      =                                   % unit = ?   

% Calculate here the standard uncertainty
ur4      =   U4/k                           % unit = ?