Changeset 2109 in ntrip
- Timestamp:
- Dec 14, 2009, 8:31:21 AM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmodel.cpp
r2108 r2109 70 70 prn = prnIn; 71 71 index_old = 0; 72 x0 = 0.0;73 72 xx = 0.0; 74 73 } … … 83 82 double bncParam::partial(t_satData* satData, const QString& prnIn) { 84 83 if (type == CRD_X) { 85 return (x 0- satData->xx(1)) / satData->rho;84 return (xx - satData->xx(1)) / satData->rho; 86 85 } 87 86 else if (type == CRD_Y) { 88 return (x 0- satData->xx(2)) / satData->rho;87 return (xx - satData->xx(2)) / satData->rho; 89 88 } 90 89 else if (type == CRD_Z) { 91 return (x 0- satData->xx(3)) / satData->rho;90 return (xx - satData->xx(3)) / satData->rho; 92 91 } 93 92 else if (type == RECCLK) { … … 196 195 t_satData* satData = it2.value(); 197 196 198 ColumnVector dx= satData->xx - _xcBanc.Rows(1,3);199 double rho = dx.norm_Frobenius();197 ColumnVector rr = satData->xx - _xcBanc.Rows(1,3); 198 double rho = rr.norm_Frobenius(); 200 199 201 200 double neu[3]; 202 xyz2neu(_ellBanc.data(), dx.data(), neu);201 xyz2neu(_ellBanc.data(), rr.data(), neu); 203 202 204 203 satData->eleSat = acos( sqrt(neu[0]*neu[0] + neu[1]*neu[1]) / rho ); … … 357 356 if (_static) { 358 357 if (x() == 0.0 && y() == 0.0 && z() == 0.0) { 359 _params[0]->x0 = _xcBanc(1); 360 _params[1]->x0 = _xcBanc(2); 361 _params[2]->x0 = _xcBanc(3); 362 } 363 else { 364 _params[0]->x0 += _params[0]->xx; 365 _params[1]->x0 += _params[1]->xx; 366 _params[2]->x0 += _params[2]->xx; 358 _params[0]->xx = _xcBanc(1); 359 _params[1]->xx = _xcBanc(2); 360 _params[2]->xx = _xcBanc(3); 367 361 } 368 362 } 369 363 else { 370 _params[0]->x 0= _xcBanc(1);371 _params[1]->x 0= _xcBanc(2);372 _params[2]->x 0= _xcBanc(3);364 _params[0]->xx = _xcBanc(1); 365 _params[1]->xx = _xcBanc(2); 366 _params[2]->xx = _xcBanc(3); 373 367 374 368 _QQ(1,1) += sig_crd_p * sig_crd_p; … … 379 373 // Receiver Clocks 380 374 // --------------- 381 _params[3]->x 0= _xcBanc(4);375 _params[3]->xx = _xcBanc(4); 382 376 for (int iPar = 1; iPar <= _params.size(); iPar++) { 383 377 _QQ(iPar, 4) = 0.0; … … 388 382 // ------------------ 389 383 if (_estTropo) { 390 _params[4]->x0 += _params[4]->xx;391 384 _QQ(5,5) += sig_trp_p * sig_trp_p; 392 }393 394 // Ambiguities395 // -----------396 for (int iPar = 1; iPar <= _params.size(); iPar++) {397 if (_params[iPar-1]->type == bncParam::AMB_L3) {398 _params[iPar-1]->x0 += _params[iPar-1]->xx;399 }400 }401 402 // Nullify the Solution Vector403 // ---------------------------404 for (int iPar = 1; iPar <= _params.size(); iPar++) {405 _params[iPar-1]->xx = 0.0;406 385 } 407 386 } … … 414 393 const static double MAXRES_PHASE = 0.10; 415 394 416 ColumnVector xx;395 ColumnVector dx; 417 396 418 397 bool outlier = false; … … 436 415 predict(epoData); 437 416 438 SymmetricMatrix QQsav = _QQ;439 417 // Create First-Design Matrix 418 // -------------------------- 440 419 unsigned nPar = _params.size(); 441 420 unsigned nObs = _usePhase ? 2 * epoData->size() : epoData->size(); 442 421 443 // Set Solution Vector444 // -------------------445 xx.ReSize(nPar);446 QVectorIterator<bncParam*> itPar(_params);447 while (itPar.hasNext()) {448 bncParam* par = itPar.next();449 xx(par->index) = par->xx;450 }451 452 // Create First-Design Matrix453 // --------------------------454 422 Matrix AA(nObs, nPar); // first design matrix 455 423 ColumnVector ll(nObs); // tems observed-computed … … 479 447 if (_params[iPar-1]->type == bncParam::AMB_L3 && 480 448 _params[iPar-1]->prn == prn) { 481 ll(iObs) -= _params[iPar-1]->x 0;449 ll(iObs) -= _params[iPar-1]->xx; 482 450 } 483 451 AA(iObs, iPar) = _params[iPar-1]->partial(satData, prn); … … 488 456 // Compute Kalman Update 489 457 // --------------------- 490 if (false) { 491 SymmetricMatrix HH; HH << PP + AA * _QQ * AA.t(); 492 SymmetricMatrix Hi = HH.i(); 493 Matrix KK = _QQ * AA.t() * Hi; 494 ColumnVector v1 = ll - AA * xx; 495 xx = xx + KK * v1; 496 IdentityMatrix Id(nPar); 497 _QQ << (Id - KK * AA) * _QQ; 498 } 499 else { 500 Matrix ATP = AA.t() * PP; 501 SymmetricMatrix NN = _QQ.i(); 502 ColumnVector bb = NN * xx + ATP * ll; 503 NN << NN + ATP * AA; 504 _QQ = NN.i(); 505 xx = _QQ * bb; 506 } 458 SymmetricMatrix QQsav = _QQ; 459 Matrix ATP = AA.t() * PP; 460 SymmetricMatrix NN = _QQ.i(); 461 NN << NN + ATP * AA; 462 _QQ = NN.i(); 463 dx = _QQ * ATP * ll; 507 464 508 465 // Outlier Detection 509 466 // ----------------- 510 ColumnVector vv = ll - AA * xx;467 ColumnVector vv = ll - AA * dx; 511 468 512 469 iObs = 0; … … 540 497 } while (outlier); 541 498 542 // Set Solution Vector back543 // ------------------- -----499 // Set Solution Vector 500 // ------------------- 544 501 QVectorIterator<bncParam*> itPar(_params); 545 502 while (itPar.hasNext()) { 546 503 bncParam* par = itPar.next(); 547 par->xx = xx(par->index);504 par->xx += dx(par->index); 548 505 } 549 506 -
trunk/BNC/bncmodel.h
r2108 r2109 43 43 return (type == CRD_X || type == CRD_Y || type == CRD_Z); 44 44 } 45 double solVal() const {return x0 + xx;} 46 double aprVal() const {return x0;} 45 double solVal() const {return xx;} 47 46 parType type; 48 47 double xx; 49 double x0;50 48 int index; 51 49 int index_old;
Note:
See TracChangeset
for help on using the changeset viewer.