How do I work with timeseries as input for my model?

4 次查看(过去 30 天)
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.

回答(1 个)

Sebastian Castro
Sebastian Castro 2015-1-30
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).
  1 个评论
Joel
Joel 2015-2-12
Hi Sebastian,
thank you for your answer. I cannot change the sample time since my input is based on daily inputs (mm/d) while the processes in the system are based on seconds (mm/s). Therefore, I do not want the Simscape to use my daily inputs as second based inputs, which would falsify my results.
I was using the block 'from workspace' where I loded my time series data, in which I already modified the data.
I will try your option, though. Getting a staircase signal sounds better.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Troubleshooting 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by