PlZ Help! applying loads

If you have a script you think might be useful to others post it
here. Hopefully we will be able to get the most useful of these incorporated in the manuals.

Moderators: silvia, selimgunay, Moderators

Post Reply
Robert EY
Posts: 6
Joined: Thu Jun 22, 2006 3:31 pm

PlZ Help! applying loads

Post by Robert EY » Fri Jun 30, 2006 11:38 am

I am new to opensees and I am trying to analyze a threestory( 4 bay frame ). I first want to apply and analyze only the loads that are assigned to the girders (eleLoads). Can anyone review this script and show me what I'm doing wrong? Is there anything else to help me other than the manual, the limited examples and this message board? Thank you.

i believe everything before the procDisplayShape2D command is correct however after that I still have much confusion.

set displayMode "displayON"

set in 1.;

set sec 1.;

set kip 1.;

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

set psi [expr $ksi/1000.];

set ft [expr 12.*$in];

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

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

set U 1.e10;

set u [expr 1/$U];

set Fy [expr 68.*$ksi];

set Es [expr 29000.*$ksi];

set Acole 101; # all exeterior columns are same

set Icole 4900;

set Acoli 117; # all interior columns are same

set Icoli 6000;

set Agird1 22.4; # 1 story girder

set Igird1 2100;

set Agird2 38.3; # 2 story girder

set Igird2 6710;

set Agird3 31.7; # 3 story girder

set Igird3 4470;

model BasicBuilder -ndm 2 -ndf 3

node 1 0.0 0.0

node 2 0.0 156.0

node 3 0.0 156.0

node 4 0.0 312.0

node 5 0.0 312.0

node 6 0.0 468.0

node 7 0.0 468.0

node 8 360.0 0.0

node 9 360.0 156.0

node 10 360.0 156.0

node 11 360.0 156.0

node 12 360.0 312.0

node 13 360.0 312.0

node 14 360.0 312.0

node 15 360.0 468.0

node 16 360.0 468.0

node 17 360.0 468.0

node 18 720.0 0.0

node 19 720.0 156.0

node 20 720.0 156.0

node 21 720.0 156.0

node 22 720.0 312.0

node 23 720.0 312.0

node 24 720.0 312.0

node 25 720.0 468.0

node 26 720.0 468.0

node 27 720.0 468.0

node 28 1080.0 0.0

node 29 1080.0 156.0

node 30 1080.0 156.0

node 31 1080.0 156.0

node 32 1080.0 312.0

node 33 1080.0 312.0

node 34 1080.0 312.0

node 35 1080.0 468.0

node 36 1080.0 468.0

node 37 1080.0 468.0

node 38 1440.0 0.0

node 39 1440.0 156.0

node 40 1440.0 156.0

node 41 1440.0 312.0

node 42 1440.0 312.0

node 43 1440.0 468.0

node 44 1440.0 468.0

fix 1 1 1 1

fix 8 1 1 1

fix 18 1 1 1

fix 28 1 1 1

fix 38 1 1 1

uniaxialMaterial ElasticPP 1 26290 0.005

source rotspring2D.tcl

geomTransf Linear 1

element elasticBeamColumn 25 1 2 $Acole $Es $Icole 1; # Exterior columns

element elasticBeamColumn 26 38 39 $Acole $Es $Icole 1

element elasticBeamColumn 27 2 4 $Acole $Es $Icole 1

element elasticBeamColumn 28 39 41 $Acole $Es $Icole 1

element elasticBeamColumn 29 4 6 $Acole $Es $Icole 1

element elasticBeamColumn 30 41 43 $Acole $Es $Icole 1

element elasticBeamColumn 31 7 16 $Agird3 $Es $Igird3 1; # 3 story girders

element elasticBeamColumn 32 17 26 $Agird3 $Es $Igird3 1

element elasticBeamColumn 33 27 36 $Agird3 $Es $Igird3 1

element elasticBeamColumn 34 37 44 $Agird3 $Es $Igird3 1

element elasticBeamColumn 35 5 13 $Agird2 $Es $Igird2 1; # 2 story girders

element elasticBeamColumn 36 14 23 $Agird2 $Es $Igird2 1

element elasticBeamColumn 37 24 33 $Agird2 $Es $Igird2 1

element elasticBeamColumn 38 34 42 $Agird2 $Es $Igird2 1

element elasticBeamColumn 39 3 10 $Agird1 $Es $Igird1 1; # 1 story girders

element elasticBeamColumn 40 11 20 $Agird1 $Es $Igird1 1

element elasticBeamColumn 41 21 30 $Agird1 $Es $Igird1 1

element elasticBeamColumn 42 31 40 $Agird1 $Es $Igird1 1

element elasticBeamColumn 43 8 9 $Acoli $Es $Icoli 1; # all same interior columns

element elasticBeamColumn 44 18 19 $Acoli $Es $Icoli 1

element elasticBeamColumn 45 28 29 $Acoli $Es $Icoli 1

element elasticBeamColumn 46 9 12 $Acoli $Es $Icoli 1

element elasticBeamColumn 47 19 22 $Acoli $Es $Icoli 1

element elasticBeamColumn 48 29 32 $Acoli $Es $Icoli 1

element elasticBeamColumn 49 12 15 $Acoli $Es $Icoli 1

element elasticBeamColumn 50 22 25 $Acoli $Es $Icoli 1

element elasticBeamColumn 51 32 35 $Acoli $Es $Icoli 1

pattern Plain 1 Constant {
eleLoad -ele 39 -type -beamUniform -0.009
eleLoad -ele 40 -type -beamUniform -0.009
eleLoad -ele 41 -type -beamUniform -0.009
eleLoad -ele 42 -type -beamUniform -0.009
eleLoad -ele 35 -type -beamUniform -0.0108333
eleLoad -ele 36 -type -beamUniform -0.0108333
eleLoad -ele 37 -type -beamUniform -0.0108333
eleLoad -ele 38 -type -beamUniform -0.0108333
eleLoad -ele 31 -type -beamUniform -0.0063333
eleLoad -ele 32 -type -beamUniform -0.0063333
eleLoad -ele 33 -type -beamUniform -0.0063333
eleLoad -ele 34 -type -beamUniform -0.0063333
}; # constant Gravity load

pattern Plain 2 Linear {
load 2 33.333 0 0
load 4 66.667 0 0
load 6 100.0 0 0
}

recorder Node -file StFrPZL1.out -time -node all -dof 1 disp; # record node displacements

recorder Element -file StFrPZL1el1.out -time -ele 1 forces; #record spring forces

recorder Element -file StFrPZL1el2.out -time -ele 2 forces

recorder Element -file StFrPZL1el3.out -time -ele 3 forces

recorder Element -file StFrPZL1el4.out -time -ele 4 forces

recorder Element -file StFrPZL1el5.out -time -ele 5 forces

recorder Element -file StFrPZL1el6.out -time -ele 6 forces

recorder Element -file StFrPZL1el7.out -time -ele 7 forces

recorder Element -file StFrPZL1el8.out -time -ele 8 forces

recorder Element -file StFrPZL1el9.out -time -ele 9 forces

recorder Element -file StFrPZL1el10.out -time -ele 10 forces

recorder Element -file StFrPZL1el11.out -time -ele 11 forces

recorder Element -file StFrPZL1el12.out -time -ele 12 forces

recorder Element -file StFrPZL1el13.out -time -ele 13 forces

recorder Element -file StFrPZL1el14.out -time -ele 14 forces

recorder Element -file StFrPZL1el15.out -time -ele 15 forces

recorder Element -file StFrPZL1el16.out -time -ele 16 forces

recorder Element -file StFrPZL1el17.out -time -ele 17 forces

recorder Element -file StFrPZL1el18.out -time -ele 18 forces

recorder Element -file StFrPZL1el19.out -time -ele 19 forces

recorder Element -file StFrPZL1el20.out -time -ele 20 forces

recorder Element -file StFrPZL1el21.out -time -ele 21 forces

recorder Element -file StFrPZL1el22.out -time -ele 22 forces

recorder Element -file StFrPZL1el23.out -time -ele 23 forces

recorder Element -file StFrPZL1el24.out -time -ele 24 forces

recorder Element -file StFrPZL1el25.out -time -ele 25 forces

recorder Element -file StFrPZL1el26.out -time -ele 26 forces

recorder Element -file StFrPZL1el27.out -time -ele 27 forces

recorder Element -file StFrPZL1el28.out -time -ele 28 forces

recorder Element -file StFrPZL1el29.out -time -ele 29 forces

recorder Element -file StFrPZL1el30.out -time -ele 30 forces

recorder Element -file StFrPZL1el31.out -time -ele 31 forces

recorder Element -file StFrPZL1el32.out -time -ele 32 forces

recorder Element -file StFrPZL1el33.out -time -ele 33 forces

recorder Element -file StFrPZL1el34.out -time -ele 34 forces

recorder Element -file StFrPZL1el35.out -time -ele 35 forces

recorder Element -file StFrPZL1el36.out -time -ele 36 forces

recorder Element -file StFrPZL1el37.out -time -ele 37 forces

recorder Element -file StFrPZL1el38.out -time -ele 38 forces

recorder Element -file StFrPZL1el39.out -time -ele 39 forces

recorder Element -file StFrPZL1el40.out -time -ele 40 forces

recorder Element -file StFrPZL1el41.out -time -ele 41 forces

recorder Element -file StFrPZL1el42.out -time -ele 42 forces

recorder Element -file StFrPZL1el43.out -time -ele 43 forces

recorder Element -file StFrPZL1el44.out -time -ele 44 forces

recorder Element -file StFrPZL1el45.out -time -ele 45 forces

recorder Element -file StFrPZL1el46.out -time -ele 46 forces

recorder Element -file StFrPZL1el47.out -time -ele 47 forces

recorder Element -file StFrPZL1el48.out -time -ele 48 forces

recorder Element -file StFrPZL1el49.out -time -ele 49 forces

recorder Element -file StFrPZL1el50.out -time -ele 50 forces

recorder Element -file StFrPZL1el51.out -time -ele 51 forces

proc procDisplayShape2D { ShapeType {dAmp 5} {xLoc 10} {yLoc 10} {xPixels 750} {yPixels 600} {nEigen 0} } {

global TunitTXT
set Xmin [lindex [nodeBounds] 0]; # view bounds in global coords - proc will add padding on the sides
set Ymin [lindex [nodeBounds] 1];
set Zmin [lindex [nodeBounds] 2];
set Xmax [lindex [nodeBounds] 3];
set Ymax [lindex [nodeBounds] 4];
set Zmax [lindex [nodeBounds] 5];


if {$ShapeType == "ModeShape" } {
set lambdaN [eigen $nEigen]; # perform eigenvalue analysis for ModeShape
set lambda [lindex $lambdaN [expr $nEigen-1]];
set omega [expr pow($lambda,0.5)]
set PI [expr 2*asin(1.0)]; # define constant
set Tperiod [expr 2*$PI/$omega]; # period (sec.)
set fmt1 "Mode Shape, Mode=%.1i Period=%.3f %s "
set windowTitle [format $fmt1 $nEigen $Tperiod $TunitTXT]
} elseif {$ShapeType == "NodeNumbers" } {
set windowTitle "Node Numbers"
} elseif {$ShapeType == "DeformedShape" } {
set windowTitle "Deformed Shape"
}

set viewPlane XY
recorder display $windowTitle $xLoc $yLoc $xPixels $yPixels -wipe ; # display recorder
procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen 0
};

integrator LoadControl 1 3 0.2 1

test EnergyIncr 1.0e-6 10 1

algorithm Newton

numberer Plain

constraints Transformation 1.0

system SparseGeneral

analysis Static

analyze 30

silvia
Posts: 3912
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia » Mon Jul 03, 2006 10:17 am

do you still have problems with this? if so, i'll look at it!
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104

Guest

Post by Guest » Wed Jul 05, 2006 8:05 am

silvia wrote:do you still have problems with this? if so, i'll look at it!
I am still having problems with this script. First, I don't know how to display the model. Does opensees open up a new window to display the model. Do I need some kind of program and do I need to open some file in it. Also I am not sure how to analyze only load pattern 1. Then analyze load pattern 1 and 2. anyhelp so that I get some numbers would be nice.

silvia
Posts: 3912
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia » Wed Jul 05, 2006 10:00 am

a couple of things.
1. first of all, the analysis does not run because your structure is not connected -- the beams are not connected to the columns. hence, the beams just fly away -- actually, the stiffness matrix is not positive definite.
2. use the elasticPP material very carefully as it has a zero tangent stiffness (i know you are not using it yet, right?)
3. here is a short way of writing the element recorders:

Code: Select all

for {set i 1} {$i <= 51} {incr i 1} {;							# added by Silvia Mazzoni 7/5/06
	recorder Element -file StFrPZL1el$i.out -time -ele $i forces; #record spring forces ;	# added by Silvia Mazzoni 7/5/06
};										# added by Silvia Mazzoni 7/5/06
and for the display, you only put in part of the set of procs. below is the code for a library file, call it display.tcl, and this is how you would call it

Code: Select all

source LibDisplay.tcl;				# added by Silvia Mazzoni 7/5/06
procDisplayShape2D NodeNumbers;			# added by Silvia Mazzoni 7/5/06

or 
procDisplayShape2D DeformedShape;			# added by Silvia Mazzoni 7/5/06
using the defaults, otherwise look over the procs to include where and the size of the window.
here
is what should be in your libDisplay.tcl (can modify this as it is not quite perfect, yet)

Code: Select all

######################################################################################
## procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen $quadrant
######################################################################################
proc procDisplayPlane {ShapeType dAmp viewPlane {nEigen 0}  {quadrant 0}} {
	######################################################################################
	## setup display parameters for specified viewPlane
	######################################################################################
	#### -- by Silvia Mazzoni, 2006 (mazzoni@berkeley_NO_SPAM_.edu)
	####
	#### 	ShapeType : 	type of shape to display. # options: ModeShape , NodeNumbers , DeformedShape 
	#### 	dAmp : 		relative amplification factor for deformations
	#### 	viewPlane :	set local xy axes in global coordinates (XY,YX,XZ,ZX,YZ,ZY)
	#### 	nEigen : 		if nEigen not=0, show mode shape for nEigen eigenvalue
	####	quadrant:		quadrant where to show this figure (0=full figure)
	####	
	######################################################################################

	set Xmin [lindex [nodeBounds] 0];	# view bounds in global coords - proc will add padding on the sides
	set Ymin [lindex [nodeBounds] 1];
	set Zmin [lindex [nodeBounds] 2];
	set Xmax [lindex [nodeBounds] 3];
	set Ymax [lindex [nodeBounds] 4];
	set Zmax [lindex [nodeBounds] 5];

	set Xo 0;	# center of local viewing system
	set Yo 0;
	set Zo 0;

	set uLocal [string index $viewPlane 0];	# viewPlane local-x axis in global coordinates
	set vLocal [string index $viewPlane 1];	# viewPlane local-y axis in global coordinates

	if {$viewPlane =="YZ" } {
		set uMin $Ymin
		set uMax $Ymax
		set vMin $Zmin
		set vMax $Zmax
		set wMin $Xmin
		set wMax $Xmax
	} elseif  {$viewPlane =="ZY" } {
		set uMin $Zmin
		set uMax $Zmax
		set vMin $Ymin
		set vMax $Ymax
		set wMin $Xmin
		set wMax $Xmax
	} elseif  {$viewPlane =="XY"  } {
		set uMin $Xmin
		set uMax $Xmax
		set vMin $Ymin
		set vMax $Ymax
		set wMin $Zmin
		set wMax $Zmax
	} elseif  {$viewPlane =="YX" } {
		set uMin $Ymin
		set uMax $Ymax
		set vMin $Xmin
		set vMax $Xmax
		set wMin $Zmin
		set wMax $Zmax
	} elseif  {$viewPlane =="XZ" } {
		set uMin $Xmin
		set uMax $Xmax
		set vMin $Zmin
		set vMax $Zmax
		set wMin $Ymin
		set wMax $Ymax
	} elseif  {$viewPlane =="ZX" } {
		set uMin $Zmin
		set uMax $Zmax
		set vMin $Xmin
		set vMax $Xmax
		set wMin $Ymin
		set wMax $Ymax
	} elseif  {$viewPlane =="3D" } {
		set uMin $Zmin+$Xmin
		set uMax $Zmax+$Xmax
		set vMin $Ymin
		set vMax $Ymax
		set wMin -10000
		set wMax 10000
		vup 0 1 0; # dirn defining up direction of view plane

	} else {
		return -1
	}

	set epsilon 1e-3;	# make windows width or height not zero when the Max and Min values of a coordinate are the same

	set uWide [expr $uMax - $uMin+$epsilon];
	set vWide [expr $vMax - $vMin+$epsilon];
	set uSide [expr 0.25*$uWide];
	set vSide [expr 0.25*$vWide];
	set uMin [expr $uMin - $uSide];
	set uMax [expr $uMax + $uSide];
	set vMin [expr $vMin - $vSide];
	set vMax [expr $vMax + $vSide];
	set uWide [expr $uMax - $uMin+$epsilon];
	set vWide [expr $vMax - $vMin+$epsilon];
	set uMid [expr ($uMin+$uMax)/2];
	set vMid [expr ($vMin+$vMax)/2];

	# keep the following general, as change the X and Y and Z for each view plane
	# next three commmands define viewing system, all values in global coords
	vrp $Xo $Yo $Zo;    # point on the view plane in global coord, center of local viewing system
	if {$vLocal == "X"} {
		vup 1 0 0; # dirn defining up direction of view plane
	} elseif {$vLocal == "Y"} {
		vup 0 1 0; # dirn defining up direction of view plane
	} elseif {$vLocal == "Z"} {
		vup 0 0 1; # dirn defining up direction of view plane
	}
	if {$viewPlane =="YZ" } {
		vpn 1 0 0; # direction of outward normal to view plane
		prp 10000. $uMid $vMid ; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="ZY" } {
		vpn -1 0 0; # direction of outward normal to view plane
		prp -10000. $vMid $uMid ; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="XY"  } {
		vpn 0 0 1; # direction of outward normal to view plane
		prp $uMid $vMid 10000; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="YX" } {
		vpn 0 0 -1; # direction of outward normal to view plane
		prp $uMid $vMid -10000; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="XZ" } {
		vpn 0 -1 0; # direction of outward normal to view plane
		prp $uMid -10000 $vMid ; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="ZX" } {
		vpn 0 1 0; # direction of outward normal to view plane
		prp $uMid 10000 $vMid ; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="3D" } {
		vpn 1 0.25 1; # direction of outward normal to view plane
		prp -100 $vMid 10000; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	}  else {
		return -1
	}
	# next three commands define view, all values in local coord system
	if  {$viewPlane =="3D" } {
		viewWindow [expr $uMin-$uWide/4] [expr $uMax/2] [expr $vMin-0.25*$vWide] [expr $vMax] 
	} else {
		viewWindow $uMin $uMax $vMin $vMax
	}
	projection 1; 	# projection mode, 0:prespective, 1: parallel
	fill 1; 		# fill mode; needed only for solid elements

	if {$quadrant == 0} {
		port -1 1 -1 1 	# area of window that will be drawn into (uMin,uMax,vMin,vMax);
	} elseif {$quadrant == 1} {
		port 0 1 0 1 	# area of window that will be drawn into (uMin,uMax,vMin,vMax);
	} elseif {$quadrant == 2} {
		port -1 0 0 1 	# area of window that will be drawn into (uMin,uMax,vMin,vMax);
	} elseif {$quadrant == 3} {
		port -1 0 -1 0 	# area of window that will be drawn into (uMin,uMax,vMin,vMax);
	} elseif {$quadrant == 4} {
		port 0 1 -1 0 	# area of window that will be drawn into (uMin,uMax,vMin,vMax);
	}

	if {$ShapeType ==  "ModeShape" } {
		display -$nEigen 0  [expr 5.*$dAmp]; 	# display mode shape for mode $nEigen
	} elseif  {$ShapeType ==  "NodeNumbers" } {
		display 1 -1 0  ; 		# display node numbers
	} elseif  {$ShapeType ==  "DeformedShape" }  {
		display 1 5 $dAmp; 		# display deformed shape
	}
};                                                                                                                                                          #
######################################################################################




######################################################################################
## procDisplayShape3D $ShapeType $dAmp $xLoc $yLoc $xPixels $yPixels $nEigen
######################################################################################

proc procDisplayShape3D { ShapeType {dAmp 5}  {xLoc 10} {yLoc 10} {xPixels 750} {yPixels 600} {nEigen 1} } {
	######################################################################################
	## display Node Numbers, Deformed or Mode Shape in all 3 planes
	######################################################################################
	#### -- by Silvia Mazzoni, 2006 (mazzoni@berkeley_NO_SPAM_.edu)
	####
	#### 	ShapeType : 	type of shape to display. # options: ModeShape , NodeNumbers , DeformedShape 
	#### 	dAmp : 		relative amplification factor for deformations
	#### 	xLoc,yLoc  : 	horizontal & vertical location in pixels of graphical window (0,0=upper left-most corner)
	#### 	xPixels,yPixels :	width & height of graphical window in pixels
	#### 	nEigen : 		if nEigen not=0, show mode shape for nEigen eigenvalue
	####	
	#######################################################################################

	global TunitTXT ;	# load global unit variable

	set Xmin [lindex [nodeBounds] 0];	# view bounds in global coords - proc will add padding on the sides
	set Ymin [lindex [nodeBounds] 1];
	set Zmin [lindex [nodeBounds] 2];
	set Xmax [lindex [nodeBounds] 3];
	set Ymax [lindex [nodeBounds] 4];
	set Zmax [lindex [nodeBounds] 5];


	if {$ShapeType ==  "ModeShape" } {
		set lambdaN [eigen $nEigen];		# perform eigenvalue analysis for ModeShape
		set lambda [lindex $lambdaN [expr $nEigen-1]];
		set omega [expr pow($lambda,0.5)]
		set PI 	[expr 2*asin(1.0)];		# define constant
		set Tperiod [expr 2*$PI/$omega];	   	# period
		set fmt1 "Mode Shape, Mode=%.1i Period=%.3f %s  "
		set windowTitle [format $fmt1 $nEigen $Tperiod $TunitTXT ]
	} elseif  {$ShapeType ==  "NodeNumbers" } {
		set windowTitle "Node Numbers"
	} elseif  {$ShapeType ==  "DeformedShape" } {
		set windowTitle0 "Deformed Shape "
	}

	if {$ShapeType ==  "DeformedShape" } {
		set xPixels [expr int($xPixels/2)]
		set yPixels [expr int($yPixels/2)]
		set xLoc1 [expr $xLoc+$xPixels]
		set yLoc1 [expr $yLoc+$yPixels]
		set planeTXT "-Plane"

		set viewPlane XY
		set windowTitle $windowTitle0$viewPlane$planeTXT
		recorder display $windowTitle $xLoc1 $yLoc $xPixels $yPixels  -wipe ; # display recorder
		procDisplayPlane $ShapeType $dAmp $viewPlane 
		set viewPlane ZY
		set windowTitle $windowTitle0$viewPlane$planeTXT
		recorder display $windowTitle $xLoc $yLoc $xPixels $yPixels  -wipe ; # display recorder
		procDisplayPlane $ShapeType $dAmp $viewPlane 
		set viewPlane ZX
		set windowTitle $windowTitle0$viewPlane$planeTXT
		recorder display $windowTitle $xLoc $yLoc1 $xPixels $yPixels  -wipe ; # display recorder
		procDisplayPlane $ShapeType $dAmp $viewPlane 
		set viewPlane 3D
		set windowTitle $windowTitle0$viewPlane
		recorder display $windowTitle $xLoc1 $yLoc1 $xPixels $yPixels  -wipe ; # display recorder
		procDisplayPlane $ShapeType $dAmp $viewPlane 

	} else {

		recorder display $windowTitle $xLoc $yLoc $xPixels $yPixels -nowipe; # display recorder
		set viewPlane XY
		procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen 1
		set viewPlane ZY
		procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen 2
		set viewPlane ZX
		procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen 3
		set viewPlane 3D
		procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen 4
	}

};                                                                                                                                                          #
######################################################################################



######################################################################################
## procDisplayShape2D $ShapeType $dAmp $xLoc $yLoc $xPixels $yPixels $nEigen
######################################################################################
proc procDisplayShape2D { ShapeType {dAmp 5}  {xLoc 10} {yLoc 10} {xPixels 750} {yPixels 600} {nEigen 0} } {
	######################################################################################
	## display Node Numbers, Deformed or Mode Shape in 2D problem
	######################################################################################
	#### -- by Silvia Mazzoni, 2006 (mazzoni@berkeley_NO_SPAM_.edu)
	####
	#### 	ShapeType : 	type of shape to display. # options: ModeShape , NodeNumbers , DeformedShape 
	#### 	dAmp : 		relative amplification factor for deformations
	#### 	xLoc,yLoc  : 	horizontal & vertical location in pixels of graphical window (0,0=upper left-most corner)
	#### 	xPixels,yPixels :	width & height of graphical window in pixels
	#### 	nEigen : 		if nEigen not=0, show mode shape for nEigen eigenvalue
	####	
	#######################################################################################
	global TunitTXT
	set Xmin [lindex [nodeBounds] 0];	# view bounds in global coords - proc will add padding on the sides
	set Ymin [lindex [nodeBounds] 1];
	set Zmin [lindex [nodeBounds] 2];
	set Xmax [lindex [nodeBounds] 3];
	set Ymax [lindex [nodeBounds] 4];
	set Zmax [lindex [nodeBounds] 5];


	if {$ShapeType ==  "ModeShape" } {
		set lambdaN [eigen $nEigen];		# perform eigenvalue analysis for ModeShape
		set lambda [lindex $lambdaN [expr $nEigen-1]];
		set omega [expr pow($lambda,0.5)]
		set PI 	[expr 2*asin(1.0)];		# define constant
		set Tperiod [expr 2*$PI/$omega];	   	# period (sec.) 
		set fmt1 "Mode Shape, Mode=%.1i Period=%.3f %s  "
		set windowTitle [format $fmt1 $nEigen $Tperiod  $TunitTXT]
	} elseif  {$ShapeType ==  "NodeNumbers" } {
		set windowTitle "Node Numbers"
	} elseif  {$ShapeType ==  "DeformedShape" } {
		set windowTitle "Deformed Shape"
	}

	set viewPlane XY
	recorder display $windowTitle $xLoc $yLoc $xPixels $yPixels  -wipe ; # display recorder
	procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen 0
};                                                                                                                                                          #
######################################################################################


######################################################################################
## procDisplayDefaults $dAmp
######################################################################################
proc procDisplayAll { {dAmp 5} } {
	######################################################################################
	## display Node Numbers, Deformed AND Mode Shape using default values.
	######################################################################################
	# view model -- node numbers
	global xPixels;
	global yPixels;
	global xLoc1;
	global yLoc1;
	global xLoc2;
	global yLoc2;
	global xLoc3;
	global yLoc3;

#	set  dAmp 5;	# relative amplification factor for deformations
	set viewEigen 1;	# eigenmode to be viewed
	procDisplayShape2D DeformedShape $dAmp $xLoc1 $yLoc1  $xPixels $yPixels
	procDisplayShape2D NodeNumbers $dAmp $xLoc2 $yLoc2  $xPixels $yPixels
	procDisplayShape2D ModeShape $dAmp $xLoc3 $yLoc3  $xPixels $yPixels  $viewEigen
};                                                                                                                                                          #
######################################################################################

######################################################################################
## procDisplayDefaults $dAmp
######################################################################################
proc procDisplayDefoShape { {dAmp 5} } {
	######################################################################################
	## display Node Numbers, Deformed AND Mode Shape using default values.
	######################################################################################
	# view model -- node numbers
	global xPixels;
	global yPixels;
	global xLoc1;
	global yLoc1;
	global xLoc2;
	global yLoc2;
	global xLoc3;
	global yLoc3;

#	set  dAmp 5;	# relative amplification factor for deformations
	set viewEigen 1;	# eigenmode to be viewed
	procDisplayShape2D DeformedShape $dAmp $xLoc1 $yLoc1  800 600
};                                                                                                                                                          #
######################################################################################
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104

Robert EY
Posts: 6
Joined: Thu Jun 22, 2006 3:31 pm

Post by Robert EY » Wed Jul 05, 2006 10:27 am

silvia wrote:a couple of things.
1. first of all, the analysis does not run because your structure is not connected -- the beams are not connected to the columns. hence, the beams just fly away -- actually, the stiffness matrix is not positive definite.
2. use the elasticPP material very carefully as it has a zero tangent stiffness (i know you are not using it yet, right?)
3. here is a short way of writing the element recorders:

Code: Select all

for {set i 1} {$i <= 51} {incr i 1} {;							# added by Silvia Mazzoni 7/5/06
	recorder Element -file StFrPZL1el$i.out -time -ele $i forces; #record spring forces ;	# added by Silvia Mazzoni 7/5/06
};										# added by Silvia Mazzoni 7/5/06
and for the display, you only put in part of the set of procs. below is the code for a library file, call it display.tcl, and this is how you would call it

Code: Select all

source LibDisplay.tcl;				# added by Silvia Mazzoni 7/5/06
procDisplayShape2D NodeNumbers;			# added by Silvia Mazzoni 7/5/06

or 
procDisplayShape2D DeformedShape;			# added by Silvia Mazzoni 7/5/06
using the defaults, otherwise look over the procs to include where and the size of the window.
here
is what should be in your libDisplay.tcl (can modify this as it is not quite perfect, yet)

Code: Select all

######################################################################################
## procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen $quadrant
######################################################################################
proc procDisplayPlane {ShapeType dAmp viewPlane {nEigen 0}  {quadrant 0}} {
	######################################################################################
	## setup display parameters for specified viewPlane
	######################################################################################
	#### -- by Silvia Mazzoni, 2006 (mazzoni@berkeley_NO_SPAM_.edu)
	####
	#### 	ShapeType : 	type of shape to display. # options: ModeShape , NodeNumbers , DeformedShape 
	#### 	dAmp : 		relative amplification factor for deformations
	#### 	viewPlane :	set local xy axes in global coordinates (XY,YX,XZ,ZX,YZ,ZY)
	#### 	nEigen : 		if nEigen not=0, show mode shape for nEigen eigenvalue
	####	quadrant:		quadrant where to show this figure (0=full figure)
	####	
	######################################################################################

	set Xmin [lindex [nodeBounds] 0];	# view bounds in global coords - proc will add padding on the sides
	set Ymin [lindex [nodeBounds] 1];
	set Zmin [lindex [nodeBounds] 2];
	set Xmax [lindex [nodeBounds] 3];
	set Ymax [lindex [nodeBounds] 4];
	set Zmax [lindex [nodeBounds] 5];

	set Xo 0;	# center of local viewing system
	set Yo 0;
	set Zo 0;

	set uLocal [string index $viewPlane 0];	# viewPlane local-x axis in global coordinates
	set vLocal [string index $viewPlane 1];	# viewPlane local-y axis in global coordinates

	if {$viewPlane =="YZ" } {
		set uMin $Ymin
		set uMax $Ymax
		set vMin $Zmin
		set vMax $Zmax
		set wMin $Xmin
		set wMax $Xmax
	} elseif  {$viewPlane =="ZY" } {
		set uMin $Zmin
		set uMax $Zmax
		set vMin $Ymin
		set vMax $Ymax
		set wMin $Xmin
		set wMax $Xmax
	} elseif  {$viewPlane =="XY"  } {
		set uMin $Xmin
		set uMax $Xmax
		set vMin $Ymin
		set vMax $Ymax
		set wMin $Zmin
		set wMax $Zmax
	} elseif  {$viewPlane =="YX" } {
		set uMin $Ymin
		set uMax $Ymax
		set vMin $Xmin
		set vMax $Xmax
		set wMin $Zmin
		set wMax $Zmax
	} elseif  {$viewPlane =="XZ" } {
		set uMin $Xmin
		set uMax $Xmax
		set vMin $Zmin
		set vMax $Zmax
		set wMin $Ymin
		set wMax $Ymax
	} elseif  {$viewPlane =="ZX" } {
		set uMin $Zmin
		set uMax $Zmax
		set vMin $Xmin
		set vMax $Xmax
		set wMin $Ymin
		set wMax $Ymax
	} elseif  {$viewPlane =="3D" } {
		set uMin $Zmin+$Xmin
		set uMax $Zmax+$Xmax
		set vMin $Ymin
		set vMax $Ymax
		set wMin -10000
		set wMax 10000
		vup 0 1 0; # dirn defining up direction of view plane

	} else {
		return -1
	}

	set epsilon 1e-3;	# make windows width or height not zero when the Max and Min values of a coordinate are the same

	set uWide [expr $uMax - $uMin+$epsilon];
	set vWide [expr $vMax - $vMin+$epsilon];
	set uSide [expr 0.25*$uWide];
	set vSide [expr 0.25*$vWide];
	set uMin [expr $uMin - $uSide];
	set uMax [expr $uMax + $uSide];
	set vMin [expr $vMin - $vSide];
	set vMax [expr $vMax + $vSide];
	set uWide [expr $uMax - $uMin+$epsilon];
	set vWide [expr $vMax - $vMin+$epsilon];
	set uMid [expr ($uMin+$uMax)/2];
	set vMid [expr ($vMin+$vMax)/2];

	# keep the following general, as change the X and Y and Z for each view plane
	# next three commmands define viewing system, all values in global coords
	vrp $Xo $Yo $Zo;    # point on the view plane in global coord, center of local viewing system
	if {$vLocal == "X"} {
		vup 1 0 0; # dirn defining up direction of view plane
	} elseif {$vLocal == "Y"} {
		vup 0 1 0; # dirn defining up direction of view plane
	} elseif {$vLocal == "Z"} {
		vup 0 0 1; # dirn defining up direction of view plane
	}
	if {$viewPlane =="YZ" } {
		vpn 1 0 0; # direction of outward normal to view plane
		prp 10000. $uMid $vMid ; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="ZY" } {
		vpn -1 0 0; # direction of outward normal to view plane
		prp -10000. $vMid $uMid ; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="XY"  } {
		vpn 0 0 1; # direction of outward normal to view plane
		prp $uMid $vMid 10000; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="YX" } {
		vpn 0 0 -1; # direction of outward normal to view plane
		prp $uMid $vMid -10000; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="XZ" } {
		vpn 0 -1 0; # direction of outward normal to view plane
		prp $uMid -10000 $vMid ; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="ZX" } {
		vpn 0 1 0; # direction of outward normal to view plane
		prp $uMid 10000 $vMid ; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	} elseif  {$viewPlane =="3D" } {
		vpn 1 0.25 1; # direction of outward normal to view plane
		prp -100 $vMid 10000; # eye location in local coord sys defined by viewing system
		plane 10000 -10000; # distance to front and back clipping planes from eye
	}  else {
		return -1
	}
	# next three commands define view, all values in local coord system
	if  {$viewPlane =="3D" } {
		viewWindow [expr $uMin-$uWide/4] [expr $uMax/2] [expr $vMin-0.25*$vWide] [expr $vMax] 
	} else {
		viewWindow $uMin $uMax $vMin $vMax
	}
	projection 1; 	# projection mode, 0:prespective, 1: parallel
	fill 1; 		# fill mode; needed only for solid elements

	if {$quadrant == 0} {
		port -1 1 -1 1 	# area of window that will be drawn into (uMin,uMax,vMin,vMax);
	} elseif {$quadrant == 1} {
		port 0 1 0 1 	# area of window that will be drawn into (uMin,uMax,vMin,vMax);
	} elseif {$quadrant == 2} {
		port -1 0 0 1 	# area of window that will be drawn into (uMin,uMax,vMin,vMax);
	} elseif {$quadrant == 3} {
		port -1 0 -1 0 	# area of window that will be drawn into (uMin,uMax,vMin,vMax);
	} elseif {$quadrant == 4} {
		port 0 1 -1 0 	# area of window that will be drawn into (uMin,uMax,vMin,vMax);
	}

	if {$ShapeType ==  "ModeShape" } {
		display -$nEigen 0  [expr 5.*$dAmp]; 	# display mode shape for mode $nEigen
	} elseif  {$ShapeType ==  "NodeNumbers" } {
		display 1 -1 0  ; 		# display node numbers
	} elseif  {$ShapeType ==  "DeformedShape" }  {
		display 1 5 $dAmp; 		# display deformed shape
	}
};                                                                                                                                                          #
######################################################################################




######################################################################################
## procDisplayShape3D $ShapeType $dAmp $xLoc $yLoc $xPixels $yPixels $nEigen
######################################################################################

proc procDisplayShape3D { ShapeType {dAmp 5}  {xLoc 10} {yLoc 10} {xPixels 750} {yPixels 600} {nEigen 1} } {
	######################################################################################
	## display Node Numbers, Deformed or Mode Shape in all 3 planes
	######################################################################################
	#### -- by Silvia Mazzoni, 2006 (mazzoni@berkeley_NO_SPAM_.edu)
	####
	#### 	ShapeType : 	type of shape to display. # options: ModeShape , NodeNumbers , DeformedShape 
	#### 	dAmp : 		relative amplification factor for deformations
	#### 	xLoc,yLoc  : 	horizontal & vertical location in pixels of graphical window (0,0=upper left-most corner)
	#### 	xPixels,yPixels :	width & height of graphical window in pixels
	#### 	nEigen : 		if nEigen not=0, show mode shape for nEigen eigenvalue
	####	
	#######################################################################################

	global TunitTXT ;	# load global unit variable

	set Xmin [lindex [nodeBounds] 0];	# view bounds in global coords - proc will add padding on the sides
	set Ymin [lindex [nodeBounds] 1];
	set Zmin [lindex [nodeBounds] 2];
	set Xmax [lindex [nodeBounds] 3];
	set Ymax [lindex [nodeBounds] 4];
	set Zmax [lindex [nodeBounds] 5];


	if {$ShapeType ==  "ModeShape" } {
		set lambdaN [eigen $nEigen];		# perform eigenvalue analysis for ModeShape
		set lambda [lindex $lambdaN [expr $nEigen-1]];
		set omega [expr pow($lambda,0.5)]
		set PI 	[expr 2*asin(1.0)];		# define constant
		set Tperiod [expr 2*$PI/$omega];	   	# period
		set fmt1 "Mode Shape, Mode=%.1i Period=%.3f %s  "
		set windowTitle [format $fmt1 $nEigen $Tperiod $TunitTXT ]
	} elseif  {$ShapeType ==  "NodeNumbers" } {
		set windowTitle "Node Numbers"
	} elseif  {$ShapeType ==  "DeformedShape" } {
		set windowTitle0 "Deformed Shape "
	}

	if {$ShapeType ==  "DeformedShape" } {
		set xPixels [expr int($xPixels/2)]
		set yPixels [expr int($yPixels/2)]
		set xLoc1 [expr $xLoc+$xPixels]
		set yLoc1 [expr $yLoc+$yPixels]
		set planeTXT "-Plane"

		set viewPlane XY
		set windowTitle $windowTitle0$viewPlane$planeTXT
		recorder display $windowTitle $xLoc1 $yLoc $xPixels $yPixels  -wipe ; # display recorder
		procDisplayPlane $ShapeType $dAmp $viewPlane 
		set viewPlane ZY
		set windowTitle $windowTitle0$viewPlane$planeTXT
		recorder display $windowTitle $xLoc $yLoc $xPixels $yPixels  -wipe ; # display recorder
		procDisplayPlane $ShapeType $dAmp $viewPlane 
		set viewPlane ZX
		set windowTitle $windowTitle0$viewPlane$planeTXT
		recorder display $windowTitle $xLoc $yLoc1 $xPixels $yPixels  -wipe ; # display recorder
		procDisplayPlane $ShapeType $dAmp $viewPlane 
		set viewPlane 3D
		set windowTitle $windowTitle0$viewPlane
		recorder display $windowTitle $xLoc1 $yLoc1 $xPixels $yPixels  -wipe ; # display recorder
		procDisplayPlane $ShapeType $dAmp $viewPlane 

	} else {

		recorder display $windowTitle $xLoc $yLoc $xPixels $yPixels -nowipe; # display recorder
		set viewPlane XY
		procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen 1
		set viewPlane ZY
		procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen 2
		set viewPlane ZX
		procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen 3
		set viewPlane 3D
		procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen 4
	}

};                                                                                                                                                          #
######################################################################################



######################################################################################
## procDisplayShape2D $ShapeType $dAmp $xLoc $yLoc $xPixels $yPixels $nEigen
######################################################################################
proc procDisplayShape2D { ShapeType {dAmp 5}  {xLoc 10} {yLoc 10} {xPixels 750} {yPixels 600} {nEigen 0} } {
	######################################################################################
	## display Node Numbers, Deformed or Mode Shape in 2D problem
	######################################################################################
	#### -- by Silvia Mazzoni, 2006 (mazzoni@berkeley_NO_SPAM_.edu)
	####
	#### 	ShapeType : 	type of shape to display. # options: ModeShape , NodeNumbers , DeformedShape 
	#### 	dAmp : 		relative amplification factor for deformations
	#### 	xLoc,yLoc  : 	horizontal & vertical location in pixels of graphical window (0,0=upper left-most corner)
	#### 	xPixels,yPixels :	width & height of graphical window in pixels
	#### 	nEigen : 		if nEigen not=0, show mode shape for nEigen eigenvalue
	####	
	#######################################################################################
	global TunitTXT
	set Xmin [lindex [nodeBounds] 0];	# view bounds in global coords - proc will add padding on the sides
	set Ymin [lindex [nodeBounds] 1];
	set Zmin [lindex [nodeBounds] 2];
	set Xmax [lindex [nodeBounds] 3];
	set Ymax [lindex [nodeBounds] 4];
	set Zmax [lindex [nodeBounds] 5];


	if {$ShapeType ==  "ModeShape" } {
		set lambdaN [eigen $nEigen];		# perform eigenvalue analysis for ModeShape
		set lambda [lindex $lambdaN [expr $nEigen-1]];
		set omega [expr pow($lambda,0.5)]
		set PI 	[expr 2*asin(1.0)];		# define constant
		set Tperiod [expr 2*$PI/$omega];	   	# period (sec.) 
		set fmt1 "Mode Shape, Mode=%.1i Period=%.3f %s  "
		set windowTitle [format $fmt1 $nEigen $Tperiod  $TunitTXT]
	} elseif  {$ShapeType ==  "NodeNumbers" } {
		set windowTitle "Node Numbers"
	} elseif  {$ShapeType ==  "DeformedShape" } {
		set windowTitle "Deformed Shape"
	}

	set viewPlane XY
	recorder display $windowTitle $xLoc $yLoc $xPixels $yPixels  -wipe ; # display recorder
	procDisplayPlane $ShapeType $dAmp $viewPlane $nEigen 0
};                                                                                                                                                          #
######################################################################################


######################################################################################
## procDisplayDefaults $dAmp
######################################################################################
proc procDisplayAll { {dAmp 5} } {
	######################################################################################
	## display Node Numbers, Deformed AND Mode Shape using default values.
	######################################################################################
	# view model -- node numbers
	global xPixels;
	global yPixels;
	global xLoc1;
	global yLoc1;
	global xLoc2;
	global yLoc2;
	global xLoc3;
	global yLoc3;

#	set  dAmp 5;	# relative amplification factor for deformations
	set viewEigen 1;	# eigenmode to be viewed
	procDisplayShape2D DeformedShape $dAmp $xLoc1 $yLoc1  $xPixels $yPixels
	procDisplayShape2D NodeNumbers $dAmp $xLoc2 $yLoc2  $xPixels $yPixels
	procDisplayShape2D ModeShape $dAmp $xLoc3 $yLoc3  $xPixels $yPixels  $viewEigen
};                                                                                                                                                          #
######################################################################################

######################################################################################
## procDisplayDefaults $dAmp
######################################################################################
proc procDisplayDefoShape { {dAmp 5} } {
	######################################################################################
	## display Node Numbers, Deformed AND Mode Shape using default values.
	######################################################################################
	# view model -- node numbers
	global xPixels;
	global yPixels;
	global xLoc1;
	global yLoc1;
	global xLoc2;
	global yLoc2;
	global xLoc3;
	global yLoc3;

#	set  dAmp 5;	# relative amplification factor for deformations
	set viewEigen 1;	# eigenmode to be viewed
	procDisplayShape2D DeformedShape $dAmp $xLoc1 $yLoc1  800 600
};                                                                                                                                                          #
######################################################################################
what do you mean my columns and beams are not connected. How do I connect them. I am following the steel frame example 1 which has rotational springs. heres my rotspring2D.tcl.



proc rotSpring2D { 1 2 3 1} {

element zeroLength 1 2 3 -mat 1 -dir 6

equalDOF 2 3 1 2
}

proc rotSpring2D { 2 5 6 1} {

element zeroLength 2 5 6 -mat 1 -dir 6

equalDOF 5 6 1 2
}

proc rotSpring2D { 3 6 7 1} {

element zeroLength 3 6 7 -mat 1 -dir 6

equalDOF 6 7 1 2
}

proc rotSpring2D { 4 16 15 1} {

element zeroLength 4 16 15 -mat 1 -dir 6

equalDOF 16 15 1 2
}

proc rotSpring2D { 5 13 12 1} {

element zeroLength 5 13 12 -mat 1 -dir 6

equalDOF 13 12 1 2
}

proc rotSpring2D { 6 10 9 1} {

element zeroLength 6 10 9 -mat 1 -dir 6

equalDOF 10 9 1 2
}

proc rotSpring2D { 7 9 11 1} {

element zeroLength 7 9 11 -mat 1 -dir 6

equalDOF 9 11 1 2
}

proc rotSpring2D { 8 12 14 1} {

element zeroLength 8 12 14 -mat 1 -dir 6

equalDOF 12 14 1 2
}

proc rotSpring2D { 9 15 17 1} {

element zeroLength 9 15 17 -mat 1 -dir 6

equalDOF 15 17 1 2
}

proc rotSpring2D { 10 26 25 1} {

element zeroLength 10 26 25 -mat 1 -dir 6

equalDOF 26 25 1 2
}

proc rotSpring2D { 11 23 22 1} {

element zeroLength 11 23 22 -mat 1 -dir 6

equalDOF 23 22 1 2
}

proc rotSpring2D { 12 20 19 1} {

element zeroLength 12 20 19 -mat 1 -dir 6

equalDOF 20 19 1 2
}

proc rotSpring2D { 13 19 21 1} {

element zeroLength 13 19 21 -mat 1 -dir 6

equalDOF 19 21 1 2
}

proc rotSpring2D { 14 22 24 1} {

element zeroLength 14 22 24 -mat 1 -dir 6

equalDOF 22 24 1 2
}

proc rotSpring2D { 15 25 27 1} {

element zeroLength 15 25 27 -mat 1 -dir 6

equalDOF 25 27 1 2
}

proc rotSpring2D { 16 36 35 1} {

element zeroLength 16 36 35 -mat 1 -dir 6

equalDOF 36 35 1 2
}

proc rotSpring2D { 17 33 32 1} {

element zeroLength 17 33 32 -mat 1 -dir 6

equalDOF 33 32 1 2
}

proc rotSpring2D { 18 30 29 1} {

element zeroLength 18 30 29 -mat 1 -dir 6

equalDOF 30 29 1 2
}

proc rotSpring2D { 19 29 31 1} {

element zeroLength 19 29 31 -mat 1 -dir 6

equalDOF 29 31 1 2
}

proc rotSpring2D { 20 32 34 1} {

element zeroLength 20 32 34 -mat 1 -dir 6

equalDOF 32 34 1 2
}

proc rotSpring2D { 21 35 37 1} {

element zeroength 21 35 37 -mat 1 -dir 6

equalDOF 35 37 1 2
}

proc rotSpring2D { 22 44 43 1} {

element zeroLength 22 44 43 -mat 1 -dir 6

equalDOF 44 43 1 2
}

proc rotSpring2D { 23 42 41 1} {

element zeroLength 23 42 41 -mat 1 -dir 6

equalDOF 42 41 1 2
}

proc rotSpring2D { 24 40 39 1} {

element zeroLength 24 40 39 -mat 1 -dir 6

equalDOF 40 39 1 2
}

silvia
Posts: 3912
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia » Wed Jul 05, 2006 11:10 am

???
you are defining one proc after the other, overwriting the previous one, but a proc is just a definition, you have to execute it.
my proc file looks like this:

Code: Select all

# rotSpring2D.tcl
# Procedure which creates a rotational spring for a planar problem
#
# SETS A MULTIPOINT CONSTRAINT ON THE TRANSLATIONAL DEGREES OF FREEDOM,
# SO DO NOT USE THIS PROCEDURE IF THERE ARE TRANSLATIONAL ZEROLENGTH
# ELEMENTS ALSO BEING USED BETWEEN THESE TWO NODES
#
# Written: MHS
# Date: Jan 2000
#
# Formal arguments
#	eleID - unique element ID for this zero length rotational spring
#	nodeR - node ID which will be retained by the multi-point constraint
#	nodeC - node ID which will be constrained by the multi-point constraint
#	matID - material ID which represents the moment-rotation relationship
#		for the spring

proc rotSpring2D {eleID nodeR nodeC matID} {
	# Create the zero length element
	element zeroLength $eleID $nodeR $nodeC -mat $matID -dir 6

	# Constrain the translational DOF with a multi-point constraint
	#          retained constrained DOF_1 DOF_2 ... DOF_n
	equalDOF    $nodeR     $nodeC     1     2
}
which only defines the proc, then you call the proc to define all the elements:

rotSpring2D $eleID $nodeR $nodeC $matID

in your case, i'd have:
rotSpring2D 3 6 7 1
rotSpring2D 4 16 15 1

and so on....

you might want to read-up on Tcl procs

hope this helps[/code][/quote]
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104

Guest

Post by Guest » Thu Jul 06, 2006 9:48 am

Thank you so much for your help. I'm still having some problems. When I source in my file it says UmfpackGenLinSOE: set size -n 69 nnz 645 lVal 12900, what does this mean and what do I do. Also part of my frame is being displayed, but its different each time I source in the same file. Can you please help. Right next to the title of the window it says "not responding". Heres my script again.


set displayMode "displayON"

set in 1.;

set sec 1.;

set kip 1.;

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

set psi [expr $ksi/1000.];

set ft [expr 12.*$in];

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

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

set U 1.e10;

set u [expr 1/$U];

set Fy [expr 68.*$ksi];

set Es [expr 29000.*$ksi];

set Acole 101; # all exeterior columns are same

set Icole 4900;

set Acoli 117; # all interior columns are same

set Icoli 6000;

set Agird1 22.4; # 1 story girder

set Igird1 2100;

set Agird2 38.3; # 2 story girder

set Igird2 6710;

set Agird3 31.7; # 3 story girder

set Igird3 4470;

model BasicBuilder -ndm 2 -ndf 3

node 1 0.0 0.0

node 2 0.0 156.0

node 3 0.0 156.0

node 4 0.0 312.0

node 5 0.0 312.0

node 6 0.0 468.0

node 7 0.0 468.0

node 8 360.0 0.0

node 9 360.0 156.0

node 10 360.0 156.0

node 11 360.0 156.0

node 12 360.0 312.0

node 13 360.0 312.0

node 14 360.0 312.0

node 15 360.0 468.0

node 16 360.0 468.0

node 17 360.0 468.0

node 18 720.0 0.0

node 19 720.0 156.0

node 20 720.0 156.0

node 21 720.0 156.0

node 22 720.0 312.0

node 23 720.0 312.0

node 24 720.0 312.0

node 25 720.0 468.0

node 26 720.0 468.0

node 27 720.0 468.0

node 28 1080.0 0.0

node 29 1080.0 156.0

node 30 1080.0 156.0

node 31 1080.0 156.0

node 32 1080.0 312.0

node 33 1080.0 312.0

node 34 1080.0 312.0

node 35 1080.0 468.0

node 36 1080.0 468.0

node 37 1080.0 468.0

node 38 1440.0 0.0

node 39 1440.0 156.0

node 40 1440.0 156.0

node 41 1440.0 312.0

node 42 1440.0 312.0

node 43 1440.0 468.0

node 44 1440.0 468.0

fix 1 1 1 1

fix 8 1 1 1

fix 18 1 1 1

fix 28 1 1 1

fix 38 1 1 1

uniaxialMaterial ElasticPP 1 26290 0.005

source rotspring2D.tcl

rotSpring2D 1 2 3 1

rotSpring2D 2 4 5 1

rotSpring2D 3 6 7 1

rotSpring2D 4 16 15 1

rotSpring2D 5 13 12 1

rotSpring2D 6 10 9 1

rotSpring2D 7 9 11 1

rotSpring2D 8 12 14 1

rotSpring2D 9 15 17 1

rotSpring2D 10 26 25 1

rotSpring2D 11 23 22 1

rotSpring2D 12 20 19 1

rotSpring2D 13 19 21 1

rotSpring2D 14 22 24 1

rotSpring2D 15 25 27 1

rotSpring2D 16 36 35 1

rotSpring2D 17 33 32 1

rotSpring2D 18 30 29 1

rotSpring2D 19 29 31 1

rotSpring2D 20 32 34 1

rotSpring2D 21 35 37 1

rotSpring2D 22 44 43 1

rotSpring2D 23 42 41 1

rotSpring2D 24 40 39 1

geomTransf Linear 1

element elasticBeamColumn 25 1 2 $Acole $Es $Icole 1; # Exterior columns

element elasticBeamColumn 26 38 39 $Acole $Es $Icole 1

element elasticBeamColumn 27 2 4 $Acole $Es $Icole 1

element elasticBeamColumn 28 39 41 $Acole $Es $Icole 1

element elasticBeamColumn 29 4 6 $Acole $Es $Icole 1

element elasticBeamColumn 30 41 43 $Acole $Es $Icole 1

element elasticBeamColumn 31 7 16 $Agird3 $Es $Igird3 1; # 3 story girders

element elasticBeamColumn 32 17 26 $Agird3 $Es $Igird3 1

element elasticBeamColumn 33 27 36 $Agird3 $Es $Igird3 1

element elasticBeamColumn 34 37 44 $Agird3 $Es $Igird3 1

element elasticBeamColumn 35 5 13 $Agird2 $Es $Igird2 1; # 2 story girders

element elasticBeamColumn 36 14 23 $Agird2 $Es $Igird2 1

element elasticBeamColumn 37 24 33 $Agird2 $Es $Igird2 1

element elasticBeamColumn 38 34 42 $Agird2 $Es $Igird2 1

element elasticBeamColumn 39 3 10 $Agird1 $Es $Igird1 1; # 1 story girders

element elasticBeamColumn 40 11 20 $Agird1 $Es $Igird1 1

element elasticBeamColumn 41 21 30 $Agird1 $Es $Igird1 1

element elasticBeamColumn 42 31 40 $Agird1 $Es $Igird1 1

element elasticBeamColumn 43 8 9 $Acoli $Es $Icoli 1; # all same interior columns

element elasticBeamColumn 44 18 19 $Acoli $Es $Icoli 1

element elasticBeamColumn 45 28 29 $Acoli $Es $Icoli 1

element elasticBeamColumn 46 9 12 $Acoli $Es $Icoli 1

element elasticBeamColumn 47 19 22 $Acoli $Es $Icoli 1

element elasticBeamColumn 48 29 32 $Acoli $Es $Icoli 1

element elasticBeamColumn 49 12 15 $Acoli $Es $Icoli 1

element elasticBeamColumn 50 22 25 $Acoli $Es $Icoli 1

element elasticBeamColumn 51 32 35 $Acoli $Es $Icoli 1

pattern Plain 1 Constant {
eleLoad -ele 39 -type -beamUniform -0.009
eleLoad -ele 40 -type -beamUniform -0.009
eleLoad -ele 41 -type -beamUniform -0.009
eleLoad -ele 42 -type -beamUniform -0.009
eleLoad -ele 35 -type -beamUniform -0.0108333
eleLoad -ele 36 -type -beamUniform -0.0108333
eleLoad -ele 37 -type -beamUniform -0.0108333
eleLoad -ele 38 -type -beamUniform -0.0108333
eleLoad -ele 31 -type -beamUniform -0.0063333
eleLoad -ele 32 -type -beamUniform -0.0063333
eleLoad -ele 33 -type -beamUniform -0.0063333
eleLoad -ele 34 -type -beamUniform -0.0063333
}; # constant Gravity load

pattern Plain 2 Linear {
load 2 33.333 0 0
load 4 66.667 0 0
load 6 100.0 0 0
}

for {set i 1} {$i <= 51} {incr i 1} {; # added by Silvia Mazzoni 7/5/06
recorder Element -file StFrPZL1el$i.out -time -ele $i forces; #record spring forces ; # added by Silvia Mazzoni 7/5/06
};

source LibDisplay.tcl

procDisplayShape2D NodeNumbers

integrator LoadControl 1 3 0.2 1

test EnergyIncr 1.0e-6 10 1

algorithm Newton

numberer RCM

constraints Transformation 1.0

system UmfPack

analysis Static

analyze 30

silvia
Posts: 3912
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia » Thu Jul 06, 2006 10:13 am

it looks fine, and it runs fine.
the output comes from the solver, it's nothing important, it gives information about what the solver is doing.

i have no problem with the viewer, you might want to minimize all windows and move your opensees window away from where the picture is going to be displayed. otherwise, i don't know what's up.
you might want to make sure you are running the latest version of opensees.
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104

Guest

Post by Guest » Thu Jul 06, 2006 10:48 am

silvia wrote:it looks fine, and it runs fine.
the output comes from the solver, it's nothing important, it gives information about what the solver is doing.

i have no problem with the viewer, you might want to minimize all windows and move your opensees window away from where the picture is going to be displayed. otherwise, i don't know what's up.
you might want to make sure you are running the latest version of opensees.
Thank you

Guest

Post by Guest » Thu Jul 06, 2006 11:52 am

When I type print ele, it gives me axial force, shear force, and moment. The numbers I get do not match up with SAP. Opensees gives me way bigger values. I did the analysis in SAP in units of kips and inches. Are my units correct in Opensees. If not can you explain what I'm doing wrong? Thanks again.

silvia
Posts: 3912
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia » Thu Jul 06, 2006 12:55 pm

it seems fine to me, so i can't tell how the models are different.
most of your intput does not have units specified, so i can't really check them.
how do your numbers match with a hand calculation?
have you tried using rigid links at the beam ends and checking those numbers?
do the reaction forces make sense? that's where i'd start.
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104

JamesDub
Posts: 2
Joined: Thu Sep 25, 2008 8:11 am
Contact:

Post by JamesDub » Fri Sep 26, 2008 2:57 am

Thank Silvia...I had the same problem and now I know what to do :) ;)
Jerry James

Post Reply