3

I want to create a variable with these unit: ((rad/s)/((N/m)^0.5))

I've tried many settings but it still doesn't work.

That's my last try:

  Real Cap_fact (quantity = "CapacityFactor", unit = "((rad/s)/((N/m)^0.5))");

I've tried also with:

  Real Cap_fact (final unit = ((rad/s)/((N/m)^0.5)));
marco
  • 5,944
  • 10
  • 22

1 Answers1

5

Square roots are not supported in unit definitions, since you must use integers as exponents.

The Modelica Specifications defines in chapter 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.

Note that you also have to remove the character ^ when you define an exponent.

marco
  • 5,944
  • 10
  • 22