Problem while simulating control surfaces of an aircraft in simulink (Code Attached)

1 view (last 30 days)
I am trying to simulate the control surface (suppose an elevator using the following blockest. I have the elevator block providing me with Cl Cd and Cm ( lift , drag and pitching coeffiecients) which will be multiplied with 0.5 * p * v* v *S to give the forces. As lift is along negative z and drag along negative x multiplied it with -1. But whenever I am running the simulation its showing the error.
  • Derivative of state '1' in block 'controlsurface_trial2/3DOF (Body Axes)/q' at time 0.0 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances) as shown in the figure below:
The code is also attached . For your help ...can you pleas ehelp me out ....stuck in middle of some project for a very long time. Thanks in advance !

Answers (1)

Mohith Kulkarni
Mohith Kulkarni on 9 Dec 2020
If there is a division by 0 or may be trigonometric infinity solutions. Here 'NaN' is the breakpoint.
To solve these type of errors, you can go try the following steps:
Use the Simulink debugger (in a model window, Simulation > debug > debug model) to identify where is the breakpoint (Inf or NaN) originates. ( Details are here: http://www.mathworks.com/help/simulink/ug/starting-the-simulink-debugger.html )
OR
Use the unit delay block / memory block.
OR
Try reducing fixed step size.
You can refer to the following link for answer by the MathWorks Support Team

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!