Opened 10 years ago

Closed 4 years ago

#3329 closed defect (fixed)

C code generation error in flexible multibody

Reported by: Bruno Scaglioni Owned by: Lennart Ochel
Priority: high Milestone: Future
Component: Code Generation Version: trunk
Keywords: c code generation, flexible multibody Cc:

Description (last modified by Bruno Scaglioni)

The attached model is a flexible beam example, the model is quite involved and contains several tensor product, hence equations reach a lenght of 28000 characters, and OMC cannot perform symbolic derivation anymore. Nevertheless, several of the terms involved in these products are null and depend from null parameters.
In order to avoid problems with the lenght of the lines the annotation (Evaluate=true) is used and these options are given to the compiler:

setPreOptModules("evaluateReplaceFinalEvaluateParameters,removeSimpleEquations");

when the parameters are evaluated omc can compute the derivatives but another error occurs:

Error: FGraph.openScope: failed to open new scope in scope: . name: $for loop scope$

and several gcc errors are present.
The simulated model is:
FEMPackage.ExamplesBeam.FreeVibrationBeam
in the attached package

Attachments (2)

dump.txt (878.9 KB ) - added by Bruno Scaglioni 10 years ago.
omc dump
FlexBeamPackage.mo (16.4 KB ) - added by Bruno Scaglioni 10 years ago.
Modelica code

Download all attachments as: .zip

Change History (5)

by Bruno Scaglioni, 10 years ago

Attachment: dump.txt added

omc dump

by Bruno Scaglioni, 10 years ago

Attachment: FlexBeamPackage.mo added

Modelica code

comment:1 by Bruno Scaglioni, 10 years ago

Description: modified (diff)

comment:2 by Bruno Scaglioni, 10 years ago

Description: modified (diff)

comment:3 by Francesco Casella, 4 years ago

Resolution: fixed
Status: newclosed

After a few years the problem is almost solved, see #6067 and FEMPackage issue #3. With the proposed workaround, we can now simulate a nice test case (PendulumBody) using OpenModelica, including the animation, obtaining the same results as Dymola.

We can now close this ticket.

Note: See TracTickets for help on using tickets.