## Model Spacecraft

To model, simulate, and visualize the motion and dynamics of spacecraft, use the Spacecraft library blocks. Use the Spacecraft Dynamics sublibrary blocks to define spacecraft constellation dynamics, orbit propagation, or attitude profile. Use the CubeSat Vehicles sublibrary blocks to define a single CubeSat vehicle.

The Spacecraft Dynamics library contains:

• Spacecraft Dynamics block — Models translational and rotational dynamics of spacecraft using numerical integration. It computes the position, velocity, attitude, and angular velocity of one or more spacecraft over time.

You can define orbital states as a set of orbital elements or as position and velocity state vectors in an inertial (ICRF) or fixed-frame (FF) coordinate system. To propagate orbital states, the block uses the gravity model defined in the "Central Body" section. It also uses external accelerations and forces provided as inputs to the block.

You can define attitude states using quaternions, direction cosine matrices (DCMs), or Euler angles. To propagate attitude states, the block uses moments provided as inputs to the block and mass properties defined in the "Mass" section.

• Orbit Propagator — Propagates the orbit of one or more spacecraft by a propagation method. The library contains two versions of the Orbit Propagator block, each preconfigured for a different propagation method, Kepler (unperturbed) or Numerical (high precision). The Kepler (unperturbed) version of the block uses a universal variable formulation propagation method that is considered faster. The Numerical (high precision) version of the block uses a numerical integration propagation method, which is considered more accurate and therefore, slower.

To use, define orbital states as a set of orbital elements or as position and velocity state vectors in an inertial (ICRF) or fixed-frame coordinate system.

• Attitude Profile — Calculate the shortest quaternion rotation that aligns the primary alignment vector with the primary constraint vector.

Provide the primary constraint as either a pointing mode, or via a custom constraint vector. The block then aligns secondary alignment and constraint vectors as much as possible without breaking primary alignment.

The CubeSat Vehicles library contains the CubeSat Vehicle, which provides a high level mission planning/rapid prototyping option to quickly model and propagate satellite orbits, one satellite at a time. For more information on the CubeSat Vehicle block, see Model and Simulate CubeSats. To propagate multiple satellites simultaneously, see the Orbit Propagator block.