Skip to content

Commit 3c964ae

Browse files
author
Crouse
committed
Update to Version 5.3
1 parent de14385 commit 3c964ae

File tree

270 files changed

+16018
-1910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+16018
-1910
lines changed

Assignment_Algorithms/2D_Assignment/numJPDAStarTarMeasHyps.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
%REFERENCES:
2626
%[1] H. A. P. Blom, E. A. Bloem, and D. Musicki, "JIPDA*: Automatic
2727
% target tracking avoiding track coalescence," IEEE Transactions on
28-
% Aerospace and Electronic Systems, vol. 51, no. 2, pp. 962974, Apr.
28+
% Aerospace and Electronic Systems, vol. 51, no. 2, pp. 962-974, Apr.
2929
% 2015.
3030
%[2] D. F. Crouse, Y. Bar-Shalom, P. Willett, and L. Svensson, "The JPDAF
3131
% in practical systems: Computation and snake oil," in Proceedings of

Assignment_Algorithms/Association_Probabilities_and_Specific_Updates/calc2DAssignmentProbsApprox.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
% approxType An optional parameter specifying the type of approximation to
2323
% use. The default if omitted is 0. Possible values are
2424
% 0 The sum-product belief propagation algorithm of [6].
25-
% 1 The Cheap JPDA of [1].
25+
% 1 The cheap JPDA of [1].
2626
% 2 The modified cheap JPDAF of [2].
2727
% 3 The algorithm of [3].
2828
% 4 The matrix permanent approximation algorithm of [7], which

Assignment_Algorithms/singleScanUpdate.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
% global nearest neighbor (GNN) update, a joint
88
% probabilistic data association (JPDA) update, a JPDA*
99
% update, a GNN-JPDA update, or approximate JPDA and
10-
% GNN-JPDA updates as well as a na�ve nearest neighbor
11-
% algorithm. In all instances except for the na�ve nearest
10+
% GNN-JPDA updates as well as a naive nearest neighbor
11+
% algorithm. In all instances except for the naive nearest
1212
% neighbor algorithm, it is assumed that each measurement
1313
% can be assigned to at most one target, and each target
1414
% can be assigned to at most one measurement.
@@ -41,13 +41,13 @@
4141
% 1) JPDA
4242
% 2) GNN
4343
% 3) Parallel single-target PDAs
44-
% 4) Na�ve nearest neighbor
44+
% 4) Naive nearest neighbor
4545
% 5) JPDA*
4646
% 6) Approximate GNN-JPDA
4747
% 7) Approximate JPDA
4848
% 8) Set JPDA
49-
% 9) Na�ve nearest neighbor JPDA
50-
% 10) Approximate na�ve nearest neighbor JPDA
49+
% 9) Naive nearest neighbor JPDA
50+
% 10) Approximate naive nearest neighbor JPDA
5151
% algSel2 An optional parameter that further specifies the algorithm
5252
% used when algSel1=6-7. If omitted but algSel1 is specified, a
5353
% default value of 0 is used. If both algSel1 and algSel2
@@ -94,7 +94,7 @@
9494
%association probabilities are computed. They are described in the comments
9595
%to the function calc2DAssignmentProbsApprox.
9696
%
97-
%Na�ve nearest neighbor association consists of just choosing the most
97+
%Naive nearest neighbor association consists of just choosing the most
9898
%likely assignment of a target to a measurement or missed detection without
9999
%regard to whether one measurmeent is assigned to multiple targets.
100100
%

Astronomical_Code/data/EOP.txt

Lines changed: 1152 additions & 802 deletions
Large diffs are not rendered by default.

Atmosphere_and_Refraction/Standard_Exponential_Model/Cart2RuvStdRefrac.m

Lines changed: 63 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function [z,uTx,uTarRx,uTarTx]=Cart2RuvStdRefrac(zC,useHalfRange,zTx,zRx,M,Ns,includeW,ce,ellipsOpts)
1+
function [z,uTx,uTarRx,uTarTx]=Cart2RuvStdRefrac(zC,useHalfRange,zTx,zRx,M,Ns,includeW,ce,rE,spherCent)
22
%%CART2RUVSTDREFRAC Convert points in Cartesian coordinates (either the
33
% global system or a local system at the receiver) into local
44
% bistatic r-u-v coordinates of the receiver, accounting for how a
@@ -34,14 +34,14 @@
3434
% vector of the local coordinate system of the receiver is the
3535
% pointing direction of the receiver. If this matrix is omitted,
3636
% then the identity matrix is used.
37-
% Ns The atmospheric refractivity reduced to the WGS-84 reference
38-
% ellipsoid. Note that the refractivity is (n-1)*1e6, where n is
39-
% the index of refraction. The function reduceStdRefrac2Spher can
40-
% be used to reduce a refractivity to the ellipsoidal surface.
41-
% This function does not allowe different refractivities to be
42-
% used as the transmitter and receiver. If this parameter is
43-
% omitted or an empty matrix is passed, a default value of 313 is
44-
% used.
37+
% Ns The atmospheric refractivity reduced to the reference sphere.
38+
% Note that the refractivity is (n-1)*1e6, where n is the index
39+
% of refraction. The function reduceStdRefrac2Spher can be used
40+
% to reduce a refractivity to the surface of a reference
41+
% ellipsoid. This function does not allow different
42+
% refractivities to be used as the transmitter and receiver. If
43+
% this parameter is omitted or an empty matrix is passed, a
44+
% default value of 313 is used.
4545
% includeW An optional boolean value indicating whether a third direction
4646
% cosine component should be included. The u and v direction
4747
% cosines are two parts of a 3D unit vector. Generally, one might
@@ -62,11 +62,15 @@
6262
% values for the two constants are expConst=0.005577; and
6363
% multConst=7.32; If ce is omitted or an empty matrix is passed,
6464
% the value based on the standard model is used.
65-
% ellipOpts Optioanlly, a structure that contains elements changing the
66-
% reference ellipsoid used. Possible entries are a for the
67-
% semi-major axis and f for the flattening factor. If this
68-
% parameter is omitted or an empty matrix is passed, then
69-
% a=Constants.WGS84SemiMajorAxis and f=Constants.WGS84Flattening.
65+
% rE,spherCent The radius of the Earth to use for the spherical Earth
66+
% approximation used in the model and also the offset between the
67+
% global model and the local spherical model. It is assumed that
68+
% zC,zTx,and zRx are all given in the global model and will need
69+
% to be transformed to the local model to the used. If rE is
70+
% omitted or an empty matrix is passed, then the default of
71+
% [rE,spherCent]=osculatingSpher4LatLon(Cart2Ellipse(zRx)) is
72+
% used. The defaults here mean that a WGS-84 reference ellipsoid
73+
% is approximated by the local osculating sphere.
7074
%
7175
%OUTPUTS: z The 3XN (or 4XN if includeW is true) matrix of location vectors
7276
% of the points in bistatic [r;u;v] coordinates. If
@@ -107,11 +111,11 @@
107111
%
108112
%EXAMPLE:
109113
%Here, we have two radars and one target near Hawaii.
110-
% latLonRx=[20.269202;-155.852051]*(pi/180);%Degrees converted to radians.
114+
% latLonRx=deg2rad([20.269202;-155.852051]);
111115
% AltRx=0;
112-
% latLonTx=[20.724568;-155.978394]*(pi/180);
116+
% latLonTx=deg2rad([20.724568;-155.978394]);
113117
% AltTx=0;
114-
% latLonTar=[20.835390;-155.313721]*(pi/180);
118+
% latLonTar=deg2rad([20.835390;-155.313721]);
115119
% AltTar=8e3;%8km target altitude.
116120
% %Convert locations to Cartesian.
117121
% zRx=ellips2Cart([latLonRx;AltRx]);
@@ -120,15 +124,15 @@
120124
%
121125
% %The receiver faces 45 degrees East of North and 15 degrees up from the
122126
% %local ellipsoidal level.
123-
% M=findRFTransParam([latLonRx;AltRx],45*(pi/180),15*(pi/180));
127+
% M=findRFTransParam([latLonRx;AltRx],deg2rad(45),deg2rad(15));
124128
% Ns=350;%Assumed refractivity at the sea surface.
125129
% useHalfRange=false;
126130
% includeW=true;%Include third dimension of unit vector.
127-
% [z,uTx,uTarRx,uTarTx]=Cart2RuvStdRefrac(zTar,useHalfRange,zTx,zRx,M,Ns,includeW)
128-
% zNoRefrac=Cart2Ruv(zTar,useHalfRange,zTx,zRx,M,includeW)
129-
% %One will see that the bistatic range differs by z(1)-zNoRefrac(1)=31.0806
130-
% %meters and the direction differs by
131-
% %angBetweenVecs(z(2:end),zNoRefrac(2:end))*(180/pi)=0.0927 degrees.
131+
% [z,uTx,uTarRx,uTarTx]=Cart2RuvStdRefrac(zTar,useHalfRange,zTx,zRx,M,Ns,includeW);
132+
% zNoRefrac=Cart2Ruv(zTar,useHalfRange,zTx,zRx,M,includeW);
133+
% z(1)-zNoRefrac(1)%Bistatic range difference of 31.0813 meters
134+
% %Direction difference of 0.0927 degrees
135+
% rad2deg(angBetweenVecs(z(2:end),zNoRefrac(2:end)))
132136
%
133137
%REFERENCES:
134138
%[1] D. F. Crouse, "Basic tracking using 3D monostatic and bistatic
@@ -180,19 +184,19 @@
180184
ce=log(Ns/(Ns+DeltaN))/1000;%Units of inverse meters.
181185
end
182186

183-
%Default parameters for the reference ellipsoid.
184-
a=Constants.WGS84SemiMajorAxis;
185-
f=Constants.WGS84Flattening;
186-
if(nargin>8&&~isempty(ellipsOpts))
187-
if(isfield(ellipsOpts,'a'))
188-
a=ellipsOpts.a;
189-
end
190-
191-
if(isfield(ellipsOpts,'f'))
192-
f=ellipsOpts.f;
193-
end
187+
if(nargin<9||isempty(rE))
188+
%Use the radius of the Earth that is the radius of the osculating
189+
%sphere at the location of the observed. This will be the radius used
190+
%in the local spherical Earth approximation for computing atmospheric
191+
%refraction. This uses the WGS-84 reference ellipsoid.
192+
[rE,spherCent]=osculatingSpher4LatLon(Cart2Ellipse(zRx));
194193
end
195194

195+
%Adjust all the Cartesian values based on the osculating sphere.
196+
zC=zC-spherCent;
197+
zTx=zTx-spherCent;
198+
zRx=zRx-spherCent;
199+
196200
%Allocate space
197201
if(includeW)
198202
z=zeros(4,numMeas);
@@ -205,8 +209,9 @@
205209

206210
if(any(zRx~=zTx))%If the scenario is bistatic
207211
for curMeas=1:numMeas
208-
[r1,uTx(:,curMeas),uTarTx(:,curMeas)]=atmosRefracMeas(zTx,zC(:,curMeas),Ns,ce,a,f);
209-
[r2,uArrive,uTarRx(:,curMeas)]=atmosRefracMeas(zRx,zC(:,curMeas),Ns,ce,a,f);
212+
[r2,uArrive,uTarRx(:,curMeas)]=atmosRefracMeas(zRx,zC(:,curMeas),Ns,ce,rE);
213+
[r1,uTx(:,curMeas),uTarTx(:,curMeas)]=atmosRefracMeas(zTx,zC(:,curMeas),Ns,ce,rE);
214+
210215
r=(r1+r2);
211216
u=M*uArrive;
212217

@@ -224,7 +229,7 @@
224229
end
225230
else%The scenario is monostatic.
226231
for curMeas=1:numMeas
227-
[range,uArrive,uTarRx(:,curMeas)]=atmosRefracMeas(zTx,zC(:,curMeas),Ns,ce,a,f);
232+
[range,uArrive,uTarRx(:,curMeas)]=atmosRefracMeas(zTx,zC(:,curMeas),Ns,ce,rE);
228233
uTx=uArrive;
229234
r=2*range;%Round-trip range.
230235
u=M*uArrive;
@@ -247,7 +252,7 @@
247252
end
248253
end
249254

250-
function [range,uArrive,uDepart]=atmosRefracMeas(xObs,xObj,Ns,ce,a,f)
255+
function [range,uArrive,uDepart]=atmosRefracMeas(xObs,xObj,Ns,ce,rE)
251256
%%ATMOSREFRACMEAS Given the location of an observer and an object in the
252257
% atmosphere of the Earth, find the delay and angle of
253258
% arrival of a signal from the object to the observer,
@@ -267,8 +272,9 @@
267272
% increasing the height by 1km, the model is that the
268273
% refractivity changes by deltaN=-multConst*exp(expConst*N).
269274
% deltaN cannot be negative.
270-
% a,f The semi-major axis and the flattening factor of the
271-
% reference ellipsoid to use.
275+
% rE The radius of the Earth to use in the spherical Earth
276+
% approximation. An osculating sphere near a sensor is
277+
% suggested.
272278
%
273279
%OUTPUTS: range The apparent one-way range (in meters) of the signal from
274280
% the transmitter to the target and back to the receiver.
@@ -295,25 +301,17 @@
295301
%May 2014 David F. Crouse, Naval Research Laboratory, Washington D.C.
296302
%(UNCLASSIFIED) DISTRIBUTION STATEMENT A. Approved for public release.
297303

298-
%The location of the observer in ellipsoidal coordinates.
299-
plhPoint=Cart2Ellipse(xObs,[],a,f);
300-
301-
%Find the radius of the Earth at the location of the observer. Use the
302-
%ellipsoidal Earth approximation. This will be the radius used in the local
303-
%spherical Earth approximation for computing atmospheric refraction.
304-
r0=norm(proj2Ellips(xObs,a,f));
305-
306304
%We need the conversion from the 3D coordinate system of the observer and
307305
%object into the 2D coordinate system used for raytracing. The 2D
308306
%coordinate system has the center of the Earth as its origin and the x-y
309307
%axes are in the plane of the vector from the observer to the target. One
310308
%vector common to both coordinate systems in the local up vector, which
311309
%will be the local y axis. The second vector common to both will be the
312310
%local x vector, which will be the projection of xObj-xObs onto the local
313-
%tangent plane. Here, the vertical is the WGS-84 vertical, since the
314-
%precision of the model is low enough that the difference between the
315-
%WGS-84 vertical and the gravitational vertical should not matter.
316-
uENU=getENUAxes(plhPoint);
311+
%tangent plane. Here, the vertical is the spherical model vertical. Since
312+
%the precision of the model is low enough that the difference between the
313+
%spherical and gravitational verticals shouldn't matter.
314+
uENU=getENUAxes(Cart2Ellipse(xObs,[],rE,0));
317315
uVertGlobal=uENU(:,3);
318316
uVertLocal=[0;1;0];
319317

@@ -356,7 +354,7 @@
356354
%refraction is not a constant 1.
357355
yMax=norm([x1Init;y1Init]);
358356

359-
range=((exp(ce*(r0-y0Init))-exp(ce*(r0-yMax)))*Ns)/(1e6*ce)+yMax-y0Init;
357+
range=((exp(ce*(rE-y0Init))-exp(ce*(rE-yMax)))*Ns)/(1e6*ce)+yMax-y0Init;
360358

361359
uArrive=vec2TarGlobal/norm(vec2TarGlobal);
362360
uDepart=-uArrive;
@@ -369,7 +367,7 @@
369367
%The initial guess is just the linear solution. The solver requires a fixed
370368
%number of steps. 20 is probably sufficient for things near the Earth. that
371369
%is, up to distances of, say 400km. We can scale the number of steps as 20
372-
%for every 400 kilometers with a minum of, say 10.
370+
%for every 400 kilometers with a minimum of, say 10.
373371
%Things outside of the atmosphere should use the astronomical refraction
374372
%routines.
375373
numSteps=max(20,ceil(20*norm(vec2TarLocal)/400e3));
@@ -381,12 +379,12 @@
381379

382380
%Now, solve the differential equation.
383381
oldOpts=bvpset();
384-
newOpts=bvpset(oldOpts,'RelTol',1e-8,'AbsTol',1e-8,'FJacobian',@(x,y)odefunJacob(x,y,Ns,r0,ce),'BCJacobian',@bcfunJacob);%Increase the accuracy.
385-
sol=bvp5c(@(x,y)expDiffEq(x,y,Ns,r0,ce),@(y0,y1)bcfun(y0,y1,y0Init,y1Init),solInit,newOpts);
382+
newOpts=bvpset(oldOpts,'RelTol',1e-8,'AbsTol',1e-8,'FJacobian',@(x,y)odefunJacob(x,y,Ns,rE,ce),'BCJacobian',@bcfunJacob);%Increase the accuracy.
383+
sol=bvp5c(@(x,y)expDiffEq(x,y,Ns,rE,ce),@(y0,y1)bcfun(y0,y1,y0Init,y1Init),solInit,newOpts);
386384

387385
%Get the refraction-corrupted range measurement for a signal traveling from
388386
%the object to the observer.
389-
range=integral(@(x)pathFun2D(x,sol,Ns,r0,ce),x0Init,x1Init,'AbsTol',eps(1),'RelTol',1e-15);
387+
range=integral(@(x)pathFun2D(x,sol,Ns,rE,ce),x0Init,x1Init,'AbsTol',eps(1),'RelTol',1e-15);
390388

391389
if(nargout>1)
392390
%Get the angle of arrival for a signal traveling from the object to the
@@ -406,10 +404,10 @@
406404
end
407405
end
408406

409-
function val=pathFun2D(x,sol,Ns,r0,ce)
407+
function val=pathFun2D(x,sol,Ns,rE,ce)
410408
%This function is used to integrate the time taken
411409
y=deval(x,sol);
412-
val=(1+NRefracExp(x,y(1,:),Ns,r0,ce)).*sqrt(1+y(2,:).^2);
410+
val=(1+NRefracExp(x,y(1,:),Ns,rE,ce)).*sqrt(1+y(2,:).^2);
413411
end
414412

415413
function res=bcfun(y0,y1,y0Init,y1Init)
@@ -430,28 +428,28 @@
430428
1 0];
431429
end
432430

433-
function J=odefunJacob(x,y,Ns,r0,ce)
431+
function J=odefunJacob(x,y,Ns,rE,ce)
434432
%The Jacobian of the differential equation for raytracing the 2D
435433
%exponential atmospheric model.
436-
expVal=NRefracExp(x,y(1),Ns,r0,ce);
434+
expVal=NRefracExp(x,y(1),Ns,rE,ce);
437435

438436
J=zeros(2,2);
439437
J(1,2)=1;
440438
J(2,1)=ce*(1+y(2)^2)*(-expVal)*(ce*y(1)*(x*y(2)-y(1))*sqrt(x^2+y(1)^2)+x*(x+y(1)*y(2))*(expVal+1))/((x^2+y(1)^2)^(3/2)*(expVal+1)^2);
441439
J(2,2)=ce*(x-2*y(1)*y(2)+3*x*y(2)^2)*expVal/((expVal+1)*sqrt(x^2+y(1)^2));
442440
end
443441

444-
function dxdy=expDiffEq(x,y,Ns,r0,ce)
442+
function dxdy=expDiffEq(x,y,Ns,rE,ce)
445443
%Find the refractivity at location (x,y).
446-
expVal=NRefracExp(x,y(1),Ns,r0,ce);
444+
expVal=NRefracExp(x,y(1),Ns,rE,ce);
447445

448446
dxdy=[y(2)
449447
ce*(1+y(2)^2)*(x*y(2)-y(1))*expVal/((expVal+1)*sqrt(x^2+y(1)^2))];
450448
end
451449

452-
function nRefrac=NRefracExp(x,y,Ns,r0,ce)
450+
function nRefrac=NRefracExp(x,y,Ns,rE,ce)
453451
%The refractivity. This is 10^6*(index of refraction-1)
454-
nRefrac=1e-6*Ns*exp(-ce*(sqrt(x.^2+y.^2)-r0));
452+
nRefrac=1e-6*Ns*exp(-ce*(sqrt(x.^2+y.^2)-rE));
455453
end
456454

457455
%LICENSE:

0 commit comments

Comments
 (0)