How to manage eigenvalues

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

Moderators: silvia, selimgunay, Moderators

Post Reply
endryus
Posts: 47
Joined: Wed Apr 13, 2005 5:59 am
Location: freelance
Contact:

How to manage eigenvalues

Post by endryus » Mon Apr 18, 2005 11:05 pm

Maybe it's really simple but I compute the first 10 eigval with
set lambda [eigen 10]
now I can write lambda with
puts $lambda
but how can I assign each eigval to a different variable?
I can't use lambda(i) because lambda is not an array.
endryus

berktaftali
Posts: 68
Joined: Fri Jul 02, 2004 6:10 am
Location: Computers and Structures, Inc.

Post by berktaftali » Tue Apr 19, 2005 2:39 am

eigen command returns a Tcl list, not an array. The following code should print all of the eigenvalues to screen...

Code: Select all

for {set i 0} {$i < 10} {incr i} {
    puts [lindex $lambda $i]
}
Berk Taftali
Georgia Institute of Technology
Ph.D. Candidate, Structural Engineering, Mechanics, and Materials
School of Civil and Environmental Engineering
Atlanta, GA 30332 USA
Email: gte994y@mail.gatech.edu

endryus
Posts: 47
Joined: Wed Apr 13, 2005 5:59 am
Location: freelance
Contact:

Post by endryus » Tue Apr 19, 2005 5:37 am

OK, using lists I've done it !
thanks
endryus

Post Reply