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

Tillers Modelica Sample Simple Car

Tillers Modelica Sample Simple Car

Hi,

I am trying to make the sample "SimpleCar" from MIcheal Tillers Modelica Instruction (http://extras.springer.com/2001/978-0-7 … SimpleCar) running. But I did not succeed so far.
I got the error message "Class Modelica.Blocks.Interfaces.OutPort not found in scope Interfaces.Chassis". Because OutPort is not in the Interface package I tried to substitute by RealOutput:

//  Modelica.Blocks.Interfaces.OutPort speed(final n=1)
  Modelica.Blocks.Interfaces.RealOutput speed(final n=1)

Than I  got the error messages:
"Forcing full instantiation of partial class Chassis during checkModel"
"Modified element n not found in class Real"

Is n=1 out of bound for type real resp. RealOutput? Maybe somebody knows if OutPOrt is an old connector which is not longer in use. If somebody has already experience with Tillers samples, would be great if you can share some experiences. Thanks a lot

Re: Tillers Modelica Sample Simple Car

Hi Luk,

Yes, 'OutPort' is an old version of the present 'RealOutput'.

As far as I remember, 'OutPort' was defined as an array with size 'n' where 'n' was a parameter within the connector definition, hence the need for the modifier '(n=1)'

'RealOutput' is a scalar connector but can be instantiated as an array using square brackets.

To make your code work, you must replace all occurrences of 'Modelica.Blocks.Interfaces.OutPort portName(n=1)' with 'Modelica.Blocks.Interfaces.RealOutput portName'.

Similarly for arrays of ports you must replace 'Modelica.Blocks.Interfaces.OutPort portName(n=x)' with 'Modelica.Blocks.Interfaces.RealOutput[x] portName' where 'x' is an integer > 1.

Best regards
Rene Just Nielsen

Edited by: justnielsen - Aug-15-18 06:20:15
There are 0 guests and 0 other users also viewing this topic
You are here: