run the system for 24 hours in short period

1 回表示 (過去 30 日間)
Mounira
Mounira 2024 年 6 月 30 日
回答済み: Umar 2024 年 7 月 1 日
hello,
so i have model in simulink, it runs for Total time=2 seconds, and sampling time for microgrid=1e-6, sampling time for model predictive controller=0.1; the thing is when i run the simulation, it takes about 3 to 4 minutes to finish because of the sampling time, when in fact the Total time is 2 seconds, and i want the axe "X" to show results for 24 hours, so what can i do?
obiously i cannot run it for 24 hours, it will take few days to finish,
thanks in advance
  2 件のコメント
Umar
Umar 2024 年 7 月 1 日
Hi Mounira,
My suggestion would be increase the simulation step size while maintaining accuracy by changing the solver settings in Simulink. Also, consider reducing the data logging frequency or using virtual scopes to visualize results without storing all data points. By strategically selecting what data to log and visualize, you can reduce the computational load and speed up the simulation process significantly.
Hope these suggestions will help resolve your issues.
Mounira
Mounira 2024 年 7 月 1 日
thank you for your answer, about the step size, do you mean the sample time Ts (1e-6)?, because i tried to make it higher and the results were incorrect, so there is no choice of changing it,
and about the scope i have many scopes made more than 10; do you think they are the reason for slowing the simulation process?

サインインしてコメントする。

採用された回答

Umar
Umar 2024 年 7 月 1 日
Hi Mounira,
Sorry to hear that. After looking at your comments into consideration, here are my suggestions.
Firstly, the discrepancy between the total simulation time of 2 seconds and the actual runtime of 3 to 4 minutes can be attributed to the sampling times you have specified. The sampling time for the microgrid (1e-6) and model predictive controller (0.1) directly affect how frequently data points are collected and processed during simulation. In your case, these small sampling times may be causing a significant computational load, leading to longer simulation times.
While increasing the sampling time (Ts) might seem like a solution to reduce computation load, it's crucial to note that changing this parameter can affect the accuracy of your results. Higher sampling times can lead to loss of detail in your model dynamics and potentially incorrect outcomes. Therefore, if changing the sampling time is not an option, you may need to optimize other aspects of your model for better performance.
Regarding the number of scopes in your model, having multiple scopes can indeed impact simulation speed. Each scope adds overhead in terms of data logging and visualization, which can contribute to longer runtimes. To improve simulation performance, consider reducing the number of scopes or optimizing their usage by only displaying essential signals.
In addition to adjusting sampling times and scopes, you can also explore other optimization techniques such as reducing the complexity of your model, utilizing parallel computing capabilities, or leveraging Simulink features like signal logging configurations to streamline data collection.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by