Error in Modeling and Simulation of an Autonomous Underwater Vehicle matlab exemple

2 ビュー (過去 30 日間)
Samuel Mercier
Samuel Mercier 2024 年 9 月 11 日
編集済み: Ashok 2024 年 9 月 16 日
I was trying to familiarize myself with this example made by matlab, but I can't test it because of this error. I haven't changed anything. Why is this mismatch happening? It only occurs when switching to high fidelity simulation in the asbAUV.slx.

回答 (1 件)

Ashok
Ashok 2024 年 9 月 16 日
編集済み: Ashok 2024 年 9 月 16 日
Hello Samuel,
I am able to replicate the error, Error in port widths or dimensions arising when running the Modeling and Simulation of an Autonomous Underwater Vehicle” example with the “High Fidelity Simulation” option enabled.
The reason for the error is that theMarine Drag - Body axes” block present in the block path,
asbAUV/Plant and Environment Model/Environmental Forces & Moments/Hydrodynamic Forces/Hydrodynamic Forces - Accurate/Marine Drag - Body axes”
assumes its second input, “AOA and Side Slip” to be a 3-element vector which later leads to the port width mismatch.
To resolve the issue, you can follow the below steps:
1. Open the “asbAUV” Simulink model by executing the following command in MATLAB Command Window.
openExample('aeroblks/AutonomousUnderwaterVehicleExample');
open_system("asbAUV");
2. Toggle the switch ‘b’ to “High Fidelity Simulation”, as shown below.
(Optional: Update the model using the keyboard shortcut “Ctrl + D which will throw the error, “Error in port widths or dimensions, as before.)
3. Open the “Marine Drag - Body axes” subsystem present in the block path,
“asbAUV/Plant and Environment Model/Environmental Forces & Moments/Hydrodynamic Forces/Hydrodynamic Forces - Accurate/Marine Drag - Body axes.
4. Double click each of the Selector” blocks indicated below and set the “Input port size” parameter to 2.
5. Run the model to ensure the error is rectified.
The following documentation provides more information on the “Selector” block.
I hope this helps you resolve the error!

カテゴリ

Help Center および File ExchangeGet Started with Aerospace Blockset についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by