gpt4 book ai didi

modelica - 无法表示 openmodelica 上的变量

转载 作者:行者123 更新时间:2023-12-04 12:30:24 25 4
gpt4 key购买 nike

我想用这些单位创建一个变量:((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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com