Documente Academic
Documente Profesional
Documente Cultură
360
340
320
Zenith Water Delay (ZWD)
1)
300
280
260
240
220
200
30
35
40
45
50
Precipitable Water Vapor (PWV)
55
60
65
2)
3)
Sigma=(V'*V)/(length(pwv)-length(X));
Qxx=inv(A'*A);
Sigmaxx=Sigma*Qxx
end
To use the function, just type (in Command Window):
Tasks1no3(pwv,zwd)
Result:
4)
Determine magnitude of correlation between zwd and pwv (use corrcoef command in Matlab).
The command:
%Determine magnitude of correlation between zwd and pwv
corrcoef(pwv,zwd)
Result:
3.8
3.7
3.6
Height
3.5
3.4
3.3
3.2
3.1
2)
10
20
30
40
50
Pressure
60
70
80
90
100
end
%Constructing Matrix Ln
for i=1:length(h);
L(i,1)=h(i)-(exp(1)^(-anol*p(i))+bnol);
end
%Constructing Matrix P (Weight)
P=1;
%Determining Parameter
X=inv(A'*P*A)*(A'*P*L);
a=0.1985+X(1);
b=3+X(2);
anol=a;
bnol=b;
end
%Show the result
a
b
iteration
end
To use the function, just type (in Command Window):
Tasks2no2(height_pwv)
Result:
3)
for i=1:length(p);
A(i,1)=-p(i)*exp(1)^(-anol*p(i));
A(i,2)=1;
end
%Constructing Matrix Ln
for i=1:length(h);
L(i,1)=h(i)-(exp(1)^(-anol*p(i))+bnol);
end
%Constructing Matrix P (Weight)
P=1;
%Determining Parameter
X=inv(A'*P*A)*(A'*P*L);
a=0.1985+X(1);
b=3+X(2);
anol=a;
bnol=b;
end
X=[a;b];
%Estimate precision
V=A*X-L;
Aposteriori=(V'*P*V)/(length(p)-length(X));
Kofaktor=inv(A'*P*A);
Sigmaxx=Aposteriori*Kofaktor
end
To use the function, just type (in Command Window):
Tasks2no3(height_pwv)
Result:
-1
-2
-3
-4
-5
2)
0.1
0.2
0.3
0.4
0.5
t
0.6
0.7
0.8
0.9
%Matrix P (weight)
P=1;
%Determining Matrik X
X=inv(A'*P*A)*(A'*P*L);
%Determine a and b
a=sqrt(X(1)^2+X(2)^2)
b=sqrt(X(3)^2+X(4)^2)
end
To use the function, just type (in Command Window):
Tasks3no2(wave)
Result:
3)
P=1;
%Determining Matrik X
X=inv(A'*P*A)*(A'*P*L);
%Determining a and b
a=sqrt(X(1)^2+X(2)^2);
b=sqrt(X(3)^2+X(4)^2);
%Determining Phase A dan Phase B
PhiA=rad2deg(atan(X(2)/X(1)))
PhiB=rad2deg(atan(X(4)/X(3)))
end
To use the function, just type (in Command Window):
Tasks3no3(wave)
Result:
1)
Apply standard least-square (SLS) technique to calculate the height of points B, C and D based on the
network of phase 1.
We used Matlab to solve the problem.
% Applying standard least square technique to determine unknown
parameters
% of phase 1, in this case, B, C, and D.
%Inputing the Matrix A
A1=[1 0 0;-1 1 0;0 -1 1;0 0 -1];
%Inputing the Matrix L
L1=[448.105;5.360;-8.523;-444.944];
%Inputing the Matrix P (Weight)
P1=diag([(1/0.006^2);(1/0.004^2);(1/0.005^2);(1/0.003^2)]);
%Determine Matrix X (Parameter)
x1=(inv(A1'*P1*A1))*(A1'*P1*L1);
%Showing the results
B1=x1(1,:)
C1=x1(2,:)
D1=x1(3,:)
Result:
10
2)
Using the same technique as in task 1, calculate the height of points B, C and D based on the network of
phase 2.
% Applying standard least square technique to determine unknown
parameter
% of phase 2, in this case, B, C, and D.
%Inputing the Matrix A
A2=[1 0 0;-1 1 0;0 -1 1;0 0 -1;-1 0 1;0 1 0];
%Inputing the Matrix L
L2=[448.105;5.360;-8.523;-444.944;-3.167;453.477];
%Inputing the Matrix P (Weight)
P2=diag([(1/0.006^2);(1/0.004^2);(1/0.005^2);(1/0.003^2);(1/0.004^2);
(1/0.012^2)]);
%Determine Matrix X (Parameter)
x2=(inv(A2'*P2*A2))*(A2'*P2*L2);
%Showing the results
B2=x2(1,:)
C2=x2(2,:)
D2=x2(3,:)
Result:
3)
Compare the results of tasks 1 and 2 and discuss the accuracy of the calculated height.
The result of the both of the phases are slightly different, we determined the accuracy of the phases by
determine the variance-covariance matrix of the phases.
% The accuracy of the calculated height.
% For phase 1
n_1=length(A_1);
u_1=length(x_1);
V_1=(A_1*x_1)-L_1;
Qxx_1=(inv(A_1'*P_1*A_1));
sigmaxx_1=(V_1'*P_1*V_1)/(n_1-u_1);
variance_covariance_1=sigmaxx_1*Qxx_1
% For phase 2
n_2=length(A_2);
u_2=length(x_2);
11
V_2=(A_2*x_2)-L_2;
Qxx_2=(inv(A_2'*P_2*A_2));
sigmaxx_2=(V_2'*P_2*V_2)/(n_2-u_2);
variance_covariance_2=sigmaxx_2*Qxx_2
Result:
As we have seen, phase 1 has a smaller variance value. It proves the phase 1 has better accuracy. this can
be caused by poor measurement in phase 2.
4)
Apply recursive least-square (RLS) technique to calculate the height of points B, C and D based on the
network of phases 1 and 2.
%Using recursive least square to calculate B, C, and D for phase 2.
K2=(inv((inv(Qxx1))+(A2'*P2*A2)))*A2'*P2;
dx2=K2*(L2-(A2*x1));
xR2=dx2+x1;
Brecursive=xR2(1,:)
Crecursive=xR2(2,:)
Drecursive=xR2(3,:)
Result:
12
5)
Compare the results of tasks 2 and 4 and discuss the accuracy of the calculated height.
% Show accuracy of height with using B, C, and D standard least square.
variance_covariance2
% Calculating accuracy of height with using B, C, and D recursive least
square.
VR2=(A2*xR2)-L2;
sigmaxxR2=(VR2'*P2*VR2)/(n2-u2);
variance_covarianceR2=sigmaxxR2*Qxx2
Result:
There are some differences in accuracy between phase 2 using standard least squares with phase 2 that uses
recursive least squares. From these results we see that using the standard least squares have better
accuracy. But the difference in accuracy between the two methods are not very far away.
6)
What are the advantages of using RLS for the above cases?
The advantages of using recursive least squares are we can perform calculations faster and saving the
computing power. Moreover, the differences in accuracy was not too far away.
13