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

Posts

Posts

Just successfully compiled revision 16181 from source. The problem seems to be solved!

Hi,

just tried to compile the current trunk version on Ubuntu.

I think that I have all dependencies installed and it seems to configure correctly:

Configured OpenModelica successfully using the following options:
Simulations may use sundials suite: Yes
Simulations may use IPOPT: No
ParModelica: No
Build OMNotebook: Yes

Then I run: make omc

I get the following strange error, including the last console output:

...
checking for mpicc... yes
checking hdf5.h... OK, needs mpi.h
checking for library containing H5Eget_auto2... -lhdf5
checking default API version... 1.6
Modelica Standard Tables may use ZLIB: Yes
Modelica Standard Tables may use HDF5: Yes
Modelica Standard Tables may use MAT7.3: Yes
configure: creating ./config.status
config.status: error: cannot find input file: `Makefile.in'
make[2]: *** [../../../libraries/OpenSourceTables/unix/Makefile] Error 1
make[2]: Leaving directory `/home/zav/OpenModelicaTrunk/Revision16120/SimulationRuntime/c/ModelicaExternalC'
make[1]: *** [ModelicaExternalC/libModelicaExternalC.a] Error 2
make[1]: Leaving directory `/home/zav/OpenModelicaTrunk/Revision16120/SimulationRuntime/c'
make: *** [interactive] Error 2
zav@zav1984:~/OpenModelicaTrunk/Revision16120$

Does anyone know what I am doing wrong here?

Thanks in advance!

Jan-15-13 23:47:22
calling OMC within Eclipse

Yes, that's it! works! Thank you!

Jan-15-13 11:48:13
calling OMC within Eclipse

Hello,

I just updated to Revision 14771 and cannot use my mos scripts any more:

- I execute my mos scripts within Eclipse (External Tools Configuration)

- Therefore I have as location the path to omc (home/OpenModelicaTrunk/Revision14771/build/bin/omc)

- as working directory i have the containing folder of the mos script: ${container_loc}

- Furthermore, as arguments I give: ${selected_resource_loc} Modelica
  (As I give Modelica as additional argument I dont have to write "loadModel(Modelica);" in every file)

- Now the problem: This worked fine in previous revisions (I am sure that it worked in revision 13983).
                                    Now it doesnt work any more!
                                    Following error: Error: Variable ModelicaServices.Machine.eps not found in scope Modelica.Constants
                                    Note: its always related to ModelicaServices, not always to Modelica.Constants or Machine.eps!

                                    I have to skip the argument Modelica and include "loadModel(Modelica);" in the mos file.
                                    Then it works in Revision 14771. However, I already have a lot mos files without the "loadModel(Modelica);".
                                    So I dont want to include that now in every file! Does anybody know why it doesnt work any more?


Thanks, Fritz

Hi again current/smile,

just found out that this error message has something to do with encapsulated packages:

try the following test model which is located inside the encapsulated package "OMTest":


Hence assuming a library structure you would have a folder containing

- a file "package.mo":

encapsulated package OMTest "OpenModelica Test Library"

end OMTest;


- and a file "AssertTest.mo":

within OMTest;


model AssertTest

Real x;

equation
  assert(x>1,"message");
 
  x = 10;
 

end AssertTest;

when trying to simulate, following error comes:

Error: Variable AssertionLevel.error not found in scope OMTest.AssertTest
Error: Error occurred while flattening model OMTest.AssertTest

by removing "encapsulated" everything works.

Hello,

I updated to rev13094 and suddenly models with assert statements assert(condition, message); do not simulate any more. There appears the following message:

Error: Variable AssertionLevel.error not found in scope myModel containing the assert statement

After commenting the assert statement the model works again!


In rev12691 everything is working fine.

Anybody else having the same problem?

Thanks, Fritz

Hello again,

I just noticed that there has been introduced a new rule which only allows one principal top level package per file.

In my OpenModelica model library I sometimes defined multiple top level items just on one single file without defining an enclosing package. Hence in rev12698 the OpenModelica compiler is unable to load the library. Has this new rule been introduced on purpose? Then I will change my library to this concept. However, Dymola doesn't say anything and takes the library as is.

Thanks, Fritz

Hello,

I just tried to compile the current trunk version from source on Ubuntu.

"make omc" worked just fine

"make mosh" also

unfortunately I get this error when running

"make qtclients"

In file included from ../Core/Optim/EA/EA:2:0
                 from ../Core/Problems/Optimization.cpp:42:
../Core/Optim/EA/NSGA2/NSGA2.h:45:14: fatal error: eo: No such file or directory
compilation terminated.

I have added the following configure option --without-paradiseo (I think that should prevent it from compiling OMOptimum)
Or is that error related to something else? I did a full trunk checkout!

Thank you very much,

Fritz

Hi,
I get a flattening error message when using a Modelica.Media type partial package structure in combination with a replaceable partial record (thermodynamic state record).

A have the following structur in my Media models: (MyReplaceablePartialModelLevelOne corresponds to BaseProperties)

Code:



package Test

partial package MyPartialPackageLevelOne

  constant String level = "LevelOne";
 
  replaceable partial record MyRecord
   //record variable to be defined a level higher
  end MyRecord;
 
 
  replaceable partial model MyReplaceablePartialModelLevelOne
 
    Real variableOne;
    Real variableTwo;
    Real variableThree;
    Real variableFour;
   
    MyRecord myRecord;
   
    equation
     
     variableThree = 3;
     variableFour = 4;
     
 
  end MyReplaceablePartialModelLevelOne;
   
end MyPartialPackageLevelOne;


partial package MyPartialPackageLevelTwo

  extends MyPartialPackageLevelOne(level = "LevelTwo");

  redeclare record extends MyRecord
    Real recordVariable; 
  end MyRecord;

end MyPartialPackageLevelTwo;


////finally used package

package MyUsedPackage
 
  extends MyPartialPackageLevelTwo(final level = "LevelThree");
//this works!
/*
  redeclare record extends MyRecord
    Real recordVariable; 
  end MyRecord;
*/
  redeclare model extends MyReplaceablePartialModelLevelOne
   
    equation
         
     myRecord.recordVariable = variableOne;
       
  end MyReplaceablePartialModelLevelOne;
 
end MyUsedPackage;

 
model TestModel
 
  package MyPackage = MyUsedPackage;
   
  MyPackage.MyReplaceablePartialModelLevelOne modelFromPackage;
 
  equation
   
    modelFromPackage.variableOne =1;
    modelFromPackage.variableTwo =2; 
 
end TestModel;


end Test;

When I redeclare the record in level two it doesnt work. Following message: Error: Error occurred while flattening model Test.TestModel
When I do it on level three it works!

In Dymola both versions work.

Is that worth a bug report? I think both versions a correct Modelica, or?

I am now on revision 11620.

Thanks!

In case anybody has got the same problem: its the omniidl-python package which is needed!

Quite obvious actually current/smile. I should have realized that straight away...

Hi,
I just tried to compile the latest revision from the repository.
Unfortunately I get the following error:

/usr/bin/omniidl -bpython -C../../build/share/omc/scripts/PythonInterface/stubs omc_communication.idl || test "`uname`" = "Darwin"
omniidl: Could not import back-end 'python'
omniidl: Maybe you need to use the -p option?
omniidl: (The error was 'No module named python')
make[4]: *** [../../build/share/omc/scripts/PythonInterface/stubs/omc_communication_idl.py] Error 1

I have never had this message before rev11450.
I had a look into the commit logs and there is a modification regarding this omniidl issue, but I have no idea how to solve that.
I am on Ubuntu and I have "python" installed. Why is there a message that it could not import python??

thanks, Fritz

Feb-03-12 16:19:00
homotopy() function supported by OM?

Hi,

I just tried a simple model in OpenModelica, including a homotopy() operation. When checking the model, everything is fine.

But simulation doesn't work. However, my model should be correct  code (tested with Dymola demo version).

So, is the homotopy function not yet fully implemented, but recognized by the compiler?

thanks, Fritz

here lines 165-181

Code:



void eqFunction_0(_X_DATA *data, _OMC_SEED_HACK) {
  real_array tmp0;
  /*#modelicaLine [/home/fzaversky/workspace/OM/OMtest.mo:12:1-12:82]*/
  real_array_create(&tmp0, ((modelica_real*)&($PmyArray)), 1, :);
  $PmySumArray$lB1$rB = sum_real_array(&tmp0);
  /*#endModelicaLine*/
}


void eqFunction_1(_X_DATA *data, _OMC_SEED_HACK) {
  real_array tmp1;
  /*#modelicaLine [/home/fzaversky/workspace/OM/OMtest.mo:12:1-12:82]*/
  real_array_create(&tmp1, ((modelica_real*)&($PmyArray)), 1, :);
  $PmySumArray$lB2$rB = sum_real_array(&tmp1);
  /*#endModelicaLine*/
}

hello,
just updated to revision 10901 and tried my test model from above. I am afraid, it doesnt work, although it should since r10870?

following output:

OMtest.c: In function ‘eqFunction_0’:
OMtest.c:168:63: error: expected expression before ‘:’ token
OMtest.c: In function ‘eqFunction_1’:
OMtest.c:177:63: error: expected expression before ‘:’ token
OMtest.c: In function ‘eqFunction_2’:
OMtest.c:186:63: error: expected expression before ‘:’ token
OMtest.c: In function ‘eqFunction_3’:
OMtest.c:195:63: error: expected expression before ‘:’ token
OMtest.c: In function ‘eqFunction_4’:
OMtest.c:204:63: error: expected expression before ‘:’ token

Jan-16-12 19:48:24
sendData removed from configure options

Thanks, works! the new plot window is amazing current/smile

Jan-16-12 18:05:03
sendData removed from configure options

Hello,

I realized that some configure options have been removed.

I get the following warning when configuring:
configure: WARNING: unrecognized options: --with-sendData-Qt, --with-Coin

which options should I put instead now? which ones are compulsory for running make omc, make mosh, make qtclients ?

Thanks!

hello again current/smile,
seems that the record issue is not going to stop. here another problem:

the parameter passing for records does not work: if you have a model which contains records or an array of records as parameters and you want to set
them to other values while creating an instance in another model, the new values are not passed!

Code:


package testOM

record GenericData
  parameter Integer dataOne = 1;
  parameter Integer dataTwo = 1;
end GenericData;

record DataSetOne = GenericData(dataOne = 5, dataTwo = 10);

record DataSetTwo = GenericData(dataOne = 15, dataTwo = 20);

model HasRecordAsParameter
  parameter GenericData data;
  Integer variable;
equation
  variable = data.dataOne;
end HasRecordAsParameter;

model PassesRecordAsParameter
  parameter DataSetOne data;
  HasRecordAsParameter parameterReceiver(data = data);
  Integer variable;
equation
  variable = parameterReceiver.variable;
end PassesRecordAsParameter;

model PassesRecordArrayAsParameter
  parameter DataSetOne data1;
  parameter DataSetTwo data2;
  parameter GenericData data[2]={data1,data2};
  HasRecordAsParameter parameterReceiver[2](data = data);
  Integer variable;
equation
  variable = parameterReceiver[1].variable;
end PassesRecordArrayAsParameter;

end testOM;

in the cases above, the "variable" value after simulating is always "1" , although it should be "5".
Is this bug related to one that has already been reported? I will have a look into codeBeamer...hope I will find that...

Jan-07-12 13:57:51
record arrays produce overdetermined system

hello again,
I finally found out how to solve problem 1 with the overdetermined system. within the record MyDataArrays the keyword parameter has to be used again!!! this works!

Code:


record MyDataArrays
  parameter Integer dimension = 2;

  parameter DataSetOne dataSetOne;

  parameter DataSetTwo dataSetTwo;

  parameter MyGenericData dataArrayOne[dimension] = {dataSetOne, dataSetTwo};

end MyDataArrays;

hello,

just realized that the following statement does not work, although it should:

Code:



model OMtest

parameter Integer dimensions = 5;

parameter Real myArray[dimensions] = {1,2,3,4,5};

parameter Real mySumArray[dimensions] = {sum(myArray[1:i]) for i in 1:dimensions};

end OMtest;

following error:
[SimCodeC.tpl:5647:11-5647:11:writable] Error: Template error: ASUB_EASY_CASE 1:1
[SimCodeC.tpl:5647:11-5647:11:writable] Error: Template error: ASUB_EASY_CASE 1:2
[SimCodeC.tpl:5647:11-5647:11:writable] Error: Template error: ASUB_EASY_CASE 1:3
[SimCodeC.tpl:5647:11-5647:11:writable] Error: Template error: ASUB_EASY_CASE 1:4

where is actually the official OM bug list? I mean it doesnt make sense if I remind you of bugs that are already known and somewhere reported for being fixed... current/smile .
and who is allowed to modify this list?
thanks

Dec-22-11 20:54:20
record arrays produce overdetermined system

Hello,

I have the following problem:

When I define arrays of records within a record,
they produce equations and the following model which needs the containing parameters
cannot be simulated. It works in the Dymola demo version.

Code:



package OMtest

record MyGenericData
  parameter Integer dataOne;
  parameter Integer dataTwo;
end MyGenericData;

record DataSetOne = MyGenericData(dataOne = 1, dataTwo = 2);

record DataSetTwo = MyGenericData(dataOne = 3, dataTwo = 4);

record MyDataArrays
  parameter Integer dimension = 2;

  DataSetOne dataSetOne;
  DataSetTwo dataSetTwo;

  MyGenericData dataArrayOne[dimension] = {dataSetOne, dataSetTwo};

end MyDataArrays;

model MyTestModel

  MyDataArrays myDataArrays;

  Integer oneVariable;

equation
oneVariable = myDataArrays.dataArrayOne[1].dataOne;

end MyTestModel;

end OMtest;



Any idea when this will be fixed? Thanks!
Fritz

Hi again current/smile, I hope nobody is answering here because of Christmas and New Year...

Anyway, this does neither work:

Code:



package OMtest

record MyGenericData
  parameter Integer dataOne = 1;
  parameter Integer dataTwo = 1; 
end MyGenericData;

record DataSetOne = MyGenericData(dataOne = 1, dataTwo = 2);

record DataSetTwo = MyGenericData(dataOne = 3, dataTwo = 4);
 
model MyTestModel2

  DataSetOne dataSetOne;
  DataSetTwo dataSetTwo;

  replaceable MyGenericData dataSetArray[:]={dataSetOne, dataSetTwo};
 
  Integer result;

equation
    result = dataSetArray[1].dataOne;

end MyTestModel2;

model MyTestModel2TestModel

DataSetOne dataSetOne;
DataSetTwo dataSetTwo;

//MyTestModel2 testReplaceable(redeclare MyGenericData dataSetArray = {dataSetTwo, dataSetOne});   // this gives a type mismatch error although there shouldn't be any!

MyTestModel2 testReplaceable2(dataSetArray = {dataSetTwo, dataSetOne});    // this gives no error, only has too many equations for simulating

end MyTestModel2TestModel;


end OMtest;


I would really need this type of code. Any comments are welcome.

Thanks, Fritz

Oct-14-11 13:46:26
I want to redeclare and extend a replaceable partial function.

Thanks! current/smile

Oct-14-11 13:35:18
I want to redeclare and extend a replaceable partial function.

No, I am on Ubuntu and wanted to load and simulate the model with the OMEdit trunk version (from Monday). Yeah, looks like there is an editing problem...OMEdit crashes while loading...I should have mentioned that before. What is now the best way to run my models until OMEdit is fixed? OMShell?

Oct-14-11 12:23:02
I want to redeclare and extend a replaceable partial function.

Hello,

I would like to redeclare and extend a replaceable partial function in my OpenModelica models as it is done for example in the Modelica Library (Fluid.Pipes.BaseClasses.WallFriction).

Should that work in OM or not?

The following code works in Dymola but My OMEdit crahses when entering the redeclare function extends part current/sad.

thanks,

Fritz


Code:


within ;
package Shell

  partial package PartialPackage

    replaceable partial function FunctionToBeExtendet

      input Real FunctionInput;
      output Real FunctionOutput;

      protected
      Real Variable;

    end FunctionToBeExtendet;

  end PartialPackage;


  package FinalPackage

  extends PartialPackage;

    redeclare function extends FunctionToBeExtendet

    algorithm
       Variable:= FunctionInput*2;
       FunctionOutput:= Variable;

    end FunctionToBeExtendet;

  end FinalPackage;


  model FunctionCall

  Real Value;
  Real Result;

  equation
  Value = 2;
  Result = FinalPackage.FunctionToBeExtendet(Value);

  end FunctionCall;
 
end Shell;


Hello,

one question: Is the stream prefix for the connector fully supported by OpenModelica? I have just seen the road map, seems that it was added in December 2010...

thanks,

Fritz

Oct-04-11 16:54:13
base_array.c: the number of array dimensions are

Hello, thanks for the dymola message!

I added an additional for loop and defined the 2nd dimension of the output array in advance.

This works! current/smile


  function ArrayExampleFunction

    input Integer dimensionOne;

    input Real valuesList[:,:];

    output Real outputList[dimensionOne,size(valuesList,2)];

  protected

    Integer listSize;

    Integer listSize2;

    Integer aux;

  algorithm

    listSize:=size(valuesList, 1);

    listSize2:=size(valuesList,2);

    for i in 1:dimensionOne loop

          aux:=min(i, listSize);

          for j in 1:listSize2 loop

          outputList[i,j]:=valuesList[aux,j];

          end for;

    end for;

  end ArrayExampleFunction;

Oct-03-11 19:43:09
base_array.c: the number of array dimensions are

Hello!

I am working with arrays of the type: Real exampleArray[2,3]

I am calculating the values of the array in a modelica function and then assign the return value (output value) of that function to a corresponding array parameter. But, that does not work.

I get the following error message:

base_array.c: the number of array dimensions are < 0!
ArrayTestModel: real_array.c:280: indexed_assign_real_array: Assertion `base_array_ok(source)' failed.
Aborted

Thats the model:

model ArrayTestModel
public
  parameter Integer dimensionOne = 2;
  parameter Real exampleArray[:,:] = {{0.4572,0.3556,0.2032}};
protected
  function ArrayExampleFunction
    input Integer dimensionOne;
    input Real valuesList[:,:];
    output Real outputList[dimensionOne,:];
  protected
    Integer listSize;
    Integer aux;
  algorithm
    listSize:=size(valuesList, 1);
    for i in 1:dimensionOne loop
          aux:=min(i, listSize);
      outputList[i]:=valuesList[aux];

    end for;
  end ArrayExampleFunction;
  parameter Real exampleArrayList[dimensionOne,:] = ArrayExampleFunction(dimensionOne, exampleArray);
end ArrayTestModel;


Does anybody have an idea why?

Thanks,

Fritz

Aug-09-11 19:47:11
backslashes before and after variable comments

Yeah, it works with revision 9619. Thanks!

Aug-09-11 10:39:21
backslashes before and after variable comments

Hi,

When I load my in Eclipse written models in OMEdit, there appear backslashes before each quotation mark of my variable comments???Nearly everything is highlighted green, and OMEdit does not recognize anything current/sad!

My models worked well, before I updated to the latest version from the repository! I am working in Ubuntu.

Does anyone have an idea why?

Thanks, Fritz

Jul-19-11 22:00:14
AvlTree.mo:103.5-103.8 Error: wrong number of arguments

Yeah, I think I had the wrong version on the path. Now it worked :-).

But, when I run the testsuite, I get one error:

RedeclareFunction (Bug1432)                                                       ... execution failed

Error: Variable RedeclareFunction.b in package RedeclareFunction is not constant
[RedeclareFunction.mo:16:13-16:27:writable] Error: Variable RedeclareFunction.b not found in scope RedeclareFunction.B.A2.f

All the other tests succeed.

Jul-19-11 01:18:37
AvlTree.mo:103.5-103.8 Error: wrong number of arguments

I have downloaded my version from the following location, as stated in the README.Linux.txt

https://openmodelica.org/svn/MetaModelica/trunk mmc

Has it been moved?

Thanks,

Fritz

Jul-18-11 15:23:40
The path that is stated in the README.Linux.txt file doesnt work

Hello,

Where is the zipped Modelica library for the testsuite now? The path that is stated in the README.Linux.txt file does not work any more.

https://openmodelica.org/svn/OpenModeli … Lib.tar.gz   does not exist!

Thanks,

Fritz

Jul-16-11 22:10:06
AvlTree.mo:103.5-103.8 Error: wrong number of arguments

Hi, I just tried to compile the latest version from the repository on Ubuntu.

I get the following error when running: make omc

AvlTree.mo:103.5-103.8 Error: wrong number of arguments to type function Key
expected: 1 arguments in type:
  Key
but got:  0 arguments!AvlTree.mo:103.5-103.8 Error: wrong number of arguments to type function Key
Error: StaticElaborationError

Does anyone has an idea why? Thanks!

Jun-06-11 21:32:09
LATEST sources from the Subversion repository do not compile

Yeah! Thats it! Thank you very much!!!

Jun-04-11 19:22:40
LATEST sources from the Subversion repository do not compile

I wanted to compile the latest version from Subversion repository https://openmodelica.org/svn/OpenModelica/trunk/ but "make omc" failed to succeed!

Following message: simulation_input_xml.cpp:52: fatal error: expat.h: No such file or directory compilation terminated

make: *** [c_runtime] Error 2

Then I tried to compile the older version under https://openmodelica.org/svn/OpenModeli … _1_7_0_RC1 and it worked!

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