Error in Modeling and Simulation of an Autonomous Underwater Vehicle matlab exemple
2 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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 the “Marine 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!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Aerospace Blockset 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!