Discrete spring-mass system
Submodule SpringMass.jl
provides the basic features to simulate the flexible appendages of the spacecraft with the discrete spring mass representation, dynamics calculation, and time evolution.
Libraries
FlexibleSpacecraft.StructuresBase.SpringMass.ModalSystem
— TypeModalSystem
Representation of dynamics part of the structural system in mass-normalized modal coordinate.
Fields
dim::Integer
: dimension of the structural systemPHI::Matrix
: modal transformation matrixOMEGA::Matrix
: modal angular velocity matrixXI::Matrix
: modal damping matrix
Mathematical representation
This data containter corresponds to the left hand side of the equation of motion as follows:
\[\ddot{\mathbf{\eta}} + 2 \boldsymbol{\Xi \Omega} \dot{\mathbf{\eta}} + \boldsymbol{\Omega}^2 \mathbf{\eta} = \ldots\]
The modal transformation is given as:
\[\mathbf{x} = \boldsymbol{\Phi} \boldsymbol{\eta}\]
- $\boldsymbol{\Phi}$ : transformation matrix from modal coordinate to physical coordinate
- $\boldsymbol{\Omega}$ : modal angular velocity matrix
- $\boldsymbol{\Xi}$ : modal damping ratio matrix
Constructor
ModalSystem(PHI::Matrix, OMEGA::Matrix, XI::Matrix)
Example
# You can convert the `physicalsystem::PhysicalSystem` into `::ModalSystem`
physicalsystem = PhysicalSystem(M, C, K)
# Convert representation of the system in modal coordinate
modalsystem = physical2modal(physicalsystem)
FlexibleSpacecraft.StructuresBase.SpringMass.PhysicalSystem
— TypePhysicalSystem
Representation of dynamics part of the structural system in physical coordinate.
Fields
dim::Integer
: dimension of the structural systemmass_matrix::Matrix
: mass matrix in physical coordinatedamping_matrix::Matrix
: damping matrix in physical coordinatestiffness_matrix::Matrix
: stiffness matrix in physical coordinate
Mathematical representation
This data containter corresponds to the left hand side of the equation of motion as follows:
\[\mathbf{M} \ddot{\mathbf{x}} + \mathbf{D} \dot{\mathbf{x}} + \mathbf{K} \mathbf{x} = \ldots\]
- $\mathbf{M}$ : mass matrix
- $\mathbf{D}$ : damping matrix
- $\mathbf{K}$ : stiffness matrix
Constructor
PhysicalSystem(mass_matrix::Matrix, damping_matrix::Matrix, stiffness_matrix::Matrix)
Example
# Suppose M, D, K are given
# Create representation of the system in physical coordinate
physicalsystem = PhysicalSystem(M, D, K)
FlexibleSpacecraft.StructuresBase.SpringMass.SpringMassModel
— TypeSpringMassModel
Spring mass representation of the entire system modeling
Mathematical representation
\[\ddot{\mathbf{\eta}} + 2 \boldsymbol{\Xi \Omega} \dot{\mathbf{\eta}} + \boldsymbol{\Omega}^2 \mathbf{\eta} = \boldsymbol{\Phi}^{\mathrm{T}} \mathbf{D} \boldsymbol{\omega} + \boldsymbol{\Phi}^{\mathrm{T}} \mathbf{F}_{\mathrm{ctrl}} \mathbf{f_\mathrm{ctrl}} + \boldsymbol{\Phi}^{\mathrm{T}} \mathbf{F}_{\mathrm{dist}} \mathbf{f_\mathrm{dist}}\]
Fields
DOF::Integer
: dimension of the displacement vector of the systemdimcontrolinput::Integer
: dimension of the control input vectordimdistinput::Integer
: dimension of the disturbance input vectorsystem::ModalSystem
: mass-normalized modal representation of the systemD::AbstractMatrix
: coupling matrix wiht the attitude motion (time derivative of the angular velocity vector)Fctrl::AbstractVecOrMat
: coefficient matrix or vector of the control input vectorFdist::AbstractVecOrMat
: coefficient matrix or vector of the disturbance input vector
FlexibleSpacecraft.StructuresBase.SpringMass.SpringMassParams
— TypeSpringMassParams
struct for accomodating the parameters for the spring mass structural model
Fields
M::AbstractMatrix
: mass matrixD::AbstractMatrix
: damping matrixK::AbstractMatrix
: stiffness matrixEcoupling::AbstractMatrix
: coefficient matrix for the attitude coupling inputEcontrol::AbstractVecOrMat
: coefficient matrix for the control inputEdisturbance::AbstractVecOrMat
: coefficient matrix for the disturbance input
FlexibleSpacecraft.StructuresBase.SpringMass.StateSpace
— TypeStateSpace
State space representation of the structural system. This representation is mainly used for the time evolution of the structural system
Mathematical representation
State space equation of the structural system with the control input, coupling input (angular velocity of the attitude dynamics), and the disturbance input is given as:
\[\frac{d}{dt} \mathbf{z} = \mathbf{A} \mathbf{z} + \mathbf{B} \mathbf{u} + \mathbf{E}_{\mathrm{cplg}} \boldsymbol{\omega} + \mathbf{E}_{\mathrm{dist}} \mathbf{f}_{\mathrm{dist}}\]
Each matrix is defined as follows:
\[\mathbf{A} \equiv \begin{bmatrix} \mathbf{0} & \mathbf{I} \\ - \boldsymbol{\Omega}^2 & -2 \boldsymbol{\Xi \Omega} \end{bmatrix} \\ \mathbf{B} \equiv \begin{bmatrix} \mathbf{0} \\ \mathbf{F}_{\mathrm{ctrl}} \end{bmatrix} \\ \mathbf{E}_{\mathrm{cplg}} \equiv \begin{bmatrix} \mathbf{0} \\ \mathbf{D} \end{bmatrix} \\ \mathbf{E}_{\mathrm{dist}} \equiv \begin{bmatrix} \mathbf{0} \\ \mathbf{F}_{\mathrm{dist}} \end{bmatrix}\]
Fields
dimstate::Int
: dimension of the state vectordimctrlinput::Int
: dimension of the control input vectordimdistinput::Int
: dimension of the disturbance input vectorsysA::SMatrix
: system matrixsysB::StaticArray
: coefficient matrix or vector for control inputsysEcplg::SMatrix
: input matrix for the coupling part (subscript represents coupling)sysEdist::StaticArray
: coefficient matrix or vector for the disturbance input (subscript represents disturbance)
Constructor
StateSpace(model::SpringMassModel)
FlexibleSpacecraft.StructuresBase.SpringMass.defmodel
— Methoddefmodel(paramdict::AbstractDict)
Argument
paramdict::AbstractDict
: dictionary that incorporates the parameter setting of the spring-mass structural system. This dictionary works with the parameter setting YAML file
FlexibleSpacecraft.StructuresBase.SpringMass.defmodel
— Methoddefmodel(params::SpringMassParams)
function that incorporates the model formulation process
Argument
params::SpringMassParams
: struct that incorporates the parameter setting of the spring-mass structural system
FlexibleSpacecraft.StructuresBase.SpringMass.modalstate2physicalstate
— Methodmodalstate2physicalstate(model::StateSpace, modalstates::AbstractVector{<:AbstractVector})
convert the vector of the state vector in modal coordinate into physical coordiniate
Argument
model::StateSpace
: state-space model for simulationmodalstates::AbstractVector{<:AbstractVector}
: vector of state vector, which is a trajectory or time history of the state vector
Usage
physicalstates = modalstate2physicalstate(model, states)
FlexibleSpacecraft.StructuresBase.SpringMass.modalstate2physicalstate
— Methodmodalstate2physicalstate(model::StateSpace, state::AbstractVector{<:Real})
convert the state vector in modal coordinate into physical coordiniate
Argument
model::StateSpace
: state-space model for simulationstate::AbstractVector{<:Real}
: state vector
Usage
physicalstate = modalstate2physicalstate(model, state)
FlexibleSpacecraft.StructuresBase.SpringMass.physical2modal
— Methodphysical2modal(mass_matrix::Matrix, damping_matrix::Matrix, stiffness_matrix::Matrix)::ModalSystem
return tuple of the modal transformation matrix and modal damping matrix for the mass-normalized modal coordinates
FlexibleSpacecraft.StructuresBase.SpringMass.physicalstate2modalstate
— Methodphysicalstate2modalstate(model::StateSpace, physicalstates::AbstractVector{<:AbstractVector})
convert the vector of state vector in physical coordinate into modal coordinate
Argument
model::StateSpace
: state-space model for simulationphysicalstates::AbstractVector{<:AbstractVector}
: vector of state vector
FlexibleSpacecraft.StructuresBase.SpringMass.physicalstate2modalstate
— Methodphysicalstate2modalstate(model::StateSpace, physicalstate::AbstractVector{<:Real})
convert the state vector in physical coordinate into modal coordinate
Argument
model::StateSpace
: state-space model for simulationphysicalstate::AbstractVector{<:Real}
: state vector
FlexibleSpacecraft.StructuresBase.SpringMass.updatestate
— Methodupdatestate(model::StateSpace, Tsampling::Real, currenttime::Real, currentstate::AbstractVector, angularvelocity::AbstractVector, controlinput::Union{AbstractVector, Real}, distinput::Union{AbstractVector, Real})::AbstractVector
Calculates time evolution of the structural system with Runge-Kutta method