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
  • » mikaOM
  • » Profile

Posts

Posts

Thank you for you answer, and for your help, The model is now working!

Hello!
I'm new to modelica and openModelica and i'm trying to learn by myself this new language and the opportunities that it can offer.
I'm trying to implement a simple partial differential equation . The equation is a diffusion equation.
After reading some examples, i want discretize the space and time variable, using pre() operator for time and the difference equation method.
I've constructed the model below but the compilation said that i'm doing wrong.

I've saw in the C-code that the error seems to be on the pre(T[i-1]) expression. I think i've made a wrong representation of the equation using modelica.
It would be very helpful if you can say me if my pde's modelica representation is correct or if there is a better way to represent this equation.

Thank you very much for your answers

The model:

Code:

model TestPde

  parameter Integer l = 10 "lenght";
  parameter Integer n = 30 "Number of section";
  parameter Real deltax = l / n "section lenght";
  parameter Real C = 1 "diffusion coefficient";

  parameter Real Ts(unit = "s") = 0.01 "time bettween samples";
  discrete Real T[n](start = fill(0, n));;

  T[1] = T0 "initial condition";
  T[n] = T[n - 1] "limit condition;

for i in 2:n-1 loop
when sample(0,Ts) then

T[n]  = pre(T[i]) + Ts * (C * ( pre(T[i+1]) + pre(T[i-1] -2*pre(T[i])/ deltax^2)

end when;
end for;

end Test;

The error of compilation:

Code:

Translation    10:42:33        0:0-0:0    Error building simulator. Buildlog: gcc  -O3 -falign-functions -march=native -mfpmath=sse   -I"/usr/include/omc" -I. -L"/media/A"   -c -o pdeAdhesion4.o pdeAdhesion4.c

pdeAdhesion4.c: In function ‘eqFunction_279’:
pdeAdhesion4.c:1156: error: ‘$P$PRE$PC$lB1$rB’ undeclared (first use in this function)
pdeAdhesion4.c:1156: error: (Each undeclared identifier is reported only once
pdeAdhesion4.c:1156: error: for each function it appears in.)
make: *** [pdeAdhesion4.o] Erreur 1

Jan-06-12 16:00:19
MDT gives up trying to connect to OMC

That works!
Thank you a lot for your answer and for the explanations!

Jan-06-12 14:50:58
MDT gives up trying to connect to OMC

Hello!

I'm facing the same problem with md and eclipset: "OpenModelica Compiler null is Online"
I'm working on Ubuntu 10.10, and i don't see any TMPDIR or something like that in order to be unsetting.
I'm not a power user in linux systems, nevertheless OMEdit, OMshell works, and i've set my OPENMODELICAHOME variable to

Code:

/usr/lib

where it can find omc and my eclipse configuration is good.

Thank you for any of your help!

Here's the log when i start eclipse:

Code:

OMCSTATUS: Will look for OMC object reference in '/tmp/openmodelica.mikaOM.objid.mdt'.

OMCSTATUS: No OMC object reference found, starting server.
OMCSTATUS: Using OPENMODELICAHOME environment variable to find omc-binary
OMCSTATUS: Environment variable OPENMODELICAHOME not set, don't know how to start OMC from standard path.
OMCSTATUS: Will look for OMC object reference in '/tmp/openmodelica.mikaOM.objid.mdt'.
Unable to parse list: Empty list: []
Unable to parse list: Empty list: []
Unable to parse list: Empty list: []
Unable to parse list: Empty list: []
org.modelica.mdt.core.compiler.UnexpectedReplyException: Unable to parse list: Empty list: []
    at org.modelica.mdt.omc.OMCProxy.loadSourceFile(OMCProxy.java:883)
    at org.modelica.mdt.omc.OMCProxy.loadSourceFile(OMCProxy.java:1)
    at org.modelica.mdt.core.CompilerProxy.loadSourceFile(CompilerProxy.java:207)
    at org.modelica.mdt.core.builder.SyntaxChecker.loadFileAndReportErrors(SyntaxChecker.java:539)
    at org.modelica.mdt.internal.core.ModelicaSourceFile.loadElements(ModelicaSourceFile.java:128)
    at org.modelica.mdt.internal.core.ModelicaSourceFile.getChildren(ModelicaSourceFile.java:115)
    at org.modelica.mdt.ui.view.ModelicaContentOutlinePage$ChildrenProvider.getChildren(ModelicaContentOutlinePage.java:175)
    at org.modelica.mdt.ui.view.ModelicaContentOutlinePage$ChildrenProvider.getElements(ModelicaContentOutlinePage.java:193)

***
lines edited out
***

and here a copy of what we can find in /tmp directory (don't know if it could help)

Code:

openmodelica.mikaOM.objid.OMEdit1048b6a4032d6e15be132584614565585800000013900037113546575

openmodelica.mikaOM.omc.output.OMEdit

Jan-01-12 01:44:34
Cannot install ModelicaML in Eclipse

I had also this kind of problem to install modelicaML:

Code:

Cannot complete the install because one or more required items could not be found.

  Software being installed: ModelicaML - Papyrus Customization, Modelica Code Generation, Simulation with OMC 1.8.1.201111251127 (org.openmodelica.modelicaml.feature.feature.group 1.8.1.201111251127)
  Missing requirement: ModelicaML - Papyrus Customization, Modelica Code Generation, Simulation with OMC 1.8.1.201111251127 (org.openmodelica.modelicaml.feature.feature.group 1.8.1.201111251127) requires 'fr.obeo.acceleo.gen 0.0.0' but it could not be found

Following your instructions, the problem was that i hadn't the right version of acceleo i.e the 2.8

Thanks!

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