what's wrong with my 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
ahu861011
Posts: 16
Joined: Tue Jan 19, 2010 5:59 am
Location: zhejiang university of technology

what's wrong with my tcl?

Post by ahu861011 »

I build a frame to do static analysis,but the compiler print the message "should be "set varname ?newvalue?"".I check it for a long time ,but I cann't find the reason. what's wrong with my model on earth?Could you help me?
I list my model below:
wipe;
# clear memory of all past model definitions
model BasicBuilder -ndm 3 -ndf 6;
# Define the model builder, ndm=#dimension, ndf=#dofs
set dataDir Data;
# set up name of data directory -- remove
file mkdir $dataDir;
# create data directory
set GMdir "../GMfiles";
# ground-motion file directory
set ViewScale 0.25;
# scaling factor for viewing deformed shape, it depends on the dimensions of the model
source LibUnits.tcl;
# define units
source DisplayPlane.tcl;
# procedure for displaying a plane in model
source DisplayModel3D.tcl;
# procedure for displaying 3D perspectives of model
source BuildRCrectSection.tcl;
# procedure for definining RC fiber section

set LCol [expr 3.3*$ft]; # column height (parallel to Y axis)
set LBeam [expr 5*$ft]; # beam length (parallel to X axis)
set LGird [expr 3*$ft]; # girder length (parallel to Z axis)

set NStory 3; # number of stories above ground level
set NBay 2; # number of bays in X direction
set NBayZ 1; # number of bays in Z direction
puts "Number of Stories in Y: $NStory; Number of bays in X: $NBay; Number of bays in Z: $NBayZ"

set X1 0.;
set X2 [expr $X1 + $LBeam];
set X3 [expr $X2 + $LBeam];
set Y1 0.;
set Y2 [expr $Y1 + $LCol];
set Y3 [expr $Y2 + $LCol];
set Y4 [expr $Y3 + $LCol];
set Z1 0.0;
set Z2 [expr $Z1 + $LGird];

node 111 $X1 $Y1 $Z1;
node 112 $X2 $Y1 $Z1;
node 113 $X3 $Y1 $Z1;
node 121 $X1 $Y2 $Z1;
node 122 $X2 $Y2 $Z1;
node 1227 $X2l $Y2 $Z1;
node 1228 $X2r $Y2 $Z1;
node 123 $X3 $Y2 $Z1;
node 131 $X1 $Y3 $Z1;
node 132 $X2 $Y3 $Z1;
node 1327 $X2l $Y3 $Z1;
node 1328 $X2r $Y3 $Z1;
node 133 $X3 $Y3 $Z1;
node 141 $X1 $Y4 $Z1;
node 142 $X2 $Y4 $Z1;
node 143 $X3 $Y4 $Z1;
node 211 $X1 $Y1 $Z2;
node 212 $X2 $Y1 $Z2;
node 213 $X3 $Y1 $Z2;
node 221 $X1 $Y2 $Z2;
node 222 $X2 $Y2 $Z2;
node 2227 $X2l $Y2 $Z2;
node 2228 $X2r $Y2 $Z2;
node 223 $X3 $Y2 $Z2;
node 231 $X1 $Y3 $Z2;
node 232 $X2 $Y3 $Z2;
node 2327 $X2l $Y3 $Z2;
node 2328 $X2r $Y3 $Z2;
node 233 $X3 $Y3 $Z2;
node 241 $X1 $Y4 $Z2;
node 242 $X2 $Y4 $Z2;
node 243 $X3 $Y4 $Z2;

set Xa [expr ($X2+$X1)/2];
set Xb [expr ($X3+$X2)/2];
set Za [expr ($Z2+$Z1)/2];
node 1121 $Xa $Y2 $Za;
node 1221 $Xb $Y2 $Za;
node 1131 $Xa $Y3 $Za;
node 1231 $Xb $Y3 $Za;
node 1141 $Xa $Y4 $Za;
node 1241 $Xb $Y4 $Za;

#Constraints for rigid diaphragm master nodes
fix 1121 0 1 0 1 0 1
fix 1221 0 1 0 1 0 1
fix 1131 0 1 0 1 0 1
fix 1231 0 1 0 1 0 1
fix 1141 0 1 0 1 0 1
fix 1241 0 1 0 1 0 1

set perpDirn 2
rigidDiaphragm $perpDirn 1121 121 122 221 222;
rigidDiaphragm $perpDirn 1221 122 123 222 223;
rigidDiaphragm $perpDirn 1131 131 132 231 232;
rigidDiaphragm $perpDirn 1231 132 133 232 233;
rigidDiaphragm $perpDirn 1141 141 142 241 242;
rigidDiaphragm $perpDirn 1241 142 143 242 243;

# determine support nodes where ground motions are input, for multiple-support excitation
#set iSupportNode "111 112 211 212"

fixY 0.0 1 1 1 0 1 0;

set IDctrlNode 141;
set IDctrlDOF 1;
set LBuilding [expr $Y4];

set SectionType FiberSection ;
set ColSecTagFiber 1
set BeamSecTagFibera 20
set BeamSecTagFiberb 21
set BeamSecTagFiberc 22
set GirdSecTagFibera 31
set GirdSecTagFiberb 32
set SecTagTorsion 70

set HCol [expr 300*$in];
set BCol [expr $HCol];
set HBeam [expr 300*$in];
set BBeam [expr 200*$in];
set HGird [expr 300*$in];
set BGird [expr 200*$in];

source LibMaterialsRC.tcl;
set cover [expr 25*$in];
set numBarsTopCol 2;
set numBarsBotCol 2;
set numBarsIntCol 0;
set barAreaTopCol [expr 201.1*$in*$in];
set barAreaBotCol [expr 201.1*$in*$in];
set barAreaIntCol [expr 0*$in*$in];
set numBarsTopBeama 3;
set numBarsBotBeama 3;
set numBarsIntBeama 0;
set barAreaTopBeama [expr 314.1*$in*$in]; set barAreaBotBeama [expr 254.3*$in*$in];
set barAreaIntBeama [expr 0*$in*$in];
set numBarsTopBeamb 2;
set numBarsBotBeamb 3;
set numBarsIntBeamb 0;
set barAreaTopBeamb [expr 314.1*$in*$in]; set barAreaBotBeamb [expr 254.3*$in*$in];
set barAreaIntBeamb [expr 0.*$in*$in];
set numBarsTopBeamc 2;
set numBarsBotBeamc 3;
set numBarsIntBeamc 0;
set barAreaTopBeamc [expr 254.3*$in*$in]; set barAreaBotBeamc [expr 153.9*$in*$in];
set barAreaIntBeamc [expr 0*$in*$in];
set numBarsTopGirda 2;
set numBarsBotGirda 3;
set numBarsIntGirda 0;
set barAreaTopGirda [expr 201.1*$in*$in];
set barAreaBotGirda [expr 113.*$in*$in];
set barAreaIntGirda [expr 0*$in*$in];
set numBarsTopGirdb 2;
set numBarsBotGirdb 3;
set numBarsIntGirdb 0;
set barAreaTopGirdb [expr 154*$in*$in];
set barAreaBotGirdb [expr 113.*$in*$in];
set barAreaIntGirdb [expr 0*$in*$in];
set nfCoreY 20;
set nfCoreZ 20;
set nfCoverY 20;
set nfCoverZ 20;
BuildRCrectSection $ColSecTagFiber $HCol $BCol $cover $cover $IDconcCore $IDconcCover $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
BuildRCrectSection $BeamSecTagFibera $HBeam $BBeam $cover $cover $IDconcCore $IDconcCover $IDSteel $numBarsTopBeama $barAreaTopBeama $numBarsBotBeama $barAreaBotBeama $numBarsIntBeama $barAreaIntBeama $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
BuildRCrectSection $BeamSecTagFiberb $HBeam $BBeam $cover $cover $IDconcCore $IDconcCover $IDSteel $numBarsTopBeamb $barAreaTopBeamb $numBarsBotBeamb $barAreaBotBeamb $numBarsIntBeamb $barAreaIntBeamb $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
BuildRCrectSection $BeamSecTagFiberc $HBeam $BBeam $cover $cover $IDconcCore $IDconcCover $IDSteel $numBarsTopBeamc $barAreaTopBeamc $numBarsBotBeamc $barAreaBotBeamc $numBarsIntBeamc $barAreaIntBeamc $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
BuildRCrectSection $GirdSecTagFibera $HGird $BGird $cover $cover $IDconcCore $IDconcCover $IDSteel $numBarsTopGirda $barAreaTopGirda $numBarsBotGirda $barAreaBotGirda $numBarsIntGirda $barAreaIntGirda $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
BuildRCrectSection $GirdSecTagFiberb $HGird $BGird $cover $cover $IDconcCore $IDconcCover $IDSteel $numBarsTopGirdb $barAreaTopGirdb $numBarsBotGirdb $barAreaBotGirdb $numBarsIntGirdb $barAreaIntGirdb $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
uniaxialMaterial Elastic $SecTagTorsion $Ubig
section Aggregator 01 $SecTagTorsion T -section $ColSecTagFiber
section Aggregator 020 $SecTagTorsion T -section $BeamSecTagFibera
section Aggregator 021 $SecTagTorsion T -section $BeamSecTagFiberb
section Aggregator 022 $SecTagTorsion T -section $BeamSecTagFiberc
section Aggregator 030 $SecTagTorsion T -section $GirdSecTagFibera
section Aggregator 031 $SecTagTorsion T -section $GirdSecTagFiberb

set GammaConcrete [expr 25*$psf];
set QdlCol [expr $GammaConcrete*$HCol*$BCol];
set QBeam [expr $GammaConcrete*$HBeam*$BBeam];
set QGird [expr $GammaConcrete*$HGird*$BGird];
set IDColTransf 1;
set IDBeamTransf 2;
set IDGirdTransf 3;
set ColTransfType Linear ;
geomTransf $ColTransfType $IDColTransf 0 0 1 ;
geomTransf Linear $IDBeamTransf 0 1 0
geomTransf Linear $IDGirdTransf 0 1 0

set np 5;
element nonlinearBeamColumn 1111 111 121 $np $ColSecTagFiber $IDColTransf;
element nonlinearBeamColumn 1112 112 122 $np $ColSecTagFiber $IDColTransf;
element nonlinearBeamColumn 1121 121 131 $np $ColSecTagFiber $IDColTransf;
element nonlinearBeamColumn 1122 122 132 $np $ColSecTagFiber $IDColTransf;
element nonlinearBeamColumn 1131 131 141 $np $ColSecTagFiber $IDColTransf;
element nonlinearBeamColumn 1132 132 142 $np $ColSecTagFiber $IDColTransf;
element nonlinearBeamColumn 1217 121 1227 $np $BeamSecTagFiberb $IDBeamTransf;
element nonlinearBeamColumn 1278 1227 1228 $np $BeamSecTagFibera $IDBeamTransf;
element nonlinearBeamColumn 1283 1228 123 $np $BeamSecTagFiberb $IDBeamTransf;
element nonlinearBeamColumn 1317 131 1327 $np $BeamSecTagFiberb $IDBeamTransf;
element nonlinearBeamColumn 1378 1327 1328 $np $BeamSecTagFibera $IDBeamTransf;
element nonlinearBeamColumn 1383 1328 133 $np $BeamSecTagFiberb $IDBeamTransf;
element nonlinearBeamColumn 1417 141 1427 $np $BeamSecTagFiberc $IDBeamTransf;
element nonlinearBeamColumn 1478 1427 1428 $np $BeamSecTagFibera $IDBeamTransf;
element nonlinearBeamColumn 1483 1428 143 $np $BeamSecTagFiberc $IDBeamTransf;
element nonlinearBeamColumn 2111 211 221 $np $ColSecTagFiber $IDColTransf;
element nonlinearBeamColumn 2112 212 222 $np $ColSecTagFiber $IDColTransf
element nonlinearBeamColumn 2121 221 231 $np $ColSecTagFiber $IDColTransf;
element nonlinearBeamColumn 2122 222 232 $np $ColSecTagFiber $IDColTransf
element nonlinearBeamColumn 2131 231 241 $np $ColSecTagFiber $IDColTransf;
element nonlinearBeamColumn 2132 232 242 $np $ColSecTagFiber $IDColTransf
element nonlinearBeamColumn 2217 221 2227 $np $BeamSecTagFiberb $IDBeamTransf;
element nonlinearBeamColumn 2278 2227 2228 $np $BeamSecTagFibera $IDBeamTransf;
element nonlinearBeamColumn 2283 2228 223 $np $BeamSecTagFiberb $IDBeamTransf;
element nonlinearBeamColumn 2317 231 2327 $np $BeamSecTagFiberb $IDBeamTransf;
element nonlinearBeamColumn 2378 2327 2328 $np $BeamSecTagFibera $IDBeamTransf;
element nonlinearBeamColumn 2383 2328 233 $np $BeamSecTagFiberb $IDBeamTransf;
element nonlinearBeamColumn 2417 241 2427 $np $BeamSecTagFiberc $IDBeamTransf;
element nonlinearBeamColumn 2478 2427 2428 $np $BeamSecTagFibera $IDBeamTransf;
element nonlinearBeamColumn 2483 2428 243 $np $BeamSecTagFiberc $IDBeamTransf;
element nonlinearBeamColumn 1321 121 221 $np $GirdSecTaga $IDGirdTransf;
element nonlinearBeamColumn 1322 122 222 $np $GirdSecTaga $IDGirdTransf;
element nonlinearBeamColumn 1331 131 231 $np $GirdSecTaga $IDGirdTransf;
element nonlinearBeamColumn 1332 132 232 $np $GirdSecTaga $IDGirdTransf;
element nonlinearBeamColumn 1341 141 241 $np $GirdSecTagb $IDGirdTransf;
element nonlinearBeamColumn 1342 142 242 $np $GirdSecTagb $IDGirdTransf;

set p [expr 7.*3.*$pci/2.];
set alpha [expr 3./10.];
set pet [expr 5.*$p/8.];
set m [expr 1-2.*$alpha*$alpha + $alpha*$alpha*$alpha];
set per [expr $m*$p];
set wall [expr 10.2*$pci]
set QdlBeam [expr $QBeam + $per + $wall];
set QdlGird [expr $QGird + $pet + $wall];
set WeightCol [expr $QdlCol*$LCol];
set WeightBeam [expr $QdlBeam*$LBeam];
set WeightGird [expr $QdlGird*$LGird];
set Mmid [expr ($WeightCol/2 + $WeightCol/2 +$WeightBeam/2+$WeightGird/2)/$g];
set Mtop [expr ($WeightCol/2 + $WeightBeam/2+$WeightGird/2)/$g];
mass 121 $Mmid 0 $Mmid 0. 0. 0.;
mass 122 $Mmid 0 $Mmid 0. 0. 0.;
mass 123 $Mmid 0 $Mmid 0. 0. 0.;
mass 131 $Mmid 0 $Mmid 0. 0. 0.;
mass 132 $Mmid 0 $Mmid 0. 0. 0.;
mass 133 $Mmid 0 $Mmid 0. 0. 0.;
mass 141 $Mtop 0 $Mtop 0. 0. 0.;
mass 142 $Mtop 0 $Mtop 0. 0. 0.;
mass 143 $Mtop 0 $Mtop 0. 0. 0.;
mass 221 $Mmid 0 $Mmid 0. 0. 0.;
mass 222 $Mmid 0 $Mmid 0. 0. 0.;
mass 223 $Mmid 0 $Mmid 0. 0. 0.;
mass 231 $Mmid 0 $Mmid 0. 0. 0.;
mass 232 $Mmid 0 $Mmid 0. 0. 0.;
mass 233 $Mmid 0 $Mmid 0. 0. 0.;
mass 241 $Mtop 0 $Mtop 0. 0. 0.;
mass 242 $Mtop 0 $Mtop 0. 0. 0.;
mass 243 $Mtop 0 $Mtop 0. 0. 0.;
set FloorWeight2 [expr 6*$WeightCol + 3*$WeightGird + 4*$WeightBeam];
set FloorWeight3 [expr 6*$WeightCol + 3*$WeightGird + 4*$WeightBeam];
set FloorWeight4 [expr 3*$WeightCol + 3*$WeightGird + 4*$WeightBeam];
set WeightTotal [expr $FloorWeight2 + $FloorWeight3 + $FloorWeight4];
set MassTotal [expr $WeightTotal/$g];
# Fj = WjHj/sum(WiHi) * Weight
set sumWiHi [expr $FloorWeight2*$Y2 + $FloorWeight3*$Y3 + $FloorWeight4*$Y4];
set WiHi2 [expr $FloorWeight2*$Y2];
set WiHi3 [expr $FloorWeight3*$Y3];
set WiHi4 [expr $FloorWeight4*$Y4];
set F2 [expr $WiHi2/$sumWiHi*$WeightTotal];
set F3 [expr $WiHi3/$sumWiHi*$WeightTotal];
set F4 [expr $WiHi4/$sumWiHi*$WeightTotal];

recorder Node -file $dataDir/DFree.out -time -node 141 -dof 1 2 3 disp;
recorder Node -file $dataDir/DBase.out -time -node 111 112 211 212 113 213 -dof 1 2 3 disp;
recorder Node -file $dataDir/RBase.out -time -node 111 112 211 212 113 213 -dof 1 2 3 reaction;
recorder Drift -file $dataDir/DrNode.out -time -iNode 111 -jNode 141 -dof 1 -perpDirn 2;
#recorder Element -file $dataDir/Fel1.out -time -ele 1111 localForce;
#recorder Element -file $dataDir/ForceEle1sec1.out -time -ele 1111 section 1 force;
#recorder Element -file $dataDir/DefoEle1sec1.out -time -ele 1111 section 1 deformation;
#recorder Element -file $dataDir/ForceEle1sec$np.out -time -ele 1111 section $np force;
#recorder Element -file $dataDir/DefoEle1sec$np.out -time -ele 1111 section $np deformation;
#set yFiber [expr $HCol/2-$cover];
#set zFiber [expr $BCol/2-$cover];
#recorder Element -file $dataDir/SSconcEle1sec1.out -time -ele 1111 section $np fiber $yFiber $zFiber $IDconcCore stressStrain; #recorder Element -file $dataDir/SSreinfEle1sec1.out -time -ele 1111 section $np fiber $yFiber $zFiber $IDSteel stressStrain;
set xPixels 1300;
set yPixels 800;
set xLoc1 10;
set yLoc1 10;
set dAmp 2;
DisplayModel3D NodeNumbers $dAmp $xLoc1 $yLoc1 $xPixels $yPixels

pattern Plain 101 Linear {
eleLoad -ele 1111 -type -beamUniform 0. 0. -$QdlCol;
eleLoad -ele 1112 -type -beamUniform 0. 0. -$QdlCol
eleLoad -ele 1121 -type -beamUniform 0. 0. -$QdlCol;
eleLoad -ele 1122 -type -beamUniform 0. 0. -$QdlCol
eleLoad -ele 1131 -type -beamUniform 0. 0. -$QdlCol;
eleLoad -ele 1132 -type -beamUniform 0. 0. -$QdlCol

eleLoad -ele 1217 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 1278 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 1283 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 1317 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 1378 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 1383 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 1417 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 1478 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 1483 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 2111 -type -beamUniform 0. 0. -$QdlCol;
eleLoad -ele 2112 -type -beamUniform 0. 0. -$QdlCol
eleLoad -ele 2121 -type -beamUniform 0. 0. -$QdlCol;
eleLoad -ele 2122 -type -beamUniform 0. 0. -$QdlCol
eleLoad -ele 2131 -type -beamUniform 0. 0. -$QdlCol;
eleLoad -ele 2132 -type -beamUniform 0. 0. -$QdlCol

eleLoad -ele 2217 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 2278 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 2283 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 2317 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 2378 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 2383 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 2417 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 2478 -type -beamUniform -$QdlBeam 0.;
eleLoad -ele 2483 -type -beamUniform -$QdlBeam 0.;

eleLoad -ele 1321 -type -beamUniform -$QdlGird 0.;
eleLoad -ele 1322 -type -beamUniform -$QdlGird 0.;
eleLoad -ele 1331 -type -beamUniform -$QdlGird 0.;
eleLoad -ele 1332 -type -beamUniform -$QdlGird 0.;
eleLoad -ele 1341 -type -beamUniform -$QdlGird 0.;
eleLoad -ele 1342 -type -beamUniform -$QdlGird 0.;
}

set Tol 1.0e-8;
variable constraintsTypeGravity Plain;
if { [info exists RigidDiaphragm] == 1} {
variable constraintsTypeGravity Lagrange;
};
};
constraints $constraintsTypeGravity ;
numberer RCM;
system BandGeneral ;
test EnergyIncr $Tol 6 ;
algorithm Newton;
set NstepGravity 10;
set DGravity [expr 1./$NstepGravity];
integrator LoadControl $DGravity;
analysis Static;
analyze $NstepGravity;
loadConst -time 0.0
#set Tol 1.0e-6;
puts "Model Built"
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

you need to open all the files and find out where you have the set command wrong.
ahu861011
Posts: 16
Joined: Tue Jan 19, 2010 5:59 am
Location: zhejiang university of technology

Post by ahu861011 »

fmk,Thanks for your reply.
I build the frame imitating example 7. But I can apply gravity on it. The error message is this:
ProfileSPDLinDirectSolver::solve() - aii < 0 (i, aii): (17, 0)
WARNING NewtonRaphson::solveCurrentStep() -the LinearSysOfEqn failed in solve()
StaticAnalysis::analyze() - the Algorithm failed at iteration: 0 with domain at
load factor 0.1
OpenSees > analyze failed, returned: -3 error flag
Model Built
OpenSees >
I have tried a long time with no result. would you help me to solve my problem?
You said there would be three ways to solve the problem:1、the element builder 2 、material definition 3、constraints. I cann't Still find the false.
Could anyone help me to find it?
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

you have a singular system. Typically this is due to not enough constraints in the model. Fix all the nodes and gradually remove the fixities until you find the problem.

It may also be due to a material with incorrect args resulting in a 0 tangent. the above may help find that one too.

If using continuum models it could be because the nodes have been numbered backwards in the input.
ahu861011
Posts: 16
Joined: Tue Jan 19, 2010 5:59 am
Location: zhejiang university of technology

Post by ahu861011 »

Thank you ,fmk. I have figured it out. It's the system problem.
Post Reply