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

Global Numerical error for IDEAS with DASSL and LSodar #26

Closed rubenbaetens closed 10 years ago

rubenbaetens commented 10 years ago

I computed the global numerical error for the ohmic losses of a feeder of five dwellings with heat pumps (ie. the ohmic losses are choosen as this is where both the electrical and thermal results are combined). The results for Dassl (red) and LSodar (blue) for a equidistant (full) and non-equidistant (dotted) grid are as follows:

error_vs_tolerance

Findings from this graph is:

Remarks on the findings:

Mathadon commented 10 years ago

Just to be sure: the error is the relative difference of the ohmic losses with the 'real' ohmic losses? And I assume this error is then integrated over the entire domain?

rubenbaetens commented 10 years ago

True, integrated over the simulation period.

On Thu, Apr 17, 2014 at 8:45 AM, Filip notifications@github.com wrote:

Just to be sure: the error is the relative difference of the ohmic losses with the 'real' ohmic losses?

— Reply to this email directly or view it on GitHubhttps://github.com/open-ideas/IDEAS/issues/26#issuecomment-40685921 .

Mathadon commented 10 years ago

Very odd how it does not converge for lower tolerances.. How do you know what the real ohmic losses are?

rubenbaetens commented 10 years ago

Non-convergence may be due to the small simulation period of 15 days and the impact of discrete control (the solvers are made for ODE/DAE). The 'real' ohmic losses can not be known, but one generally uses a reference simulation with extremely stringent solver tolerances, i.e. in this case 10e-10 with a non-equidistant grid and event logging.

(I should ave new graphs by the meeting tomorrow for annnual simulations.)

Mathadon commented 10 years ago

The solvers are made for ODE/DAE but if Dymola generates an event at every discontinuity then these solvers are solving piecewise ODE's so this should not be a problem, right? But I suppose there are a lot of noEvent()'s in the code so the above is no longer valid. Your reference case then does generate events even for noEvent() statements or?

rubenbaetens commented 10 years ago

The notion of "just solving piecewise ODE's" isn't very correct: Both DASSL and LSodar are variable-step variable-order backward differentiation formulae methods which denotes that the determination of the "pieces" itself is half the work the solver has to do and thus also subject to the user-specified solver tolerances.

rubenbaetens commented 10 years ago

Update: It seems LSodar (blue) and Dassl (red) don't evolve to the same solution by tightening the solver tolerance. Dassl converges to a solution which differs 2.3 % from the LSodar-solution (the reference result is a 1e-10 solution for LSodar) :

figure_1

If a change the reference solution to the 1e-7 solution of Dassl, the result becoms this:

figure_1

Which denotes that both solvers converge with tightening the solver tolerance, but to a different solution.