Error in Modeling and Simulation of an Autonomous Underwater Vehicle matlab exemple
조회 수: 1 (최근 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!