How to Use Sample Times in Simulink
Many engineering applications require control over when the block updates and produces output. Simulink® provides a way to do this by allowing you to set the sample time or rate for discrete and hybrid systems. You can further understand and visualize sample times in the model by using annotations, colors, and the Timing Legend. Colors and annotations relate to different sample time groups existing in the model. The Timing Legend gives you an interactive way to identify rate, rate types, and rate sources, and navigate to them in the model.
Published: 15 Mar 2018
Many engineering applications require control over when the block updates and produces output. Simulink provides a way to do this by allowing you to set the sample time for discrete, continuous, and multi-rate components.
This model of a fuel control system has sample times set to control when the discrete, continuous, and multi-rate components are updated.
Sample time is set as a parameter in the block dialog. You can also set the sample time value to be inherited. Setting the sample time to be inherited allows that block’s sample time to be controlled by the block it’s connected to.
You can understand and visualize sample times in the model by using annotations, colors, and the Timing Legend. Colors and annotations relate to different sample time groups existing in the model. In this model, we can see that the subsystem related to fuel rate control is discrete and the subsystem related to engine gas dynamics is multi-rate.
When we highlight the continuous rate in the model, we can identify our plant – the Engine Gas Dynamics subsystem.
But why is Engine Gas Dynamics multi-rate? It doesn’t have the second discrete rate. But it does have the first. We can now highlight the origin to learn what block is driving this rate. The highlighting helps us identify where in the model the rate is. Now that we’ve identified the block, we can decide whether we want to keep it discrete.
If I highlight the Triggered rate, I see that Fuel Rate Control subsystem contains it, yet that subsystem is not multi-rate. And triggered sample times, such as a function call being sent, are always a subset of another sample time like the discrete sample time. So, therefore, it won’t change the subsystem to multi-rate. The same thing is true for a constant sample time in a component.
Sample times are a fundamental concept in Simulink, because it is one of the main ways to control when a block updates and outputs its value. And understanding how sample times operate can help you better understand your model.
Related Products
Learn More
Featured Product
Simulink
Up Next:
Related Videos:
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)