stop the analysis, modify the model, restart the analysis

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

Moderators: silvia, selimgunay, Moderators

Post Reply
bravejbc
Posts: 13
Joined: Wed Dec 08, 2010 6:08 pm

stop the analysis, modify the model, restart the analysis

Post by bravejbc »

Dear all,
How could I stop the analysis, modify the model and then restart the analysis? In other words how can I control analysis process of the program ?
Thanks!

bravejbc DUT
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Re: stop the analysis, modify the model, restart the analysi

Post by vesna »

Do the analysis in the loop and inside of the loop define condition under which you want to change your model. Under this condition define all changes of your model that you want to see.
bravejbc
Posts: 13
Joined: Wed Dec 08, 2010 6:08 pm

Re: stop the analysis, modify the model, restart the analysi

Post by bravejbc »

Dear vesna,
Thanks for your reply. Followed your advice, I modified the Basic_Truss_Example (http://opensees.berkeley.edu/wiki/index ... ss_Example), and did the analysis in the while loop as follows:

# Remove existing model
wipe

# Create ModelBuilder (with two-dimensions and 2 DOF/node)
model BasicBuilder -ndm 2 -ndf 2

# Create nodes
# ------------

# Create nodes & add to Domain - command: node nodeId xCrd yCrd
node 1 0.0 0.0
node 2 144.0 0.0
node 3 168.0 0.0
node 4 72.0 96.0

# Set the boundary conditions - command: fix nodeID xResrnt? yRestrnt?
fix 1 1 1
fix 2 1 1
fix 3 1 1

# Define materials for truss elements
# -----------------------------------

# Create Elastic material prototype - command: uniaxialMaterial Elastic matID E
uniaxialMaterial Elastic 1 3000

# Define elements
# ---------------

# Create truss elements - command: element truss trussID node1 node2 A matID
element Truss 1 1 4 10.0 1
element Truss 2 2 4 5.0 1
element Truss 3 3 4 5.0 1

# Define loads
# ------------

#create a Linear TimeSeries (load factor varies linearly with time): command timeSeries Linear $tag
timeSeries Linear 1

# Create a Plain load pattern with a linear TimeSeries: command pattern Plain $tag $timeSeriesTag { $loads }
pattern Plain 1 1 {

# Create the nodal load - command: load nodeID xForce yForce
load 4 100 -50
}

# ------------------------------
# Start of analysis generation
# ------------------------------

# Create the system of equation, a SPD using a band storage scheme
system BandSPD

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

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

# Create the integration scheme, the LoadControl scheme using steps of 1.0
integrator LoadControl 1.0

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

# create the analysis object
analysis Static

# ------------------------------
# Start of recorder generation
# ------------------------------

# create a Recorder object for the nodal displacements at node 4
recorder Node -file example.out -time -node 4 -dof 1 2 disp

# Create a recorder for element forces, one in global and the other local system
recorder Element -file eleGlobal.out -time -ele 1 2 3 forces
recorder Element -file eleLocal.out -time -ele 1 2 3 basicForces

# ------------------------------
# Finally perform the analysis
# ------------------------------
#set area of the element 2
set A 5.0
variable AA $A;
# Perform the analysis
while {$AA >=$A && $AA <= 5*$A} {
analyze 1;
variable AA [expr $AA+$A ];
remove element 2;
element Truss 2 2 4 $AA 1;
}

# ------------------------------
# Print Stuff to Screen
# ------------------------------

# Print the current state at node 4 and at all elements
puts "node 4 displacement: [nodeDisp 4]"
print node 4
print ele

I want to increase cross-sectional area of the element 2 during the analysis. However, the result of element global force is like this:

1 -26.3611 -35.1482 26.3611 35.1482 -34.5278 46.0371 34.5278 -46.0371 -39.1111 39.1111 39.1111 -39.1111
2 -52.916 -70.5546 52.916 70.5546 -68.8825 92.353 68.8825 -92.353 -78.2016 78.2016 78.2016 -78.2016
3 -79.6682 -106.224 79.6682 106.224 -103.058 138.951 103.058 -138.951 -117.273 117.273 117.273 -117.273
4 -106.622 -142.162 106.622 142.162 -137.05 185.833 137.05 -185.833 -156.329 156.329 156.329 -156.329
5 -133.78 -178.373 133.78 178.373 -170.85 233.004 170.85 -233.004 -195.37 195.37 195.37 -195.37

It means that the force was also increased when I did the analysis in the while loop. How could I deal with this problem? Thanks again!

bravejbc DUT
bravejbc
Posts: 13
Joined: Wed Dec 08, 2010 6:08 pm

Re: stop the analysis, modify the model, restart the analysi

Post by bravejbc »

Dear vesna,
Thanks for your reply. Followed your advice, I modified the Basic_Truss_Example (http://opensees.berkeley.edu/wiki/index ... ss_Example), and did the analysis in the while loop as follows:

# Remove existing model
wipe

# Create ModelBuilder (with two-dimensions and 2 DOF/node)
model BasicBuilder -ndm 2 -ndf 2

# Create nodes
# ------------

# Create nodes & add to Domain - command: node nodeId xCrd yCrd
node 1 0.0 0.0
node 2 144.0 0.0
node 3 168.0 0.0
node 4 72.0 96.0

# Set the boundary conditions - command: fix nodeID xResrnt? yRestrnt?
fix 1 1 1
fix 2 1 1
fix 3 1 1

# Define materials for truss elements
# -----------------------------------

# Create Elastic material prototype - command: uniaxialMaterial Elastic matID E
uniaxialMaterial Elastic 1 3000

# Define elements
# ---------------

# Create truss elements - command: element truss trussID node1 node2 A matID
element Truss 1 1 4 10.0 1
element Truss 2 2 4 5.0 1
element Truss 3 3 4 5.0 1

# Define loads
# ------------

#create a Linear TimeSeries (load factor varies linearly with time): command timeSeries Linear $tag
timeSeries Linear 1

# Create a Plain load pattern with a linear TimeSeries: command pattern Plain $tag $timeSeriesTag { $loads }
pattern Plain 1 1 {

# Create the nodal load - command: load nodeID xForce yForce
load 4 100 -50
}

# ------------------------------
# Start of analysis generation
# ------------------------------

# Create the system of equation, a SPD using a band storage scheme
system BandSPD

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

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

# Create the integration scheme, the LoadControl scheme using steps of 1.0
integrator LoadControl 1.0

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

# create the analysis object
analysis Static

# ------------------------------
# Start of recorder generation
# ------------------------------

# create a Recorder object for the nodal displacements at node 4
recorder Node -file example.out -time -node 4 -dof 1 2 disp

# Create a recorder for element forces, one in global and the other local system
recorder Element -file eleGlobal.out -time -ele 1 2 3 forces
recorder Element -file eleLocal.out -time -ele 1 2 3 basicForces

# ------------------------------
# Finally perform the analysis
# ------------------------------
#set area of the element 2
set A 5.0
variable AA $A;
# Perform the analysis
while {$AA >=$A && $AA <= 5*$A} {
analyze 1;
variable AA [expr $AA+$A ];
remove element 2;
element Truss 2 2 4 $AA 1;
}

# ------------------------------
# Print Stuff to Screen
# ------------------------------

# Print the current state at node 4 and at all elements
puts "node 4 displacement: [nodeDisp 4]"
print node 4
print ele

I want to increase cross-sectional area of the element 2 during the analysis. However, the result of element global force is like this:

1 -26.3611 -35.1482 26.3611 35.1482 -34.5278 46.0371 34.5278 -46.0371 -39.1111 39.1111 39.1111 -39.1111
2 -52.916 -70.5546 52.916 70.5546 -68.8825 92.353 68.8825 -92.353 -78.2016 78.2016 78.2016 -78.2016
3 -79.6682 -106.224 79.6682 106.224 -103.058 138.951 103.058 -138.951 -117.273 117.273 117.273 -117.273
4 -106.622 -142.162 106.622 142.162 -137.05 185.833 137.05 -185.833 -156.329 156.329 156.329 -156.329
5 -133.78 -178.373 133.78 178.373 -170.85 233.004 170.85 -233.004 -195.37 195.37 195.37 -195.37

It means that the force was also increased when I did the analysis in the while loop. How could I deal with this problem? Thanks again!

bravejbc DUT
bravejbc
Posts: 13
Joined: Wed Dec 08, 2010 6:08 pm

Re: stop the analysis, modify the model, restart the analysi

Post by bravejbc »

vesna wrote:
> Do the analysis in the loop and inside of the loop define condition under
> which you want to change your model. Under this condition define all
> changes of your model that you want to see.

Dear vesna,
I've learned about that the analysis will stop either the analysis is finished or the analysis fails to converg. My problem is how could I I pause the analysis, modify the model and then restart this analysis?
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Re: stop the analysis, modify the model, restart the analysi

Post by vesna »

while loop is good for convergence problems but not for what you are doing.

do the analysis from step 1 to n in a "for loop". inside of a loop you can have condition "IF" the certain step of analysis is reached make some changes and after that go to the next step of analysis.
bravejbc
Posts: 13
Joined: Wed Dec 08, 2010 6:08 pm

Re: stop the analysis, modify the model, restart the analysi

Post by bravejbc »

I think I've gotten some misunderstanding or made some mistake, so I wasn't able to solve my problem. Would you like to give me a example and show me much more details about the loop. :P
Thank you very much!

bravejbc DUT
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Re: stop the analysis, modify the model, restart the analysi

Post by vesna »

Ok, here is an example:

for { set i 1 } { $i<$numSteps } { incr i} {
if { $i == 575 } {
remove loadPattern 12001
remove element 12002
}
set res [analyze 1 $dt]
}
bravejbc
Posts: 13
Joined: Wed Dec 08, 2010 6:08 pm

Re: stop the analysis, modify the model, restart the analysi

Post by bravejbc »

Thank you very much!
Post Reply