Previous Topic

Next Topic

...Build Model and Define Nodes using Variables

This example sets up the geometry of the cantilever column shown in the Figure -- using variables.

# -------Build&Nodes.tcl-------------------------------------------------------

wipe; # clear data from past analysis

model basic -ndm 3 -ndf 6;

# define units and constants

# source units.tcl; # if contained in external file

# Define nodes ------ frame is in X-Y plane (X-horizontal, Y-vertical) using the node Command

node 1 0. 0. 0.; # base of left column

node 2 $Lbeam 0. 0.; # base of right columnn

node 3 0. $Lcol 0.; # top of left column

node 4 $Lbeam $Lcol 0.; # top of right columnn

# Define Boundary conditions using the fix Command ! 1: restrained, 0: released

fix 1 1 1 1 1 1 1; # fully-fixed support

fix 2 1 1 1 1 1 1;

fix 3 0 1 1 1 1 0 -mass $Mass 0. 0. 0. 0. 0.;

fix 4 0 1 1 1 1 0;

# define the mass at node 4 using the mass Command:

mass 4 $Mass 0. 0. 0. 0. 0.;

# NOTE: The second command assigning the mass of a specific node will override any previous mass assignements to that node.