Forward Franceso's message as he used an email
that was not member of the list.
(Francesco, I now added you with the new email).

-------- Original Message --------
From: Francesco Casella <francesco.case...@polimi.it>
To: openmodelicainterest@ida.liu.se
Subject: Re: how to diagnose underdetermined system?

On 28/02/2013 22.31, Martin Sjölund wrote:
On 02/28/2013 09:43 PM, Bill Janssen wrote:
 > Error: Too few equations, underdetermined system [...]
What are the best OpenModelica debugging flags to set to help figure
this out?  What's the general way OM users approach this?

They use a tool that implemented the section on balance checking? That
way you get to know actual component that had too few/many equations
instead of getting the answer at the end... I believe OpenModelica does
not support this yet.

I guess this should be implemented asap. First of all, it will be
required by the upcoming compliance checker (unbalanced models are
illegal in Modelica 3.x, so they should be spotted out), and it will be
very useful for large models, where graph-analysis based methods might
provide hard-to-use diagnostics

                        Francesco



Sometimes OpenModelica will give you a few nice hints, like: a.b.c isn't
used in any equation. But usually it is so smart it knows it can just
give an error message before it needs to calculate any diagnostics ;)
You can determine some of these things yourself if you are lucky:

a.mo:
model M
   Real r;
   Real x;
equation
   r = 1.5*time;
end M;

[martin@mega tmp]$ omc a.mo +s +d=optdaedump |& egrep -n5 "(Transpose
Incid)|(^Variables )" | tail -n25
550-
--
596-
597-
598-Optimisation Module removeSimpleEquations:
599-
600-
601:Variables (2)
602-========================================
603-1:  x:VARIABLE() .M, .Real type: Real
604-2:  r:VARIABLE() .M, .Real type: Real
605-
606-
--
617-========================================
618-number of rows: 1
619-1:2
620-
621-
622:Transpose Incidence Matrix (row: var)
623-========================================
624-number of rows: 2
625-1:
626-2:1
627-

If a variable is not associated with any equations, you know this is one
place you forgot (here x has no equation and r is used in equation 1).
You should perhaps create a ticket asking for more useful diagnostics
from the backend instead of just saying the system(s) were unbalanced.

--
Martin Sjölund


--
Francesco Casella - Ph.D.
Dipartimento di Elettronica, Informazione e Bioingegneria
Politecnico di Milano
Via Ponzio 34/5
I-20133 MILANO - ITALY

Tel:    +39-02-2399-3465 (Leonardo)
         +39-02-2399-7749 (Polo di Cremona)
Fax:    +39-02-2399-3412
e-mail: francesco.case...@polimi.it
web:    http://home.dei.polimi.it/casella
Skype:  callto://francesco.casella

Reply via email to