SolverGeneral Class Reference
[GPS solution algorithms and Tropospheric]

#include <SolverGeneral.hpp>

Inheritance diagram for SolverGeneral:

Inheritance graph
[legend]
Collaboration diagram for SolverGeneral:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class is an Extended Kalman Filter (EKF) implementation that is run-time programmable, making it extremely flexible.

SolverGeneral is programmed using class "EquationSystem", that defines a set of rules to "tune" the solver to solve a specific problem. In turn, "EquationSystem" relies in other classes like "Variable" and "Equation", responsible of setting rules such as TypeID's, SourceID's, stochastic models, etc.

In this way, complex multi-station and/or hybrid GNSS-INS problems can be tackled with relatively few code lines, encouraging code reusability.

A typical way to use this class follows, showing how to set up a SolverGeneral object to perform "Precise Point Positioning" (PPP):

      // SETTING THE RULES: DEFINE VARIABLES

      // Declare stochastic models to be used
   StochasticModel coordinatesModel;
   TropoRandomWalkModel tropoModel;
   PhaseAmbiguityModel ambiModel;

      // These variables are, by default, SourceID-indexed
   Variable dx( TypeID::dx, &coordinatesModel, true, false, 100.0 );

   Variable dy( TypeID::dy, &coordinatesModel );
   dy.setInitialVariance( 100.0 );     // Equivalent to 'dx' setup

   Variable dz( TypeID::dz, &coordinatesModel );
   dz.setInitialVariance( 100.0 );

   Variable cdt( TypeID::cdt );
   cdt.setDefaultForced(true);   // Force default coefficient (1.0)

   Variable tropo( TypeID::wetMap, &tropoModel );
   tropo.setInitialVariance( 25.0 );


      // The following variable is, SourceID and SatID-indexed
   Variable ambi( TypeID::BLC, &ambiModel, true, true );
   ambi.setDefaultForced(true);   // Force default coefficient (1.0)

      // This will be the independent term for code equation
   Variable prefitC( TypeID::prefitC );

      // This will be the independent term for phase equation
   Variable prefitL( TypeID::prefitL );


      // SETTING THE RULES: DESCRIBE EQUATIONS

      // Define Equation object for code equations, and add variables
   Equation equPC( prefitC );

   equPC.addVariable(dx);
   equPC.addVariable(dy);
   equPC.addVariable(dz);
   equPC.addVariable(cdt);
   equPC.addVariable(tropo);

      // Define Equation object for phase equations, and add variables
   Equation equLC( prefitL );

   equLC.addVariable(dx);
   equLC.addVariable(dy);
   equLC.addVariable(dz);
   equLC.addVariable(cdt);
   equLC.addVariable(tropo);
   equLC.addVariable(ambi);       // This variable is for phase only

      // Phase equations should have higher relative weight
   equLC.setWeight(10000.0);     // 100.0 * 100.0


      // SETTING THE RULES: SETUP EQUATION SYSTEM

      // Create 'EquationSystem' object
   EquationSystem eqSystem;

      // Add equation descriptions
   eqSystem.addEquation(equPC);
   eqSystem.addEquation(equLC);


      // SETUP "SolverGeneral" OBJECT

      // Create 'SolverGeneral' object and add equation system
   SolverGeneral solver( eqSystem );

The "SolverGeneral" object is then ready to be fed with data encapsulated in an appropriate GDS. Take notice that for problems involving multiple epochs and/or multiple stations the recommended GDS is "gnssDataMap", which "SolverGeneral" fully supports.

Warning:
Please be aware that this class requires a significant amount of overhead. Therefore, if your priority is execution speed you should either use the already provided 'purpose-specific' solvers (like 'SolverPPP' or hand-code your own class. For new processing strategies you should balance the importance of machine time (extra overhead) versus researcher time (writing a new solver).

"SolverGeneral" is based on an Extended Kalman filter, and Kalman filters are objets that store their internal state, so you MUST NOT use the SAME object to process DIFFERENT data streams.

See also:
Variable.hpp, Equation.hpp, EquationSystem.hpp.

Definition at line 168 of file SolverGeneral.hpp.

Public Member Functions

 SolverGeneral (const Equation &equation)
 Explicit constructor.
 SolverGeneral (const std::list< Equation > &equationList)
 Explicit constructor.
 SolverGeneral (const EquationSystem &equationSys)
 Explicit constructor.
virtual EquationSystem getEquationSystem () const
 Get a copy of the equation system being solved.
virtual SolverGeneralsetEquationSystem (const EquationSystem &equationSys)
 Set the equation system to be solved.
virtual ConstraintSystem getEquationSystemConstraints () const
 Get a copy ConstraintSystem of the equation system being solved.
virtual SolverGeneralsetEquationSystemConstraints (const ConstraintSystem &constraintSys)
 Set the ConstraintSystem of the equation system to be solved.
virtual SolverGeneraladdEquation (const Equation &equation)
 Add a new equation to be managed.
virtual SolverGeneralremoveEquation (const Variable &indterm)
 Remove an Equation being managed.
virtual SolverGeneralclearEquations ()
 Remove all Equation objects currently defined.
virtual SolverGeneralreset (void)
 This method resets the filter, setting all variance values in covariance matrix to a very high level.
virtual gnssSatTypeValueProcess (gnssSatTypeValue &gData) throw (ProcessingException)
 Returns a reference to a gnnsSatTypeValue object after solving the previously defined equation system.
virtual gnssRinexProcess (gnssRinex &gData) throw (ProcessingException)
 Returns a reference to a gnnsRinex object after solving the previously defined equation system.
virtual gnssDataMapProcess (gnssDataMap &gdsMap) throw (ProcessingException)
 Returns a reference to a gnssDataMap object after solving the previously defined equation system.
virtual double getSolution (const Variable &variable) const throw (InvalidRequest)
 Returns the solution associated to a given Variable.
virtual double getSolution (const TypeID &type) const throw (InvalidRequest)
 Returns the solution associated to a given TypeID.
virtual double getSolution (const TypeID &type, const SourceID &source) const throw (InvalidRequest)
 Returns the solution associated to a given TypeID and SourceID.
virtual double getSolution (const TypeID &type, const SatID &sat) const throw (InvalidRequest)
 Returns the solution associated to a given TypeID, SourceID and SatID.
virtual double getSolution (const TypeID &type, const SourceID &source, const SatID &sat) const throw (InvalidRequest)
 Returns the solution associated to a given TypeID, SourceID and SatID.
virtual double getCovariance (const Variable &var1, const Variable &var2) const throw (InvalidRequest)
 Returns the covariance associated to a given Variable.
virtual double getVariance (const Variable &variable) const throw (InvalidRequest)
 Returns the variance associated to a given Variable.
virtual double getVariance (const TypeID &type) const throw (InvalidRequest)
 Returns the variance associated to a given TypeID.
virtual double getVariance (const TypeID &type, const SourceID &source) const throw (InvalidRequest)
 Returns the variance associated to a given TypeID.
virtual double getVariance (const TypeID &type, const SatID &sat) const throw (InvalidRequest)
 Returns the variance associated to a given TypeID.
virtual double getVariance (const TypeID &type, const SourceID &source, const SatID &sat) const throw (InvalidRequest)
 Returns the variance associated to a given TypeID.
virtual Matrix< double > getPhiMatrix (void) const
 Get the State Transition Matrix (phiMatrix).
virtual Matrix< double > getQMatrix (void) const
 Get the Noise covariance matrix (QMatrix).
virtual int getIndex (void) const
 Returns an index identifying this object.
virtual std::string getClassName (void) const
 Returns a string identifying this object.
virtual ~SolverGeneral ()
 Destructor.

Protected Member Functions

virtual gnssDataMappreCompute (gnssDataMap &gdsMap) throw (ProcessingException)
 Code to be executed before 'Compute()' method.
virtual gnssDataMappostCompute (gnssDataMap &gdsMap) throw (ProcessingException)
 Code to be executed after 'Compute()' method.
virtual SolverGeneralsetSolution (const Variable &variable, const double &val) throw (InvalidRequest)
 Set the solution associated to a given Variable.
virtual SolverGeneralsetCovariance (const Variable &var1, const Variable &var2, const double &cov) throw (InvalidRequest)
 Set the covariance associated to a given Variable.

Protected Attributes

EquationSystem equSystem
 Equation system.

Friends

class GeneralConstraint


Constructor & Destructor Documentation

SolverGeneral const Equation equation  )  [inline]
 

Explicit constructor.

Parameters:
equation Object describing the equations to be solved.

Definition at line 176 of file SolverGeneral.hpp.

SolverGeneral const std::list< Equation > &  equationList  ) 
 

Explicit constructor.

Parameters:
equationList List of objects describing the equations to be solved.

Definition at line 57 of file SolverGeneral.cpp.

References EquationSystem::addEquation(), and SolverGeneral::equSystem.

SolverGeneral const EquationSystem equationSys  )  [inline]
 

Explicit constructor.

Parameters:
equationSys Object describing an equation system to be solved.

Definition at line 193 of file SolverGeneral.hpp.

virtual ~SolverGeneral  )  [inline, virtual]
 

Destructor.

Definition at line 444 of file SolverGeneral.hpp.


Member Function Documentation

virtual SolverGeneral& addEquation const Equation equation  )  [inline, virtual]
 

Add a new equation to be managed.

Parameters:
equation Equation object to be added.

Definition at line 231 of file SolverGeneral.hpp.

virtual SolverGeneral& clearEquations  )  [inline, virtual]
 

Remove all Equation objects currently defined.

Warning:
This method will left this SolverGeneral method in an unstable state. You MUST add at least one equation definition for this object to work.

Definition at line 254 of file SolverGeneral.hpp.

std::string getClassName void   )  const [virtual]
 

Returns a string identifying this object.

Implements ProcessingClass.

Definition at line 47 of file SolverGeneral.cpp.

double getCovariance const Variable var1,
const Variable var2
const throw (InvalidRequest) [virtual]
 

Returns the covariance associated to a given Variable.

Parameters:
var1 first variable object
var2 second variable object

Definition at line 793 of file SolverGeneral.cpp.

References GPSTK_THROW.

Referenced by GeneralConstraint::changeState(), and GeneralConstraint::getCovariance().

virtual EquationSystem getEquationSystem  )  const [inline, virtual]
 

Get a copy of the equation system being solved.

Definition at line 198 of file SolverGeneral.hpp.

Referenced by GeneralConstraint::constraintToSolver().

virtual ConstraintSystem getEquationSystemConstraints  )  const [inline, virtual]
 

Get a copy ConstraintSystem of the equation system being solved.

Definition at line 213 of file SolverGeneral.hpp.

References EquationSystem::getConstraintSystem().

int getIndex void   )  const [virtual]
 

Returns an index identifying this object.

Definition at line 42 of file SolverGeneral.cpp.

virtual Matrix<double> getPhiMatrix void   )  const [inline, virtual]
 

Get the State Transition Matrix (phiMatrix).

Definition at line 426 of file SolverGeneral.hpp.

virtual Matrix<double> getQMatrix void   )  const [inline, virtual]
 

Get the Noise covariance matrix (QMatrix).

Definition at line 431 of file SolverGeneral.hpp.

double getSolution const TypeID type,
const SourceID source,
const SatID sat
const throw (InvalidRequest) [virtual]
 

Returns the solution associated to a given TypeID, SourceID and SatID.

Parameters:
type TypeID of the solution we are looking for.
source SourceID of the solution we are looking for.
sat SatID of the solution we are looking for.
Warning:
In the case the solution contains more than one variable of this type, only the first one will be returned.

Definition at line 758 of file SolverGeneral.cpp.

References Matrix::begin(), and GPSTK_THROW.

double getSolution const TypeID type,
const SatID sat
const throw (InvalidRequest) [virtual]
 

Returns the solution associated to a given TypeID, SourceID and SatID.

Parameters:
type TypeID of the solution we are looking for.
sat SatID of the solution we are looking for.
Warning:
In the case the solution contains more than one variable of this type, only the first one will be returned.

Definition at line 719 of file SolverGeneral.cpp.

References Matrix::begin(), and GPSTK_THROW.

double getSolution const TypeID type,
const SourceID source
const throw (InvalidRequest) [virtual]
 

Returns the solution associated to a given TypeID and SourceID.

Parameters:
type TypeID of the solution we are looking for.
source SourceID of the solution we are looking for.
Warning:
In the case the solution contains more than one variable of this type, only the first one will be returned.

Definition at line 681 of file SolverGeneral.cpp.

References Matrix::begin(), and GPSTK_THROW.

double getSolution const TypeID type  )  const throw (InvalidRequest) [virtual]
 

Returns the solution associated to a given TypeID.

Parameters:
type TypeID of the solution we are looking for.
Warning:
In the case the solution contains more than one variable of this type, only the first one will be returned.

Definition at line 645 of file SolverGeneral.cpp.

References Matrix::begin(), and GPSTK_THROW.

double getSolution const Variable variable  )  const throw (InvalidRequest) [virtual]
 

Returns the solution associated to a given Variable.

Parameters:
variable Variable object solution we are looking for.

Definition at line 616 of file SolverGeneral.cpp.

References GPSTK_THROW.

Referenced by GeneralConstraint::changeState(), and GeneralConstraint::getSolution().

double getVariance const TypeID type,
const SourceID source,
const SatID sat
const throw (InvalidRequest) [virtual]
 

Returns the variance associated to a given TypeID.

Parameters:
type TypeID of the variance we are looking for.
source SourceID of the solution we are looking for.
sat SatID of the solution we are looking for.
Warning:
In the case the solution contains more than one variable of this type, only the first one will be returned.

Definition at line 964 of file SolverGeneral.cpp.

References Matrix::begin(), and GPSTK_THROW.

double getVariance const TypeID type,
const SatID sat
const throw (InvalidRequest) [virtual]
 

Returns the variance associated to a given TypeID.

Parameters:
type TypeID of the variance we are looking for.
source SourceID of the solution we are looking for.
sat SatID of the solution we are looking for.
Warning:
In the case the solution contains more than one variable of this type, only the first one will be returned.

Definition at line 926 of file SolverGeneral.cpp.

References Matrix::begin(), and GPSTK_THROW.

double getVariance const TypeID type,
const SourceID source
const throw (InvalidRequest) [virtual]
 

Returns the variance associated to a given TypeID.

Parameters:
type TypeID of the variance we are looking for.
source SourceID of the solution we are looking for.
Warning:
In the case the solution contains more than one variable of this type, only the first one will be returned.

Definition at line 890 of file SolverGeneral.cpp.

References Matrix::begin(), and GPSTK_THROW.

double getVariance const TypeID type  )  const throw (InvalidRequest) [virtual]
 

Returns the variance associated to a given TypeID.

Parameters:
type TypeID of the variance we are looking for.
Warning:
In the case the solution contains more than one variable of this type, only the first one will be returned.

Definition at line 854 of file SolverGeneral.cpp.

References Matrix::begin(), and GPSTK_THROW.

double getVariance const Variable variable  )  const throw (InvalidRequest) [virtual]
 

Returns the variance associated to a given Variable.

Parameters:
variable Variable object variance we are looking for.

Definition at line 828 of file SolverGeneral.cpp.

References GPSTK_THROW.

gnssDataMap & postCompute gnssDataMap gdsMap  )  throw (ProcessingException) [protected, virtual]
 

Code to be executed after 'Compute()' method.

Parameters:
gData Data object holding the data.

Definition at line 491 of file SolverGeneral.cpp.

References Matrix::end(), GPSTK_THROW, and gpstk::VariableSet.

Referenced by GeneralConstraint::constraintToSolver().

gnssDataMap & preCompute gnssDataMap gdsMap  )  throw (ProcessingException) [protected, virtual]
 

Code to be executed before 'Compute()' method.

Parameters:
gData Data object holding the data.

Definition at line 203 of file SolverGeneral.cpp.

References Vector::end(), Matrix::end(), GPSTK_THROW, and gpstk::VariableSet.

gnssDataMap & Process gnssDataMap gdsMap  )  throw (ProcessingException) [virtual]
 

Returns a reference to a gnssDataMap object after solving the previously defined equation system.

Parameters:
gdsMap Data object holding the data.

Definition at line 158 of file SolverGeneral.cpp.

References GPSTK_THROW.

gnssRinex & Process gnssRinex gData  )  throw (ProcessingException) [virtual]
 

Returns a reference to a gnnsRinex object after solving the previously defined equation system.

Parameters:
gData Data object holding the data.

Implements ProcessingClass.

Definition at line 118 of file SolverGeneral.cpp.

References gnssDataMap::addGnssRinex(), gnssDataMap::getGnssRinex(), and GPSTK_THROW.

gnssSatTypeValue & Process gnssSatTypeValue gData  )  throw (ProcessingException) [virtual]
 

Returns a reference to a gnnsSatTypeValue object after solving the previously defined equation system.

Parameters:
gData Data object holding the data.

Implements ProcessingClass.

Definition at line 77 of file SolverGeneral.cpp.

References gnssData::body, GPSTK_THROW, and gnssRinex::header.

Referenced by GeneralConstraint::process().

virtual SolverGeneral& removeEquation const Variable indterm  )  [inline, virtual]
 

Remove an Equation being managed.

In this case the equation is identified by its independent term.

Parameters:
indterm Variable object of the equation independent term (measurement type).
Warning:
All Equations with the same independent term will be erased.

Definition at line 244 of file SolverGeneral.hpp.

virtual SolverGeneral& reset void   )  [inline, virtual]
 

This method resets the filter, setting all variance values in covariance matrix to a very high level.

Definition at line 260 of file SolverGeneral.hpp.

SolverGeneral & setCovariance const Variable var1,
const Variable var2,
const double &  cov
throw (InvalidRequest) [protected, virtual]
 

Set the covariance associated to a given Variable.

Parameters:
var1 first variable object
var2 second variable object
cov covariance value for the variable objects

Definition at line 1024 of file SolverGeneral.cpp.

References GPSTK_THROW.

virtual SolverGeneral& setEquationSystem const EquationSystem equationSys  )  [inline, virtual]
 

Set the equation system to be solved.

Parameters:
equationSys Object describing an equation system to be solved.

Definition at line 207 of file SolverGeneral.hpp.

virtual SolverGeneral& setEquationSystemConstraints const ConstraintSystem constraintSys  )  [inline, virtual]
 

Set the ConstraintSystem of the equation system to be solved.

Parameters:
constraintSys Object of ConstraintSystem for EquationSystem object of the solver

Definition at line 222 of file SolverGeneral.hpp.

Referenced by GeneralConstraint::process().

SolverGeneral & setSolution const Variable variable,
const double &  val
throw (InvalidRequest) [protected, virtual]
 

Set the solution associated to a given Variable.

Parameters:
variable Variable object solution we are looking for.
val solution value for the Variable object

Definition at line 999 of file SolverGeneral.cpp.

References GPSTK_THROW.


Friends And Related Function Documentation

friend class GeneralConstraint [friend]
 

Definition at line 564 of file SolverGeneral.hpp.


Member Data Documentation

EquationSystem equSystem [protected]
 

Equation system.

Definition at line 451 of file SolverGeneral.hpp.

Referenced by SolverGeneral::SolverGeneral().


The documentation for this class was generated from the following files:
Generated on Thu May 23 03:31:43 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1