COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
Cosmos::Physics::State Class Reference

#include <physicsclass.h>

Collaboration diagram for Cosmos::Physics::State:

Public Member Functions

 State ()
 
int32_t Init (Propagator *posprop, Propagator *attprop, Propagator *thermprop, Propagator *elecprop)
 
int32_t Init (Structure::Type stype, Propagator::Type ptype, Propagator::Type atype, Propagator::Type ttype, Propagator::Type etype, locstruc *loc, physicsstruc *phys, double idt, vector< tlestruc > lines)
 
int32_t Increment (double nextutc)
 

Public Attributes

locstruc oldloc
 
locstrucnewloc
 
physicsstruc oldphys
 
physicsstrucnewphys
 
double dt
 
double dtj
 
Propagator::Type ptype
 
InertialPositionPropagatorinposition
 
IterativePositionPropagatoritposition
 
GaussJacksonPositionPropagatorgjposition
 
Propagator::Type atype
 
InertialAttitudePropagatorinattitude
 
IterativeAttitudePropagatoritattitude
 
LVLHAttitudePropagatorlvattitude
 
Propagator::Type ttype
 
ThermalPropagatorthermal
 
Propagator::Type etype
 
ElectricalPropagatorelectrical
 
vector< tlestructle
 
Structure::Type stype
 
Structurestructure
 

Constructor & Destructor Documentation

Cosmos::Physics::State::State ( )
253  {
254  }

Member Function Documentation

int32_t Cosmos::Physics::State::Init ( Propagator posprop,
Propagator attprop,
Propagator thermprop,
Propagator elecprop 
)
257  {
258  int32_t iretn = 0;
259 
260  oldloc = *posprop->newloc;
261  oldphys = *posprop->newphys;
262 
263  switch (posprop->type)
264  {
265  case Propagator::Type::PositionInertial:
266  inposition = static_cast<InertialPositionPropagator *>(posprop);
267  break;
268  case Propagator::Type::PositionIterative:
269  itposition = static_cast<IterativePositionPropagator *>(posprop);
270  break;
271  case Propagator::Type::PositionGaussJackson:
272  gjposition = static_cast<GaussJacksonPositionPropagator *>(posprop);
273  if (tle.size())
274  {
275  gjposition->Init(tle);
276  }
277  else {
278  gjposition->Init();
279  }
280  break;
281  default:
282  inposition = static_cast<InertialPositionPropagator *>(posprop);
283  break;
284  }
285  this->ptype = posprop->type;
286 
287  switch (posprop->type)
288  {
289  case Propagator::Type::AttitudeInertial:
290  inattitude = static_cast<InertialAttitudePropagator *>(posprop);
291  break;
292  case Propagator::Type::AttitudeIterative:
293  itattitude = static_cast<IterativeAttitudePropagator *>(posprop);
294  break;
295  case Propagator::Type::AttitudeLVLH:
296  lvattitude = static_cast<LVLHAttitudePropagator *>(posprop);
297  break;
298  default:
299  inattitude = static_cast<InertialAttitudePropagator *>(posprop);
300  break;
301  }
302  this->atype = posprop->type;
303 
304  switch (posprop->type)
305  {
306  case Propagator::Type::Thermal:
307  thermal = static_cast<ThermalPropagator *>(posprop);
308  break;
309  default:
310  thermal = static_cast<ThermalPropagator *>(posprop);
311  break;
312  }
313  this->ttype = posprop->type;
314 
315  switch (posprop->type)
316  {
317  case Propagator::Type::Electrical:
318  electrical = static_cast<ElectricalPropagator *>(posprop);
319  break;
320  default:
321  electrical = static_cast<ElectricalPropagator *>(posprop);
322  break;
323  }
324  this->etype = posprop->type;
325 
326  newphys = posprop->newphys;
327  newloc = posprop->newloc;
328  dt = posprop->dt;
329  dtj = posprop->dtj;
330 
331  return iretn;
332  }
vector< tlestruc > tle
Definition: physicsclass.h:320
physicsstruc oldphys
Definition: physicsclass.h:301
GaussJacksonPositionPropagator * gjposition
Definition: physicsclass.h:308
ThermalPropagator * thermal
Definition: physicsclass.h:316
Propagator::Type ttype
Definition: physicsclass.h:315
int iretn
Definition: rw_test.cpp:37
locstruc * newloc
Definition: physicsclass.h:300
locstruc oldloc
Definition: physicsclass.h:299
Propagator::Type ptype
Definition: physicsclass.h:305
InertialAttitudePropagator * inattitude
Definition: physicsclass.h:311
Propagator::Type etype
Definition: physicsclass.h:318
double dt
Definition: physicsclass.h:303
Propagator::Type atype
Definition: physicsclass.h:310
IterativePositionPropagator * itposition
Definition: physicsclass.h:307
IterativeAttitudePropagator * itattitude
Definition: physicsclass.h:312
double dtj
Definition: physicsclass.h:304
int32_t Init(vector< tlestruc > lines)
Definition: physicsclass.cpp:914
physicsstruc * newphys
Definition: physicsclass.h:302
LVLHAttitudePropagator * lvattitude
Definition: physicsclass.h:313
InertialPositionPropagator * inposition
Definition: physicsclass.h:306
ElectricalPropagator * electrical
Definition: physicsclass.h:319
int32_t Cosmos::Physics::State::Init ( Structure::Type  stype,
Propagator::Type  ptype,
Propagator::Type  atype,
Propagator::Type  ttype,
Propagator::Type  etype,
locstruc loc,
physicsstruc phys,
double  idt,
vector< tlestruc lines 
)
335  {
336  oldloc = *loc;
337  oldphys = *phys;
338  tle = lines;
339  dt = 86400.*((loc->utc + (idt / 86400.))-loc->utc);
340  dtj = dt / 86400.;
341 
342  structure = new Structure(phys);
344  this->stype = stype;
345 
346  switch (ptype)
347  {
348  case Propagator::Type::PositionInertial:
349  inposition = new InertialPositionPropagator(loc, phys, dt);
350  dt = inposition->dt;
351  dtj = inposition->dtj;
352  break;
353  case Propagator::Type::PositionIterative:
354  itposition = new IterativePositionPropagator(loc, phys, dt);
355  dt = itposition->dt;
356  dtj = itposition->dtj;
357  break;
358  case Propagator::Type::PositionGaussJackson:
359  gjposition = new GaussJacksonPositionPropagator(loc, phys, dt, 6);
360  dt = gjposition->dt;
361  dtj = gjposition->dtj;
362  if (tle.size())
363  {
364  gjposition->Init(tle);
365  }
366  else {
367  gjposition->Init();
368  }
369  break;
370  default:
371  inposition = new InertialPositionPropagator(loc, phys, dt);
372  dt = inposition->dt;
373  dtj = inposition->dtj;
374  break;
375  }
376  this->ptype = ptype;
377 
378  switch (atype)
379  {
380  case Propagator::Type::AttitudeInertial:
381  inattitude = new InertialAttitudePropagator(loc, phys, dt);
382  break;
383  case Propagator::Type::AttitudeIterative:
384  itattitude = new IterativeAttitudePropagator(loc, phys, dt);
385  break;
386  case Propagator::Type::AttitudeLVLH:
387  lvattitude = new LVLHAttitudePropagator(loc, phys, dt);
388  break;
389  default:
390  inattitude = new InertialAttitudePropagator(loc, phys, dt);
391  break;
392  }
393  this->atype = atype;
394 
395  switch (ttype)
396  {
397  case Propagator::Type::Thermal:
398  thermal = new ThermalPropagator(loc, phys, dt, 300.);
399  break;
400  default:
401  thermal = new ThermalPropagator(loc, phys, dt, 300.);
402  break;
403  }
404  this->ttype = ttype;
405 
406  switch (etype)
407  {
408  case Propagator::Type::Electrical:
409  electrical = new ElectricalPropagator(loc, phys, dt, .5);
410  break;
411  default:
412  electrical = new ElectricalPropagator(loc, phys, dt, .5);
413  break;
414  }
415  this->etype = etype;
416 
417  newphys = phys;
418  newloc = loc;
419 
420  return 0;
421  }
vector< tlestruc > tle
Definition: physicsclass.h:320
physicsstruc oldphys
Definition: physicsclass.h:301
GaussJacksonPositionPropagator * gjposition
Definition: physicsclass.h:308
ThermalPropagator * thermal
Definition: physicsclass.h:316
Propagator::Type ttype
Definition: physicsclass.h:315
int32_t Setup(Type type)
Definition: physicsclass.cpp:7
double utc
Master time for location, in Modified Julian Day.
Definition: convertdef.h:879
locstruc * newloc
Definition: physicsclass.h:300
locstruc oldloc
Definition: physicsclass.h:299
double dt
Definition: physicsclass.h:108
Propagator::Type ptype
Definition: physicsclass.h:305
InertialAttitudePropagator * inattitude
Definition: physicsclass.h:311
Propagator::Type etype
Definition: physicsclass.h:318
double dt
Definition: physicsclass.h:303
Structure::Type stype
Definition: physicsclass.h:322
Propagator::Type atype
Definition: physicsclass.h:310
IterativePositionPropagator * itposition
Definition: physicsclass.h:307
IterativeAttitudePropagator * itattitude
Definition: physicsclass.h:312
double dtj
Definition: physicsclass.h:304
double dtj
Definition: physicsclass.h:109
Structure * structure
Definition: physicsclass.h:323
int32_t Init(vector< tlestruc > lines)
Definition: physicsclass.cpp:914
physicsstruc * newphys
Definition: physicsclass.h:302
LVLHAttitudePropagator * lvattitude
Definition: physicsclass.h:313
InertialPositionPropagator * inposition
Definition: physicsclass.h:306
ElectricalPropagator * electrical
Definition: physicsclass.h:319
int32_t Cosmos::Physics::State::Increment ( double  nextutc)
424  {
425  int32_t count = 0;
426  do
427  {
428  newloc->utc += dtj;
429  switch (ptype)
430  {
431  case Propagator::Type::PositionIterative:
432  static_cast<IterativePositionPropagator *>(itposition)->Propagate();
433  break;
434  case Propagator::Type::PositionInertial:
435  static_cast<InertialPositionPropagator *>(inposition)->Propagate();
436  break;
437  case Propagator::Type::PositionGaussJackson:
438  static_cast<GaussJacksonPositionPropagator *>(gjposition)->Propagate();
439  break;
440  default:
441  break;
442  }
443  switch (atype)
444  {
445  case Propagator::Type::AttitudeIterative:
446  static_cast<IterativeAttitudePropagator *>(itattitude)->Propagate();
447  break;
448  case Propagator::Type::AttitudeInertial:
449  static_cast<InertialAttitudePropagator *>(inattitude)->Propagate();
450  break;
451  case Propagator::Type::AttitudeLVLH:
452  static_cast<LVLHAttitudePropagator *>(lvattitude)->Propagate();
453  break;
454  default:
455  break;
456  }
457  static_cast<ThermalPropagator *>(thermal)->Propagate();
458  static_cast<ElectricalPropagator *>(electrical)->Propagate();
459  ++count;
460  } while (newloc->utc < nextutc);
461  return count;
462  }
int count
Definition: rw_test.cpp:36
GaussJacksonPositionPropagator * gjposition
Definition: physicsclass.h:308
ThermalPropagator * thermal
Definition: physicsclass.h:316
double utc
Master time for location, in Modified Julian Day.
Definition: convertdef.h:879
locstruc * newloc
Definition: physicsclass.h:300
Propagator::Type ptype
Definition: physicsclass.h:305
InertialAttitudePropagator * inattitude
Definition: physicsclass.h:311
Propagator::Type atype
Definition: physicsclass.h:310
IterativePositionPropagator * itposition
Definition: physicsclass.h:307
IterativeAttitudePropagator * itattitude
Definition: physicsclass.h:312
double dtj
Definition: physicsclass.h:304
LVLHAttitudePropagator * lvattitude
Definition: physicsclass.h:313
InertialPositionPropagator * inposition
Definition: physicsclass.h:306
ElectricalPropagator * electrical
Definition: physicsclass.h:319

Member Data Documentation

locstruc Cosmos::Physics::State::oldloc
locstruc* Cosmos::Physics::State::newloc
physicsstruc Cosmos::Physics::State::oldphys
physicsstruc* Cosmos::Physics::State::newphys
double Cosmos::Physics::State::dt
double Cosmos::Physics::State::dtj
Propagator::Type Cosmos::Physics::State::ptype
InertialPositionPropagator* Cosmos::Physics::State::inposition
IterativePositionPropagator* Cosmos::Physics::State::itposition
GaussJacksonPositionPropagator* Cosmos::Physics::State::gjposition
Propagator::Type Cosmos::Physics::State::atype
InertialAttitudePropagator* Cosmos::Physics::State::inattitude
IterativeAttitudePropagator* Cosmos::Physics::State::itattitude
LVLHAttitudePropagator* Cosmos::Physics::State::lvattitude
Propagator::Type Cosmos::Physics::State::ttype
ThermalPropagator* Cosmos::Physics::State::thermal
Propagator::Type Cosmos::Physics::State::etype
ElectricalPropagator* Cosmos::Physics::State::electrical
vector<tlestruc> Cosmos::Physics::State::tle
Structure::Type Cosmos::Physics::State::stype
Structure* Cosmos::Physics::State::structure

The documentation for this class was generated from the following files: