A Bug in example "MomentCurvature3D.tcl "

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
jiaochiyu2000
Posts: 7
Joined: Wed Mar 28, 2007 9:03 am
Location: BEIJING UNIVERSITY OF CIVIL ENGINEERING AND ARCHITECTURE

A Bug in example "MomentCurvature3D.tcl "

Post by jiaochiyu2000 »

Hello,
I 'm a Chinese postgraduate student, I think I found a bug in the Moment-curvature3D.tcl examples!
when I copy the analyse part of the "Moment-curvature3D.tcl " to my script there shows some bug in it!
Here give you my script!
the problem is that:
During the main proc "M-canalysis.tcl"
When I use "set Nx 159302",it will not converged.
but if I change it to"set Nx 159303",it will converage and get a correct answer.
so I think there must be some bug in it.
Can you doing some work to work out the converage problem
or give a explain ?

myscript_1_M-canalysis.tcl
#######################
set epsutempy 0.005
set Nx 159302; #not converage, but if 159303,the answer is #converge, so there must be some problem in your "Moment-#curvature3D.tcl examples"?
set IDcolSec 8
set axialLoad [expr (-1)*$Nx];
puts "Nx=$Nx"
set numIncr 100
source Material&model9a.tcl
source MPhiProcMz.tcl
MomentCurvature $IDcolSec $axialLoad $epsutempy $numIncr;

#########################

myscript_2_material&model9a.tcl
#######################
# Define tower nonlinear section for nonlinear columns
model BasicBuilder -ndm 3 ndf 6
# Define materials for nonlinear columns
#Core concrete (confined)
# CONCRETE tag f'ce ec0 f'cu ecu
uniaxialMaterial Concrete01 1 -38695.46 -3.94E-03 -3.439E+04 -1.054E-02

#Cover concrete (unconfined)
# CONCRETE tag f'cc ecc f'cu ecu
uniaxialMaterial Concrete01 2 -32400 -0.002 -26700 -0.004


# Core concrete (confined)
# CONCRETE tag f'cc ecc f'cu ecu
uniaxialMaterial Concrete01 4 -38597.87 -3.91E-03 -3.419E+04 -1.056E-02

# Core concrete (confined)
uniaxialMaterial Concrete01 5 -38471.85843 -0.00387403 -33935.68468 -0.010582994

# Core concrete (confined)
uniaxialMaterial Concrete01 6 -38473.26053 -0.003874463 -33938.57102 -0.010582754

# Core concrete (confined)
uniaxialMaterial Concrete01 7 -38471.25387 -0.003873844 -33934.43999 -0.010583097

# Core concrete (confined)
uniaxialMaterial Concrete01 8 -38469.17164 -0.003873201 -33930.15233 -0.010583453

#Core concrete (confined)
uniaxialMaterial Concrete01 9 -38470.525969 -0.003874 -33932.941243 -0.010583

#Core concrete (confined 8
uniaxialMaterial Concrete01 10 -38385.782785 -0.003847 -33757.541789 -0.010598

#Core concrete (confined
uniaxialMaterial Concrete01 11 -38383.422213 -0.003847 -33752.629792 -0.010598

#Core concrete (confined
uniaxialMaterial Concrete01 12 -38385.214019 -0.003847 -33756.358401 -0.010598

#Core concrete (confined
uniaxialMaterial Concrete01 13 -38382.781305 -0.003847 -33751.295913 -0.010598

#Core concrete (confined
uniaxialMaterial Concrete01 14 -38380.248731 -0.003846 -33746.024002 -0.010599
#Core concrete (confined
uniaxialMaterial Concrete01 15 -38377.607425 -0.003845 -33740.523996 -0.010599
#Core concrete (confined
uniaxialMaterial Concrete01 16 -38379.449900 -0.003846 -33744.360781 -0.010599
#Core concrete (confined
uniaxialMaterial Concrete01 17 -38376.720517 -0.003845 -33738.676782 -0.010599
#Core concrete (confined
uniaxialMaterial Concrete01 18 -38373.865618 -0.003844 -33732.729346 -0.010600
#Core concrete (confined
uniaxialMaterial Concrete01 19 -38375.731076 -0.003844 -33736.615778 -0.010599
#Core concrete (confined
uniaxialMaterial Concrete01 20 -38372.771946 -0.003843 -33730.450411 -0.010600
#Core concrete (confined
uniaxialMaterial Concrete01 21 -38369.675312 -0.003842 -33723.996143 -0.010601
#Core concrete (confined
uniaxialMaterial Concrete01 22 -38366.428312 -0.003841 -33717.225818 -0.010601
#Core concrete (confined
uniaxialMaterial Concrete01 23 -38367.746148 -0.003842 -33719.973967 -0.010601

#steel
set Fy 335E3;
set Es 2.0E8;
set B 0.0003
set R0 10;
set cR1 0.925;
set cR2 0.15;

uniaxialMaterial Steel02 3 $Fy $Es $B $R0 $cR1 $cR2

## Define cross-section for nonlinear columns

##set some paramaters # longitudinal dimension
set H 10
set B 7
set chf1 0.7

set cover 0.068

set chf2 0.8

set As1 [expr 804.2*2*1e-6]

set As2 [expr 804.2*1e-6]

set Bouti 7.44059
set Bini 8.37535
set Houti 166.66667
set Q(0) 8.4688
set Q(1) 17.875
set Q(2) 26.55
set Q(3) 34.15
set Q(4) 41.75
set Q(5) 50.0430
set Q(6) 57.5441
set Q(7) 65.5430
set Q(8) 73.5430
set Q(9) 81.5430
set Q(10) 89.5430
set Q(11) 97.5430
set Q(12) 105.5430
set Q(13) 113.5430
set Q(14) 121.5430
set Q(15) 129.5430
set Q(16) 137.5430
set Q(17) 145.5430
set Q(18) 153.5430
set Q(19) 159.108

set Bsick1 1.297
set Bsick2 2.0
set Bsick3 1.5877
set Bsick4 1.2
set Bsick5 1.0

set Hsick1 1.278
set Hsick2 3.0
set Hsick3 2.0822
set Hsick4 1.2
set Hsick5 1.0



set T1 635.095
set T2 537.272
set T3 421.7135
set T4 399.2817
set T5 380.2401
set T6 361.76
set T7 342.2305
set T8 292.2411
set T9 276.7843
set T10 261.827
set T11 247.3681
set T12 233.3921
set T13 219.9021
set T14 206.884
set T15 194.3334
set T16 182.2433
set T17 170.6061
set T18 159.4173
set T19 150.2571
set T20 139.858
set T21 132.8804

set dx 0.0282
set dy 0.0282


set SecTemp 1
set SecTor 1000
set SecId 2



set g 3

set f [open hb.out a+]

for {set k 0} {$k<=19} {incr k} {
set b($k) [expr round(($B-$Q($k)/$Bouti+$Q($k)/$Bini)*10000)/10000.0]
set h($k) [expr round(($H-2*$Q($k)/$Houti)*10000)/10000.0]
puts $f "b($k)=$b($k) h($k)=$h($k)"
#secid
set BTSecId($k) [expr $k+$g ]
set BTSecTor($k) [expr $BTSecId($k)+100]
set BTsectmp($k) [expr $BTSecId($k)+200]
}

close $f


#Define sec8=BTSecId(5)=$BTSecTor(5)+$BTsectmp(5)

section Fiber $BTsectmp(5) {
# concrete
patch quad 9 5 4 [expr -$h(5)/2+$cover] [expr $b(5)/2-$chf1-$cover] [expr -$h(5)/2+$Hsick4-$cover] [expr $b(5)/2-$Bsick4-$chf2+$dy] [expr -$h(5)/2+$Hsick4+$chf2-$dx] [expr ($b(5)/2-$Bsick4+$cover)] [expr -$h(5)/2+$cover+$chf1] [expr $b(5)/2-$cover-$chf1]
patch quad 9 18 5 [expr -$h(5)/2+$cover] [expr $b(5)/2-$chf1-$cover] [expr -$h(5)/2+$cover] [expr -($b(5)/2-$chf1-$cover)] [expr -$h(5)/2+$Hsick4-$cover] [expr -($b(5)/2-$Bsick4-$chf2+$dy)] [expr -$h(5)/2+$Hsick4-$cover] [expr $b(5)/2-$Bsick4-$chf2+$dy]
patch quad 9 4 5 [expr -$h(5)/2+$cover] [expr -($b(5)/2-$chf1-$cover)] [expr -$h(5)/2+$cover+$chf1] [expr -($b(5)/2-$cover-$chf1)] [expr -$h(5)/2+$Hsick4+$chf2-$dx] [expr -($b(5)/2-$Bsick4+$cover)] [expr -$h(5)/2+$Hsick4-$cover] [expr -($b(5)/2-$Bsick4-$chf2+$dy)]
patch quad 9 4 29 [expr -$h(5)/2+$cover+$chf1] [expr $b(5)/2-$cover] [expr -$h(5)/2+$cover+$chf1] [expr $b(5)/2-$cover-$chf1] [expr $h(5)/2-$cover-$chf1] [expr $b(5)/2-$cover-$chf1] [expr $h(5)/2-$cover-$chf1] [expr $b(5)/2-$cover]
patch quad 9 5 29 [expr -$h(5)/2+$cover+$chf1] [expr $b(5)/2-$cover-$chf1] [expr -$h(5)/2+$Hsick4+$chf2-$dx] [expr ($b(5)/2-$Bsick4+$cover)] [expr $h(5)/2-$Hsick4-$chf2+$dx] [expr ($b(5)/2-$Bsick4+$cover)] [expr $h(5)/2-$cover-$chf1] [expr $b(5)/2-$cover-$chf1]
patch quad 9 5 29 [expr -$h(5)/2+$Hsick4+$chf2-$dx] [expr -($b(5)/2-$Bsick4+$cover)] [expr -$h(5)/2+$cover+$chf1] [expr -($b(5)/2-$cover-$chf1)] [expr $h(5)/2-$cover-$chf1] [expr -($b(5)/2-$cover-$chf1)] [expr $h(5)/2-$Hsick4-$chf2+$dx] [expr -($b(5)/2-$Bsick4+$cover)]
patch quad 9 4 29 [expr -$h(5)/2+$cover+$chf1] [expr -($b(5)/2-$cover-$chf1)] [expr -$h(5)/2+$cover+$chf1] [expr -($b(5)/2-$cover)] [expr $h(5)/2-$cover-$chf1] [expr -($b(5)/2-$cover)] [expr $h(5)/2-$cover-$chf1] [expr -($b(5)/2-$cover-$chf1)]
patch quad 9 4 5 [expr -(-$h(5)/2+$Hsick4+$chf2-$dx)] [expr ($b(5)/2-$Bsick4+$cover)] [expr -(-$h(5)/2+$Hsick4-$cover)] [expr $b(5)/2-$Bsick4-$chf2+$dy] [expr $h(5)/2-$cover] [expr $b(5)/2-$chf1-$cover] [expr $h(5)/2-$cover-$chf1] [expr $b(5)/2-$cover-$chf1]
patch quad 9 18 5 [expr -(-$h(5)/2+$Hsick4-$cover)] [expr $b(5)/2-$Bsick4-$chf2+$dy] [expr -(-$h(5)/2+$Hsick4-$cover)] [expr -($b(5)/2-$Bsick4-$chf2+$dy)] [expr $h(5)/2-$cover] [expr -($b(5)/2-$chf1-$cover)] [expr $h(5)/2-$cover] [expr $b(5)/2-$chf1-$cover]
patch quad 9 4 5 [expr -(-$h(5)/2+$Hsick4-$cover)] [expr -($b(5)/2-$Bsick4-$chf2+$dy)] [expr $h(5)/2-$Hsick4-$chf2+$dx] [expr -($b(5)/2-$Bsick4+$cover)] [expr $h(5)/2-$cover-$chf1] [expr -($b(5)/2-$cover-$chf1)] [expr $h(5)/2-$cover] [expr -($b(5)/2-$chf1-$cover)]

patch quad 2 19 1 [expr -$h(5)/2] [expr $b(5)/2-$chf1] [expr -$h(5)/2] [expr -($b(5)/2-$chf1)] [expr -$h(5)/2+$cover] [expr -($b(5)/2-$chf1)] [expr -$h(5)/2+$cover] [expr $b(5)/2-$chf1]

patch quad 2 1 3 [expr -$h(5)/2+$cover] [expr $b(5)/2-$chf1] [expr -$h(5)/2+$cover] [expr $b(5)/2-$chf1-$cover] [expr -$h(5)/2+$chf1] [expr $b(5)/2-$chf1-$cover] [expr -$h(5)/2+$chf1] [expr $b(5)/2-$chf1]

patch quad 2 1 3 [expr -$h(5)/2+$cover] [expr -($b(5)/2-$chf1-$cover)] [expr -$h(5)/2+$cover] [expr -($b(5)/2-$chf1)] [expr -$h(5)/2+$chf1] [expr -($b(5)/2-$chf1)] [expr -$h(5)/2+$chf1] [expr -($b(5)/2-$chf1-$cover)]

patch quad 2 4 1 [expr -$h(5)/2+$chf1] [expr $b(5)/2] [expr -$h(5)/2+$chf1] [expr $b(5)/2-$chf1-$cover] [expr -$h(5)/2+$chf1+$cover] [expr $b(5)/2-$chf1-$cover] [expr -$h(5)/2+$chf1+$cover] [expr $b(5)/2]

patch quad 2 4 1 [expr -$h(5)/2+$chf1] [expr -($b(5)/2-$chf1-$cover)] [expr -$h(5)/2+$chf1] [expr -$b(5)/2] [expr -$h(5)/2+$chf1+$cover] [expr -$b(5)/2] [expr -$h(5)/2+$chf1+$cover] [expr -($b(5)/2-$chf1-$cover)]

patch quad 2 1 29 [expr -$h(5)/2+$chf1+$cover] [expr $b(5)/2] [expr -$h(5)/2+$chf1+$cover] [expr $b(5)/2-$cover] [expr $h(5)/2-$chf1-$cover] [expr $b(5)/2-$cover] [expr $h(5)/2-$chf1-$cover] [expr $b(5)/2]

patch quad 2 1 29 [expr -$h(5)/2+$chf1+$cover] [expr -($b(5)/2-$cover)] [expr -$h(5)/2+$chf1+$cover] [expr -$b(5)/2] [expr $h(5)/2-$chf1-$cover] [expr -$b(5)/2] [expr $h(5)/2-$chf1-$cover] [expr -($b(5)/2-$cover)]

patch quad 2 4 1 [expr $h(5)/2-$chf1-$cover] [expr $b(5)/2] [expr $h(5)/2-$chf1-$cover] [expr $b(5)/2-$chf1-$cover] [expr $h(5)/2-$chf1] [expr $b(5)/2-$chf1-$cover] [expr $h(5)/2-$chf1] [expr $b(5)/2]

patch quad 2 4 1 [expr $h(5)/2-$chf1-$cover] [expr -($b(5)/2-$chf1-$cover)] [expr $h(5)/2-$chf1-$cover] [expr -$b(5)/2] [expr $h(5)/2-$chf1] [expr -$b(5)/2] [expr $h(5)/2-$chf1] [expr -($b(5)/2-$chf1-$cover)]

patch quad 2 1 3 [expr $h(5)/2-$chf1] [expr $b(5)/2-$chf1] [expr $h(5)/2-$chf1] [expr $b(5)/2-$chf1-$cover] [expr $h(5)/2-$cover] [expr $b(5)/2-$chf1-$cover] [expr $h(5)/2-$cover] [expr $b(5)/2-$chf1]

patch quad 2 1 3 [expr $h(5)/2-$chf1] [expr -($b(5)/2-$chf1-$cover)] [expr $h(5)/2-$chf1] [expr -($b(5)/2-$chf1)] [expr $h(5)/2-$cover] [expr -($b(5)/2-$chf1)] [expr $h(5)/2-$cover] [expr -($b(5)/2-$chf1-$cover)]

patch quad 2 19 1 [expr $h(5)/2-$cover] [expr $b(5)/2-$chf1] [expr $h(5)/2-$cover] [expr -($b(5)/2-$chf1)] [expr $h(5)/2] [expr -($b(5)/2-$chf1)] [expr $h(5)/2] [expr $b(5)/2-$chf1]

patch quad 2 1 4 [expr -$h(5)/2+$Hsick4-$cover] [expr $b(5)/2-$Bsick4-$chf2+$dy] [expr -$h(5)/2+$Hsick4] [expr $b(5)/2-$Bsick4-$chf2] [expr -$h(5)/2+$Hsick4+$chf2] [expr ($b(5)/2-$Bsick4)] [expr -$h(5)/2+$Hsick4+$chf2-$dx] [expr ($b(5)/2-$Bsick4+$cover)]

patch quad 2 18 1 [expr -$h(5)/2+$Hsick4-$cover] [expr $b(5)/2-$Bsick4-$chf2+$dy] [expr -$h(5)/2+$Hsick4-$cover] [expr -($b(5)/2-$Bsick4-$chf2+$dy)] [expr -$h(5)/2+$Hsick4] [expr -($b(5)/2-$Bsick4-$chf2)] [expr -$h(5)/2+$Hsick4] [expr $b(5)/2-$Bsick4-$chf2]

patch quad 2 4 1 [expr -$h(5)/2+$Hsick4-$cover] [expr -($b(5)/2-$Bsick4-$chf2+$dy)] [expr -$h(5)/2+$Hsick4+$chf2-$dx] [expr -($b(5)/2-$Bsick4+$cover)] [expr -$h(5)/2+$Hsick4+$chf2] [expr -($b(5)/2-$Bsick4)] [expr -$h(5)/2+$Hsick4] [expr -($b(5)/2-$Bsick4-$chf2)]

patch quad 2 1 29 [expr -$h(5)/2+$Hsick4+$chf2-$dx] [expr ($b(5)/2-$Bsick4+$cover)] [expr -$h(5)/2+$Hsick4+$chf2] [expr ($b(5)/2-$Bsick4)] [expr -(-$h(5)/2+$Hsick4+$chf2)] [expr ($b(5)/2-$Bsick4)] [expr -(-$h(5)/2+$Hsick4+$chf2-$dx)] [expr ($b(5)/2-$Bsick4+$cover)]

patch quad 2 1 29 [expr -$h(5)/2+$Hsick4+$chf2] [expr -($b(5)/2-$Bsick4)] [expr -$h(5)/2+$Hsick4+$chf2-$dx] [expr -($b(5)/2-$Bsick4+$cover)] [expr -(-$h(5)/2+$Hsick4+$chf2-$dx)] [expr -($b(5)/2-$Bsick4+$cover)] [expr -(-$h(5)/2+$Hsick4+$chf2)] [expr -($b(5)/2-$Bsick4)]

patch quad 2 4 1 [expr -(-$h(5)/2+$Hsick4+$chf2)] [expr ($b(5)/2-$Bsick4)] [expr -(-$h(5)/2+$Hsick4)] [expr $b(5)/2-$Bsick4-$chf2] [expr -(-$h(5)/2+$Hsick4-$cover)] [expr $b(5)/2-$Bsick4-$chf2+$dy] [expr -(-$h(5)/2+$Hsick4+$chf2-$dx)] [expr ($b(5)/2-$Bsick4+$cover)]

patch quad 2 18 1 [expr -(-$h(5)/2+$Hsick4)] [expr $b(5)/2-$Bsick4-$chf2] [expr -(-$h(5)/2+$Hsick4)] [expr -($b(5)/2-$Bsick4-$chf2)] [expr -(-$h(5)/2+$Hsick4-$cover)] [expr -($b(5)/2-$Bsick4-$chf2+$dy)] [expr -(-$h(5)/2+$Hsick4-$cover)] [expr $b(5)/2-$Bsick4-$chf2+$dy]

patch quad 2 1 4 [expr -(-$h(5)/2+$Hsick4+$chf2)] [expr -($b(5)/2-$Bsick4)] [expr -(-$h(5)/2+$Hsick4+$chf2-$dx)] [expr -($b(5)/2-$Bsick4+$cover)] [expr -(-$h(5)/2+$Hsick4-$cover)] [expr -($b(5)/2-$Bsick4-$chf2+$dy)] [expr -(-$h(5)/2+$Hsick4)] [expr -($b(5)/2-$Bsick4-$chf2)]

# outside steel bar 200
layer straight 3 51 $As1 -3.75 -3.0247 3.75 -3.0247

layer straight 3 51 $As1 -3.75 3.0247 3.75 3.0247

layer straight 3 31 $As1 -4.5998 -2.25 -4.5998 2.25

layer straight 3 31 $As1 4.5998 -2.25 4.5998 2.25

layer straight 3 3 $As1 -4.4498 -2.3247 -4.1498 -2.3247

layer straight 3 3 $As1 -4.4498 2.3247 -4.1498 2.3247

layer straight 3 3 $As1 4.4498 -2.3247 4.1498 -2.3247

layer straight 3 3 $As1 4.4498 2.3247 4.1498 2.3247

layer straight 3 3 $As1 -3.8998 -2.5747 -3.8998 -2.8747

layer straight 3 3 $As1 -3.8998 2.5747 -3.8998 2.8747

layer straight 3 3 $As1 3.8998 -2.5747 3.8998 -2.8747

layer straight 3 3 $As1 3.8998 2.5747 3.8998 2.8747

fiber -4.5998 -2.3247 $As1 3

fiber -4.5998 2.3247 $As1 3

fiber 4.5998 -2.3247 $As1 3

fiber 4.5998 2.3247 $As1 3

fiber -3.8998 -2.3247 $As1 3

fiber -3.8998 2.3247 $As1 3

fiber 3.8998 -2.3247 $As1 3

fiber 3.8998 2.3247 $As1 3

fiber -3.8995 -3.0247 $As1 3

fiber -3.8995 3.0247 $As1 3

fiber 3.8995 -3.0247 $As1 3

fiber 3.8995 3.0247 $As1 3

# inside steel bar
layer straight 3 36 $As2 -2.625 -2.0247 2.625 -2.0247

layer straight 3 36 $As2 -2.625 2.0247 2.625 2.0247

layer straight 3 14 $As2 -3.5998 -0.975 -3.5998 0.975

layer straight 3 14 $As2 3.5998 -0.975 3.5998 0.975

layer straight 3 7 $As2 -3.4887 -1.2772 -2.8523 -1.9136

layer straight 3 7 $As2 -3.4887 1.2772 -2.8523 1.9136

layer straight 3 7 $As2 3.4887 -1.2772 2.8523 -1.9136

layer straight 3 7 $As2 3.4887 1.2772 2.8523 1.9136

fiber -3.5998 -1.1661 $As2 3

fiber -3.5998 1.1661 $As2 3

fiber 3.5998 -1.1661 $As2 3

fiber 3.5998 1.1661 $As2 3

fiber -2.7412 -2.0247 $As2 3

fiber -2.7412 2.0247 $As2 3

fiber 2.7412 -2.0247 $As2 3

fiber 2.7412 2.0247 $As2 3
}

##Linear elastic torsion
uniaxialMaterial Elastic $BTSecTor(5) [expr $T7*13800000.0]

#Attach torsion to the RC section
section Aggregator $BTSecId(5) $BTSecTor(5) T -section $BTsectmp(5)
#puts "BTSecId(5)=$BTSecId(5)"

####################################

myscript_3_MPhiProcMz.tcl####################################
# Moment-curvature analysis of tower base section
# secTag -- tag identifying section to be analyzed
# axialLoad -- axial load applied to section (negative is compression)
# maxK -- maximum curvature reached during analysis
# numIncr -- number of increments used to reach maxK (default 100)
proc MomentCurvature {secTag axialLoad maxK {numIncr 100} } {
if {$secTag == 2} {
puts secTag=$secTag
set concresectag 1
puts concresectag=$concresectag
} elseif {($secTag<=22)&&($secTag>2)} {
set concresectag [expr $secTag+1];
puts concresectag=$concresectag
} else {
puts "wrong sectag";
}


# Define two nodes at (0,0)
node 10001 0.0 0.0 0.0
node 10002 0.0 0.0 0.0
# Fix all degrees of freedom except axial and bending
fix 10001 1 1 1 1 1 1
fix 10002 0 1 1 1 1 0
# Define element
# tag ndI ndJ secTag
element zeroLengthSection 1 10001 10002 $secTag

# Create recorder
recorder Node -file Mzsection$secTag.out -time -node 10002 -dof 6 disp
recorder Element -file curvMz.out -time -ele 1 section deformation
recorder Element -file steelstrainMz.out -time -ele 1 section fiber -5 0 3 stressStrain
recorder Element -file concretestrainMz.out -time -ele 1 section fiber 5 0 $concresectag stressStrain
recorder Element -file uconcretestrainMz.out -time -ele 1 section fiber 5 0 2 stressStrain


# Define constant axial load
pattern Plain 1 "Constant" {
load 10002 $axialLoad 0.0 0.0 0.0 0.0 0.0
}

# Define analysis parameters
integrator LoadControl 0 1 0 0
system SparseGeneral -piv; # Overkill, but may need the pivoting!
test NormUnbalance 1.0e-9 100
numberer Plain
constraints Plain
algorithm Newton
analysis Static

# Do one analysis for constant axial load
analyze 1

# Define reference moment
pattern Plain 2 "Linear" {
load 10002 0.0 0.0 0.0 0.0 0.0 1.0
}

# Compute curvature increment
set dK [expr $maxK/$numIncr];

# Use displacement control at node 2 for section analysis
integrator DisplacementControl 10002 6 $dK 1 $dK $dK
# Do the section analysis
set ok [analyze $numIncr]
# ----------------------------------------------if convergence failure-------------------------
set IDctrlNode 10002
set IDctrlDOF 6
set Dmax $maxK
set Dincr $dK
set TolStatic 1.e-9;
set testTypeStatic EnergyIncr
set maxNumIterStatic 6
set algorithmTypeStatic Newton
if {$ok != 0} {
# if analysis fails, we try some other stuff, performance is slower inside this loop
set Dstep 0.0;
set ok 0
while {$Dstep <= 1.0 && $ok == 0} {
set controlDisp [nodeDisp $IDctrlNode $IDctrlDOF ]
set Dstep [expr $controlDisp/$Dmax]
set ok [analyze 1]; # this will return zero if no convergence problems were encountered
if {$ok != 0} {; # reduce step size if still fails to converge
set Nk 4; # reduce step size
set DincrReduced [expr $Dincr/$Nk];
integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced
for {set ik 1} {$ik <=$Nk} {incr ik 1} {
set ok [analyze 1]; # this will return zero if no convergence problems were encountered
if {$ok != 0} {
# if analysis fails, we try some other stuff
# performance is slower inside this loop global maxNumIterStatic; # max no. of iterations performed before "failure to converge" is ret'd
puts "Trying Newton with Initial Tangent .."
test NormDispIncr $TolStatic 2000 0
algorithm Newton -initial
set ok [analyze 1]
test $testTypeStatic $TolStatic $maxNumIterStatic 0
algorithm $algorithmTypeStatic
}
if {$ok != 0} {
puts "Trying Broyden .."
algorithm Broyden 8
set ok [analyze 1 ]
algorithm $algorithmTypeStatic
}
if {$ok != 0} {
puts "Trying NewtonWithLineSearch .."
algorithm NewtonLineSearch 0.8
set ok [analyze 1]
algorithm $algorithmTypeStatic
}
if {$ok != 0} {; # stop if still fails to converge
puts [format $fmt1 "PROBLEM" $IDctrlNode $IDctrlDOF [nodeDisp $IDctrlNode $IDctrlDOF] $LunitTXT]
return -1
}; # end if
}; # end for
integrator DisplacementControl $IDctrlNode $IDctrlDOF $Dincr; # bring back to original increment
}; # end if
}; # end while loop
}; # end if ok !0
# -----------------------------------------------------------------------------------------------------
global LunitTXT; # load time-unit text
if { [info exists LunitTXT] != 1} {set LunitTXT "Length"}; # set blank if it has not been defined previously.

set fmt1 "%s Pushover analysis: CtrlNode %.3i, dof %.1i, Curv=%.4f /%s"; # format for screen/file output of DONE/PROBLEM analysis
if {$ok != 0 } {
puts [format $fmt1 "PROBLEM" $IDctrlNode $IDctrlDOF [nodeDisp $IDctrlNode $IDctrlDOF] $LunitTXT]
} else {
puts [format $fmt1 "DONE" $IDctrlNode $IDctrlDOF [nodeDisp $IDctrlNode $IDctrlDOF] $LunitTXT]
}


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

Post by silvia »

it is not a bug in the procedure.
in your scripts you have a lot of divide by 2 rather than 2. or 2.0
if you take an even number and divide it by 2 you get an answer and no problems, if you take an odd number and divide it by 2 you get zero, hence an error in your program.

ALWAYS USE REAL NUMBERS, NOT INTEGERS!!!
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104
jiaochiyu2000
Posts: 7
Joined: Wed Mar 28, 2007 9:03 am
Location: BEIJING UNIVERSITY OF CIVIL ENGINEERING AND ARCHITECTURE

I'm afraid your answer is not right for this problem

Post by jiaochiyu2000 »

I've already change all "/2" into "/2.0"in my script, but it does not converaged still, in the window of the "cmd.exe",it shows that:
opensees>analyze failed, returned: -3 error flag
can't read "fmt1": no such variable
while executing
"format $fmt1" PROBLEM" $IDctrNode $IDctrDOF [nodeDisp $IDctrlNode $IDctrlDOF] $lunitTXT"
(procedure "MomentCurvature" line 107)
------

so I still believe there is a bug or a non-converage problem in your examples of "MomentCurvature3D.tcl", so I think you should take a try to solve them.
silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia »

yes, please move the definition of fmt1 to the top of the file.
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104
Post Reply