Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Trouble solving pendulum model

Trouble solving pendulum model

Hello,

I am trying to simulate the pendulum model in the user guide (release 1.9.0 beta), and am encountering the following issue:

Code:

record SimulationResult

    resultFile = "C:/DOCUME~1/ajpm/LOCALS~1/Temp/OpenModelica/MyPendulum3D_res.mat",
    simulationOptions = "startTime = 0.0, stopTime = 5.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'MyPendulum3D', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = '', simflags = ''",
    messages = "warning | Error solving nonlinear system residualFunc2 (size 1) at time 1.3237
warning | Error solving nonlinear system residualFunc2 (size 1) at time 1.32375
warning | Error solving nonlinear system residualFunc2 (size 1) at time 1.32373
warning | Error solving nonlinear system residualFunc2 (size 1) at time 1.32373

etc...

The model itself is as per the user guide:

Code:

class MyPendulum3D "Planar Pendulum"

constant Real PI=3.141592653589793;
parameter Real m=1, g=9.81, L=5;
Real F;
Real x(start=5),y(start=0);
Real vx,vy;
equation
m*der(vx)=-(x/L)*F;
m*der(vy)=-(y/L)*F-m*g;
der(x)=vx;
der(y)=vy;
x^2+y^2=L^2;
end MyPendulum3D;

If I then try to add the 3D visulisation, it crashes in a similar manner to the one described in https://www.openmodelica.org/index.php/ … pic?id=817, even when changing the location of the SimpleVisual.PositionSize type commands to be just before the equation section.

Any suggestions?

Thanks,

Arnaud

There are 0 guests and 0 other users also viewing this topic
You are here: