spring example - load control - openseesopensees.berkeley.edu/opensees/workshops/openseesdays...set...

15
1 Frank McKenna UC Berkeley Basic Modeling With Simple Examples OpenSees Days 2011 http://opensees.berkeley.edu/wiki/index.php/OpenSeesDays2011 2 P (100) (1) 1 E (30000) 0.1E (3000) Fy (60) U F # create the model builder model Basic -ndm 1 -ndf 1 # create an analysis constraints Plain numberer RCM test NormDispIncr 1.0e-6 6 0 algorithm Newton system ProfileSPD integrator LoadControl 0.1 analysis Static # perform the analysis analyze 10 # Output print node 2 set exact [expr $Fy/$E + (100-$Fy)/($b*$E)] set res [lindex [nodeDisp 2] 0] if {$exact == $res} { puts "Exact ($exact) EQUALS Result ($res)" } else { puts "Exact ($exact) NOT EQUAL Result ($res)" } a.tcl Spring Example - Load Control # create 2 nodes node 1 0.0 node 2 0.0 # fix node 1 fix 1 1 # create material set Fy 60.0 set E 30000.0 set b 0.1 uniaxialMaterial Steel01 1 $Fy $E $b # create time series and load pattern set P 100.0 timeSeries Linear 1 pattern Plain 1 1 { load 2 $P } # create element element zeroLength 1 1 2 -mat 1 -dir 1

Upload: lydat

Post on 12-May-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

1

Frank McKennaUC Berkeley

Basic ModelingWith

Simple Examples

OpenSees Days 2011

http://opensees.berkeley.edu/wiki/index.php/OpenSeesDays2011

2P (100)

(1)1

E (30000)

0.1E (3000)Fy (60)

U

F

# create the model builder model Basic -ndm 1 -ndf 1 # create an analysis

constraints Plainnumberer RCMtest NormDispIncr 1.0e-6 6 0algorithm Newtonsystem ProfileSPDintegrator LoadControl 0.1analysis Static# perform the analysis analyze 10# Output print node 2set exact [expr $Fy/$E + (100-$Fy)/($b*$E)]set res [lindex [nodeDisp 2] 0]if {$exact == $res} { puts "Exact ($exact) EQUALS Result ($res)"} else { puts "Exact ($exact) NOT EQUAL Result ($res)"}

a.tclSpring Example - Load Control

# create 2 nodes node 1 0.0node 2 0.0# fix node 1 fix 1 1# create material set Fy 60.0set E 30000.0set b 0.1uniaxialMaterial Steel01 1 $Fy $E $b

# create time series and load pattern set P 100.0 timeSeries Linear 1pattern Plain 1 1 { load 2 $P}

# create element element zeroLength 1 1 2 -mat 1 -dir 1

2

Computers cannot represent all numbers exactly and

Computer math involves roundoff

2P (100)

(1)1

E (30000)

-0.1E (-3000)Fy (60)

U

F

# create the model builder model Basic -ndm 1 -ndf 1# create 2 nodes node 1 0.0node 2 0.0# fix node 1 fix 1 1# create material set Fy 60.0set E 30000.0set b -0.1uniaxialMaterial Steel01 1 $Fy $E $b# create element element zeroLength 1 1 2 -mat 1 -dir 1# create time series and load pattern set P 100.0 timeSeries Linear 1pattern Plain 1 1 { load 2 $P}

# create an analysis constraints Plainnumberer RCMtest NormDispIncr 1.0e-6 6 0algorithm Newtonsystem ProfileSPDintegrator LoadControl 0.1analysis Static

# perform the analysis analyze 10# Output print node 2

b.tcl

3

change system ProfileSPD to system BandGen

50

change LoadControl 0.1 to LoadControl 0.0999999

2P (100)

(1)1

E (30000)

-0.1E (-3000)Fy (60)

U

F

# create the model builder model Basic -ndm 1 -ndf 1# create 2 nodes node 1 0.0node 2 0.0# fix node 1 fix 1 1# create material set Fy 60.0set E 30000.0set b -0.1uniaxialMaterial Steel01 1 $Fy $E $b# create element element zeroLength 1 1 2 -mat 1 -dir 1# create time series and load pattern set P 100.0 timeSeries Linear 1pattern Plain 1 1 { load 2 $P}

# create an analysis constraints Plainnumberer RCMtest NormDispIncr 1.0e-6 6 0algorithm Newtonsystem BandGenintegrator LoadControl 0.09999analysis Static

# perform the analysis analyze 10# Output print node 2

c.tcl

4

E (30000)

-0.1E (-3000)Fy (60) F

With a Yield Strength of 60This is as far as we can push the

Model using LoadControl

We can go further using a Displacement Control scheme

2P (100)

(1)1

E (30000)

-0.1E (-3000)Fy (60)

U

F

# create the model builder model Basic -ndm 1 -ndf 1# create 2 nodes node 1 0.0node 2 0.0# fix node 1 fix 1 1# create material set Fy 60.0set E 30000.0set b -0.1uniaxialMaterial Steel01 1 $Fy $E $b# create element element zeroLength 1 1 2 -mat 1 -dir 1# create time series and load pattern set P 100.0 timeSeries Linear 1pattern Plain 1 1 { load 2 $P}

# create an analysis constraints Plainnumberer RCMtest NormDispIncr 1.0e-12 6 0algorithm Newtonsystem BandGenintegrator DisplacementControl 2 1 0.001analysis Static

# perform the analysis & print resultsfor {set i 0} {$i < 10} {incr i 1} { analyze 1 set factor [getTime] puts "[expr $factor*$P] [lindex [nodeDisp 2] 0]"} print node 2

d.tclSpring Example - Displacement Control

5

2P (100)

(1)1

# create the model builder model Basic -ndm 1 -ndf 1# create 2 nodes node 1 0.0node 2 1.0# fix node 1 fix 1 1# create material set Fy 60.0set E 30000.0set b -0.1uniaxialMaterial Steel01 1 $Fy $E $b# create element set A 1.0 element Truss 1 1 2 $A 1# create time series and load pattern set P 100.0 timeSeries Linear 1pattern Plain 1 1 { load 2 $P}

# create an analysis constraints Plainnumberer RCMtest NormDispIncr 1.0e-12 6 0algorithm Newtonsystem BandGenintegrator DisplacementControl 2 1 0.001analysis Static

# perform the analysis & print resultsfor {set i 0} {$i < 10} {incr i 1} { analyze 1 set factor [getTime] puts "[expr $factor*$P] [lindex [nodeDisp 2] 0]"} print node 2

e.tcl

E (30000)

-0.1E (-3000)Fy (60)

strain

stressTruss Example - Displacement Control

6

2

P (100)

(1)1

# create the model builder model Basic -ndm 1 -ndf 1# create 2 nodes node 1 0.0node 2 1.0# fix node 1 fix 1 1# create material set Fy 60.0set E 30000.0set b -0.1uniaxialMaterial Steel01 1 $Fy $E $b# create element set A 1.0 element Truss 1 1 2 $A 1# create time series and load pattern set P 100.0 timeSeries Linear 1pattern Plain 1 1 { load 2 $P}

# create an analysis constraints Plainnumberer RCMtest NormDispIncr 1.0e-12 6 0algorithm Newtonsystem BandGenintegrator DisplacementControl 2 1 0.001analysis Static# perform the analysis & print resultsforeach {$numIter $dU} {10 0.001 20 -0.001 10 0.001} { integrator DisplacementControl 2 1 0.001 analyze $numIter set factor [getTime] puts "[expr $factor*$P] [lindex [nodeDisp 2] 0]"} print node 2

f.tcl

E (30000)

-0.1E (-3000)Fy (60)

strain

stressTruss Example - Push & Pull

7

2(1)1

# set some variablesset Tn 1.0set K 4.0set dampR 0.02#set some constantsset g 386.4set PI [expr 2.0 * asin(1.0)]#derived quantatiesset Wn [expr 2.0 * $PI / $Tn]set M [expr $K / ($Wn * $Wn)]set c [expr 2.0*$M*$Wn*$dampR]# create the modelmodel basic -ndm 1 -ndf 1node 1 0.0node 2 1.0 -mass $Mfix 1 1uniaxialMaterial Elastic 1 $K 0.0uniaxialMaterial Elastic 2 0.0 $cuniaxialMaterial Parallel 3 1 2

element truss 1 1 2 1.0 3set dT 0.0;set nPts 0;

# create the uniform excitation patternset record el_centrosource ReadRecord.tclReadRecord $record.AT2 $record.dat dT nPtstimeSeries Path 1 -filePath $record.dat -dt $dT -factor $gpattern UniformExcitation 1 1 -accel 1# create the analysisconstraints Plainintegrator Newmark 0.5 [expr 1.0/6.0]system ProfileSPDtest NormUnbalance 1.0e-12 6 0algorithm Newtonnumberer RCManalysis Transient

j.tcl

K

strain

stress

Truss Example - Uniform Excitation

M

# perform analysisset t 0.0; set ok 0.0; set maxD 0.0;set maxT [expr (1+$nPts)*$dT]; while {$ok == 0 && $t < $maxT} { set ok [analyze 1 $dT] set t [getTime] set d [nodeDisp 2 1] if {$d > $maxD} { set maxD $d } elseif {$d < [expr -$maxD]} { set maxD [expr -$d] }}puts "record: $record period: $Tn damping ratio: $dampR max disp: $maxD"

8

# create the model builder model Basic -ndm 2 -ndf 3# create 2 nodes node 1 0.0 0.0node 2 360.0 0.0node 3 0.0 144.0node 4 360.0 144.0# fix node 1 fix 1 1 1 1fix 2 1 1 1geomTransf Linear 1geomTransf Linear 2# create elementssource SteelWSections.tclset in 1.0set E 30000ElasticBeamWSection2d 1 1 3 W14X257 $E 1ElasticBeamWSection2d 2 3 4 W24X68 $E 2ElasticBeamWSection2d 3 2 4 W14X257 $E 1# create time series and load pattern set P 10000.0timeSeries Constant 1pattern Plain 1 1 { load 3 0.0 -$P 0.0 load 4 0.0 -$P 0.0}

Elastic Portal Frame - Pushover30’

3P(10000) P (10000)

(1)

(2)

(3)

1

4

12’

2

g.tcl

H

W14

X25

7

W24X68W

14X

257

# create an analysis constraints Plainnumberer RCMtest NormDispIncr 1.0e-12 6 0algorithm Newtonsystem ProfileSPDintegrator LoadControl 1.0analysis Static# perform the analysis analyze 1timeSeries Linear 2pattern Plain 2 2 { load 3 1.0 0.0 0.0 load 4 1.0 0.0 0.0}integrator DisplacementControl 3 1 0.1analyze 100; print node 3

print node 3

9

proc ElasticBeamWSection2d {eleTag iNode jNode sectType E transfTag {Orient XX}} { global WSection global in set found 0 foreach {section prop} [array get WSection $sectType] { set propList [split $prop] set A [expr [lindex $propList 0]*$in*$in] set Ixx [expr [lindex $propList 5]*$in*$in*$in*$in] set Iyy [expr [lindex $propList 6]*$in*$in*$in*$in] if {$Orient == "YY" } { puts "element elasticBeamColumn $eleTag $iNode $jNode $A $E $Iyy $transfTag" element elasticBeamColumn $eleTag $iNode $jNode $A $E $Iyy $transfTag } else { puts "element elasticBeamColumn $eleTag $iNode $jNode $A $E $Ixx $transfTag" element elasticBeamColumn $eleTag $iNode $jNode $A $E $Ixx $transfTag } }}#Winxlb/f "Area(in2) d(in) bf(in) tw(in) tf(in) Ixx(in4) Iyy(in4)" array set WSection { W44X335 "98.5 44.0 15.9 1.03 1.77 31100 1200 74.7" W44X290 "85.4 43.6 15.8 0.865 1.58 27000 1040 50.9" W44X262 "76.9 43.3 15.8 0.785 1.42 24100 923 37.3" W44X230 "67.7 42.9 15.8 0.710 1.22 20800 796 24.9" W40X593 "174 43.0 16.7 1.79 3.23 50400 2520 445" W40X503 "148 42.1 16.4 1.54 2.76 41600 2040 277"

SteelWSections.tcl

10

# create the model builder model Basic -ndm 2 -ndf 3# create 2 nodes node 1 0.0 0.0node 2 360.0 0.0node 3 0.0 144.0node 4 360.0 144.0# fix node 1 fix 1 1 1 1fix 2 1 1 1geomTransf PDelta 1geomTransf Linear 2# create elementssource SteelWSections.tclset in 1.0set E 30000ElasticBeamWSection2d 1 1 3 W14X257 $E 1ElasticBeamWSection2d 2 3 4 W24X68 $E 2ElasticBeamWSection2d 3 2 4 W14X257 $E 1# create time series and load pattern set P 10000.0timeSeries Constant 1pattern Plain 1 1 { load 3 0.0 -$P 0.0 load 4 0.0 -$P 0.0}

Elastic Portal Frame - Pushover30’

3P(10000) P (10000)

(1)

(2)

(3)

1

4

12’

2

h.tcl

H

W14

X25

7

W24X68

W14

X25

7

# create an analysis constraints Plainnumberer RCMtest NormDispIncr 1.0e-12 6 0algorithm Newtonsystem ProfileSPDintegrator LoadControl 1.0analysis Static# perform the analysis analyze 1timeSeries Linear 2pattern Plain 2 2 { load 3 1.0 0.0 0.0 load 4 1.0 0.0 0.0}integrator DisplacementControl 3 1 0.1analyze 100; print node 3

print node 3

11

Moment Curvature Example m.tclmodel Basic -ndm 2 -ndf 3# Define materials 1) confined, 2) unconfined, 3 steel uniaxialMaterial Concrete01 1 -6.0 -0.004 -5.0 -0.014uniaxialMaterial Concrete01 2 -5.0 -0.002 0.0 -0.006set fy 60.0; # Yield stress set E 30000.0; # Young's modulus uniaxialMaterial Steel01 3 $fy $E 0.01# set some paramaters set width 15set depth 24set cover 1.5set As 0.60; # area of no. 7 bars

# Estimate yield curvature # (Assuming no axial load and only top and bottom steel) set d [expr $depth-$cover] ;# d -- from cover to rebar set epsy [expr $fy/$E] ;# steel yield strain set Ky [expr $epsy/(0.7*$d)]

# Print estimate to standard output puts "Estimated yield curvature: $Ky"

source RCsection2D.tclRCsection2D 1 $depth $width $cover 1 2 3 3 1 $As \ 10 10 2

set P -180; # axial load set mu 15; # Target ductility for analysis set numIncr 100; # Number of analysis increments # Call the section analysis procedure source MomentCurvature.tclMomentCurvature 1 $P [expr $Ky*$mu] $numIncr

HOW TO MODEL FIBERSECTIONS

12

proc RCsection2D {id h b cover coreID coverID steelID numBarsTB numBarsS barArea nfCore nfCoverSnfCoverTB} {

# some variables derived from the parameters set y1 [expr $h/2.0] set z1 [expr $b/2.0] set As $barArea section Fiber 1 { # Create the concrete core fibers patch rect $coreID $nfCore 1 [expr $cover-$y1] [expr $cover-$z1] [expr $y1-$cover] [expr $z1-

$cover]

# Create the concrete cover fibers (top, bottom, left, right) patch rect $coverID $nfCoverS 1 [expr -$y1] [expr $z1-$cover] $y1 $z1 patch rect $coverID $nfCoverS 1 [expr -$y1] [expr -$z1] $y1 [expr $cover-$z1] patch rect $coverID $nfCoverTB 1 [expr -$y1] [expr $cover-$z1] [expr $cover-$y1] [expr $z1-

$cover] patch rect $coverID $nfCoverTB 1 [expr $y1-$cover] [expr $cover-$z1] $y1 [expr $z1-

$cover]

# Create the reinforcing fibers (left, middle, right) layer straight $steelID $numBarsTB $As [expr $y1-$cover] [expr $z1-$cover] [expr $y1-$cover]

[expr $cover-$z1] layer straight $steelID $numBarsTB $As [expr $cover-$y1] [expr $z1-$cover] [expr $cover-$y1]

[expr $cover-$z1] layer straight $steelID $numBarsS $As [expr $y1-$cover] [expr $z1-$cover] [expr $cover-$y1] [expr

$cover-$z1] layer straight $steelID $numBarsS $As [expr $y1-$cover] [expr $cover-$z1] [expr $cover-$y1] [expr

$z1-$cover] }}

RCsection2D.tcl RCsection2D.tcl

13

Simply Supported Beam# create nodes set nodeTag 1set yLoc 0.0;for {set i 0} {$i < $nY} {incr i 1} { set xLoc 0.0; for {set j 0} {$j < $nX} {incr j 1} { node $nodeTag $xLoc $yLoc set xLoc [expr $xLoc+ $L/($nX-1.0)] incr nodeTag } set yLoc [expr $yLoc+ $H/($nY-1.0)]}# boundary conditionsfix 1 1 1fix $nX 1 1# create elements set eleTag 1for {set i 1} {$i < $nY} {incr i 1} { set iNode [expr 1+($i-1)*$nX]; set jNode [expr $iNode+1]; set kNode [expr $jNode+$nX] set lNode [expr $iNode+$nX] for {set j 1} {$j < $nX} {incr j 1} element quad $eleTag $iNode $jNode $kNode $lNode \ $thick "PlaneStress" 1 incr eleTag; incr iNode; incr jNode; incr kNode; incr lNode }}# apply loads set midNode [expr ($nX+1)/2]timeSeries Linear 1pattern Plain 1 1 { load $midNode 0 -$P load [expr $midNode + $nX*($nY-1)] 0 -$P}analysis Static;analyze 1; print node $midNode

# some problem parameters set L 40.0set H 10.0set thick 2.0set P 10set nX 9; # numNodes x dirn set nY 3; # numNodes y dirn# model builder model Basic -ndm 2 -ndf 2# create material nDMaterial ElasticIsotropic 1 1000 0.25 3.0

n.tcl

Simply Supported Beam# use block commandset cmd "block2D [expr $nX-1] [expr $nY-1] 1 1 \ quad \" $thick PlaneStress 1\" { 1 0 0 2 $L 0 3 $L $H 4 0 $H }"

eval $cmd

# apply loads set midNode [expr ($nX+1)/2]timeSeries Linear 1pattern Plain 1 1 { load $midNode 0 -$P load [expr $midNode + $nX*($nY-1)] 0 -$P}analysis Static;analyze 1; print node $midNode

# some problem parameters set L 40.0set H 10.0set thick 2.0set P 10set nX 9; # numNodes x dirn set nY 3; # numNodes y dirn

# model builder model Basic -ndm 2 -ndf 2# create material nDMaterial ElasticIsotropic 1 1000 0.25 3.0

o.tcl

14

Cantilevered Circular Column p.tcl

set P 1.0set L 20.0set R 1.0set E 1000.0set nz 20set nx 6set ny 6set PI [expr 2.0 * asin(1.0)]set I [expr $PI*pow((2*$R),4)/64.0]puts "PL^3/3EI = [expr $P*pow($L,3)/(3.0*$E*$I)]"

# Create ModelBuilder with 3 dimensions and 6 DOF/node model Basic -ndm 3 -ndf 3

# create the material nDMaterial ElasticIsotropic 1 $E 0.25 1.27

set eleArgs "1"set element bbarBrick

set nn [expr ($nz)*($nx+1)*($ny+1) + (($nx+1)*($ny+1)+1)/2]set n1 [expr ($nz)*($nx+1)*($ny+1) +$nx]

# mesh generation set sqrtR [expr sqrt($R/2.0)]set cmd "block3D $nx $ny $nz 1 1 $element $eleArgs { 1 -$sqrtR -$sqrtR 0 2 $sqrtR -$sqrtR 0 3 $sqrtR $sqrtR 0 4 -$sqrtR $sqrtR 0 5 -$sqrtR -$sqrtR $L 6 $sqrtR -$sqrtR $L 7 $sqrtR $sqrtR $L 8 -$sqrtR $sqrtR $L 13 0 -$R 0 14 $R 0 0 15 0 $R 0 16 -$R 0 0 18 0 -$R $L 19 $R 0 $L 20 0 $R $L 21 -$R 0 $L 23 0 -$R [expr $L/2.0] 24 $R 0 [expr $L/2.0] 25 0 $R [expr $L/2.0] 26 -$R 0 [expr $L/2.0] }"

eval $cmd# boundary conditions fixZ 0.0 1 1 1

# Constant point load pattern Plain 1 Linear { load $nn 0.0 $P 0.0}

15

Any Questions?