io#

Interfacing of Tudat(py) to and from other applications.

This module provides with different functionalities that allow to export results from Tudat(py) to other softwares such as MATLAB, to post-process results. A set of methods are also provided to read inputs from other softwares and integrate them with Tudat(py).

Functions#

save2txt(solution, filename[, directory])

Save a vector or matrix history to a file.

save_time_history_to_file(solution, filename)

Save a propagated time history to a file.

get_resource_path()

Get the path at which tudat resources are located.

get_ephemeris_path()

Get the path at which the ephemeris used by tudat are located.

get_earth_orientation_path()

Get the path at which the Earth orientation resources used by tudat are located.

get_quadrature_path()

Get the path at which the Gaussian quadrature resources are located.

get_spice_kernel_path()

Get the path at which the SPICE kernel used by tudat is located.

get_atmosphere_tables_path()

Get the path at which tudat atmosphere tables are located.

get_gravity_models_path()

Get the path at which tudat gravity models are located.

get_space_weather_path()

Get the path at which tudat space weather is located.

read_vector_history_from_file(vector_size, ...)

Read a vector history from a file.

read_matrix_history_from_file(matrix_rows, ...)

Read a matrix history from a file.

save2txt(solution, filename, directory='./')[source]#

Save a vector or matrix history to a file.

This function can be used to save a dictionary that maps epochs to a vector or matrix at the given epoch.

Parameters:
  • solution (Dict[float, numpy.ndarray]) – Dictionary mapping floats (e.g. the simulation time steps) to arrays (e.g. the propagated state time series).

  • filename (str) – Name of the text file that is to be saved.

  • directory (str, optional, default="./") – Directory in which to save the text file.

save_time_history_to_file(solution, filename, directory='./')[source]#

Save a propagated time history to a file.

This function can be used to save a propagated state history to a text file. It can also be used for instance to save a dependent variable history, or a sensitivity matrix history.

Note

This function is essentially the same method as save2txt(), offering the same functionality under a different name.

Parameters:
  • solution (Dict[float, numpy.ndarray]) – Dictionary mapping the simulation time steps to the propagated state time series.

  • filename (str) – Name of the text file that is to be saved.

  • directory (str, optional, default="./") – Directory in which to save the text file.

get_resource_path() str#

Get the path at which tudat resources are located.

Returns:

Local path at which tudat resources are located.

Return type:

str

get_ephemeris_path() str#

Get the path at which the ephemeris used by tudat are located.

Returns:

Local path at which the tudat ephemeris resources are located.

Return type:

str

get_earth_orientation_path() str#

Get the path at which the Earth orientation resources used by tudat are located.

Returns:

Local path at which tudat Earth orientation resources are located.

Return type:

str

get_quadrature_path() str#

Get the path at which the Gaussian quadrature resources are located.

Returns:

Local path at which tudat Gaussian quadrature resources are located.

Return type:

str

get_spice_kernel_path() str#

Get the path at which the SPICE kernel used by tudat is located.

Returns:

Local path at which the SPICE kernel is located.

Return type:

str

get_atmosphere_tables_path() str#

Get the path at which tudat atmosphere tables are located.

Returns:

Local path at which tudat atmosphere tables are located.

Return type:

str

get_gravity_models_path() str#

Get the path at which tudat gravity models are located.

Returns:

Local path at which tudat gravity models are located.

Return type:

str

get_space_weather_path() str#

Get the path at which tudat space weather is located.

Returns:

Local path at which tudat space weather is located.

Return type:

str

read_vector_history_from_file(vector_size: int, file_name: str) Dict[float, Eigen::Matrix<double, -1, 1, 0, -1, 1>]#

Read a vector history from a file.

Parameters:
  • vector_size (int) – Size of the vector at each epoch.

  • file_name (str) – Name of the file containing the vector history.

Returns:

Dictionary mapping epochs to the vector at the given epoch.

Return type:

Dict[float, numpy.ndarray]

read_matrix_history_from_file(matrix_rows: int, matrix_columns: int, file_name: str) Dict[float, Eigen::Matrix<double, -1, -1, 0, -1, -1>]#

Read a matrix history from a file.

Parameters:
  • matrix_rows (int) – Number of rows in the matrix at each epoch.

  • matrix_columns (int) – Number of columns in the matrix at each epoch.

  • file_name (str) – Name of the file containing the matrix history.

Returns:

Dictionary mapping epochs to the matrix at the given epoch.

Return type:

Dict[float, numpy.ndarray]

Enumerations#

StaticCoefficientNames

Enumeration of Missile DATCOM static aerodynamic coefficient types.

DynamicCoefficientNames

Enumeration of Missile DATCOM dynamic aerodynamic coefficient types.

class StaticCoefficientNames#

Enumeration of Missile DATCOM static aerodynamic coefficient types.

Members:

cn :

Normal force coefficient.

cm :

Pitching moment coefficient.

ca :

Axial force coefficient.

cy :

Side force coefficient.

cln :

Yawing moment coefficient.

cll :

Rolling moment coefficient.

cna :

Normal force coefficient change w.r.t. angle of attack.

cma :

Pitching moment coefficient change w.r.t. angle of attack.

cyb :

Side force coefficient change w.r.t. sideslip angle.

cnb :

Yawing moment coefficient change w.r.t. sideslip angle.

clb :

Rolling moment coefficient change w.r.t. sideslip angle.

property name#
class DynamicCoefficientNames#

Enumeration of Missile DATCOM dynamic aerodynamic coefficient types.

Members:

cnq :

Normal force coefficient change w.r.t. pitch rate.

cmq :

Pitching moment coefficient change w.r.t. pitch rate.

caq :

Pitching moment coefficient change w.r.t. pitch rate.

cyq :

Side force coefficient change w.r.t. pitch rate.

clnq :

Yawing moment coefficient change w.r.t. pitch rate.

cllq :

Rolling moment coefficient change w.r.t. pitch rate.

cnr :

Normal force coefficient change w.r.t. yaw rate.

cmr :

Pitching moment coefficient change w.r.t. yaw rate.

car :

Pitching moment coefficient change w.r.t. yaw rate.

cyr :

Side force coefficient change w.r.t. yaw rate.

clnr :

Yawing moment coefficient change w.r.t. yaw rate.

cllr :

Rolling moment coefficient change w.r.t. yaw rate.

cnp :

Normal force coefficient change w.r.t. roll rate.

cmp :

Pitching moment coefficient change w.r.t. roll rate.

cap :

Pitching moment coefficient change w.r.t. roll rate.

cyp :

Side force coefficient change w.r.t. roll rate.

clnp :

Yawing moment coefficient change w.r.t. roll rate.

cllp :

Rolling moment coefficient change w.r.t. roll rate.

cnad :

Normal force coefficient change w.r.t. angle of attack change rate.

cmad :

Pitching moment coefficient change w.r.t. angle of attack change rate.

property name#

Classes#

missile_DATCOM_data

Class containing data and methods interfacing the Missile DATCOM software.

class missile_DATCOM_data#

Class containing data and methods interfacing the Missile DATCOM software.

This class is the main method that can be used to interface tudat with the Missile DATCOM software. It can be initialised with the output file from Missile DATCOM, and provides methods to convert these results into tudat-compatible data.

Note

The Missile DATCOM software from which outputs can be interfaced to TUDAT is an entirely separate software from Tudat(Py). Please refer to Missile DATCOM user manuals for information on how to use it. These can be accessed on the US Defence Technical Information Center at accession numbers ADA267447 and ADA503576.

Note

The interfacing of Missile DATCOM to tudat assumes that aerodynamic coefficients are computed as a function of both Mach number and angle of attack.

__init__(self: tudatpy.kernel.io.missile_DATCOM_data, file_name_and_path: str) None#

Class constructor.

Function used to construct and initialise the class. In essence, it can be used to read and extract the aerodynamic coefficients computed by Missile DATCOM, and save them in different formats.

Parameters:

file_name_and_path (str) – Full path and file name of the for004.dat Missile DATCOM results output file.

get_Reynolds_numbers(self: tudatpy.kernel.io.missile_DATCOM_data) List[float]#

Get the list of Reynolds numbers at which Missile DATCOM has been run.

Returns:

List of Reynolds numbers.

Return type:

numpy.ndarray

get_angle_of_attacks(self: tudatpy.kernel.io.missile_DATCOM_data) List[float]#

Get the list of angle of attacks at which Missile DATCOM has been run.

Returns:

List of angle of attacks.

Return type:

numpy.ndarray

get_dynamic_coefficient(self: tudatpy.kernel.io.missile_DATCOM_data, mach_index: int, angle_of_attack_index: int, coefficient_index: tudat::input_output::MissileDatcomData::DynamicCoefficientNames) float#

Get a specific dynamic coefficient from the result database.

Parameters:
  • mach_index (int) – Index of the Mach number for which to get the static coefficient.

  • angle_of_attack_index (int) – Index of the angle of attack for which to get the static coefficient.

  • coefficient_index (tudatpy.io.DynamicCoefficientNames) – Type of the dynamic aerodynamic coefficient.

Returns:

Dynamic aerodynamic coefficient.

Return type:

float

get_mach_numbers(self: tudatpy.kernel.io.missile_DATCOM_data) List[float]#

Get the list of Mach numbers at which Missile DATCOM has been run.

Returns:

List of Mach numbers.

Return type:

numpy.ndarray

get_static_coefficient(self: tudatpy.kernel.io.missile_DATCOM_data, mach_index: int, angle_of_attack_index: int, coefficient_index: tudat::input_output::MissileDatcomData::StaticCoefficientNames) float#

Get a specific static coefficient from the result database.

Parameters:
  • mach_index (int) – Index of the Mach number for which to get the static coefficient.

  • angle_of_attack_index (int) – Index of the angle of attack for which to get the static coefficient.

  • coefficient_index (tudatpy.io.StaticCoefficientNames) – Type of the static aerodynamic coefficient.

Returns:

Static aerodynamic coefficient.

Return type:

float

write_all_coefficients_to_files(self: tudatpy.kernel.io.missile_DATCOM_data, file_name_base: str, base_precision: int = 15, exponent_width: int = 2) None#

Write all the aerodynamic coefficients to CSV files.

Parameters:
  • file_name_base (str) – Full base path and name of the file that will be saved. The name of each aerodynamic coefficient will be included at the end of the file name.

  • base_precision (int, optional, default=15) – Number of digits to represent the base of the floating-point number.

  • exponent_width (int, optional, default=2) – Number of digits to represent the exponent of the floating-point number.

write_force_and_moment_coefficients_to_files(self: tudatpy.kernel.io.missile_DATCOM_data, file_name_base: str, base_precision: int = 15, exponent_width: int = 2) None#

Write the force and moment coefficients to a file in the format taken by the tabulated_from_files() function.

Parameters:
  • file_name_base (str) – Full base path and name of the file that will be saved. The name of each aerodynamic coefficient will be included at the end of the file name.

  • base_precision (int, optional, default=15) – Number of digits to represent the base of the floating-point number.

  • exponent_width (int, optional, default=2) – Number of digits to represent the exponent of the floating-point number.