I have defined a variable #I in Teddy. This variable is intended to have the unit m⁴. The following parameters are used:
#k [MN/m] #E [MN/m²] #h_beton #h_holz
As you can see, I have not specified any units for #h_beton and #h_holz. However, these are supposed to have the unit mm. For this, these variables should actually be converted to m within the calculation.
Strangely enough, Sofistik performs this conversion automatically and converts #h_beton and #h_holz from mm to m. I would like to know why Teddy does this and how I can gain more control over the unit conversion.
I get an error when running your code. Actually because the unit of #I is not correct, which makes sense.
Are you sure you never had a unit for #H_BETON and #H_HOLZ and you removed the unit mark in the course of your work? I can imagine they still have [mm] as unit in the database, as you’ve been saving them with STO. And until you change the unit (for example with [-]), it will stay there.
Yes, I had previously defined the variables in [mm]. However, because I kept getting an error as a result, I removed the unit assignment and deleted the CDB. After that, the code worked for me.
Which approach is generally recommended? Should units be defined, or is it better not to define them?
#I = (539/310000)*[(100*0.5/1000)^3+(1800.5/1000)^3)]=1,534 10^-5
→ as you can see the result in the report browser result from an intetrnal conversion of the parameters #h_beton and #h_holz from mm to m
Yes, I guess it’s because SOFiSTiK has preferential units for database storage. For the moment of inertia it’s m^4 (see the database help cdbase.chm). When you store what appears to be a moment of inertia, the conversion is made for the variable.
Check with PRT#I and see the echo of your input. Whatever the input unit you give for #H_BETON, #H_HOLZ, #K and #E, if you don’t specify a unit when defining #I, you end up with
---- CADINT VARIABLE I ( 0) = 0.1534E-04 Unit 44 0.1534E-04 m⁴
And in the database (if you store #I with STO), you’ll see DIM is 44, which is m^4. If you specify [mm4] at the definition of #I, you’ll have DIM as 43 in the database, which is mm^4.
And in the definition with SVAL, the unit used will be m^4, as is specified in the user manual of AQUA.
Which approach is generally recommended? Should units be defined, or is it better not to define them?
Once you have learned how to work with (implicit) units, it is very convenient and it saves you from many unit errors/warnings e.g. in the definition of loads.
I solved the problem by deleting the STO variables using DEL and then redefining them without units. After that, I was able to calculate #I as desired.
Another option is to assign the “unit” [without specification]:
let#var1 1.23[m]
let#var2 456[K]
let#var3 #var1+#var2[-] $ [-] means, that the value is without specification / unit-free
looks like this