My Simulink Model takes hours to complete 1 second, and I need to run it for 5,000 second. I tried to change the minimum time step, but Matlab keeps giving erros when I do so.

1 view (last 30 days)
Here are some images. There are a few algebraic loops in this code which is why I assume it is taking so long, but I cannot quite figure out how to get it to run faster. I have attempted use of the Acellerator and Rapid Accelerator. Maybe some guidance on how to increase minimum time step would help? Whenever I try to change the time step I get errors such as:
Any assistance will help! Here is a general overview of my model; there are funtions and algebraic loops within the subsystems:
Current Configuration Parameters:
Please let me know if there are any more questions! If you are wondering, this code analyzses the attitude and angular velocity of a sattelite with an attitude determination and control system!
  1 Comment
Walter Roberson
Walter Roberson on 12 Nov 2022
I suggest you first try with a stiff solver. If that does not eliminate the warnings about step size, then I suggest trying a fixed-step solver.
The second issue, with output not finite, might be more difficult to get around.

Sign in to comment.

Answers (1)

Sam Chak
Sam Chak on 12 Nov 2022
The typical satellite attitude dynamics are not stiff. You can try, but I think changing it to a stiff solver won't solve the issue.
Moreover, the error message says that output of the integrator in the Reaction Wheel/Actuator masked subsystem is not finite. Yet, we know that physical motors/wheels have constraints on the max torque and max rpm. Thus, you need to investigate what goes into the Integrator block.
How to Troubleshoot:
Try this troushooting procedure to identify the block or function that may be causing the singularity issue.
Right click the signal arrow and select "Show Value Label of Selected Port".
Repeat doing this for all outputs of certain functions that you suspect of causing the Division-by-Zero issue. The mathematics of Attitude Kinematics is known for causing singularities at certain orientations. You need to check whether or not the Attitude Determination algorithm (probably unconstrained) is the root cause when estimating the attitude.

Categories

Find more on General Applications in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by