[][src]Crate kalast

kalast

kalast is a thermophysical modelling engine for binary systems of asteroids.

Using kalast

You will need the last stable build of the rust compiler and the official package manager: cargo.

Simply add the following to your Cargo.toml file:

[dependencies]
kalast = "0.1"

Most useful functionalities of kalast are grouped in the root module kalast::.

However, the recommended way to use nalgebra is to import types and traits explicitly, and call free-functions using the na:: prefix:

use kalast::{BasicProperties, Body, Time, World, ASTRONAUMICAL_UNIT, DAY, HOUR, V3};
use std::path::Path;

fn main() {
    // Create a simulation time that lasts 50 days with 30 seconds steps
    let time = Time::new(50. * DAY, 30.);

    // Instanciate a celestial body named 'Dimorphos', at a distance of 1 AU from
    // the Sun, from a 3D object shape model localted at 'rsc/obj/dimorphos.obj',
    // with a complete set of ground physical properties.
    let mut body = Body::new(
        "Dimorphos", // name
        V3::new(0., 1., 0.) * ASTRONAUMICAL_UNIT, // distance to Sun
        Path::new("rsc/obj/dimorphos.obj"), // 3D object path
        BasicProperties { // ground physical properties
            rotation_period: 11.92 * HOUR,
            revolution_period: 11.92 * HOUR,
            obliquity: 0.,
            thermal_inertia: 500.,
            density: 2146.,
            heat_capacity: 600.,
            albedo: 0.07,
            emissivity: 0.9,
        }
        .into_all(time.time_step()), // this converts the struct `BasicProperties` into
        // `Properties` (which is the actual last argument type of the body constructor)
        // by considering the time step to optimize some ground parameters
    );

    body.set_faces_mask_equator(); // only computes temperatures for equator

    let mut world = World::new(time, body); // define the world of the simulation
    world.start(); // run the simulation
    world.save(Path::new("rsc/temperatures/dimorphos.txt")); // save the temperatures to a file
}

Features

kalast is meant for binary system of asteroids surface thermophysical modelling. The physics of this engine includes these features:

  • custom shape model
  • celestial body revolution
  • compute surface temperatures from solar flux
  • ground 1D heat transfert conduction
  • celestial body mask view (example only equator)
  • TODO: mutual heating from primary/moon
  • TODO: self heating
  • TODO: mutual occultations
  • TODO: shadowing

Re-exports

pub use crate::base::*;
pub use crate::toolbox::*;

Modules

base

The main features of kalast are implemented in base.

toolbox

The module toolbox is a collection of generic functions to help some typical math, physics, matrix, or the usage of other crates.

Traits

SuperScalar

SuperScalar is a trait that extends the Scalar trait of nalgebra to allow to create integer matrices just like float matrices. It aims to be the equivalent of RealField of nalgebra but for integer.

Type Definitions

V3

V3 is a type alias for Matrix3x1 from nalgebra Matrix3x1 is a matrix of 3 rows and 1 column. V3 follows the definition of V3X which aims to ease the pain of remembering the row/column order. You consider V3 as a 3D column vector.

V3X

V3X is a type alias for Matrix3xX from nalgebra Matrix3xX is a matrix of 3 rows and X columns. V3X comes to ease the pain of remembering the row/column order. You consider V3X as a list of 3D vectors: there are X 3D-vectors, and each vector is a column.

VX

VX is a type alias for DVector from nalgebra DVector is a vector of X columns. VX follows the definition of V3X and V3 which aims to ease the pain of remembering the row/column order. You consider VX as a column vector of size X.