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

조회 수: 4 (최근 30일)
Joel
Joel 2015년 1월 28일
댓글: Joel 2015년 2월 12일
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