Previous Topic

Next Topic

...Define Units & Constants

The OpenSees interpreter does not process units. Units, however, can be used when entering values if these units are defined previously. The unit definition consists of two parts: the basic units are defined first, all other units are subsequently defined. The basic units are assigned a value of one and all OpenSees output is in these units. It is very important that all basic units are independent of each other. The unit-definition file can contain both metric and Imperial units, as can the basic units. Hence, the input files may contain mixed units.

Constants, such as p and g can also be defined apriori.

An example of unit and constant definition is given in the following:

# ----Units&Constants.tcl---------------------------------------------------------

set in 1.; # define basic units

set sec 1.;

set kip 1.;

set ksi [expr $kip/pow($in,2)]; # define dependent units

set psi [expr $ksi/1000.];

set ft [expr 12.*$in];

set lb [expr $kip/1000];

set pcf [expr $lb/pow($ft,3)];

set ksi [expr $kip/pow($in,2)];

set psi [expr $ksi/1000.];

set cm [expr $in/2.54]; # define metric units

set meter [expr 100.*$cm];

set MPa [expr 145*$psi];

set PI [expr 2*asin(1.0)]; # define constants

set g [expr 32.2*$ft/pow($sec,2)];

set U 1.e10; # a really large number

set u [expr 1/$U]; # a really small number