OrbitPhysicalProperties.java

  1. /* Copyright 2002-2025 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */

  17. package org.orekit.files.ccsds.ndm.odm.ocm;

  18. import java.util.ArrayList;
  19. import java.util.List;

  20. import org.hipparchus.linear.DefaultRealMatrixChangingVisitor;
  21. import org.hipparchus.linear.MatrixUtils;
  22. import org.hipparchus.linear.RealMatrix;
  23. import org.orekit.files.ccsds.ndm.CommonPhysicalProperties;
  24. import org.orekit.time.AbsoluteDate;
  25. import org.orekit.utils.Constants;

  26. /** Spacecraft physical properties.
  27.  * @author Luc Maisonobe
  28.  * @since 11.0
  29.  */
  30. public class OrbitPhysicalProperties extends CommonPhysicalProperties {

  31.     /** Satellite manufacturer name. */
  32.     private String manufacturer;

  33.     /** Bus model name. */
  34.     private String busModel;

  35.     /** Other space objects this object is docked to. */
  36.     private List<String> dockedWith;

  37.     /** Attitude-independent drag cross-sectional area, not already into attitude-dependent area along OEB. */
  38.     private double dragConstantArea;

  39.     /** Nominal drag coefficient. */
  40.     private double dragCoefficient;

  41.     /** Drag coefficient 1σ uncertainty. */
  42.     private double dragUncertainty;

  43.     /** Total mass at beginning of life. */
  44.     private double initialWetMass;

  45.     /** Total mass at T₀. */
  46.     private double wetMass;

  47.     /** Mass without propellant. */
  48.     private double dryMass;

  49.     /** Minimum cross-sectional area for collision probability estimation purposes. */
  50.     private double minAreaForCollisionProbability;

  51.     /** Maximum cross-sectional area for collision probability estimation purposes. */
  52.     private double maxAreaForCollisionProbability;

  53.     /** Typical (50th percentile) cross-sectional area for collision probability estimation purposes. */
  54.     private double typAreaForCollisionProbability;

  55.     /** Attitude-independent SRP area, not already into attitude-dependent area along OEB. */
  56.     private double srpConstantArea;

  57.     /** Nominal SRP coefficient. */
  58.     private double srpCoefficient;

  59.     /** SRP coefficient 1σ uncertainty. */
  60.     private double srpUncertainty;

  61.     /** Attitude control mode. */
  62.     private String attitudeControlMode;

  63.     /** Type of actuator for attitude control. */
  64.     private String attitudeActuatorType;

  65.     /** Accuracy of attitude knowledge. */
  66.     private double attitudeKnowledgeAccuracy;

  67.     /** Accuracy of attitude control. */
  68.     private double attitudeControlAccuracy;

  69.     /** Overall accuracy of spacecraft to maintain attitude. */
  70.     private double attitudePointingAccuracy;

  71.     /** Average average frequency of orbit or attitude maneuvers (in SI units, hence per second). */
  72.     private double maneuversFrequency;

  73.     /** Maximum composite thrust the spacecraft can accomplish. */
  74.     private double maxThrust;

  75.     /** Total ΔV capability at beginning of life. */
  76.     private double bolDv;

  77.     /** Total ΔV remaining for spacecraft. */
  78.     private double remainingDv;

  79.     /** Inertia matrix. */
  80.     private final RealMatrix inertiaMatrix;

  81.     /** Simple constructor.
  82.      * @param epochT0 T0 epoch from file metadata
  83.      */
  84.     public OrbitPhysicalProperties(final AbsoluteDate epochT0) {

  85.         // Call to CommonPhysicalProperties constructor
  86.         super();

  87.         // we don't call the setXxx() methods in order to avoid
  88.         // calling refuseFurtherComments as a side effect
  89.         dockedWith                     = new ArrayList<>();
  90.         // 502.0-B-3 (page 6-22) says these drag values are optional.
  91.         dragConstantArea               = Double.NaN;
  92.         dragCoefficient                = Double.NaN;
  93.         dragUncertainty                = Double.NaN;
  94.         // 502.0-B-3 (page 6-25) says these SRP values are optional.
  95.         srpCoefficient                 = Double.NaN;
  96.         srpConstantArea                = Double.NaN;
  97.         srpUncertainty                 = Double.NaN;
  98.         initialWetMass                 = Double.NaN;
  99.         wetMass                        = Double.NaN;
  100.         dryMass                        = Double.NaN;
  101.         minAreaForCollisionProbability = Double.NaN;
  102.         maxAreaForCollisionProbability = Double.NaN;
  103.         typAreaForCollisionProbability = Double.NaN;
  104.         attitudeKnowledgeAccuracy      = Double.NaN;
  105.         attitudeControlAccuracy        = Double.NaN;
  106.         attitudePointingAccuracy       = Double.NaN;
  107.         maneuversFrequency             = Double.NaN;
  108.         maxThrust                      = Double.NaN;
  109.         bolDv                          = Double.NaN;
  110.         remainingDv                    = Double.NaN;
  111.         // 502.0-B-3 (page 6-27) says these inertia values are optional.
  112.         inertiaMatrix                  = MatrixUtils.createRealMatrix(3, 3);
  113.         // set all values to NaN
  114.         inertiaMatrix.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor() {
  115.             @Override
  116.             public double visit(final int i, final int j, final double v) {
  117.                 return Double.NaN;
  118.             }
  119.         });
  120.     }

  121.     /** Get manufacturer name.
  122.      * @return manufacturer name
  123.      */
  124.     public String getManufacturer() {
  125.         return manufacturer;
  126.     }

  127.     /** Set manufacturer name.
  128.      * @param manufacturer manufacturer name
  129.      */
  130.     public void setManufacturer(final String manufacturer) {
  131.         refuseFurtherComments();
  132.         this.manufacturer = manufacturer;
  133.     }

  134.     /** Get the bus model name.
  135.      * @return bus model name
  136.      */
  137.     public String getBusModel() {
  138.         return busModel;
  139.     }

  140.     /** Set the bus model name.
  141.      * @param busModel bus model name
  142.      */
  143.     public void setBusModel(final String busModel) {
  144.         refuseFurtherComments();
  145.         this.busModel = busModel;
  146.     }

  147.     /** Get the other space objects this object is docked to.
  148.      * @return the oother space objects this object is docked to
  149.      */
  150.     public List<String> getDockedWith() {
  151.         return dockedWith;
  152.     }

  153.     /** Set the other space objects this object is docked to.
  154.      * @param dockedWith the other space objects this object is docked to
  155.      */
  156.     public void setDockedWith(final List<String> dockedWith) {
  157.         refuseFurtherComments();
  158.         this.dockedWith = dockedWith;
  159.     }

  160.     /** Get the attitude-independent drag cross-sectional area, not already into attitude-dependent area along OEB.
  161.      * @return attitude-independent drag cross-sectional area, not already into attitude-dependent area along OEB
  162.      */
  163.     public double getDragConstantArea() {
  164.         return dragConstantArea;
  165.     }

  166.     /** Set the attitude-independent drag cross-sectional area, not already into attitude-dependent area along OEB.
  167.      * @param dragConstantArea attitude-independent drag cross-sectional area, not already into attitude-dependent area along OEB
  168.      */
  169.     public void setDragConstantArea(final double dragConstantArea) {
  170.         refuseFurtherComments();
  171.         this.dragConstantArea = dragConstantArea;
  172.     }

  173.     /** Get the nominal drag coefficient.
  174.      * @return the nominal drag coefficient
  175.      */
  176.     public double getDragCoefficient() {
  177.         return dragCoefficient;
  178.     }

  179.     /** Set the the nominal drag coefficient.
  180.      * @param dragCoefficient the nominal drag coefficient
  181.      */
  182.     public void setDragCoefficient(final double dragCoefficient) {
  183.         refuseFurtherComments();
  184.         this.dragCoefficient = dragCoefficient;
  185.     }

  186.     /** Get the drag coefficient 1σ uncertainty.
  187.      * @return drag coefficient 1σ uncertainty (in %)
  188.      */
  189.     public double getDragUncertainty() {
  190.         return dragUncertainty;
  191.     }

  192.     /** Set the drag coefficient 1σ uncertainty.
  193.      * @param dragUncertainty drag coefficient 1σ uncertainty (in %)
  194.      */
  195.     public void setDragUncertainty(final double dragUncertainty) {
  196.         refuseFurtherComments();
  197.         this.dragUncertainty = dragUncertainty;
  198.     }

  199.     /** Get the total mass at beginning of life.
  200.      * @return total mass at beginning of life
  201.      */
  202.     public double getInitialWetMass() {
  203.         return initialWetMass;
  204.     }

  205.     /** Set the total mass at beginning of life.
  206.      * @param initialWetMass total mass at beginning of life
  207.      */
  208.     public void setInitialWetMass(final double initialWetMass) {
  209.         refuseFurtherComments();
  210.         this.initialWetMass = initialWetMass;
  211.     }

  212.     /** Get the total mass at T₀.
  213.      * @return total mass at T₀
  214.      */
  215.     public double getWetMass() {
  216.         return wetMass;
  217.     }

  218.     /** Set the total mass at T₀.
  219.      * @param wetMass total mass at T₀
  220.      */
  221.     public void setWetMass(final double wetMass) {
  222.         refuseFurtherComments();
  223.         this.wetMass = wetMass;
  224.     }

  225.     /** Get the mass without propellant.
  226.      * @return mass without propellant
  227.      */
  228.     public double getDryMass() {
  229.         return dryMass;
  230.     }

  231.     /** Set the mass without propellant.
  232.      * @param dryMass mass without propellant
  233.      */
  234.     public void setDryMass(final double dryMass) {
  235.         refuseFurtherComments();
  236.         this.dryMass = dryMass;
  237.     }

  238.     /** Get the minimum cross-sectional area for collision probability estimation purposes.
  239.      * @return minimum cross-sectional area for collision probability estimation purposes
  240.      */
  241.     public double getMinAreaForCollisionProbability() {
  242.         return minAreaForCollisionProbability;
  243.     }

  244.     /** Set the minimum cross-sectional area for collision probability estimation purposes.
  245.      * @param minAreaForCollisionProbability minimum cross-sectional area for collision probability estimation purposes
  246.      */
  247.     public void setMinAreaForCollisionProbability(final double minAreaForCollisionProbability) {
  248.         refuseFurtherComments();
  249.         this.minAreaForCollisionProbability = minAreaForCollisionProbability;
  250.     }

  251.     /** Get the maximum cross-sectional area for collision probability estimation purposes.
  252.      * @return maximum cross-sectional area for collision probability estimation purposes
  253.      */
  254.     public double getMaxAreaForCollisionProbability() {
  255.         return maxAreaForCollisionProbability;
  256.     }

  257.     /** Set the maximum cross-sectional area for collision probability estimation purposes.
  258.      * @param maxAreaForCollisionProbability maximum cross-sectional area for collision probability estimation purposes
  259.      */
  260.     public void setMaxAreaForCollisionProbability(final double maxAreaForCollisionProbability) {
  261.         refuseFurtherComments();
  262.         this.maxAreaForCollisionProbability = maxAreaForCollisionProbability;
  263.     }

  264.     /** Get the typical (50th percentile) cross-sectional area for collision probability estimation purposes.
  265.      * @return typical (50th percentile) cross-sectional area for collision probability estimation purposes
  266.      */
  267.     public double getTypAreaForCollisionProbability() {
  268.         return typAreaForCollisionProbability;
  269.     }

  270.     /** Get the typical (50th percentile) cross-sectional area for collision probability estimation purposes.
  271.      * @param typAreaForCollisionProbability typical (50th percentile) cross-sectional area for collision probability estimation purposes
  272.      */
  273.     public void setTypAreaForCollisionProbability(final double typAreaForCollisionProbability) {
  274.         refuseFurtherComments();
  275.         this.typAreaForCollisionProbability = typAreaForCollisionProbability;
  276.     }

  277.     /** Get the attitude-independent SRP area, not already into attitude-dependent area along OEB.
  278.      * @return attitude-independent SRP area, not already into attitude-dependent area along OEB
  279.      */
  280.     public double getSrpConstantArea() {
  281.         return srpConstantArea;
  282.     }

  283.     /** Set the attitude-independent SRP area, not already into attitude-dependent area along OEB.
  284.      * @param srpConstantArea attitude-independent SRP area, not already into attitude-dependent area along OEB
  285.      */
  286.     public void setSrpConstantArea(final double srpConstantArea) {
  287.         refuseFurtherComments();
  288.         this.srpConstantArea = srpConstantArea;
  289.     }

  290.     /** Get the nominal SRP coefficient.
  291.      * @return nominal SRP coefficient
  292.      */
  293.     public double getSrpCoefficient() {
  294.         return srpCoefficient;
  295.     }

  296.     /** Set the nominal SRP coefficient.
  297.      * @param srpCoefficient nominal SRP coefficient
  298.      */
  299.     public void setSrpCoefficient(final double srpCoefficient) {
  300.         refuseFurtherComments();
  301.         this.srpCoefficient = srpCoefficient;
  302.     }

  303.     /** Get the SRP coefficient 1σ uncertainty.
  304.      * @return SRP coefficient 1σ uncertainty
  305.      */
  306.     public double getSrpUncertainty() {
  307.         return srpUncertainty;
  308.     }

  309.     /** Set the SRP coefficient 1σ uncertainty.
  310.      * @param srpUncertainty SRP coefficient 1σ uncertainty.
  311.      */
  312.     public void setSrpUncertainty(final double srpUncertainty) {
  313.         refuseFurtherComments();
  314.         this.srpUncertainty = srpUncertainty;
  315.     }

  316.     /** Get the attitude control mode.
  317.      * @return attitude control mode
  318.      */
  319.     public String getAttitudeControlMode() {
  320.         return attitudeControlMode;
  321.     }

  322.     /** Set the attitude control mode.
  323.      * @param attitudeControlMode attitude control mode
  324.      */
  325.     public void setAttitudeControlMode(final String attitudeControlMode) {
  326.         refuseFurtherComments();
  327.         this.attitudeControlMode = attitudeControlMode;
  328.     }

  329.     /** Get the type of actuator for attitude control.
  330.      * @return type of actuator for attitude control
  331.      */
  332.     public String getAttitudeActuatorType() {
  333.         return attitudeActuatorType;
  334.     }

  335.     /** Set the type of actuator for attitude control.
  336.      * @param attitudeActuatorType type of actuator for attitude control
  337.      */
  338.     public void setAttitudeActuatorType(final String attitudeActuatorType) {
  339.         refuseFurtherComments();
  340.         this.attitudeActuatorType = attitudeActuatorType;
  341.     }

  342.     /** Get the accuracy of attitude knowledge.
  343.      * @return accuracy of attitude knowledge
  344.      */
  345.     public double getAttitudeKnowledgeAccuracy() {
  346.         return attitudeKnowledgeAccuracy;
  347.     }

  348.     /** Set the accuracy of attitude knowledge.
  349.      * @param attitudeKnowledgeAccuracy accuracy of attitude knowledge
  350.      */
  351.     public void setAttitudeKnowledgeAccuracy(final double attitudeKnowledgeAccuracy) {
  352.         refuseFurtherComments();
  353.         this.attitudeKnowledgeAccuracy = attitudeKnowledgeAccuracy;
  354.     }

  355.     /** Get the accuracy of attitude control.
  356.      * @return accuracy of attitude control
  357.      */
  358.     public double getAttitudeControlAccuracy() {
  359.         return attitudeControlAccuracy;
  360.     }

  361.     /** Set the accuracy of attitude control.
  362.      * @param attitudeControlAccuracy accuracy of attitude control
  363.      */
  364.     public void setAttitudeControlAccuracy(final double attitudeControlAccuracy) {
  365.         refuseFurtherComments();
  366.         this.attitudeControlAccuracy = attitudeControlAccuracy;
  367.     }

  368.     /** Get the overall accuracy of spacecraft to maintain attitude.
  369.      * @return overall accuracy of spacecraft to maintain attitude
  370.      */
  371.     public double getAttitudePointingAccuracy() {
  372.         return attitudePointingAccuracy;
  373.     }

  374.     /** Set the overall accuracy of spacecraft to maintain attitude.
  375.      * @param attitudePointingAccuracy overall accuracy of spacecraft to maintain attitude
  376.      */
  377.     public void setAttitudePointingAccuracy(final double attitudePointingAccuracy) {
  378.         refuseFurtherComments();
  379.         this.attitudePointingAccuracy = attitudePointingAccuracy;
  380.     }

  381.     /** Get the average number of orbit or attitude maneuvers per year.
  382.      * @return average number of orbit or attitude maneuvers per year.
  383.      */
  384.     public double getManeuversPerYear() {
  385.         return maneuversFrequency * Constants.JULIAN_YEAR;
  386.     }

  387.     /** Get the average frequency of orbit or attitude maneuvers (in SI units, hence per second).
  388.      * @return average frequency of orbit or attitude maneuvers (in SI units, hence per second).
  389.      */
  390.     public double getManeuversFrequency() {
  391.         return maneuversFrequency;
  392.     }

  393.     /** Set the average frequency of orbit or attitude maneuvers (in SI units, hence per second).
  394.      * @param maneuversFrequency average frequency of orbit or attitude (in SI units, hence per second).
  395.      */
  396.     public void setManeuversFrequency(final double maneuversFrequency) {
  397.         refuseFurtherComments();
  398.         this.maneuversFrequency = maneuversFrequency;
  399.     }

  400.     /** Get the maximum composite thrust the spacecraft can accomplish.
  401.      * @return maximum composite thrust the spacecraft can accomplish
  402.      */
  403.     public double getMaxThrust() {
  404.         return maxThrust;
  405.     }

  406.     /** Set the maximum composite thrust the spacecraft can accomplish.
  407.      * @param maxThrust maximum composite thrust the spacecraft can accomplish
  408.      */
  409.     public void setMaxThrust(final double maxThrust) {
  410.         refuseFurtherComments();
  411.         this.maxThrust = maxThrust;
  412.     }

  413.     /** Get the total ΔV capability at beginning of life.
  414.      * @return total ΔV capability at beginning of life
  415.      */
  416.     public double getBolDv() {
  417.         return bolDv;
  418.     }

  419.     /** Set the total ΔV capability at beginning of life.
  420.      * @param bolDv total ΔV capability at beginning of life
  421.      */
  422.     public void setBolDv(final double bolDv) {
  423.         refuseFurtherComments();
  424.         this.bolDv = bolDv;
  425.     }

  426.     /** Get the total ΔV remaining for spacecraft.
  427.      * @return total ΔV remaining for spacecraft
  428.      */
  429.     public double getRemainingDv() {
  430.         return remainingDv;
  431.     }

  432.     /** Set the total ΔV remaining for spacecraft.
  433.      * @param remainingDv total ΔV remaining for spacecraft
  434.      */
  435.     public void setRemainingDv(final double remainingDv) {
  436.         refuseFurtherComments();
  437.         this.remainingDv = remainingDv;
  438.     }

  439.     /** Get the inertia matrix.
  440.      * @return the inertia matrix
  441.      */
  442.     public RealMatrix getInertiaMatrix() {
  443.         return inertiaMatrix;
  444.     }

  445.     /** Set an entry in the inertia matrix.
  446.      * <p>
  447.      * Both I(j, k) and I(k, j) are set.
  448.      * </p>
  449.      * @param j row index (must be between 0 and 3 (inclusive)
  450.      * @param k column index (must be between 0 and 3 (inclusive)
  451.      * @param entry value of the matrix entry
  452.      */
  453.     public void setInertiaMatrixEntry(final int j, final int k, final double entry) {
  454.         refuseFurtherComments();
  455.         inertiaMatrix.setEntry(j, k, entry);
  456.         inertiaMatrix.setEntry(k, j, entry);
  457.     }

  458. }