Eigenanalysis and symmSparseArpack
Moderators: silvia, selimgunay, Moderators
Eigenanalysis and symmSparseArpack
Hello All,
I am trying to use the symmSparseArpack solver for the eigen analysis, but I am getting the following error: "domain error: argument not in valid range"
Can you please tell me what is wrong in the following command line?
"set lambda [eigen -generalized -symmSparseArpack $numModes];"
To test the command I am using from the example from wiki page "Eigen analysis of a two-story shear frame", by Vesna.
I am changing the line 74 from:
"set lambda [eigen $numModes];"
to
"set lambda [eigen -generalized -symmSparseArpack $numModes];"
Thank you in advance
I am trying to use the symmSparseArpack solver for the eigen analysis, but I am getting the following error: "domain error: argument not in valid range"
Can you please tell me what is wrong in the following command line?
"set lambda [eigen -generalized -symmSparseArpack $numModes];"
To test the command I am using from the example from wiki page "Eigen analysis of a two-story shear frame", by Vesna.
I am changing the line 74 from:
"set lambda [eigen $numModes];"
to
"set lambda [eigen -generalized -symmSparseArpack $numModes];"
Thank you in advance
André
Re: Eigenanalysis and symmSparseArpack
Your command is correct. The only thing that can be a problem is a number of modes that you are issuing ($numModes). Make sure it is smaller than (number of inertial dofs - 1).
Re: Eigenanalysis and symmSparseArpack
Thank you for your reply.
However, in your example the numModes is set to 2, and you have 4 inertial dofs. Could it be something else?
Thank you
However, in your example the numModes is set to 2, and you have 4 inertial dofs. Could it be something else?
Thank you
André
Re: Eigenanalysis and symmSparseArpack
Yes, you can ask for any number of modes that is of interest to you but keep in mind that the maximum number of modes you can get has to be smaller than the number of inertial dofs.
Re: Eigenanalysis and symmSparseArpack
Ok, but if I use the the command line "set lambda [eigen -generalized -symmSparseArpack $numModes];" instead of "set lambda [eigen $numModes];" I get the following error message: "domain error: argument not in valid range".
I may be doing some mistake, but I am pretty sure that all I changed w.r.t. your example was the line 74 of the file.
Thank you again
I may be doing some mistake, but I am pretty sure that all I changed w.r.t. your example was the line 74 of the file.
Thank you again
André
Re: Eigenanalysis and symmSparseArpack
I just tested what you described and realized what was the problem. The solver you were trying to use (symmSparseArpack) has some limitations on the number of modes it can provide. For my example it worked if I asked for the first mode but did not if I asked for the first two modes. fullGenLapack can give all four modes, and the default solver genBandArpack can give maximum of 3 modes.
Re: Eigenanalysis and symmSparseArpack
So, do you know if is it something in the opensees code or is it the actual solver that only allows that one mode shape be output? Could symmSparseArpack provide more mode shapes in the future?
Even though I was trying the simple example to test the syntax, the reason for trying the symmSparseArpack it that my actual application is a very big structure and it would be useful (in terms of computational time) to be able to use a Sparse solver. SuperLU is already doing the job much faster than fullGenLapack, but it would still be useful if I could use the symmSparseArpack. However, as you said, currently, it seems that I can only get one mode shape.
Thank you again.
Even though I was trying the simple example to test the syntax, the reason for trying the symmSparseArpack it that my actual application is a very big structure and it would be useful (in terms of computational time) to be able to use a Sparse solver. SuperLU is already doing the job much faster than fullGenLapack, but it would still be useful if I could use the symmSparseArpack. However, as you said, currently, it seems that I can only get one mode shape.
Thank you again.
André
Re: Eigenanalysis and symmSparseArpack
All solvers are outside packages that Opensees uses (it is not developed inside opensees). Test symmSparseArpack solver on a structure with more inertial degrees of freedom. I believe it will give more then one mode shape.
Re: Eigenanalysis and symmSparseArpack
I must be doing a mistake somewhere then. Please see below the code and if you can, please let me know what is wrong with it. The example below is based on an example posted on the opensees wiki, and I have changed/added more inertial masses (total of 8 inertial dofs) and I am requesting two modes. The symmSparseArpack solver only outputs something if I ask only for one mode.
Thank you.
# Eigen analysis of a two-storey shear frame; Example 10.4 from "Dynamics of Structures" book by Anil Chopra - using equalDOF and very high Ib
# units: in, kips
wipe
#input
set m [expr 100.0/386.0]
set numModes 2
#material
set Ac 63.41
set Ic 320.0
set E 30000.0
set Ib 10e+12
set Ab 63.41
#geometry
set L 288.
set h 144.
# create data directory
file mkdir modes;
# define the model
#---------------------------------
#model builder
model BasicBuilder -ndm 2 -ndf 3
# nodal coordinates:
node 1 0. 0. ;
node 2 $L 0. ;
node 3 0. $h ;
node 4 $L $h ;
node 5 0. [expr 2*$h];
node 6 $L [expr 2*$h];
# Single point constraints -- Boundary Conditions
fix 1 1 1 1;
fix 2 1 1 1;
# MP constraints
equalDOF 3 4 2 3
equalDOF 5 6 2 3
# assign mass
[b]
mass 3 $m $m 0. ;
mass 4 $m $m 0. ;
mass 5 [expr $m/2.] [expr $m/2.] 0. ;
mass 6 [expr $m/2.] [expr $m/2.] 0. ;
[/b]
# define geometric transformation:
set TransfTag 1;
geomTransf Linear $TransfTag ;
# define elements:
# columns
element elasticBeamColumn 1 1 3 $Ac $E [expr 2.*$Ic] $TransfTag;
element elasticBeamColumn 2 3 5 $Ac $E $Ic $TransfTag;
element elasticBeamColumn 3 2 4 $Ac $E [expr 2.*$Ic] $TransfTag;
element elasticBeamColumn 4 4 6 $Ac $E $Ic $TransfTag;
# beams
element elasticBeamColumn 5 3 4 $Ab $E $Ib $TransfTag;
element elasticBeamColumn 6 5 6 $Ab $E $Ib $TransfTag;
# record eigenvectors
#----------------------
for { set k 1 } { $k <= $numModes } { incr k } {
recorder Node -file [format "modes/mode%i.out" $k] -nodeRange 1 6 -dof 1 2 3 "eigen $k"
}
# perform eigen analysis
#-----------------------------
[b]
set lambda [eigen -generalized -symmSparseArpack $numModes];
[/b]
# calculate frequencies and periods of the structure
#---------------------------------------------------
set omega {}
set f {}
set T {}
set pi 3.141593
foreach lam $lambda {
lappend omega [expr sqrt($lam)]
lappend f [expr sqrt($lam)/(2*$pi)]
lappend T [expr (2*$pi)/sqrt($lam)]
}
puts "periods are $T"
# write the output file cosisting of periods
#--------------------------------------------
set period "modes/Periods.txt"
set Periods [open $period "w"]
foreach t $T {
puts $Periods " $t"
}
close $Periods
# create display for mode shapes
#---------------------------------
# $windowTitle $xLoc $yLoc $xPixels $yPixels
recorder display "Mode Shape 1" 10 10 500 500 -wipe
prp $h $h 1; # projection reference point (prp); defines the center of projection (viewer eye)
vup 0 1 0; # view-up vector (vup)
vpn 0 0 1; # view-plane normal (vpn)
viewWindow -200 200 -200 200; # coordiantes of the window relative to prp
display -1 5 20; # the 1st arg. is the tag for display mode (ex. -1 is for the first mode shape)
# the 2nd arg. is magnification factor for nodes, the 3rd arg. is magnif. factor of deformed shape
recorder display "Mode Shape 2" 10 510 500 500 -wipe
prp $h $h 1;
vup 0 1 0;
vpn 0 0 1;
viewWindow -200 200 -200 200
display -2 5 20
# Run a one step gravity load with no loading (to record eigenvectors)
#-----------------------------------------------------------------------
integrator LoadControl 0 1 0 0
# Convergence test
# tolerance maxIter displayCode
test EnergyIncr 1.0e-10 100 0
# Solution algorithm
algorithm Newton
# DOF numberer
numberer RCM
# Constraint handler
constraints Transformation
# System of equations solver
system ProfileSPD
analysis Static
set res [analyze 1]
if {$res < 0} {
puts "Modal analysis failed"
}
# get values of eigenvectors for translational DOFs
#---------------------------------------------------
set f11 [nodeEigenvector 3 1 1]
set f21 [nodeEigenvector 5 1 1]
set f12 [nodeEigenvector 3 2 1]
set f22 [nodeEigenvector 5 2 1]
puts "eigenvector 1: [list [expr {$f11/$f21}] [expr {$f21/$f21}] ]"
puts "eigenvector 2: [list [expr {$f12/$f22}] [expr {$f22/$f22}] ]"
Thank you.
# Eigen analysis of a two-storey shear frame; Example 10.4 from "Dynamics of Structures" book by Anil Chopra - using equalDOF and very high Ib
# units: in, kips
wipe
#input
set m [expr 100.0/386.0]
set numModes 2
#material
set Ac 63.41
set Ic 320.0
set E 30000.0
set Ib 10e+12
set Ab 63.41
#geometry
set L 288.
set h 144.
# create data directory
file mkdir modes;
# define the model
#---------------------------------
#model builder
model BasicBuilder -ndm 2 -ndf 3
# nodal coordinates:
node 1 0. 0. ;
node 2 $L 0. ;
node 3 0. $h ;
node 4 $L $h ;
node 5 0. [expr 2*$h];
node 6 $L [expr 2*$h];
# Single point constraints -- Boundary Conditions
fix 1 1 1 1;
fix 2 1 1 1;
# MP constraints
equalDOF 3 4 2 3
equalDOF 5 6 2 3
# assign mass
[b]
mass 3 $m $m 0. ;
mass 4 $m $m 0. ;
mass 5 [expr $m/2.] [expr $m/2.] 0. ;
mass 6 [expr $m/2.] [expr $m/2.] 0. ;
[/b]
# define geometric transformation:
set TransfTag 1;
geomTransf Linear $TransfTag ;
# define elements:
# columns
element elasticBeamColumn 1 1 3 $Ac $E [expr 2.*$Ic] $TransfTag;
element elasticBeamColumn 2 3 5 $Ac $E $Ic $TransfTag;
element elasticBeamColumn 3 2 4 $Ac $E [expr 2.*$Ic] $TransfTag;
element elasticBeamColumn 4 4 6 $Ac $E $Ic $TransfTag;
# beams
element elasticBeamColumn 5 3 4 $Ab $E $Ib $TransfTag;
element elasticBeamColumn 6 5 6 $Ab $E $Ib $TransfTag;
# record eigenvectors
#----------------------
for { set k 1 } { $k <= $numModes } { incr k } {
recorder Node -file [format "modes/mode%i.out" $k] -nodeRange 1 6 -dof 1 2 3 "eigen $k"
}
# perform eigen analysis
#-----------------------------
[b]
set lambda [eigen -generalized -symmSparseArpack $numModes];
[/b]
# calculate frequencies and periods of the structure
#---------------------------------------------------
set omega {}
set f {}
set T {}
set pi 3.141593
foreach lam $lambda {
lappend omega [expr sqrt($lam)]
lappend f [expr sqrt($lam)/(2*$pi)]
lappend T [expr (2*$pi)/sqrt($lam)]
}
puts "periods are $T"
# write the output file cosisting of periods
#--------------------------------------------
set period "modes/Periods.txt"
set Periods [open $period "w"]
foreach t $T {
puts $Periods " $t"
}
close $Periods
# create display for mode shapes
#---------------------------------
# $windowTitle $xLoc $yLoc $xPixels $yPixels
recorder display "Mode Shape 1" 10 10 500 500 -wipe
prp $h $h 1; # projection reference point (prp); defines the center of projection (viewer eye)
vup 0 1 0; # view-up vector (vup)
vpn 0 0 1; # view-plane normal (vpn)
viewWindow -200 200 -200 200; # coordiantes of the window relative to prp
display -1 5 20; # the 1st arg. is the tag for display mode (ex. -1 is for the first mode shape)
# the 2nd arg. is magnification factor for nodes, the 3rd arg. is magnif. factor of deformed shape
recorder display "Mode Shape 2" 10 510 500 500 -wipe
prp $h $h 1;
vup 0 1 0;
vpn 0 0 1;
viewWindow -200 200 -200 200
display -2 5 20
# Run a one step gravity load with no loading (to record eigenvectors)
#-----------------------------------------------------------------------
integrator LoadControl 0 1 0 0
# Convergence test
# tolerance maxIter displayCode
test EnergyIncr 1.0e-10 100 0
# Solution algorithm
algorithm Newton
# DOF numberer
numberer RCM
# Constraint handler
constraints Transformation
# System of equations solver
system ProfileSPD
analysis Static
set res [analyze 1]
if {$res < 0} {
puts "Modal analysis failed"
}
# get values of eigenvectors for translational DOFs
#---------------------------------------------------
set f11 [nodeEigenvector 3 1 1]
set f21 [nodeEigenvector 5 1 1]
set f12 [nodeEigenvector 3 2 1]
set f22 [nodeEigenvector 5 2 1]
puts "eigenvector 1: [list [expr {$f11/$f21}] [expr {$f21/$f21}] ]"
puts "eigenvector 2: [list [expr {$f12/$f22}] [expr {$f22/$f22}] ]"
André
Re: Eigenanalysis and symmSparseArpack
Your model is good. It is about solver (symmSparseArpack) you are trying to use. I tested this solver on a bigger frame with 12 inertial dofs and I could get maximum of 2 modes. I will talk with Frank to see what are the limitations of this particular solver and get back to you.
Re: Eigenanalysis and symmSparseArpack
Hi
how can I obtain the Mode shape In Opensees Navigator ?
how can I obtain the Mode shape In Opensees Navigator ?