help in simple monte carlo simulation attempt!

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

Moderators: silvia, selimgunay, Moderators

Post Reply
giakila
Posts: 3
Joined: Sat May 26, 2012 9:44 am
Location: Aristotle University of Thessaloniki

help in simple monte carlo simulation attempt!

Post by giakila »

I am trying to perform a monte carlo simulation. It seems that the analysis crashes when it comes to the command
if {[performanceFunction 1] <= 0.0} {incr Nfail}
that i use to count the number of fail analyses.
How could i get the updated value of my performance function?

This is my simple code:

model basic -ndm 2 -ndf 3

set L 144.0
set E 30000.0
set A 25.0
set I 1500.0

node 1 0.0 0.0
node 2 $L 0.0

fix 1 1 1 0
fix 2 0 1 0
section Elastic 1 $E $A $I

geomTransf Linear 1

element forceBeamColumn 1 1 2 1 Lobatto 1 3
set P 25.0

pattern Plain 1 Constant {
load 2 $P 0 0
}

reliability
randomVariable 1 normal -mean $E -stdv [expr 0.1*$E]
randomVariable 2 normal -mean $A -stdv [expr 0.1*$A]
parameter 1 randomVariable 1 element 1 E
parameter 2 randomVariable 2 element 1 A
parameter 3 node 2 disp 1
performanceFunction 1 "0.005-\[nodeDisp 2 1\]"

set Ntrials 1000; set Nfail 0
for {set i 1} {$i <= $Ntrials} {incr i} {
reset
foreach {rvTag pTag} {1 1 2 2} {
set p [expr rand()]
updateParameter $pTag [getInverseCDF $rvTag $p]
}

functionEvaluator Tcl -file static.tcl

if {[performanceFunction 1] <= 0.0} {incr Nfail}
}

puts "pf = [expr double($Nfail)/$Ntrials]"
Post Reply