필터 지우기
필터 지우기

How to make a simulink model which runs using a output it calculates at each step and to its next calcuation

조회 수: 3 (최근 30일)
Hi,
I am looking to run a piece of simulink model which uses a final output in it's intremin calculations. For example, I have tried using phiFilterTrapped to feedback the value the switch action cases but it throws an error
Input data dependency violation due to action subsystems. See Subsystem Examples in the Simulink library for valid and invalid examples of action subsystems
Component: Simulink | Category: Model error
Input ports (1, 2) of 'SubRate_Threshold/Merge1' are involved in the loop.
Component: Simulink | Category: Model error
Input ports (1) of 'SubRate_Threshold/If Action Subsystem1' are involved in the loop.
I read couple of stratergies shown in these links here and here 2 but what my target it to feedback the value phiFilterTripped back to it source for re calculation. I programming language I using C where i just keep the variable in a loop for simulation time.

채택된 답변

Kiran Felix Robert
Kiran Felix Robert 2021년 3월 24일
Hi Akshay,
You get the 'Data Dependency Violation error' because you have not latched the inputs to your function-call subsystems. Refer this answer for the procedure Latch your inputs to the switch-case subsystems.
Refer this blog for more information - To Latch or not to Latch ?
The To Workspace blocks saves the simulation data only after the simulation ends (After the last time step) not intermittently, so Latching your inputs to the subsystem will be the best way to have a feedback loop.
  댓글 수: 2
Akshay Dhyani
Akshay Dhyani 2021년 3월 24일
편집: Akshay Dhyani 2021년 3월 24일
Hi Kiran,
I am completely lost what the solution you have mentioned. Latching works on Inport, to do that I have to my output (phiFilterTripped) to inport? I went inside inport settings but it is asking me to specify the input data which I don't know how to connect to this output?
Any idea will be appreciated.
I was using Unit delay and Memory block to delay output data by 1 simulation time but it throws error in Merge block stating that it is receving more than 1 input.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Schedule Model Components에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by