%Example2_17.m  modified from Example2_13.m
% estimates for multiplicative errors in line source application
clear all
format short g
t=[0.7916; 1.2916; 2.0833; 3.4582; 5.7081; 9.2913; 15.1660; 24.7490; 40.3320 ]
y =[65.2010; 66.2620; 67.3580; 68.5790; 69.8210; 71.0220; 72.0390; 73.2130; 74.3840 ]
y = y - 56;
figure(1); clf; plot(log(t),y,'b-o', 'linewidth', 1 );
xlabel('Ln(time)');
ylabel('Temperature, F')
C =[0.0200; 0.0200; 0.0200; 0.0200; 0.0200; 0.0200; 0.0800; 0.0800; 0.0800 ]
X=[ones(9,1) (0.25*36.3/pi)*log(t)];
Cr=y.*y;
V=diag(Cr');   % Example 2.5.1
b=lscov(X,y,V)  
T_ini = 56;    % initial temperature in F
omega = diag( 1./(y).^2 );
V = omega;    % Example 2.5.5
Z = X'*omega*X
X'*omega*(y)
bWLS = Z \ X'*omega*(y)