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

Further problems with simple models

Further problems with simple models


I'm having further problems getting a simple model to run correctly. I'm trying to duplicate a simple model shown in the Modelica User's guide: … orldForce. I've set all of the parameters just as the example shows. Upon trying to simulate I get 3 error messages: 1) "Type mismatch in binding k={-800,400,0}, expected subtype of Real(start=10), got type Integer [3]" 2) "Error occurred while flattening model wecpart" 3) same as 1) above. I've attached the model.

I thought we had to stipulate that the force has 3 components as indicated by the 3 component vector for k. Is this not correct? Not sure why I'm getting this error message when it's exactly the example given.

Any help would be most appreciated. Thankyou.

Re: Further problems with simple models

The error is correct, const.k is a scalar, so of course you can't give it a vector as value. You need to make const a vector to make it work:

  Modelica.Blocks.Sources.Constant const[3](k = {-800,400,0});

You also need to change the first connect equation to connect the whole arrays:


There are 0 guests and 0 other users also viewing this topic
You are here: