How do I work with timeseries as input for my model?
4 views (last 30 days)
Show older comments
Hello,
I am quite new to the Simulink and Simscape environment and the work with it.
In my model I want to model a rainwater harvesting system. I have daily based precipitation data and demand (outpur) [d^-1]. Between input and output the water tanks and water treatment units are running on a second based time step.
If I create a normal time series with values every 86400 seconds (one day) Simulink interpolates the data for the time steps inbetween and uses them as input, too. Therefore, I have more incoming rain than intended.
Is there a way to conect those two time steps?
Every help or recommendation is appreciated. Thank you.
0 Comments
Answers (1)
Sebastian Castro
on 30 Jan 2015
Hi Joel,
If you're using an Inport block to load the data, there's an "Interpolate data" option that will give you a staircase signal instead of interpolating.
However, why should Simulink's interpolation affect your results? If you are using precipitation data, shouldn't the amount of water falling be accumulated over time with some sort of Integrator block? In that case, it shouldn't really matter whether you sample your signal "too often".
Another thing you can do if you want to avoid additional time steps is to explicitly set the sample time of the input signal to match that of your data. However, I wouldn't necessarily recommend this since you may then have to make the sample times sync up with the rest of your model (depending on what blocks you have).
See Also
Categories
Find more on Troubleshooting in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!