Quickstart
This guide will help you set up SADYCOS on your machine, run a simple simulation and inspect the simulation results.
Page Contents
Prerequisites
To effectively work with SADYCOS, you need the following software installed on your machine:
- Git
- MATLAB R2024b or newer with
- Simulink
- a supported compiler for the inclusion of external c code
- e.g. MinGW on Windows machines
- see MATLAB and Simulink Requirements for more information
- (not needed for this tutorial) further toolboxes for some models or extended functionality:
- Aerospace Toolbox
- Mapping Toolbox
- Parallel Computing Toolbox
Older versions of MATLAB might work, but are not tested.
Installation
First, you need to clone the Github Repository. Since the repository uses submodules, you cannot simply download the files as a zip archive but need to properly clone it. If you plan on synchronizing your clone of SADYCOS with Github, you should first fork the repository and then clone your own fork to your machine. Otherwise you can clone the repository directly with the following command:
git clone https://github.com/SADYCOS/sadycos.git --recurse-submodules
Running a Simulation
- Navigate to the cloned repository and open MATLAB.
cd sadycos matlab .
- Within MATLAB, open the MATLAB project SADYCOS. Either double click on the file
SADYCOS.prj
in the current folder view or enter the following command in the MATLAB command window:openProject("SADYCOS.prj");
This will ensure that the MATLAB path is set up correctly and that all necessary files are available to MATLAB.
- Simulations are configured as classes within the directory
UserFiles/Configurations
. Initially you will find a namespaceExampleMission
containing two configuration classes:DefaultConfiguration
GainSearch
Running the default configuration is as simple as creating an object of the class and calling the run method in MATLAB’s command window:
o = ExampleMission.DefaultConfiguration; o.run;
SADYCOS will display the progress of the individual steps of preparing the simulation model (configuring parameters, buses and simulation inputs and generating interface files) before running the simulation in the background. Afterwards, an output to the command line will indicate that the simulation has finished.
Inspecting the Results
The simulation results are stored as a Simulink.SimulationOutput
object inside the configuration object. You can go ahead and explore the data by accessing the corresponding property:
o.simulation_outputs
For example, you can plot the time series of the satellite’s angular velocity vector’s three elements simply by executing the following commands:
figure;
plot(o.simulation_outputs.logsout{3}.Values.PlantOutputs.RigidBody.angular_velocity_BI_B__rad_per_s);