EquationSystem Class Reference
[GPSTk data structures]

#include <EquationSystem.hpp>

Collaboration diagram for EquationSystem:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class defines and handles complex equation systems for solvers, generating the Vectors and Matrices they will need, including:.

In addition, this class will provide important/interesting information such as number of variables, satellites and data sources being processed.

In order to achieve this, the 'EquationSystem' class will start from a list of 'Equation descriptions' and the currently available GNSS data. From there, it will deduce the unknowns corresponding to each data source as well as the specific equations.

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

      // 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 );


      // 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


      // SETUP EQUATION SYSTEM

      // Create 'EquationSystem' object
   EquationSystem eqSystem;

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

In this way, rather complex processing strategies may be set up in a handy and flexible way.

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).
See also:
Variable.hpp, Equation.hpp.

Definition at line 165 of file EquationSystem.hpp.

Public Member Functions

 EquationSystem ()
 Default constructor.
virtual EquationSystemaddEquation (const Equation &equation)
 Add a new equation to be managed.
virtual EquationSystemremoveEquation (const Variable &indterm)
 Remove an Equation being managed.
virtual EquationSystemclearEquations ()
 Remove all Equation objects from this EquationSystem.
virtual EquationSystemPrepare (gnssSatTypeValue &gData)
 Prepare this object to carry out its work.
virtual EquationSystemPrepare (gnssRinex &gData)
 Prepare this object to carry out its work.
virtual EquationSystemPrepare (gnssDataMap &gdsMap)
 Prepare this object to carry out its work.
virtual int getTotalNumVariables () const throw (InvalidEquationSystem)
 Return the TOTAL number of variables being processed.
virtual VariableSet getVarUnknowns () const throw (InvalidEquationSystem)
 Return the set containing all variables being processed.
virtual int getCurrentNumVariables () const throw (InvalidEquationSystem)
 Return the CURRENT number of variables, given the current equation system definition and the GDS's involved.
virtual VariableSet getCurrentUnknowns () const throw (InvalidEquationSystem)
 Return the set containing variables being currently processed.
virtual int getCurrentNumSources () const throw (InvalidEquationSystem)
 Return the CURRENT number of sources, given the current equation system definition and the GDS's involved.
virtual SourceIDSet getCurrentSources () const throw (InvalidEquationSystem)
 Return the set containing sources being currently processed.
virtual int getCurrentNumSats () const throw (InvalidEquationSystem)
 Return the CURRENT number of satellites, given the current equation system definition and the GDS's involved.
virtual SatIDSet getCurrentSats () const throw (InvalidEquationSystem)
 Return the set containing satellites being currently processed.
virtual Vector< double > getPrefitsVector () const throw (InvalidEquationSystem)
 Get prefit residuals GPSTk Vector, given the current equation system definition and the GDS' involved.
virtual Matrix< double > getGeometryMatrix () const throw (InvalidEquationSystem)
 Get geometry matrix, given the current equation system definition and the GDS' involved.
virtual Matrix< double > getWeightsMatrix () const throw (InvalidEquationSystem)
 Get weights matrix, given the current equation system definition and the GDS' involved.
virtual Matrix< double > getPhiMatrix () const throw (InvalidEquationSystem)
 Get the State Transition Matrix (PhiMatrix), given the current equation system definition and the GDS' involved.
virtual Matrix< double > getQMatrix () const throw (InvalidEquationSystem)
 Get the Process Noise Covariance Matrix (QMatrix), given the current equation system definition and the GDS' involved.
virtual int getEquationDefinitionNumber () const
 Get the number of equation descriptions being currently processed.
virtual std::list< EquationgetCurrentEquationsList () const
 Get the list of current equations.
virtual ~EquationSystem ()
 Destructor.


Constructor & Destructor Documentation

EquationSystem  )  [inline]
 

Default constructor.

Definition at line 170 of file EquationSystem.hpp.

virtual ~EquationSystem  )  [inline, virtual]
 

Destructor.

Definition at line 360 of file EquationSystem.hpp.

References gpstk::SatIDSet, gpstk::SourceIDSet, and gpstk::VariableSet.


Member Function Documentation

EquationSystem & addEquation const Equation equation  )  [virtual]
 

Add a new equation to be managed.

Parameters:
equation Equation object to be added.

Definition at line 49 of file EquationSystem.cpp.

Referenced by SolverGeneral::addEquation(), EquationSystem::removeEquation(), and SolverGeneral::SolverGeneral().

EquationSystem & clearEquations  )  [virtual]
 

Remove all Equation objects from this EquationSystem.

Definition at line 115 of file EquationSystem.cpp.

Referenced by SolverGeneral::clearEquations(), and EquationSystem::removeEquation().

virtual std::list<Equation> getCurrentEquationsList  )  const [inline, virtual]
 

Get the list of current equations.

Definition at line 355 of file EquationSystem.hpp.

int getCurrentNumSats  )  const throw (InvalidEquationSystem) [virtual]
 

Return the CURRENT number of satellites, given the current equation system definition and the GDS's involved.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 902 of file EquationSystem.cpp.

References GPSTK_THROW.

int getCurrentNumSources  )  const throw (InvalidEquationSystem) [virtual]
 

Return the CURRENT number of sources, given the current equation system definition and the GDS's involved.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 859 of file EquationSystem.cpp.

References GPSTK_THROW.

int getCurrentNumVariables  )  const throw (InvalidEquationSystem) [virtual]
 

Return the CURRENT number of variables, given the current equation system definition and the GDS's involved.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 816 of file EquationSystem.cpp.

References GPSTK_THROW.

SatIDSet getCurrentSats  )  const throw (InvalidEquationSystem) [virtual]
 

Return the set containing satellites being currently processed.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 923 of file EquationSystem.cpp.

References GPSTK_THROW, and gpstk::SatIDSet.

SourceIDSet getCurrentSources  )  const throw (InvalidEquationSystem) [virtual]
 

Return the set containing sources being currently processed.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 880 of file EquationSystem.cpp.

References GPSTK_THROW, and gpstk::SourceIDSet.

VariableSet getCurrentUnknowns  )  const throw (InvalidEquationSystem) [virtual]
 

Return the set containing variables being currently processed.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 837 of file EquationSystem.cpp.

References GPSTK_THROW, and gpstk::VariableSet.

virtual int getEquationDefinitionNumber  )  const [inline, virtual]
 

Get the number of equation descriptions being currently processed.

Definition at line 350 of file EquationSystem.hpp.

Matrix< double > getGeometryMatrix  )  const throw (InvalidEquationSystem) [virtual]
 

Get geometry matrix, given the current equation system definition and the GDS' involved.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 967 of file EquationSystem.cpp.

References GPSTK_THROW.

Matrix< double > getPhiMatrix  )  const throw (InvalidEquationSystem) [virtual]
 

Get the State Transition Matrix (PhiMatrix), given the current equation system definition and the GDS' involved.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 1010 of file EquationSystem.cpp.

References GPSTK_THROW.

Vector< double > getPrefitsVector  )  const throw (InvalidEquationSystem) [virtual]
 

Get prefit residuals GPSTk Vector, given the current equation system definition and the GDS' involved.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 945 of file EquationSystem.cpp.

References GPSTK_THROW.

Matrix< double > getQMatrix  )  const throw (InvalidEquationSystem) [virtual]
 

Get the Process Noise Covariance Matrix (QMatrix), given the current equation system definition and the GDS' involved.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 1032 of file EquationSystem.cpp.

References GPSTK_THROW.

int getTotalNumVariables  )  const throw (InvalidEquationSystem) [virtual]
 

Return the TOTAL number of variables being processed.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 773 of file EquationSystem.cpp.

References GPSTK_THROW.

VariableSet getVarUnknowns  )  const throw (InvalidEquationSystem) [virtual]
 

Return the set containing all variables being processed.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 794 of file EquationSystem.cpp.

References GPSTK_THROW, and gpstk::VariableSet.

Matrix< double > getWeightsMatrix  )  const throw (InvalidEquationSystem) [virtual]
 

Get weights matrix, given the current equation system definition and the GDS' involved.

Warning:
You must call method Prepare() first, otherwise this method will throw an InvalidEquationSystem exception.

Definition at line 989 of file EquationSystem.cpp.

References GPSTK_THROW.

EquationSystem & Prepare gnssDataMap gdsMap  )  [virtual]
 

Prepare this object to carry out its work.

Parameters:
gdsMap Map of GNSS data structures (GDS), indexed by SourceID.

Definition at line 155 of file EquationSystem.cpp.

EquationSystem & Prepare gnssRinex gData  )  [virtual]
 

Prepare this object to carry out its work.

Parameters:
gData GNSS data structure (GDS).

Definition at line 133 of file EquationSystem.cpp.

References gnssDataMap::addGnssRinex(), and EquationSystem::Prepare().

virtual EquationSystem& Prepare gnssSatTypeValue gData  )  [inline, virtual]
 

Prepare this object to carry out its work.

Parameters:
gData GNSS data structure (GDS).

Definition at line 203 of file EquationSystem.hpp.

Referenced by EquationSystem::Prepare().

EquationSystem & removeEquation const Variable indterm  )  [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 73 of file EquationSystem.cpp.

References EquationSystem::addEquation(), and EquationSystem::clearEquations().

Referenced by SolverGeneral::removeEquation().


The documentation for this class was generated from the following files:
Generated on Thu Jul 29 03:31:58 2010 for GPS ToolKit Software Library by  doxygen 1.3.9.1