problem with trained model/unit delay

조회 수: 6 (최근 30일)
M.M
M.M 2022년 6월 3일
답변: Yash 2024년 1월 10일
Hello,
I trained three models using the regression learner MATLAB app and then exported the trained functions to Simulink. When I run the Simulink model below, I get the following error:
error:
"Cannot solve algebraic loop 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"
When I add unit delays as shown below, there is no error, but the trained models can not predict the desired response (while my model is validated by 90%). The unit delay appears to be the cause, as it alters the system from continues to a discrete and feeds the incorrect output as an input.
The red figure in the following picture represents the Simulink-trained model, while the blue one represents the desired output. As you can see, the red figure follows the blue one for around 0.5 seconds, but then it is weird!
I'd like to ask you about the issue I'm having with unit delay:
-Is there another technique to solve an algebraic loop?
Thank you in advance for your help
  댓글 수: 3
M.M
M.M 2022년 6월 6일
Thank you for responding.
I tried the Memory block, but got the same result as before.
Alex Alex
Alex Alex 2022년 6월 6일
Try....treat as atomic unit in Block Parameters for MATLAB Function....no idea for more

댓글을 달려면 로그인하십시오.

답변 (1개)

Yash
Yash 2024년 1월 10일
Hi,
Algebraic loops in Simulink occur when an output of a block or a set of blocks is required to compute its own input without any delay, which can lead to computational issues since Simulink needs to determine the values simultaneously. Breaking an algebraic loop often involves introducing some form of delay or memory to provide a dependent relationship between inputs and outputs. You mentioned that you tried using a Unit Delay block, but it alters the system from continues to a discrete and feeds the incorrect output as an input.
To solve this, you can use Transport Delay block, which can introduce a continuous delay to the signal without discretizing it. The Transport Delay block does not interpolate discrete signals. Instead, the block returns the discrete value at the required time. This block differs from the Unit Delay block, which delays and holds the output on sample hits only.
To know about the Transport Delay block, refer to its documentation here: https://in.mathworks.com/help/simulink/slref/transportdelay.html
Hope this helps

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by