I’m having trouble applying a Constant source with a 3D vector to a WorldForce model. When I try to set the constant k to a 3D vector, I get the following error:
[2] 17:19:55 Translation Error
[Modelica.Blocks.Sources: 165:5-166:102]: Type mismatch in binding ‘k = {-100, 100, 0}’, expected array dimensions [], got [3]
This occurs despite copying exactly the same working models from the example (Example – ForceAndTorque in Elementary). As soon as I put a 3D vector into constant k, it gives this error.
Here’s what I’ve tried:
- I’m using a Modelica.Blocks.Sources.Constant block.
- I’m trying to set k = {-100, 100, 0} to represent a 3D force vector.
- I’m attempting to connect this to a WorldForce (any Multibody.Forces) model.
The error suggests that the Constant block is expecting a scalar value (array dimensions []) but is receiving a vector ([3]). However, I thought WorldForce required a 3D vector input.
Can anyone explain why this is happening and how I can correctly apply a 3D constant force to a WorldForce (any Multibody.Forces) model?
Thank you for your help!