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
  • Index
  • » Users
  • » admech
  • » Profile

Posts

Posts

Oct-27-13 00:51:23
Category: Developer

Hi,
I was playing around with visualizers, and...

As far as I could understand from the 'ModelicaServices 3.2.1 modelica3d' source, visualization of surfaces (which are, by the way, present in the standard library (i.e. Modelica.Mechanics.MultiBody.Visualizers.Advanced.Surface)), is not supported yet (unlike that of shapes), is it?

What is the current state of development regarding this matter? Couldn't find corresponding tickets in trac.
How long would it possibly take to implement this feature?
Can I possibly contribute?

Kirill

Oct-27-13 00:36:18
Category: Developer

Great! Thank you.

Oct-26-13 19:56:13
Category: Developer

The editor reformats the model source code into a completely unreadable state every time I save the file.
It even rearranges the line order in some cases.

Is this crucial to some internal processes of OpenModelica?
This slows down the work dramatically.

Is it possible to permit saving the indentation, empty lines, etc. in one of the next versions?

Kirill

Oct-19-13 07:36:54
Category: Developer

The package can be installed manually, however, if downloaded via wget.

Oct-19-13 00:16:03
Category: Developer

omlib-modelica-3.2.1_7053-om1-1_all.deb cannot be installed, apt-get returns type mismatch error message.

Debian 7.2 (wheezy) 64-bit.

Oct-07-13 14:30:59
visualising a multi-body system after it has been simulated

This did the trick, thank you.

By the way, dbus, libdbus-1-3, libdbus-glib-1-2 (included in distribution) and libdbus-c++-1-0 (added later) did not suffice.

----
update:
In case this is not a common behavior: closing the viewer kills the dbus_server, so to visualize the next simulation one must re-run dbus_server.py.

----
update 2:

Simulating DoublePendulum, then running this:

Code:


loadString("model Pendulum
  extends Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum;
  inner ModelicaServices.Modelica3D.Controller m3d_control;
end Pendulum;");getErrorString();
simulate(Pendulum);

and then simulating DoublePendulum again works in the following manner:

first two simulations are okay, but the last one has 3D models messed up, although it shows correct motion (as I can see from what remains of the visual shapes).
dbus_server at the time shows multiple "inconsistent naming, could not find ....".

Is the user supposed to relaunch dbus_server between simulations?

Oct-07-13 13:11:13
visualising a multi-body system after it has been simulated

Thank you for the fast reply.

Running this script gives warnings about start values and an error: "/usr/bin/ld: cannot find -ldbus-1".

With the "+d=initialization" option (lists of variables not shown):

Code:


record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 0.000001, method = 'dassl', fileNamePrefix = 'DoublePendulum', options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = '', simflags = ''",
    messages = "Simulation failed for model: DoublePendulum
Warning: Assuming fixed start value for the following 285 variables:
========= <Here comes a list of roughly 300 variables> ============


Warning: Iteration variables with default zero start attribute in equation system:
========= <Here comes a list of roughly 10 variables> ============

Error: Error building simulator. Build log: gcc   -falign-functions -march=native -mfpmath=sse   -I\"/usr/include/omc\" -I.   -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum.o DoublePendulum.c
gcc   -falign-functions -march=native -mfpmath=sse   -I\"/usr/include/omc\" -I.   -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_records.o DoublePendulum_records.c
g++ -I. -o DoublePendulum DoublePendulum.o DoublePendulum_records.o -I\"/usr/include/omc\" -I.   -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -lmodcount -lModelicaExternalC -lmodbus -ldbus-1    -falign-functions -march=native -mfpmath=sse   -L\"/usr/lib/omc\" -L\"/usr/lib\" -Wl,-rpath,\"/usr/lib/omc\" -Wl,-rpath,\"/usr/lib\" -lSimulationRuntimeC   -ldl -linteractive  -lexpat    -lrt -lgc -lexpat -fopenmp -lsundials_kinsol -lsundials_nvecserial -llapack  -lpthread -Wl,-Bstatic -lf2c -Wl,-Bdynamic -llis
/usr/bin/ld: cannot find -ldbus-1
collect2: error: ld returned 1 exit status
make: *** [omc_main_target] Error 1

",
    timeFrontend = 0.0,
    timeBackend = 0.0,
    timeSimCode = 0.0,
    timeTemplates = 0.0,
    timeCompile = 0.0,
    timeSimulation = 0.0,
    timeTotal = 0.0
end SimulationResult;

So, it yet can't find the mysterious -ldbus-1 (although dbus is installed).

Oct-06-13 23:46:02
visualising a multi-body system after it has been simulated

Hello,

I'm new to modelling. I'm trying to get the visualization working on Debian.
The model is Pendulum.mo included in Modelica3D package.

Actions taken so far and the environment details follow.
The best option would be if someone would kindly present his opinion on how to run all this on this OS, because what you'll see below is a mere magical trick to me and should not, perhaps, be modified at all, but instead built from scratch.


So, what I'm doing:

In Terminal run:

Code:

python '/usr/lib/omlibrary-modelica3d/osg-gtk/dbus-server.py'

Open OMShell and run the following script, analogous to what seems to have solved one of the previous authors' problem:

Code:


loadModelica3D();

loadModel(Modelica, {"3.2.1"}); getErrorString();
loadModel(ModelicaServices, {"3.2.1 modelica3d"}); getErrorString();

m3d_path := getInstallationDirectoryPath() + "/lib/omlibrary-modelica3d/";

loadFile(m3d_path + "Internal.mo"); getErrorString();
loadFile(m3d_path + "Pendulum.mo"); getErrorString();

loadString("
model Visualize_Pendulum
inner ModelicaServices.Modelica3D.Controller m3d_control;
extends Pendulum;
end Visualize_Pendulum;
");

simulate(Visualize_Pendulum, stopTime=30); getErrorString();

The output (from the very beginning) looks like this. So, it fails to compile, doesn't it?

Code:


OMShell 1.1 Copyright Open Source Modelica Consortium (OSMC) 2002-2013
Distributed under OMSC-PL and GPL, see www.openmodelica.org

Connected to OpenModelica 1.9.0 RC1+dev (r17557)
To get help on using OMShell and OpenModelica, type "help()" and press enter.

>> runScript("/home/vf/modelica/s1.mos")
"true
true
\"Warning: Requested package ModelicaServices of version 3.2.1, but this package was already loaded with version 3.2.1 modelica3d. You might experience problems if these versions are incompatible.
\"
true
\"\"
\"/usr/lib/omlibrary-modelica3d/\"
true
\"\"
true
\"\"
true
record SimulationResult
    resultFile = \"\",
    simulationOptions = \"startTime = 0.0, stopTime = 30.0, numberOfIntervals = 500, tolerance = 0.000001, method = 'dassl', fileNamePrefix = 'Visualize_Pendulum', options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = '', simflags = ''\",
    messages = \"Simulation failed for model: Visualize_Pendulum
[<interactive>:4:1-4:17:writable] Error: Base class Pendulum not found in scope Visualize_Pendulum.
[<interactive>:3:1-3:57:writable] Error: Class ModelicaServices.Modelica3D.Controller not found in scope Visualize_Pendulum.
Error: Error occurred while flattening model Visualize_Pendulum
\",
    timeFrontend = 0.0,
    timeBackend = 0.0,
    timeSimCode = 0.0,
    timeTemplates = 0.0,
    timeCompile = 0.0,
    timeSimulation = 0.0,
    timeTotal = 0.0
end SimulationResult;
\"\"
"

>>

I would greatly appreciate any advice and try to communicate back as soon as possible.

------------------------------------------------
Debian 7.1.0

Packages (versions) installed:

openmodelica (17557-1)
omlib-modelica-3.2.1 (7053-om1-1)
omlib-modelicaservices-3.2.1 (6931-om1-1)
omlib-modelicaservices-3.2.1-modelica3d (6931-om-m3-d23-om3d5-1)
libmodelica3d (17557-1)
omlib-modelicareference (6944-1)
drmodelica (17557-1)
omlib-complex-3.2.1 (6931-om1-1)
omedit (17557-1)
omoptim (17557-1)

------
Best regards,
Kirill

  • Index
  • » Users
  • » admech
  • » Profile
You are here: