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

#include <physicsclass.h>

Inheritance diagram for Cosmos::Physics::ElectricalPropagator:
Collaboration diagram for Cosmos::Physics::ElectricalPropagator:

Public Member Functions

 ElectricalPropagator (locstruc *locp, physicsstruc *physp, double idt, float ibattery_charge)
 
int32_t Init (float bp)
 
int32_t Propagate ()
 
- Public Member Functions inherited from Cosmos::Physics::Propagator
 Propagator (locstruc *locp, physicsstruc *physp, double idt)
 
int32_t Increment (double nextutc)
 

Public Attributes

float battery_charge
 
- Public Attributes inherited from Cosmos::Physics::Propagator
double dt
 
double dtj
 
locstruc oldloc
 
locstrucnewloc
 
physicsstruc oldphys
 
physicsstrucnewphys
 
Type type
 

Additional Inherited Members

- Public Types inherited from Cosmos::Physics::Propagator
enum  Type {
  None = 0, PositionInertial = 10, PositionIterative = 11, PositionGaussJackson = 12,
  AttitudeInertial = 20, AttitudeIterative = 21, AttitudeLVLH = 22, Thermal = 30,
  Electrical = 40
}
 

Constructor & Destructor Documentation

Cosmos::Physics::ElectricalPropagator::ElectricalPropagator ( locstruc locp,
physicsstruc physp,
double  idt,
float  ibattery_charge 
)
inline
285  : Propagator{ locp, physp, idt }, battery_charge{ibattery_charge}
286  {
287  type = AttitudeLVLH;
288  }
Propagator(locstruc *locp, physicsstruc *physp, double idt)
Definition: physicsclass.h:129
float battery_charge
Definition: physicsclass.h:293
Definition: physicsclass.h:123
Type type
Definition: physicsclass.h:127

Member Function Documentation

int32_t Cosmos::Physics::ElectricalPropagator::Init ( float  bp)
689  {
690  battery_charge = bp;
691  return 0;
692  }
float battery_charge
Definition: physicsclass.h:293
int32_t Cosmos::Physics::ElectricalPropagator::Propagate ( )
695  {
697  Vector unite = Vector(newloc->pos.eci.s).normalize(-1.);
698  unite = Vector(newloc->pos.eci.s).normalize(-1.);
700  double energyd;
701  for (trianglestruc& triangle : newphys->triangles)
702  {
703  if (triangle.external)
704  {
705  // Solar effects
706  double sdot = units.dot(triangle.normal);
707 
708  // Earth effects
709  double edot = acos(unite.dot(triangle.normal) / triangle.normal.norm()) - RADOF(5.);
710  if (edot < 0.)
711  {
712  edot = 1.;
713  }
714  else
715  {
716  edot = cos(edot);
717  }
718 
719  energyd = 0.;
720  if (newloc->pos.sunradiance && sdot > 0)
721  {
722  energyd += sdot * triangle.irradiation * dt;
723  }
724 
725  if (edot > 0)
726  {
727  energyd += edot * dt * SIGMA * pow(290.,4);
728  }
729  if (triangle.pcell > 0.)
730  {
731  if (triangle.ecellbase > 0.)
732  {
733  double efficiency = triangle.ecellbase + triangle.ecellslope * triangle.temp;
734  triangle.power = triangle.area * efficiency * energyd / dt;
735  triangle.volt = triangle.vcell;
736  triangle.amp = -triangle.power / triangle.volt;
737  newphys->powgen += triangle.power;
738  }
739  }
740  }
741  else
742  {
743  triangle.power = 0.;
744  triangle.volt = 0.;
745  triangle.amp = 0.;
746  }
747 
748  }
749  return 0;
750  }
locstruc * newloc
Definition: physicsclass.h:111
double dot(Vector b)
Dot product.
Definition: vector.cpp:1684
physicsstruc * newphys
Definition: physicsclass.h:113
double norm()
Norm.
Definition: vector.cpp:1735
float sunradiance
Watts per square meter per steradian.
Definition: convertdef.h:752
float area
Area.
Definition: jsondef.h:3307
float volt
Voltage generated in volts.
Definition: jsondef.h:3325
double dt
Definition: physicsclass.h:108
float pcell
Solar cell coverage.
Definition: jsondef.h:3315
rvector s
Location.
Definition: convertdef.h:163
Definition: jsondef.h:3275
float vcell
Nominal voltage of Solar cell.
Definition: jsondef.h:3321
uint8_t external
External facing sides.
Definition: jsondef.h:3278
attstruc att
attstruc for this time.
Definition: convertdef.h:883
float amp
Current generated in amps.
Definition: jsondef.h:3327
qatt icrf
Definition: convertdef.h:830
float ecellbase
Solar cell base efficiency.
Definition: jsondef.h:3317
float power
Power generated in watts.
Definition: jsondef.h:3323
Vector normal
outward facing normal
Definition: jsondef.h:3282
posstruc pos
posstruc for this time.
Definition: convertdef.h:881
Vector & normalize(double size=1.)
Normalize.
Definition: vector.cpp:1706
quaternion s
0th derivative: Quaternion
Definition: convertdef.h:479
cartpos eci
Definition: convertdef.h:737
float irradiation
Insolation in Watts/sq m.
Definition: jsondef.h:3313
Vector Class.
Definition: vector.h:672
#define SIGMA
SI Stefan-Boltzmann constant.
Definition: convertdef.h:51
cartpos icrf
Definition: convertdef.h:736
float temp
Temperature in Kelvin.
Definition: jsondef.h:3305
Vector irotate(const Vector &v)
Indirectly rotate a ::Vector using a ::Quaternion.
Definition: vector.cpp:2473
vector< trianglestruc > triangles
Definition: jsondef.h:3452
float ecellslope
Solar cell efficiency with temp.
Definition: jsondef.h:3319
float powgen
Definition: jsondef.h:3432
#define RADOF(deg)
Radians of a Degree value.
Definition: math/constants.h:29

Member Data Documentation

float Cosmos::Physics::ElectricalPropagator::battery_charge

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