Mohabsaid / Power-to-Gas

this project deal with building power to gas unit in Nile cargo ship , this unit has different sources of energy and variable load with storage energy in the form of hydrogen fuel , then reuse hydrogen in fuel cell to generate electricity during increasing of load demand
15 stars 13 forks source link

very slow simulation - C) Ballard HD60 Fuel Cell Model #11

Open kmsaleh opened 6 years ago

kmsaleh commented 6 years ago

too many function blocks (Fcn), try modeling equations using normal math blocks instead. To avoid clattering the model, each equation in a separate subsystem.

On every simulation time step, the Fcn consumes time as it is re-evaluated, I believe it is different and efficient with math blocks.

Mina-Safwat commented 6 years ago

Firstly, thank you so much for your feedback Eng. Khaled Saleh. Secondly, we will start working on using the original math blocks soon but in the mean time we will continue uploading the rest of the files so that our work is accessible at all times on GitHub.

kmsaleh commented 6 years ago

Ok, very good. Correction: I meant "native math blocks" not "normal math blocks", because being native to the application means lot of effort was not spared by the developers to make best efficient use of memory and resources.

Mina-Safwat commented 6 years ago

The Fuel Cell model that uses native blocks has been uploaded but unfortunately, it is not significantly faster but I will continue searching for the reason of why it is so slow.

kmsaleh commented 6 years ago

check these links out for troubleshooting:

https://www.mathworks.com/matlabcentral/answers/94052-how-can-i-speed-up-simulation-of-my-simulink-model https://www.mathworks.com/videos/finding-causes-of-slow-simulations-73445.html

On Wed, Apr 25, 2018 at 4:29 AM, Mina-Safwat notifications@github.com wrote:

The Fuel Cell model that uses native blocks has been uploaded but unfortunately, it is not significantly faster but I will continue searching for the reason of why it is so slow.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Mohabsaid/Power-to-Gas/issues/11#issuecomment-384141696, or mute the thread https://github.com/notifications/unsubscribe-auth/ATnSIEtSmp6MiAMMZYMUI36sp_gwwfXYks5tr9-PgaJpZM4TbVTd .

kmsaleh commented 6 years ago

Looking at the model again: 1- in bad need for textual clarifications on all systems/subs, 2- it should raise errors due to: (if it is running despite these errors, it is a sign of serious bugs) .............................................. (refer to my message on Code Simplicity)......................................... a- unconnected blocks image image b- Unconnected Signal image

Mina-Safwat commented 6 years ago

kindly review the latest model.

https://github.com/Mohabsaid/Power-to-Gas/commit/479b25b98f1a68e06c25e96a7a15fb0727a024b0

kmsaleh commented 6 years ago

https://undocumentedmatlab.com/blog/improving-simulink-performance