Simulink or for-loop?
Mostrar comentarios más antiguos
I am trying to model a solar water heating system monitoring every second in one day. The problem is that these calculations (using for-loops) are quite slow, and two simulated hours can take as much as 15 minutes. My question for you is if it's perhaps better to use Simulink, since its specifically designed to handle a signal (solar irradiation, in this case). Is it faster, or slower?
I'm not using any add-ons but I'm open to suggestions.
6 comentarios
Mathieu NOE
el 13 de Nov. de 2020
hello Christopher
it's difficult to answer your question without getting a bit more in the details of your computation
if you have lot of for loops , can you vectorize your code instead ?
IMHO, also Simulink is not the best choice if you still need lots of for loops
Christopher Norling
el 13 de Nov. de 2020
Mathieu NOE
el 15 de Nov. de 2020
Ok
I understand the complexity of the problem , but there is maybe a way to solve this without needing tons of for loops
I believe we need to find the equilibrium point of the entire installation
that should leave to solving a set of linear equations maybe with polynomial functions
do you have already a code that works ?
Christopher Norling
el 15 de Nov. de 2020
Mathieu NOE
el 16 de Nov. de 2020
OK
to be honest with you , I will not try to work on your symbolic code (simply I do not have the Symbolic Math Toolbox)
I would prefer to have first a document that describes the system and what are the governing equations , then I would like to see if I can find the equilibrium point with simple methods
are you interested to find the equilibrium point for a given condition only or are you triying to do a time simulation that covers one complete night / day cycle ?
Christopher Norling
el 19 de Nov. de 2020
Respuestas (0)
Categorías
Más información sobre General Applications en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!