Table of Contents

Class UniverseSystem

Namespace
NominalSystems.Universe
Assembly
NominalSystems.Universe.dll

Container class for spawning in all Universe models and simulation objects.

public class UniverseSystem : SimulationSystem
Inheritance
UniverseSystem
Inherited Members

Constructors

UniverseSystem()

Default Constructor for creating the Universe Subsystem

public UniverseSystem()

Fields

EMComponents

public List<PhysicalComponent> EMComponents

Field Value

List<PhysicalComponent>

SpiceInterface

A reference to the created Spice Interface constructed by the main constructor.

public readonly SpiceInterface SpiceInterface

Field Value

SpiceInterface

Properties

Albedo

A reference to the Albedo object. It is not initialised until it is created.

public Albedo Albedo { get; }

Property Value

Albedo

CelestialModels

A list of all celestial models that needs to be attach to dynamic bodies

public List<CelestialModel> CelestialModels { get; }

Property Value

List<CelestialModel>

CoordinateFrame

The base coordinate frame used by the Universe system

public CoordinateFrame CoordinateFrame { get; set; }

Property Value

CoordinateFrame

CurrentDate

The current date of the simulation including the current simulated time

public NsDateTime CurrentDate { get; }

Property Value

NsDateTime

CurrentSeconds

The current number of seconds the Simulation has been executed for.

public double CurrentSeconds { get; }

Property Value

double

Eclipse

A reference to the Eclipse object

public Eclipse Eclipse { get; }

Property Value

Eclipse

Epoch

The starting Epoch of the Universe

public NsDateTime Epoch { get; set; }

Property Value

NsDateTime

GlobalIntegrator

Defines the Integrator type that is defined by all new components, unless specified otherwise.

public IntegratorType GlobalIntegrator { get; }

Property Value

IntegratorType

GravityBodies

A dictionary of all gravity bodies in the simulation

public Dictionary<string, GravityBody> GravityBodies { get; }

Property Value

Dictionary<string, GravityBody>

NumBodies

The number of bodies that exist in the simulation

public int NumBodies { get; }

Property Value

int

Out_EpochMsg

The current date of the simulation including the current simulated time

public EpochMessage Out_EpochMsg { get; }

Property Value

EpochMessage

Out_SpaceWeatherDataMsg

The space weather message if it has been created by the NRLMSIS model

public SpaceWeatherDataMessage Out_SpaceWeatherDataMsg { get; }

Property Value

SpaceWeatherDataMessage

SolarFlux

A reference to the Solar Flux object

public SolarFlux SolarFlux { get; }

Property Value

SolarFlux

StarSphere

A reference to the Star Map object

public StarSphere StarSphere { get; }

Property Value

StarSphere

ZeroBase

The zero base (what is set to 0,0,0) in SPICE coordinates

public string ZeroBase { get; set; }

Property Value

string

Methods

AddAlbedoInstrument(AlbedoInstrumentConfig)

Adds a new instrument with albedo to the Albedo module

public void AddAlbedoInstrument(AlbedoInstrumentConfig configuration)

Parameters

configuration AlbedoInstrumentConfig

The Albedo configuration file

AddEMComponent(PhysicalComponent)

protected void AddEMComponent(PhysicalComponent EMComponent)

Parameters

EMComponent PhysicalComponent

AttachBodyToModels(DynamicBody)

Attaches a dynamic body to all celestial models

public void AttachBodyToModels(DynamicBody body)

Parameters

body DynamicBody

A reference to the dynamic body

CreateAlbedoPlanetAverage(string)

Creates a new Albedo configuration around a certain planet using the average albedo planet model. This uses the default values for the latitudes and longitudes.

public AlbedoPlanetConfig CreateAlbedoPlanetAverage(string planetName)

Parameters

planetName string

The name of the planet to add the albedo to

Returns

AlbedoPlanetConfig

The planet configuration file

CreateAlbedoPlanetAverage(string, double, int, int)

Creates a new Albedo configuration around a certain planet using the average albedo planet model.

public AlbedoPlanetConfig CreateAlbedoPlanetAverage(string planetName, double average, int numLat, int numLon)

Parameters

planetName string

The name of the planet to add the albedo to

average double

[-] The average albedo value between 0 and 1

numLat int

The number of latitude divisions

numLon int

The number of longitude divisions

Returns

AlbedoPlanetConfig

The planet configuration file

CreateAlbedoPlanetLookup(string, string)

Creates a new Albedo configuration around a certain planet using the lookup data model that uses a valid filepath to load the data.

public AlbedoPlanetConfig CreateAlbedoPlanetLookup(string planetName, string filePath)

Parameters

planetName string

The name of the planet to add the albedo to

filePath string

The data path for the file

Returns

AlbedoPlanetConfig

The planet configuration file

CreateAtmosphereExponential(string, double, double, double, double, double)

Creates a new exponential atmosphere and attaches it to a planet in the Universe

public AtmosphereExponential CreateAtmosphereExponential(string planet, double baseDensity = 1.217, double scaleHeight = 8500, double localTemperature = 293, double minReach = -1, double maxReach = -1)

Parameters

planet string

The name of the planet to attach to

baseDensity double

[kg/m^3] Density of the atmosphere at h=0

scaleHeight double

[m] Exponential characteristic height

localTemperature double

[K] Local atmospheric temperature (constant)

minReach double

[m] Minimum planet-relative position needed for the environment to work

maxReach double

[m] Maximum distance at which the environment will be calculated

Returns

AtmosphereExponential

A reference to the Environment

CreateAtmosphereNRLMSIS()

Creates the NRL-MSIS-E-90 Atmosphere around the Earth and attaches it to the planet in the Universe. The series of parameters provided are the solar flux and space weather indicies.

public AtmosphereNRLMSIS CreateAtmosphereNRLMSIS()

Returns

AtmosphereNRLMSIS

The NRLMSIS Atmosphere module

CreateBody(string)

Creates a new body of some name. This function just renames the "FindBody" function.

public bool CreateBody(string bodyName)

Parameters

bodyName string

The name of the body to find

Returns

bool

Whether a body is created

CreateDefaultSystem()

Creates a default solar system with an Earth, Moon and Sun in the simulation.

public void CreateDefaultSystem()

CreateMagneticFieldCenteredDipole(string, double, double, double, double, double)

Creates a new centered dipole magnetic field and attaches it to the planet in the Universe

public MagneticFieldCenteredDipole CreateMagneticFieldCenteredDipole(string planet, double G10 = -15463, double G11 = -1159, double H11 = 2908.5, double minReach = -1, double maxReach = -1)

Parameters

planet string

The name of the planet to attach to

G10 double

[nT] The IGRF Coefficient g_1^0

G11 double

[nT] The IGRF Coefficient g_1^1

H11 double

[nT] The IGRF Coefficient h_1^1

minReach double

[m] Minimum planet-relative position needed for the environment to work

maxReach double

[m] Maximum distance at which the environment will be calculated

Returns

MagneticFieldCenteredDipole

A reference to the Magnetic Field module

CreateMagneticFieldWMM(string)

Creates the World Magnetic Model (WMM) Magnetosphere around the Earth and connects up all the associated data with the right data.

public MagneticFieldWMM CreateMagneticFieldWMM(string coeffFile = "WMM.COF")

Parameters

coeffFile string

The coefficients file

Returns

MagneticFieldWMM

The WMM Magnetic Field module

CreateSolarSystem()

Attempts to create every single valid body in the Solar System that can exist in the simulation.

public void CreateSolarSystem()

FindBody(string)

Attempts to find a gravity body if it exists. If it does not exists, it will create the gravity body from scratch.

public GravityBody FindBody(string bodyName)

Parameters

bodyName string

The name of the body to find

Returns

GravityBody

The Gravity Body reference

GetGravityBodies()

Returns a list of all gravity bodies that exist in the simulation.

public List<GravityBody> GetGravityBodies()

Returns

List<GravityBody>

All gravity bodies

GetGravityBodyNames()

Returns a list of all gravity body names that exist in the simulation.

public List<string> GetGravityBodyNames()

Returns

List<string>

All gravity body names

GetPropagatedGeodetics(Vector3, Vector3, string, double, double)

Gets a series of propegated coordinates in latitude, longitude and altitude for an orbit around a body and determines where the body should be relative to the planet for an amount of time.

public Vector3[] GetPropagatedGeodetics(Vector3 initialPosition, Vector3 initialVelocity, string planet, double time, double delta = 10)

Parameters

initialPosition Vector3

[m] The initial position of the body

initialVelocity Vector3

[m/s] The initial velocity of the body

planet string

[-] The planet the body is orbiting

time double

[s] The total amount of time to propegate

delta double

[s] The difference in seconds between each step

Returns

Vector3[]

An array of Vector3 locations for the lat, lon and alt values

IsBodyExist(string)

Checks if a gravity body exists in the current simulation.

public bool IsBodyExist(string bodyName)

Parameters

bodyName string

The name of the body

Returns

bool

A flag for if the body exists

IsLineOfSight(Vector3, Vector3)

Determines if one object is in line of sight of another object taking in account all of the positions of the planets and their radius.

public bool IsLineOfSight(Vector3 start, Vector3 end)

Parameters

start Vector3

[m] The start position

end Vector3

[m] The end position

Returns

bool

A flag for if line of sight exists

LoadSphericalHarmonicsFromFile(string, string, int)

Updates the Spherical Harmonics degree on a particular gravity body

public bool LoadSphericalHarmonicsFromFile(string bodyName, string file, int degree)

Parameters

bodyName string

The name of the body

file string

The name of the file to load the CBar and SBar into

degree int

The harmonics degree

Returns

bool

A success flag

OnBegin(double)

Called when the 'SimulationSystem' is beginning

protected override void OnBegin(double time)

Parameters

time double

elapsed time (seconds)

OnDecodeMetadata(JObject)

Called after the "SimulationSystem" was loaded to handle additional metadata.

protected override void OnDecodeMetadata(JObject metadata)

Parameters

metadata JObject

OnEncodeMetadata(JObject)

Called while the "SimulationSystem" is being saved to save additional metadata.

protected override JObject OnEncodeMetadata(JObject metadata)

Parameters

metadata JObject

Returns

JObject

OnFinish(double)

Called when the 'SimulationSystem' is finishing

protected override void OnFinish(double time)

Parameters

time double

elapsed time (seconds)

OnReset(double)

Called when the 'SimulationSystem' is resetting

protected override void OnReset(double time)

Parameters

time double

reset time (seconds)

OnUpdate(double, double)

Called when the 'SimulationSystem' should update

protected override void OnUpdate(double time, double step)

Parameters

time double

elapsed time (seconds)

step double

the time step (seconds)

RemoveAtmosphere(string)

Removes the atmosphere component from a particular planet in the Universe.

public void RemoveAtmosphere(string planet)

Parameters

planet string

The planet to remove the environment from

RemoveBody(string)

Attempts to remove the body from the Solar System.

public void RemoveBody(string bodyName)

Parameters

bodyName string

The name of the body

RemoveEMComponent(PhysicalComponent)

protected void RemoveEMComponent(PhysicalComponent EMComponent)

Parameters

EMComponent PhysicalComponent

RemoveMagneticField(string)

Removes the magnetic field component from a particular planet in the Universe.

public void RemoveMagneticField(string planet)

Parameters

planet string

The planet to remove the environment from

SetEarthSpaceWeather(double, double, double)

Creates the space weather flags around earth and attaches to the NRLMSIS model if it already exists.

public void SetEarthSpaceWeather(double f107a, double f107, double aph)

Parameters

f107a double

The 81 day average space weather index

f107 double

The daily space weather index

aph double

The current geomagentic values

SetEpoch(string)

Sets the Epoch of the Simulation and adjusts the time based on the current seconds.

public void SetEpoch(string epoch)

Parameters

epoch string

The new epoch of the system

SetGlobalIntegrator(IntegratorType)

Method to set the global integrator type for all integratable objects that exists.

public void SetGlobalIntegrator(IntegratorType type)

Parameters

type IntegratorType

[-] The integrator type

SetSphericalHarmonics(string, int)

Sets the Spherical Harmonics level based on the degree and the body being used. This will use some default values.

public void SetSphericalHarmonics(string bodyName, int degree)

Parameters

bodyName string

The name of the Body to load harmonics from

degree int

The degree of the harmonics

Events

OnIntegratorChanged

A callback when the integrator changes, which is subscribed to by any IIntergrable objects.

public event UniverseSystem.IntegratorChanged OnIntegratorChanged

Event Type

UniverseSystem.IntegratorChanged