Question
Hi,Dago
I'm trying to do PPP with
SolverGeneral? based on example, but I can't get expect result.
Here is my codes to setup the equation system and solver.
// prepare solver general
StochasticModel sm_dx;
StochasticModel sm_dy;
StochasticModel sm_dz;
WhiteNoiseModel sm_cdt;
RandomWalkModel sm_trop(3.0e-8);
PhaseAmbiguityModel sm_ambi;
// equation system
Variable v_dx(TypeID::dx,&sm_dx,true,false,1e4);
Variable v_dy(TypeID::dy,&sm_dy,true,false,1e4);
Variable v_dz(TypeID::dz,&sm_dz,true,false,1e4);
Variable v_cdt(TypeID::cdt,&sm_cdt,true,false,9e10);
Variable v_trop(TypeID::wetMap,&sm_trop,true,false,0.25);
Variable v_ambLC(TypeID::BLC,&sm_ambi,true,true,4e14,1.0,true);
Variable v_prefitPC(TypeID::prefitC);
Variable v_prefitLC(TypeID::prefitL);
Equation equPC(v_prefitPC);
equPC.addVariable(v_dx);
equPC.addVariable(v_dy);
equPC.addVariable(v_dz);
equPC.addVariable(v_cdt);
equPC.addVariable(v_trop);
Equation equLC(v_prefitLC);
equLC.addVariable(v_dx);
equLC.addVariable(v_dy);
equLC.addVariable(v_dz);
equLC.addVariable(v_cdt);
equLC.addVariable(v_trop);
equLC.addVariable(v_ambLC);
equLC.setWeight(10000.0);
// equation system
EquationSystem equSystem;
equSystem.addEquation(equPC);
equSystem.addEquation(equLC);
SolverGeneral genSolver(equSystem);
And I try to get the solution like this:
gRin >> requireObs // Check if required observations are present
>> linear1 // Compute linear combinations to detect CS
>> markCSLI // Mark cycle slips: LI algorithm
>> markCSMW // Mark cycle slips: Melbourne-Wubbena
>> markArc // Keep track of satellite arcs
// >> decimateData // If not a multiple of 900 s, decimate
>> basic // Compute the basic components of model
>> eclipsedSV // Remove satellites in eclipse
>> grDelay // Compute gravitational delay
>> svPcenter // Compute the effect of satellite phase center
>> corr // Correct observables from tides, etc.
>> windup // Compute wind-up effect
>> computeTropo // Compute tropospheric effect
>> linear2 // Compute ionosphere-free combinations
>> pcFilter // Filter out spurious data
>> phaseAlign // Align phases with codes
>> linear3 // Compute prefit residuals
>> baseChange // Prepare to use North-East-UP reference frame
>> cDOP // Compute DOP figures
>> genSolver;
// Print here the position results
cout <<setw(8)<<setprecision(1) << time.DOYsecond() << " ";
SourceID source(gRin.header.source);
cout << setw(10)<<setprecision(6) << genSolver.getSolution(TypeID::dx,source) << " ";
cout << setw(10)<<setprecision(6) << genSolver.getSolution(TypeID::dy,source) << " ";
cout << setw(10)<<setprecision(6) << genSolver.getSolution(TypeID::dz,source) << " ";
cout << setw(10)<<setprecision(6) << genSolver.getSolution(TypeID::wetMap,source) << " ";
cout << gRin.numSats() << " ";
cout << cDOP.getGDOP() << " ";
cout << endl;
Thank you.
regards,
YAN Wei
--
YanWei - 30 Dec 2009
Answer
If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.
Hi
I finally find the problem, and the result is different from the
SolverPPP?, maybe I should tune the stochastic models carefully.
regards
YAN Wei
--
YanWei - 19 Jan 2010
Hi Yan!
I've not polished the example yet, but part of it follows.
You'll see that I've pre-processed all data and put it inside a
gnssDataMap structure. That part is not shown.
I hope it helps you.
Dago
Code follows:
// Declare stochastic models to be used
WhiteNoiseModel coordinatesModel(100.0);
TropoRandomWalkModel tropoModel;
PhaseAmbiguityModel ambiModel;
// This variables are, by default, SourceID-indexed
Variable dLat( TypeID::dLat, &coordinatesModel, true, false, 100.0 );
Variable dLon( TypeID::dLon, &coordinatesModel, true, false, 100.0 );
Variable dH( TypeID::dH, &coordinatesModel, true, false, 100.0 );
Variable cdt( TypeID::cdt );
cdt.setDefaultForced(true); // Force the default coefficient (1.0)
Variable tropo( TypeID::wetMap, &tropoModel, true, false, 10.0 );
// The following variable is, SourceID and SatID-indexed
Variable ambi( TypeID::BLC, &ambiModel, true, true );
ambi.setDefaultForced(true); // Force the default coefficient (1.0)
// This variable will be SatID-indexed only
Variable satClock( TypeID::dtSat );
satClock.setSourceIndexed(false);
satClock.setSatIndexed(true);
satClock.setDefaultForced(true); // Force the default coefficient (1.0)
// This will be the independent term for code equations
Variable prefitC( TypeID::prefitC );
// This will be the independent term for phase equations
Variable prefitL( TypeID::prefitL );
// Rover code equation description
Equation equPCRover( prefitC );
equPCRover.addVariable(dLat);
equPCRover.addVariable(dLon);
equPCRover.addVariable(dH);
equPCRover.addVariable(cdt);
equPCRover.addVariable(tropo);
equPCRover.addVariable(satClock);
// Set the source of the equation
equPCRover.header.equationSource = rover;
// Rover phase equation description
Equation equLCRover( prefitL );
equLCRover.addVariable(dLat);
equLCRover.addVariable(dLon);
equLCRover.addVariable(dH);
equLCRover.addVariable(cdt);
equLCRover.addVariable(tropo);
equLCRover.addVariable(ambi);
equLCRover.addVariable(satClock);
// Rover phase equation has more weight
equLCRover.setWeight(10000.0); // 100.0 * 100.0
// Set the source of the equation
equLCRover.header.equationSource = rover;
// Reference stations code equation description
Equation equPCRef( prefitC );
equPCRef.addVariable(cdt);
equPCRef.addVariable(tropo);
equPCRef.addVariable(satClock);
// Set the source of the equation
equPCRef.header.equationSource = Variable::someSources;
// Reference stations phase equation description
Equation equLCRef( prefitL );
equLCRef.addVariable(cdt);
equLCRef.addVariable(tropo);
equLCRef.addVariable(ambi);
equLCRef.addVariable(satClock);
// Reference station phase equation has more weight
equLCRef.setWeight(10000.0); // 100.0 * 100.0
// Set the source of the equation
equLCRef.header.equationSource = Variable::someSources;
// Add all reference stations
for( std::set<SourceID>::const_iterator itSet = refStationSet.begin();
itSet != refStationSet.end();
++itSet )
{
equPCRef.addSource2Set( (*itSet) );
equLCRef.addSource2Set( (*itSet) );
}
// Master station code equation description
Equation equPCMaster( prefitC );
equPCMaster.addVariable(tropo);
equPCMaster.addVariable(satClock);
// Set the source of the equation
equPCMaster.header.equationSource = master;
// Master station phase equation description
Equation equLCMaster( prefitL );
equLCMaster.addVariable(tropo);
equLCMaster.addVariable(ambi);
equLCMaster.addVariable(satClock);
// Master station phase equation has more weight
equLCMaster.setWeight(10000.0); // 100.0 * 100.0
// Set the source of the equation
equLCMaster.header.equationSource = master;
// Setup equation system
EquationSystem system;
system.addEquation(equPCRover);
system.addEquation(equLCRover);
system.addEquation(equPCRef);
system.addEquation(equLCRef);
system.addEquation(equPCMaster);
system.addEquation(equLCMaster);
SolverGeneral solverGen(system);
while( !gdsMap.empty() )
{
// Get data
gnssDataMap gds( gdsMap.frontEpoch() );
// Remove first element
gdsMap.pop_front_epoch();
gnssDataMap::const_iterator it( gds.begin() );
DayTime workEpoch( (*it).first );
// Compute the solutions
solverGen.Process( gds );
try
{
cout << workEpoch.DOYsecond() << " "
<< solverGen.getSolution( TypeID::dLat, rover ) << " "
<< solverGen.getSolution( TypeID::dLon, rover ) << " "
<< solverGen.getSolution( TypeID::dH, rover ) << " "
<< solverGen.getSolution( TypeID::wetMap, rover )
+ 0.1 + tropoMap[ rover ] << endl;
}
catch(...)
{
cerr << "Exception for receiver '" << rover <<
" at epoch: " << workEpoch.DOYsecond() << endl;
continue;
}
} // End of 'while( !gdsMap.empty() )'
--
DagobertoSalazar - 20 Jan 2010
Hi,Dago
It's really help a lot, Thank you.
Cheers
YAN Wei
--
YanWei - 20 Jan 2010