Why Integrator with Wrapped State don't wrap the lower limit? (R2018b)

조회 수: 3 (최근 30일)
Rubem Pacelli
Rubem Pacelli 2020년 4월 2일
댓글: Fangjun Jiang 2020년 4월 3일
On simulink we have a block called "Integrator with Wrapped State". This behavior looks pretty simple. This image (from the help doc) show whats the expected output (depicted by "Wrapped state integrator"):
In the parameters configuration, I set the values as follow:
Hence, I expected a output between 0 and 4. However, I got this output:
Why Integrator with Wrapped State don't wrap the lower(=0) limit?

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 4월 2일
It should not be like that. Create a simple new model to verify it. Grab a Sine Wave block, change the amplitude to be 3, Connect it to the Wrapped State block, change the upper value to be 4 and sample time to be 0, run simulation for 20 seconds, you should see it limits at both ends.
  댓글 수: 4
Rubem Pacelli
Rubem Pacelli 2020년 4월 3일
Well Fangjun Jiang, I did it. The following picture shows what I changed in the Linked Block:
It solved my problem partially... When I run my system on sampled-based mode, the output matches the continuous-time output. It turns out that my system is a little bit complicated as it operates on frame-based. The following picture your example operating on continuous-time; discrete-time and sample-based; and discrete-time and frame-based (200 samples per frame).
And the outputs are, respectively
As you see, the last picture (discrete-time and frame-based) is a complete mess... I don't know what's exactly happens there. And I also don't know how can it keep in touch with the support team of Matlab (I never did it)
Fangjun Jiang
Fangjun Jiang 2020년 4월 3일
Not sure about the issue wrt frame-based. You can contact the Mathworks tech support online from your Mathworks account, or call them up.
  1. Your reset value is valid only when lower value is 0. Thinking of an example when upper is 5 and lower is 3.
  2. The same block in R2019b seems to have fixed the problem. It contains the OR logic you implemented and a different way for reset value.

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

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by