Clear Filters
Clear Filters

Cannot solve algebraic loop involving

14 views (last 30 days)
Viet Dung
Viet Dung on 10 Jun 2024
Answered: Sam Chak on 11 Jun 2024
Cannot solve algebraic loop involving 'Simulation_vehicle/Equation1_ddgama1/MATLAB Function5' because it consists of blocks that cannot be assigned algebraic variables, such as blocks with discrete-valued outputs, blocks with non-double or complex outputs, Stateflow blocks, or nonvirtual subsystems. Consider breaking the algebraic loop. For example, add a delay or a memory block to the loop. To see more details about the loops use the command Simulink.BlockDiagram.getAlgebraicLoops(bdroot)
Component:Simulink | Category:Model error
Input ports (23) of 'Simulation_vehicle' are involved in the loop.
How to fix this error ?
  2 Comments
Sam Chak
Sam Chak on 10 Jun 2024
Hi Viet Dung
I suspect that you have unknowingly or accidentally constructed a functional signal loop in this manner:
x(t) = f[x(t)]
without providing the initial value x(0).
How do you to calculate the output value for the current time step with the input value to the function for the current time step?
Viet Dung
Viet Dung on 11 Jun 2024
Hi Sam Chak. An error occurred while running the simulation and the simulation was terminated
Caused by:
Derivative of state '1' in block 'NAM_Mo_phong_xe/Equation1_ddgama1/Integrator' at time 0.0030900000000000003 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)
How to fix this ?

Sign in to comment.

Answers (1)

Sam Chak
Sam Chak on 11 Jun 2024
% Derivative of state '1' in block 'NAM_Mo_phong_xe/Equation1_ddgama1/Integrator' at time
% 0.0030900000000000003 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)
The error message indicates that around seconds, the value of the input signal entering the 'Integrator' block exceeds the processing capabilities of the Simulink solver. When the signal value increases dramatically within a very short time frame, such that the rate of change approaches infinity, a singularity may have occurred at the output of the preceding block before reaching the 'Integrator' block.
In the provided example, since the 'Gain' block is situated upstream of the 'Integrator' block where the error message identifies the value at approximately as non-finite, the issue appears to be with the exceptionally large output of from the 'Gain' block. This should be the focus of the investigation!
we need to

Community Treasure Hunt

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

Start Hunting!