To run the MATLAB scripts provided in this repository, follow the instructions below to set up MATLAB and install any necessary package dependencies.
Ensure you have MATLAB installed on your system. You can download MATLAB from the MathWorks website.
-
Download and Install MATLAB:
- Visit the MathWorks website.
- Follow the instructions to download and install MATLAB on your system.
-
Verify Installation:
- Open MATLAB.
- Type
verin the Command Window and press Enter. This will display the installed MATLAB version and toolboxes.
Some scripts may require additional MATLAB toolboxes or packages. Follow the steps below to install any necessary dependencies:
-
Check Required Toolboxes:
- Each script will list the required toolboxes at the beginning of the file or in the documentation.
-
Install Toolboxes:
- Open MATLAB.
- Go to the "Home" tab and click on "Add-Ons" -> "Get Add-Ons".
- Search for the required toolbox and click "Install".
-
Install Additional Packages:
- If additional packages are required, they will be listed in the script documentation.
- Use the MATLAB Add-On Explorer to search for and install these packages.
Once MATLAB and the necessary dependencies are installed, you can run the scripts by:
- Opening MATLAB.
- Navigating to the directory containing the script.
- Typing the script name (without the
.mextension) in the Command Window and pressing Enter.
Example:
cd('/path/to/your/scripts')
exampleScriptFor any issues or further assistance, refer to the MATLAB documentation or contact the repository maintainer.
This script trains a reinforcement learning (RL) model using the Blade Element Momentum (BEM) theory.
- Ensure all files are in the same directory.
- Open the
RL_Rough_Structure5.slxSimulink model in MATLAB. - Run the
testRL.mscript to start the RL training process. Note: All of these files are found in the Original MatLab Scripts folder
-
nacaCoordinates_new.m:- Generates the airfoil coordinates and plots the airfoil shape.
- Outputs these coordinates to the
xfoil.mscript.
-
xfoil.m:- Uses the airfoil coordinates to calculate lift and drag coefficients.
-
bem.m:- Performs Blade Element Momentum (BEM) theory calculations.
- Outputs the efficiency of the system.
-
testRL.m:- Contains the configuration for the RL model.
- Trains the model for 2000 episodes using a DDPG (Deep Deterministic Policy Gradient) agent. The number of episodes can be adjusted in this script.
-
RL_Rough_Structure5.slx:- A Simulink model that contains the "Next State" and "Reward" functions:
- Next State Function: Runs the physics model to generate the output.
- Reward Function: Calculates the reward based on the RL agent's action.
- A Simulink model that contains the "Next State" and "Reward" functions:
-
Physics Model:
- The current physics model occasionally produces efficiencies greater than 1. A more accurate physics model or physics-informed neural networks could be explored as alternatives.
-
Reward Function:
- The reward function should be optimized to suit the new physics model, based on a chosen efficiency threshold.