Simulink: Understanding Time Steps and Sampling Frequencies

Click For Summary

Discussion Overview

The discussion revolves around understanding time steps and sampling frequencies in Simulink, particularly in the context of setting up models for projects. Participants explore how time steps are determined, how to manage input arrays, and the implications of sampling frequency changes.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • Raman inquires about what determines the time step between iterations in Simulink models and expresses confusion regarding changes in sampling frequency.
  • One participant suggests that the step size can be adjusted in the settings menu along with the choice of numeric solver, such as ode45 or ode23.
  • There is a question about whether input arrays need to have values spaced the same as the specified step size in Simulink Options, with one participant expressing uncertainty and suggesting further research.
  • Another participant seeks guidance on how to input a variable that is not constant, specifically how to read an array element by element during iterations.
  • The same question about input variables is repeated, emphasizing the need for clarity on reading array values in sequence.
  • A later reply indicates that the issue was resolved by using the "from workspace" block in Simulink.

Areas of Agreement / Disagreement

Participants express uncertainty regarding the relationship between input array spacing and step size, and there is no consensus on the best approach to manage non-constant input variables.

Contextual Notes

Some participants suggest looking for additional information on the MathWorks website, indicating that there may be limitations in their current understanding or access to resources.

Who May Find This Useful

This discussion may be useful for individuals working on Simulink projects, particularly those dealing with time steps, sampling frequencies, and input variable management.

swraman
Messages
165
Reaction score
0
Hi,

I have a project due that has to be done in Simulink.

I am somewhat familiar with Simulink, but some things don't make sense to me.

First off, What determines the time step between each iteration? eg. when you have a clock in the model, what determines the change in time from one iteration to the next?

I remember working with a model once, and changing something in the model changed the sampling frequency for some reason, shich makes no sense to me.

Thanks

Raman
 
Engineering news on Phys.org
You can change the step size in the settings of the menu bar along with what kind of numeric solver it uses. i.e. ode45,ode23, etc.
 
So if I have a input array which is to be used in the system, then I have to make sure the values in the input array are spaced the same time apart as the step size I specify in Simulink Options?
 
How do I add an imput variable that is not a constant?

I have an array of values that I want the system to use, but I don't know how to get it to read the array one element at a time (each iteration I want it to take in one value from the array, and as it goes on it will read down the array).

Thanks
 
Last edited:
swraman said:
So if I have a input array which is to be used in the system, then I have to make sure the values in the input array are spaced the same time apart as the step size I specify in Simulink Options?

I'm not sure, I would google that or look on the mathworks website. It may well be that simulink just interpolates points if it needs to.
 
swraman said:
How do I add an imput variable that is not a constant?

I have an array of values that I want the system to use, but I don't know how to get it to read the array one element at a time (each iteration I want it to take in one value from the array, and as it goes on it will read down the array).

Thanks

Again, a question for the mathworks forums.
 
thanks i was able to solve itl its just the "from workspace" block.
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
2K
Replies
17
Views
6K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
1
Views
3K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 43 ·
2
Replies
43
Views
6K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
1
Views
1K