我想用这些单位创建一个变量:((rad/s)/((N/m)^0.5))
我尝试了很多设置,但还是不行。
这是我最后一次尝试:
Real Cap_fact (quantity = "CapacityFactor", unit = "((rad/s)/((N/m)^0.5))");
我也尝试过:
Real Cap_fact (final unit = ((rad/s)/((N/m)^0.5)));
最佳答案
单位定义不支持平方根,因为您必须使用整数作为指数。
Modelica 规范在 19.1 The Syntax of Unit Expressions 章中定义:
unit_factor:
unit_operand [ unit_exponent ]
unit_exponent:
[ "+" | "-" ] integer
The SI standard uses super-script for the exponentation, and does thus
not define any operator symbol for exponentiation. A unit_factor
consists of a unit_operand possibly suffixed by a possibly signed
integer number, which is interpreted as an exponent.
请注意,您还必须在定义指数时删除字符 ^
。
关于modelica - 无法表示 openmodelica 上的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69467926/