You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using OpenModelica in equation mode to solve the 3D Pendulum as a DAE problem. I get different results when using different forms to express the same constraint (distance from point mass to fixed point is a constant). Results are summarized below and described in more detail in the attached PDF.
Steps to Reproduce
Run the attached -- PendulumdaeYiheng.mo. There are 3 different constraint equations, comment out any two.
Expected Behavior
Constraint form #1 gives incorrect results -- it gives a damped response but there is no damping in the model. Constraint forms #2 and #3 give correct results.
The three constraint equations are:
//len = sqrt(x[1] ^ 2 + x[2] ^ 2 + x[3] ^ 2) "Length of the string (1)";
//len^2 = x[1] ^ 2 + x[2] ^ 2 + x[3] ^ 2 "(2)";
len = Vec.length(x) "(3)";
OpenModelica Version: [e.g. omc --version or Help->About OMEdit from OMEdit]
Connected to OpenModelica v1.19.0-dev-299-g8ec18b706f (64-bit)
Connected to OMSimulator v2.1.1.post102-g532159b-mingw
OS: [e.g. Windows 10, 64 bit]
Windows 10 - 64 bit
Versions of used Modelica libraries if applicable **N/A
The same results have been obtained with a later version of OM with WIn-11-64bit.
Additional Context
In addition to the incorrect result when using constraint #1, the result when using this constraint will change with changes in the "number of intervals" used for the solution. This does not happen with 2 or 3 (see attached PDF for more details). PendulumDAE.zip
The text was updated successfully, but these errors were encountered:
@kabdelhak, @phannebohm, could you have a quick look? The computed initial values of der(v[1]) and der(v[2]) are different depending on whether the first or the second constraint (which are equivalent) are used, of course this shouldn't be the case, so something goes wrong with index reduction when the first constraint is used.
Additional issue: if I compile the examples with the first constraint equation and the example with the second constraint equation, using --indexReductionMethod=dummyDerivatives, the solutions are different from each other and both completely wrong.
@kabdelhak, I guess this is a nice basic example for index reduction, worth putting it in the testsuite.
Description
I am using OpenModelica in equation mode to solve the 3D Pendulum as a DAE problem. I get different results when using different forms to express the same constraint (distance from point mass to fixed point is a constant). Results are summarized below and described in more detail in the attached PDF.
Steps to Reproduce
Run the attached -- PendulumdaeYiheng.mo. There are 3 different constraint equations, comment out any two.
Expected Behavior
Constraint form #1 gives incorrect results -- it gives a damped response but there is no damping in the model. Constraint forms #2 and #3 give correct results.
The three constraint equations are:
//len = sqrt(x[1] ^ 2 + x[2] ^ 2 + x[3] ^ 2) "Length of the string (1)";
//len^2 = x[1] ^ 2 + x[2] ^ 2 + x[3] ^ 2 "(2)";
len = Vec.length(x) "(3)";
Screenshots
Result for constraint #1
Result for constraints 2 and 3:
Version and OS
OpenModelica Version: [e.g.
omc --version
orHelp->About OMEdit
from OMEdit]Connected to OpenModelica v1.19.0-dev-299-g8ec18b706f (64-bit)
Connected to OMSimulator v2.1.1.post102-g532159b-mingw
OS: [e.g. Windows 10, 64 bit]
Windows 10 - 64 bit
Versions of used Modelica libraries if applicable **N/A
The same results have been obtained with a later version of OM with WIn-11-64bit.
Additional Context
In addition to the incorrect result when using constraint #1, the result when using this constraint will change with changes in the "number of intervals" used for the solution. This does not happen with 2 or 3 (see attached PDF for more details).
PendulumDAE.zip
The text was updated successfully, but these errors were encountered: