Parametric Studies

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

Moderators: silvia, selimgunay, Moderators

Post Reply
evgin
Posts: 64
Joined: Tue Dec 06, 2011 3:18 pm
Location: UCLA

Parametric Studies

Post by evgin »

Hello

Assume we have a set of parameters

like

set LA1 3

set LA2 4

.
.
.
set LA10 10

and we wanna call them in , into a script like:


set {for i 1} {$i <=10 } {incr i } {


set b($i) [expr $LA$i+1]

}

[expr $LA$i+1] does not work , any suggestions that i can call in LA1, LA2,... LA10 automatically into my code?? I know that I can put them into an array and do it but anything but that is available ?

Thanks
RG.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Parametric Studies

Post by fmk »

try this:
set LA2 4
set LA3 12
set b {}
for {set i 1} {$i <=2 } {incr i 1} {
set val "LA[expr $i+1]"
lappend b [subst $$val]
}
puts $b
Post Reply