record different load case

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

Moderators: silvia, selimgunay, Moderators

Post Reply
dkwong
Posts: 6
Joined: Mon Jun 16, 2014 7:09 am
Location: University at Buffalo

record different load case

Post by dkwong »

Hi, everyone.
I have generated the model and put the load on it. It is the transverse direction of a bridge. The bridge has been modeled as a continuous beam supported by springs. The first load case is a car modeled as 20 inches uniform load on the left side (x=0) of the bridge. The next case is the load in x=2, and the next case is x=4
The only question is when I ran the model, the result is an accumulated load result. I am not quite sure how to separate the recorded results from different cases.
I hope you can give some idea.



# build the model
wipe

puts "System"

model basic -ndm 2 -ndf 3

set NBoxes 8.
set NSpans [expr ($NBoxes -1)]
set B1 48
set B2 54
set B3 54
set B4 54
set B5 54
set B6 54
set B7 48
set C1 12
set C2 12
set KS 20
set KB 50

set BL [expr ($C1 + $B1 + $B2 + $B3 + $B4 + $B5 + $B6 + $B7 + $C2)]
set NCBNds [expr ($BL + 1)]
set FXNd [expr ($C1 + $B1 + $B2 + $B3 + $B4 + 1)]


# add nodes - command: node nodeId xCrd yCrd
for {set i 1} {$i <= [expr ($NCBNds - 1)]} {incr i 1} {
node $i [expr ($i - 1)] 0.0
}

#fixX 0.0 1 0 0
fix $FXNd 1 0 0

set xb 0
set ni [expr ($NCBNds + 1)]
set xB1 [expr ($xb + $C1)]; set na1 [expr ($ni + 0)];
node $na1 $xB1 0.00;
fix $na1 1 1 1
set xB2 [expr ($xB1 + $B1)]; set na2 [expr ($ni + 1)];
node $na2 $xB2 0.00;
fix $na2 1 1 1
set xB3 [expr ($xB2 + $B2)]; set na3 [expr ($ni + 2)];
node $na3 $xB3 0.00;
fix $na3 1 1 1
set xB4 [expr ($xB3 + $B3)]; set na4 [expr ($ni + 3)];
node $na4 $xB4 0.00;
fix $na4 1 1 1
set xB5 [expr ($xB4 + $B4)]; set na5 [expr ($ni + 4)];
node $na5 $xB5 0.00;
fix $na5 1 1 1
set xB6 [expr ($xB5 + $B5)]; set na6 [expr ($ni + 5)];
node $na6 $xB6 0.00;
fix $na6 1 1 1
set xB7 [expr ($xB6 + $B6)]; set na7 [expr ($ni + 6)];
node $na7 $xB7 0.00;
fix $na7 1 1 1
set xB8 [expr ($xB7 + $B7)]; set na8 [expr ($ni + 7)];
node $na8 $xB8 0.00;
fix $na8 1 1 1


puts "Geometry In"


# add material - command: material <matType> matID <matArgs>
uniaxialMaterial Elastic 1 $KB
uniaxialMaterial Elastic 2 $KS
uniaxialMaterial Parallel 3 1 2
#uniaxialMaterial Elastic 1 100
set E 29000
set A 9.855
set Iz 21.2085


geomTransf Linear 1


set a 1
for {set n1 $a} {$n1 <= [expr ($BL - 1)]} {incr n1 1} {


element elasticBeamColumn $n1 $n1 [expr ($n1 + 1)] $A $E $Iz 1

}

equalDOF $na1 [expr ($xB1 + 1)] 1 3
equalDOF $na2 [expr ($xB2 + 1)] 1 3
equalDOF $na3 [expr ($xB3 + 1)] 1 3
equalDOF $na4 [expr ($xB4 + 1)] 1 3
equalDOF $na5 [expr ($xB5 + 1)] 1 3
equalDOF $na6 [expr ($xB6 + 1)] 1 3
equalDOF $na7 [expr ($xB7 + 1)] 1 3
equalDOF $na8 [expr ($xB8 + 1)] 1 3

puts "Beam Elements In"


element zeroLength [expr ($BL + 1)] $na1 [expr ($xB1 + 1)] -mat 3 -dir 2
element zeroLength [expr ($BL + 2)] $na2 [expr ($xB2 + 1)] -mat 3 -dir 2
element zeroLength [expr ($BL + 3)] $na3 [expr ($xB3 + 1)] -mat 3 -dir 2
element zeroLength [expr ($BL + 4)] $na4 [expr ($xB4 + 1)] -mat 3 -dir 2
element zeroLength [expr ($BL + 5)] $na5 [expr ($xB5 + 1)] -mat 3 -dir 2
element zeroLength [expr ($BL + 6)] $na6 [expr ($xB6 + 1)] -mat 3 -dir 2
element zeroLength [expr ($BL + 7)] $na7 [expr ($xB7 + 1)] -mat 3 -dir 2
element zeroLength [expr ($BL + 8)] $na8 [expr ($xB8 + 1)] -mat 3 -dir 2

timeSeries Linear 1
#command pattern Plain $tag $timeSeriesTag { $loads }
#For uniformly-distributed load:
#eleLoad -ele $eleTag1 <$eleTag2 ....> -type -beamUniform $Wz <$Wx>

set LR 20
set a 1
for {set m $a} {$m <= [expr ($BL - $LR - 1)]} {incr m 2} {
pattern Plain $m 1 {
eleLoad -ele $m [expr ($m + 1)] [expr ($m + 2)] [expr ($m + 3)] [expr ($m + 4)] [expr ($m + 5)] [expr ($m + 6)] [expr ($m + 7)] [expr ($m + 8)] [expr ($m + 9)] [expr ($m + 10)] [expr ($m + 11)] [expr ($m + 12)] [expr ($m + 13)] [expr ($m + 14)] [expr ($m + 15)] [expr ($m + 16)] [expr ($m + 17)] [expr ($m + 18)] [expr ($m + 19)] [expr ($m + 20)] -type -beamUniform -1
}
recorder Element -file eleGlobal$m.out -time -eleall forces
}


recorder display "eleGlobal$m.out" 10 100 500 500 -wipe
vup 0 1 0 # dirn defining up direction of view plane(ghab bordar movazi)
vpn 0 0 1 # direction of outward normal to view plane(amud bar safhe ghab)
prp 0 0 1 # eye location in local coord sys defined by viewing system
viewWindow -300 300 -500 500
display 2 2 1



puts "analysis"

# Create the system of equation
system BandGeneral

# Create the DOF numberer, the reverse Cuthill-McKee algorithm
numberer Plain

# Create the constraint handler, a Plain handler is used as homo constraints
constraints Transformation 1.0

test NormDispIncr 1e-6 10 1
# Create the integration scheme, the LoadControl scheme using steps of 1.0
integrator LoadControl 1 1 1 1

# Create the solution algorithm, a Linear algorithm is created
algorithm Newton

# create the analysis object
analysis Static

analyze 5

puts "Static Analysis Done"
#print -file eleGlobal$m.out -ele 1 2
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: record different load case

Post by fmk »

you have it all wrong. the analysis does not workk on independent load patterns, it performs the analysis for all the load patterns that are present. so while you are creating many load patterns they are all being included in the analysis and hence recorders will all have the same result and will be the result for combination of all. if you want the results for each pattern idividually you need to put everything inside the for loop, i.e.:

for {set m $a} {$m <= [expr ($BL - $LR - 1)]} {incr m 2} {

wipe
model Basic
#create nodes
#create elements

pattern Plain $m 1 {
eleLoad -ele $m [expr ($m + 1)] [expr ($m + 2)] [expr ($m + 3)] [expr ($m + 4)] [expr ($m + 5)] [expr ($m + 6)] [expr ($m + 7)] [expr ($m + 8)] [expr ($m + 9)] [expr ($m + 10)] [expr ($m + 11)] [expr ($m + 12)] [expr ($m + 13)] [expr ($m + 14)] [expr ($m + 15)] [expr ($m + 16)] [expr ($m + 17)] [expr ($m + 18)] [expr ($m + 19)] [expr ($m + 20)] -type -beamUniform -1
}
recorder Element -file eleGlobal$m.out -time -eleall forces

# create analysis
#anzalyze
}
}
}
Post Reply