Concept Flow - Sample time configuration
Start Simulation
Check Sample Time
Continuous
Integrate
Output Signal
End Simulation
Simulation starts, checks if block uses continuous or discrete sample time, then processes accordingly before output.
sampleTime = 0.1 t = 0.0 while t <= 1.0: output = f"Output at {t}" print(f"Time {t}: Output {output}") t += sampleTime
| Step | Time (t) | Sample Time Check | Action | Output |
|---|---|---|---|---|
| 1 | 0.0 | t % 0.1 == 0 | Calculate output | Output at 0.0 |
| 2 | 0.1 | t % 0.1 == 0 | Calculate output | Output at 0.1 |
| 3 | 0.2 | t % 0.1 == 0 | Calculate output | Output at 0.2 |
| 4 | 0.3 | t % 0.1 == 0 | Calculate output | Output at 0.3 |
| 5 | 0.4 | t % 0.1 == 0 | Calculate output | Output at 0.4 |
| 6 | 0.5 | t % 0.1 == 0 | Calculate output | Output at 0.5 |
| 7 | 0.6 | t % 0.1 == 0 | Calculate output | Output at 0.6 |
| 8 | 0.7 | t % 0.1 == 0 | Calculate output | Output at 0.7 |
| 9 | 0.8 | t % 0.1 == 0 | Calculate output | Output at 0.8 |
| 10 | 0.9 | t % 0.1 == 0 | Calculate output | Output at 0.9 |
| 11 | 1.0 | t % 0.1 == 0 | Calculate output | Output at 1.0 |
| 12 | 1.1 | t > 1.0 | Stop simulation | No output |
| Variable | Start | After 1 | After 2 | After 3 | After 4 | After 5 | After 6 | After 7 | After 8 | After 9 | After 10 | Final |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| t | 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 | 1.1 |
| output | Output at 0.0 | Output at 0.1 | Output at 0.2 | Output at 0.3 | Output at 0.4 | Output at 0.5 | Output at 0.6 | Output at 0.7 | Output at 0.8 | Output at 0.9 | Output at 1.0 | N/A |
Sample time controls when blocks update in Simulink. Continuous sample time updates constantly. Discrete sample time updates at fixed intervals. Set sample time to control simulation steps. Output updates only at multiples of sample time.
Pass the test and this pattern moves unknown