simulation not running properly

13 次查看(过去 30 天)
ugonna
ugonna 2023-8-17
编辑: Akshat 2023-9-22
Hello community, I am working on a project where i am designing an lectric vehicle with simscapes i tried simulating the projects its meant to run for about 1000seconds, but when i pressed run the simulation starts from 20 seconds then increases by .0005 seconds which is so slow and i dont know why.i tried changing the solver configuration and all but nothing seems to be working. I will really appreciate if i can get some assistance as i am not well experienced with simulink. i have attached a copy of the project below

回答(2 个)

Akshat
Akshat 2023-9-18
编辑:Akshat 2023-9-22
I understand that you are facing challenges while designing an electric vehicle in Simscape. To address this issue, utilizing the Solver Profiler can be a valuable option for identifying the root causes of slow simulations. I highly recommend watching this informative video tutorial that demonstrates how to effectively make use of Solver Profiler
Further, I suggest referring to the following MATLAB Answer for investigating the performance of Simscape models.
I hope this helps.

Anurag
Anurag 2023-9-20
Hello ugonna,
From your question I understand that you are facing issues in running the simulation with the desired starting time and the desired time step.
Please follow the below steps to correct the issue you are currently facing:
  • Solver Configuration: You mentioned that you have already tried changing the solver configuration, but it is worth double-checking if the selected solver is appropriate for your system dynamics. Ensure that you are using a solver that is suitable for the type of simulation you are running. For complex systems, a variable-step solver like ode15s or ode23t might be more efficient.
  • Model Complexity: Consider simplifying your model if it contains unnecessary complexity. Remove any unused blocks, simplify equations, or reduce the number of components if possible. This can help improve simulation speed.
  • Sample Time: Adjusting the sample time of your model can affect simulation performance. If your model does not require high-frequency updates, consider increasing the sample time to reduce the computational load.
  • Sample Time: Adjusting the sample time of your model can affect simulation performance. If your model does not require high-frequency updates, consider increasing the sample time to reduce the computational load.
  • Parallel Computing: Simulink offers parallel computing capabilities that can significantly speed up simulations. Enable parallel computing in the Simulink preferences and check if it improves simulation speed for your project.
  • Code Generation: If your simulation is running slowly due to computational complexity, consider generating C code from your Simulink model and running it as a standalone executable. This can provide faster execution times compared to running the simulation within Simulink.
Hope this helped.

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by