This code repository is organized using a MATLAB project file. To open the code and set up dependencies and paths correctly, open the "HybridSystemPerformance.prj" file. This will ensure that all dependencies are added to the project root. By using the project file for organization, the code repository should be entirely portable across systems.
The codebase is organized by workflow. First the input signals, plant, and hybrid model are generated by running code that creates .mat and .sim files. Then the simulation code is run using these as inputs, and generates the raw response data in .mat format. Lastly, the Master Figure Generator creates the plots for visualizing the data.
I have left the latest plant and input signal files in the repository, so it is not necessary to generate them.
In "common files" there are a number of commonly used utilities, as well as the .mat and .sim files that represent the input signals, the smooth system plant, and the hybrid model. The code used to generate these inputs is also located in the common files folder. The simulation outputs are also saved here for use by the figure generator.
The Master Figure Generator is the processing code for all of the generated simulation data. It requires simulation data that is generated by the "Smooth Stability," "Hybrid Stability," and "Hybrid Performance" scripts. Additionally, both "Hybrid Stability" and "Hybrid Performance" require results from the "Smooth Stability" script.
Therefore, it is best to run the "Smooth Stability" script first, then the "Hybrid Stability" and "Hybrid Performance" scripts, and lastly the "Master Figure Generator" script.