open-ideas / IDEAS

Modelica library allowing simultaneous transient simulation of thermal and electrical systems at both building and feeder level.
131 stars 52 forks source link

benchmarking against old discretisation method #683

Closed Mathadon closed 6 years ago

Mathadon commented 7 years ago

I ran a test (Bui600) using:

and I compared some statistics.

Master:

Number of mixed real/discrete systems of equations: 0
Sizes of linear systems of equations: {2, 2, 2, 2, 9, 2, 2, 15, 15, 2, 2, 2, 2, 2}
Sizes after manipulation of the linear systems: {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Sizes of nonlinear systems of equations: {3}
Sizes after manipulation of the nonlinear systems: {1}

Benchmark (https://github.com/open-ideas/IDEAS/tree/issue683_benchmark):

Number of mixed real/discrete systems of equations: 0
Sizes of linear systems of equations: {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}
Sizes after manipulation of the linear systems: {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Sizes of nonlinear systems of equations: {4, 69, 4, 4, 4, 4, 3}
Sizes after manipulation of the nonlinear systems: {1, 19, 1, 1, 1, 1, 1}

cpu time is 2.4 seconds vs 38 seconds.

Mathadon commented 7 years ago

Result differences can however be fairly substantial: screen shot 2017-03-07 at 10 32 24

Mathadon commented 7 years ago

These differences are mostly caused by the different discretisation method. When the number of elements is set sufficiently high then both discretisations lead to the same result as illustrated in the figure below. However, for the current discretisation level they don't. So I suppose the question is: do we want to increase the default discretisation level? Doubling it does not seem to be sufficient.

screen shot 2017-03-07 at 13 34 20

In this plot 'n' is nStaRef, the number of states for a reference slab of concrete of 20cm if we want to get a certain time constant for the resulting R*C.

What I conclude from this is that the short-term response for 'state in wall' is better, but the long term response is worse. Since we're mostly interested in long term responses 'state on wall' seems preferable.

Mathadon commented 7 years ago

When looking at an actual model (bui600) the results are similar:

screen shot 2017-03-07 at 13 24 19 The plotted variables are TSensor. This seems to suggest that 'state on wall' is more accurate for low values of nStaRef. 'state in wall' is much less favourable in this comparison. Based on the earlier figure this could be explained because in a real building we are essentially always looking at the response of disturbances that happened quite a while ago, so the long term response is more important.

Mathadon commented 7 years ago

Earlier posts were corrected and edited to avoid spamming everybody with e-mails.

I conclude from this discussion that the current implementation is ok. Feel free to comment if you disagree!