Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.3K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Programmatically set rotationType from Mathematica?

Posted 5 years ago
POSTED BY: Bogdan Udrea
4 Replies

I see, this is something that certainly works in the more recent versions, now that we have given more attention to other types of value setting like in enumerations. There are a couple of options. We could first try something like this that may have worked in 12.1,

<|"ParameterValues" -> {"transf.rotationType" -> WSMLink`Reference`ToDotName["Modelica.Mechanics.MultiBody.Types.RotationTypes.PlanarRotationSequence"]}|>

Try this association in either SetSystemModel or possibly in the ConnectSystemModelComponents call, which may have already been supported at the the time.

POSTED BY: Sergio Vargas
Posted 5 years ago

Thank you Sergio. The new method gives the same error

SystemModel::irl: The list of rules is not on the form {"variable" -> numericValue, ...}.

I'll email you about the bugs.

B

POSTED BY: Bogdan Udrea

A wrapper that allows the value setting functions to see a string as a component identifier is QuantityVariable. QuantityVariable, when representing a variable, has two arguments. For the first, we use the identifier string. Conventionally, the second argument is a physical quantity, but in this case you can use a generic IndependentPhysicalQuantity[""]. So your parameter can be added as

QuantityVariable["Modelica.Mechanics.MultiBody.Types.RotationTypes.PlanarRotationSequence", IndependentPhysicalQuantity[""]]

Sergio

POSTED BY: Sergio Vargas
Posted 5 years ago
POSTED BY: Bogdan Udrea
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard