how to model this algorithm in simulink?

조회 수: 1 (최근 30일)
Gary
Gary 2023년 4월 8일
댓글: Paul 2023년 4월 8일
I have a model which uses an integrator. I want this integrator to be initialized to a value at start of simulation. During the course of simulation, I am resetting the integrator upon a condition. I want the integrator to be reset to zero and not with the initial value. How to model this in simulink? ie.. to have two different values at start and during the run time

답변 (1개)

Paul
Paul 2023년 4월 8일
In the integrator block, set the "Initial Condition Source" to external. Then, connect that source to whatever logic you need to set the initial value at t = 0 or to the reset value if t > 0. Maybe feed a Clock into Compare to Zero, and use the ouput of that to drive a Switch that selects either the initial value or the reset value. The output of the Switch is the external IC into the integrator.
  댓글 수: 2
Gary
Gary 2023년 4월 8일
I need to generate hdl code for this algorithm. Please suggest suitable method
Paul
Paul 2023년 4월 8일
I can't help with that. But I don't see how HDL code is related to the original question. Maybe you should post a new question about generating HDL code.

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

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

태그

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by