Set Parameter in STKO

Lin Sun
Posts: 24
Joined: Wed Jan 26, 2022 10:04 pm

Set Parameter in STKO

Post by Lin Sun » Wed Jul 27, 2022 9:14 pm

Dear STKO team,

I am doing FE model updating, which requires the OpenSees model to run with different parameter values at each time steps. In Jan 27th, 2022's round table (https://www.youtube.com/watch?v=1LzNtZi ... v&index=28), I learned how to use setParameter command to achieve this.

I have several questions. Hope you can help me with them. I am very appreciative. I have a model with ElasticMembranePlate Section for slabs and wall, Elastic section for beams and columns.

Now I want to update the following parameters:
(1) Young's modulus of the whole building E (I have already known how to do it by using setParameter).
(2) Membrane stiffness modifier of the walls
(4) Flexural stiffness modifier of the columns.

Question 1: For Membrane stiffness modifier of the walls, there is a parameter as Ep_mod. In STKO, it's decribed as "Ratio of Flexural to Membrane stiffness". However, when I check the OpenSees source code. Ep_mod is defined as Ep_mod= Ep/Em. Flexural stiffness is calculated as Ep * (h*h*h) / 12.0 / ( 1.0 - nu*nu ). There is some inconsistency between the source code and the STKO description.

Question 2: How can I tune membrane stiffness modifier of the ElasticMembranePlate section if it's not given in setParameter?

Question 3: How to I tune the flexural stiffness modifier of the Elastic section? I have checked the setParameter function of Elastic section. I can only change the Iy, Iz but there is no flexural stiffness modifier for me to change.

To test the commands, I made a toy example, with walls, columns and slabs. They have eigen-analysis before changing parameter and eigen-analysis after changing the parameter.

Thank you very much if you can give some explanation on this.

Best,
Lin Sun
Attachments
toyExample.zip
(58.14 KiB) Downloaded 8 times

Lin Sun
Posts: 24
Joined: Wed Jan 26, 2022 10:04 pm

Re: Set Parameter in STKO

Post by Lin Sun » Wed Aug 03, 2022 4:42 pm

Dear STKO team,

Sorry to bother again. I am trying to use parameter, addToParameter and updateParameter to change the parameter. I have also studied this post: viewtopic.php?f=40&t=1759&p=2558&hilit= ... eter#p2558

Below is my tcl script

Code: Select all

# set parameter tag as 123
parameter 123  
# add object to parameter 123, here is column tag 6 and its Iy
addToParameter 123 element 6 "Iy"
# get the current values of element 6's Iy
set Iy [getParamValue 123]
set damage 0.0001
# set the Iy_mod which is tuned by $damage
set Iy_mod [expr $damage*$Iy]
# update the Iy of element 6
updateParameter 123 $Iy_mod
My question is how to update parameter on one selection set not a single element? Here in tcl, I don't know the element tags from a certain selection set.

I also know that in STKO, the parameter command can choose a selection set, and then updateParameter can update that selection set. But with this approach, I can only update all elements in that selection set to a certain value instead of update them to a certain ratio with respect to their original value as the above code shows.

Hope you could give me some insights on this.

Best,
Lin Sun

STKO Team
Posts: 1346
Joined: Tue Oct 29, 2019 8:45 am

Re: Set Parameter in STKO

Post by STKO Team » Mon Aug 22, 2022 10:40 am

Actually, there is a way to understand the elements (or nodes) inside a selection set:

Create a region, check the WriteOnList, and give it a name:
SSET_list.png
SSET_list.png (18.18 KiB) Viewed 183 times
This will create a region even if you don't need it, but it will also create a Tcl list containing the element tags of the selection set used for the region.
After that, you can use your script, but inside a for-loop:

Code: Select all

foreach ele $my_elements_to_update {

# the parameter ID
set param_id 12345
# set parameter tag as $param_id
parameter $param_id  
# add object to parameter $param_id, here is column tag 6 and its Iy
addToParameter $param_id element $ele "Iy"
# get the current values of element 6's Iy
set Iy [getParamValue $param_id]
set damage 0.0001
# set the Iy_mod which is tuned by $damage
set Iy_mod [expr $damage*$Iy]
# update the Iy of element 6
updateParameter $param_id $Iy_mod
# remove parameter
remove parameter $param_id

# You can un-commment this to make sure the update happened
#puts "Ele: $ele - Iy = $Iy -> $Iy_mod"

}

Lin Sun
Posts: 24
Joined: Wed Jan 26, 2022 10:04 pm

Re: Set Parameter in STKO

Post by Lin Sun » Wed Aug 24, 2022 6:11 pm

Thank you STKO team. This reply is very helpful for me.

STKO Team
Posts: 1346
Joined: Tue Oct 29, 2019 8:45 am

Re: Set Parameter in STKO

Post by STKO Team » Fri Aug 26, 2022 10:25 am

You're welcome

Lin Sun
Posts: 24
Joined: Wed Jan 26, 2022 10:04 pm

Re: Set Parameter in STKO

Post by Lin Sun » Tue Aug 30, 2022 6:26 pm

Dear STKO team,

I encountered a problem while using your approach on my Geisel Library model. Currently, I am using OpenSeesMP to run the analysis. When I make the partition as 1. It can run without problem. Here is what it prints out from opensee. You can see the 12 elements are updated.

Code: Select all

Using ASDShellQ4 - Developed by: Massimo Petracca, Guido Camata, ASDEA Software Technology
Using ASDEmbeddedNodeElement - Developed by: Massimo Petracca, Guido Camata, ASDEA Software Technology
Ele: 40638 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 40639 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 40640 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42549 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42550 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42551 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42582 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42583 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42584 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42612 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42613 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42614 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 40638 - Iz =          13333.33333333333393966313 -> 6666.666666666667
Ele: 40639 - Iz =          13333.33333333333393966313 -> 6666.666666666667
Ele: 40640 - Iz =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42549 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42550 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42551 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42582 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42583 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42584 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42612 - Iz =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42613 - Iz =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42614 - Iz =          13333.33333333333393966313 -> 6666.666666666667
Increment:      1 | Iterations:    0 | Norm: 0.000e+00 | Progress: 100.000 %
Target time has been reached. Current time = 1.0
SUCCESS.
Model 0 Static  Analysis is Done
Now if i make the partitions more than 1, say its 2 now, it has this following error. I am trying to understand this error. As you can see, one processor have updated the 12 elements. However it seems that the second processor cannot detect the elements. So it throws this warning "Parameter::addComponent 1 -- no objects were able to identify parameter" I am curious why, and should I ignore this error?

Code: Select all

Using ASDShellQ4 - Developed by: Massimo Petracca, Guido Camata, ASDEA Software Technology
Using ASDShellQ4 - Developed by: Massimo Petracca, Guido Camata, ASDEA Software Technology
Using ASDEmbeddedNodeElement - Developed by: Massimo Petracca, Guido Camata, ASDEA Software Technology
Ele: 40638 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 40639 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 40640 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42549 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42550 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42551 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42582 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42583 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42584 - Iy =           8748.00000000000000000000 -> 4374.0
Ele: 42612 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42613 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42614 - Iy =          13333.33333333333393966313 -> 6666.666666666667
Ele: 40638 - Iz =          13333.33333333333393966313 -> 6666.666666666667
Ele: 40639 - Iz =          13333.33333333333393966313 -> 6666.666666666667
Ele: 40640 - Iz =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42549 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42550 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42551 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42582 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42583 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42584 - Iz =           8748.00000000000000000000 -> 4374.0
Ele: 42612 - Iz =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42613 - Iz =          13333.33333333333393966313 -> 6666.666666666667
Ele: 42614 - Iz =          13333.33333333333393966313 -> 6666.666666666667


Using ASDEmbeddedNodeElement - Developed by: Massimo Petracca, Guido Camata, ASDEA Software Technology
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 40638 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 40639 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 40640 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 42549 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 42550 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 42551 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 42582 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 42583 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 42584 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 42612 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 42613 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 1 -- no objects were able to identify parameter
Iy
Ele: 42614 - Iy =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 40638 - Iz =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 40639 - Iz =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 40640 - Iz =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 42549 - Iz =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 42550 - Iz =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 42551 - Iz =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 42582 - Iz =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 42583 - Iz =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 42584 - Iz =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 42612 - Iz =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 42613 - Iz =              1.00000000000000000000 -> 0.5
Parameter::addComponent 2 -- no objects were able to identify parameter
Iz
Ele: 42614 - Iz =              1.00000000000000000000 -> 0.5
Increment:      1 | Iterations:    0 | Norm: 0.000e+00 | Progress: 100.000 %
Target time has been reached. Current time = 1.0
SUCCESS.
Model 0 Static  Analysis is Done
Model 0 Static  Analysis is Done
I have attached my model in this post. Hope you can have a quick look. Thank you very much.

Best,
Lin Sun

Lin Sun
Posts: 24
Joined: Wed Jan 26, 2022 10:04 pm

Re: Set Parameter in STKO

Post by Lin Sun » Tue Aug 30, 2022 6:27 pm

Here is my model.
Attachments
library_time_history.zip
(11.64 MiB) Downloaded 5 times

STKO Team
Posts: 1346
Joined: Tue Oct 29, 2019 8:45 am

Re: Set Parameter in STKO

Post by STKO Team » Wed Aug 31, 2022 8:59 am

Don't worry, they are just warnings.
Why does it happen?

Because the Tcl list you created in STKO contains all the elements you put in the selection set.
However, when you partition your model, some of them may be in one processor but not in the other.
When you try to update a parameter on element 1 (which is on processor 3) on processor 2 , you will see that warning.
But it's not a problem, because you will also update the parameter on processor 3 (an all other processors) so you will anyway update all elements.

If you want to get rid of the warning, just add these lines at the beginning of your "update Parameter Col":

Code: Select all

# Modification for OpenSeesMP
# recomputed colElements keeping only the elements in this PARTITION

set old_size [llength $colElements]
set temporary_copy $colElements
set colElements {}
set all_elements_in_this_partition [getEleTags]
foreach ele $temporary_copy {
	if {[lsearch -integer $all_elements_in_this_partition $ele] >= 0} {
		lappend colElements $ele
	}
}
set current_size [llength $colElements]
puts "PID: [getPID] - OLD_SIZE = $old_size; NEW_SIZE = $current_size"

Lin Sun
Posts: 24
Joined: Wed Jan 26, 2022 10:04 pm

Re: Set Parameter in STKO

Post by Lin Sun » Wed Aug 31, 2022 6:37 pm

This is also what I tried to understand this error. Thank you so much for this detailed explanation. Much appreciated.

STKO Team
Posts: 1346
Joined: Tue Oct 29, 2019 8:45 am

Re: Set Parameter in STKO

Post by STKO Team » Thu Sep 01, 2022 8:11 am

You're welcome

Post Reply