Arrays of Components

8 posts / 0 new
Last post
cy949
Offline
Joined: 2012-02-16
Arrays of Components

Dear Sir or Madam,
I'm trying to put together an array of components similar to what I am reading in the tutorial.  I'm starting off with a circuit model with two resistors, trying understand how to code properly before using larger arrays and the TLine models provided.  Using the two files attached, I'm getting 2 errors that reads as follows below.  Is there something I am missing?  The error looks like it does not know what p or n is.  But I thought that the dependencies of the resistor, p and n, will be known since the resistor has an extends...OnePort line in the Basic.mo file.  Can someone please help me in understanding how to code the two array component model properly?  Many thanks in advance for the advice.
Clayton
********************************************
 

JVM started.

 

Traceback (most recent call last):

  File "C:\Users\Clayton_Young\Documents\projects\closed_loop\modelica\tlinetest.py", line 9, in <module>

    fmu_name = compile_fmu("tlinetest1","tlinetest.mo") #model of interest in the file

  File "C:\JModelica.org-1.6\Python\jmodelica\fmi.py", line 130, in compile_fmu

    comp.compile_FMU(class_name, file_name, target, compile_to)

  File "C:\JModelica.org-1.6\Python\jmodelica\compiler.py", line 516, in compile_FMU

    self._handle_exception(ex)

  File "C:\JModelica.org-1.6\Python\jmodelica\compiler.py", line 699, in _handle_exception

    raise CompilerError(errors,compliance_errors,warnings)

jmodelica.compiler.CompilerError: 

2 error(s), 0 compliance error(s) and 1 warning(s) found:

 

Error: in file 'tlinetest.mo':

Semantic error at line 25, column 16:

  Cannot find class or component declaration for n

 

Error: in file 'tlinetest.mo':

Semantic error at line 27, column 21:

  Cannot find class or component declaration for p

 

Warning: in file 'C:\JModelica.org-1.6\ThirdParty\MSL\Modelica\Electrical\Analog\Basic.mo':

At line 67, column 40:

  Assuming 'each' for the binding expression to the variable R

jakesson
Offline
Joined: 2009-03-14
Hi,   I tried the model and I

Hi,
 
I tried the model and I got an exception:
 
JError: java.lang.NullPointerException
    at org.jmodelica.modelica.compiler.ASTNode.getChildNoTransform(ASTNode.java:2226)
    at org.jmodelica.modelica.compiler.ASTNode.getChild(ASTNode.java:2159)
    at org.jmodelica.modelica.compiler.ASTNode.getChild(ASTNode.java:2151)
    at org.jmodelica.modelica.compiler.FIfEquation.getElse(FIfEquation.java:500)
    at org.jmodelica.modelica.compiler.FIfEquation.createIfExpEquationList_compute(FIfEquation.java:862)
    at org.jmodelica.modelica.compiler.FIfEquation.createIfExpEquationList(FIfEquation.java:849)
    at org.jmodelica.modelica.compiler.FIfEquation.rewriteRule1(FIfEquation.java:944)
    at org.jmodelica.modelica.compiler.FIfEquation.rewriteTo(FIfEquation.java:918)
    at org.jmodelica.modelica.compiler.ASTNode.getChild(ASTNode.java:2172)
    at org.jmodelica.modelica.compiler.ASTNode.getChild(ASTNode.java:2151)
    at org.jmodelica.modelica.compiler.ASTNode$4.next(ASTNode.java:2479)
    at org.jmodelica.modelica.compiler.ASTNode$4.next(ASTNode.java:2472)
    at org.jmodelica.modelica.compiler.ASTNode.enableWhenEquationRewrite(ASTNode.java:1020)
    at org.jmodelica.modelica.compiler.ASTNode.enableWhenEquationRewrite(ASTNode.java:1021)
    at org.jmodelica.modelica.compiler.ASTNode.enableWhenEquationRewrite(ASTNode.java:1021)
    at org.jmodelica.modelica.compiler.ASTNode.enableWhenEquationRewrite(ASTNode.java:1021)
    at org.jmodelica.modelica.compiler.FClass.transformCanonicalBase(FClass.java:1541)
    at org.jmodelica.modelica.compiler.FClass.transformCanonical(FClass.java:1566)
    at org.jmodelica.modelica.compiler.ModelicaCompiler.flattenModel(ModelicaCompiler.java:1558)
    at org.jmodelica.modelica.compiler.ModelicaCompiler.compileModel(ModelicaCompiler.java:1289)
    at org.jmodelica.modelica.compiler.ModelicaCompiler.compileUnit(ModelicaCompiler.java:1088)
    at org.jmodelica.modelica.compiler.ModelicaCompiler.compileFMU(ModelicaCompiler.java:1036)
 
Probably this is due to the recent updates in the handling of if-equations. Jesper will need to have a look at this.
 
/Johan

cy949
Offline
Joined: 2012-02-16
Arrays of Components - Thank You

Johan,
Thank you very much for taking a look at my problem.
Clayton

cy949
Offline
Joined: 2012-02-16
Arrays of Components - Thank You

Johan,
Thank you very much for taking a look at my problem.
Clayton

jmattsson
Offline
Joined: 2009-10-18
Ticket

Hi Clayton
 
I have created a ticket for this problem (https://trac.jmodelica.org/ticket/1848), and am working on it.
 
Jesper

jmattsson
Offline
Joined: 2009-10-18
Fixed

This issue was fixed in r3228.
 
Jesper

cy949
Offline
Joined: 2012-02-16
Thank You

Jesper,
Thank you very much for taking the time to help me on this.  On the link provided, I saw a bunch of older code and revised code.  What am I supposed to do next?  I am very new to Modelica and thanks in advance for being patient with a newbie.
Clayton

tove
Offline
Joined: 2009-04-08
Hi Clayton, It looks like you

Hi Clayton,

It looks like you are running the binary version of JModelica.org. To get bug fixes implemented after the release of the binary version you have installed, you need to install the JModelica.org-SDK with which you can compile the source code yourself. Whenever a bugfix comes, you can then update your source code and rebuild - you don't have to wait for us to release a new binary version. There is a section Software Development Kit under the chapter Installation in the User's Guide with instructions on how to install the SDK and ask here again if you get stuck.

Best regards,
Tove

 

Login or register to post comments