Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent results when solving DAE #8438

Open
dmauslander opened this issue Jan 18, 2022 · 1 comment
Open

Inconsistent results when solving DAE #8438

dmauslander opened this issue Jan 18, 2022 · 1 comment

Comments

@dmauslander
Copy link

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

image

Result for constraints 2 and 3:

image

Version and OS

  • 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

@casella
Copy link
Contributor

casella commented Jan 18, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants