Author Topic: Perlicun Ver3- Location of the Components  (Read 586 times)

rezvan

  • Newbie
  • *
  • Posts: 20
    • View Profile
Perlicun Ver3- Location of the Components
« on: May 03, 2022, 10:32:35 PM »
Hello Adam,

I faced a problem related to the location of the components.

I checked in different prototypes, when I define the location of the components in the CMP_marginals_LET file, I do not face any problem if I put "all" or any floor number (e.g. "1", "2",...) in the "Location" column except for the ground floor. If I assign any component to the ground level (e.g. "0" or "0--5") I face two different errors depending on whether the component is drift-sensitive or acceleration-sensitive. I copied the error messages at the end of this message. I personally think this is an important issue, because usually the components of the roof level are different, and using "all" is not possible for many components.
As another example, in the Jupyter notebook example file, if you change the location of the Traction Elevator to "0" (According to FEMA documentation, for traction elevator the acceleration of the first floor which is "0" floor in PELICUN should be used), you will see the same error.

I also have a few questions related to the location of the components, I will try to explain as clearly as I can, however, if it is not that clear please let me know.

1- According to the FEMA documentation, for some components like C30.32.001a (suspended ceiling),  the EDP of the above floor should be considered for calculating the damage in the component; therefore, it is meaningless to assign such components to the roof level since there is no level above that. Does Pelicun follow the same rule? If it does, what would happen if such components are assigned to the roof level (e.g. using "all" in the "Location" column)? Will Pelicun ignore the roof level automatically?

2- The drift-sensitive components should be assigned to the "story" numbers while the acceleration-sensitive components should be assigned to the "floor" number (floor number = story number +1).  What does it mean if you assign "0-6'' to a drift-sensitive component in a 6-story building. Will Pelicun ignore "0" or "6"?  or for example, in the Jupyter notebook example, you assigned "all" to many drift-sensitive components like Wall partitions. Does Pelicun ignore the "roof" or "0" level in such cases?

3- In a four-story building (like Jupyter notebook example), if we put "2-4" in the "Location" column for a drift-sensitive component, does Pelicun consider the drifts of the 2nd, 3rd, and 4th stories? if yes, then what does "0--4" mean (the same question)?

Again, thank you so much and I really appreciate your nice and quick support.

Pooya,



Drift-sensitive components

    PAL.damage.calculate(sample_size, dmg_process=dmg_process)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pelicun\model.py", line 1991, in calculate
    demand = self._assemble_required_demand_data(EDP_req)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pelicun\model.py", line 1591, in _assemble_required_demand_data
    demand = demand_source[(EDP_req[0], EDP_req[1], EDP_req[2])].values

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\frame.py", line 3504, in __getitem__
    return self._getitem_multilevel(key)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\frame.py", line 3555, in _getitem_multilevel
    loc = self.columns.get_loc(key)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\indexes\multi.py", line 2882, in get_loc
    return self._engine.get_loc(key)

  File "pandas\_libs\index.pyx", line 779, in pandas._libs.index.BaseMultiIndexCodesEngine.get_loc

  File "pandas\_libs\index.pyx", line 136, in pandas._libs.index.IndexEngine.get_loc

  File "pandas\_libs\index.pyx", line 163, in pandas._libs.index.IndexEngine.get_loc

  File "pandas\_libs\hashtable_class_helper.pxi", line 1832, in pandas._libs.hashtable.UInt64HashTable.get_item

  File "pandas\_libs\hashtable_class_helper.pxi", line 1841, in pandas._libs.hashtable.UInt64HashTable.get_item


acceleration-sensitive components:

    PAL.damage.calculate(sample_size, dmg_process=dmg_process)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pelicun\model.py", line 1994, in calculate
    ds_sample = self._evaluate_damage_state(demand, capacity_sample, lsds_sample)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pelicun\model.py", line 1625, in _evaluate_damage_state
    dmg_eval = (capacity_sample.sub(demand, axis=0) < 0)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\ops\__init__.py", line 447, in f
    new_data = self._dispatch_frame_op(other, op)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\frame.py", line 6967, in _dispatch_frame_op
    bm = self._mgr.apply(array_op, right=right)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\internals\managers.py", line 302, in apply
    applied = b.apply(f, **kwargs)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\internals\blocks.py", line 402, in apply
    result = func(self.values, **kwargs)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\ops\array_ops.py", line 222, in arithmetic_op
    res_values = _na_arithmetic_op(left, right, op)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\ops\array_ops.py", line 163, in _na_arithmetic_op
    result = func(left, right)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\computation\expressions.py", line 239, in evaluate
    return _evaluate(op, op_str, a, b)  # type: ignore[misc]

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\computation\expressions.py", line 128, in _evaluate_numexpr
    result = _evaluate_standard(op, op_str, a, b)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\computation\expressions.py", line 69, in _evaluate_standard
    return op(a, b)

TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'





KeyError: 101
« Last Edit: July 04, 2022, 03:02:11 PM by rezvan »

adamzs

  • Moderator
  • Jr. Member
  • *****
  • Posts: 75
    • View Profile
Re: Perlicun Ver.3b4 - Bug in Location of the Components
« Reply #1 on: May 04, 2022, 01:00:08 AM »
Hi Pooya,

Thanks for the extensive testing and great questions!

The location parameter in pelicun3 works slightly differently from pelicun 2. I'll explain below and that will hopefully answer all your questions.

First of all, the "0" location is considered special and reserved for components where the location is not applicable. Think about 'collapse', for example. Pelicun treats those locations and components assigned to those locations differently.

When it comes to components in FEMA P58, you do not need to assign anything to "0". If the component is on the ground floor, you would assign it to "1". You correctly mention that the traction elevator, for example, shall be assigned to the ground floor to be able to use the PGA as a demand. But that mapping of component location to demand location happens automatically inside pelicun. When a component uses floor acceleration, the demands automatically come from the bottom of the floor, that is, from PFA-0. For components that are on the roof, there is an offset variable in the metadata that tell pelicun to get the acceleration from the top slab - so it is okay to assign roof components to the top floor because the offset will make sure you get the right acceleration value for them.

When you use "all" in the location column, it is replaced internally with "1-#stories". Hence, pelicun never assigns anything to the roof.

When you use "roof", it is replaced with the top story, not the top story + 1.

As I mentioned earlier, some components, such as the suspended ceiling, have an offset of 1 prescribed so that the PFA values from the top slab are used to assess their damage.

I think the above information already answers your first question.

As for your second question, I would like to emphasize that component assignment is not influenced by the type of demand the component uses. I intentionally decoupled these to make asset modeling more straightforward. All you need to consider when assigning components is which floor they are actually in.

As for your third question, if you put 2-4 in the location column, pelicun would consider stories 2, 3, and 4. The 0-4 option is not recommended because floor 0 has a special meaning as I explained earlier.

Let me know if any of the above is not clear.

Adam

rezvan

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Perlicun Ver.3b4 - Bug in Location of the Components
« Reply #2 on: May 04, 2022, 01:17:49 PM »
Thank you so much, Adam.

Now, I completely understand the definition of the location parameter.

However, I still have a doubt about some acceleration-sensitive components that should be assigned to the floors and not the stories.
Consider two different cases in a 4-story building where we want to put a chiller (D.30.31.023) or cooling tower (D.30.31.023) either on the roof or on the ground (as far as I know both cases are very common).

How can we define the location in these two cases? Because here we have 5 floors and we want to use the EDP of the first and the last floor which are gound and roof levels.
If the offset of 1 is defined for the cooling tower, then how to use the EDP of the ground floor?
If that offset is not defined, then how to use the EDP of the roof?

So many thanks,

Pooya
« Last Edit: May 04, 2022, 02:01:20 PM by rezvan »

adamzs

  • Moderator
  • Jr. Member
  • *****
  • Posts: 75
    • View Profile
Re: Perlicun Ver3- Location of the Components
« Reply #3 on: May 05, 2022, 01:13:10 AM »
Hi Pooya,

That's a great question.

The offset defined in FEMA P58 for D.30.31.023 is 0. I think this suggests the developers of P58 intended to assign it to the floor of a story - rather than to the ceiling - which makes perfect sense. Let me walk you through two approaches to handle the ground floor and roof cases:

1, Expand the component library
You could add another chiller component to the library (i.e., another row to the fragility_DB_FEMA_P58_2nd.csv file) that has an offset of 1 and otherwise is identical to the existing chiller. You could call this D.30.31.023_roof, for example. Then, if you want to put a chiller on the roof, you would assign this component to the top floor. If you want to put a chiller on any other floor, you would assign the original component to that floor.

2, Assign the component to a non-existing story
Pelicun will not have a problem with you assigning a component to the 5th floor of a 4-story building. You could keep using the original component from FEMA P58 and specify its location as 5. Then, internally, pelicun will see that the component uses PFA as demand and look for a PFA-4 to calculate the damage - which is exactly what you want.

Looking at the two options above, the second one seems more intuitive to me. I am inclined to revise the interpretation of the 'roof' keyword to be parsed as "number of stories + 1". That would make it easy for users to assign such components to the roof without having to worry about the above mechanism inside Pelicun. If you agree, I will get this implemented in the upcoming 3.1.b5

Let me know your thoughts.

Adam

rezvan

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Perlicun Ver3- Location of the Components
« Reply #4 on: May 05, 2022, 02:29:01 AM »
Hi Adam,

Both suggestions look so interesting and innovative to me.

I just tried the second method and it worked perfectly!
I totally agree to define the 'roof' keyword to be parsed as "number of stories + 1"; I think it makes more sense.

I appreciate your innovative solution.

Pooya,



adamzs

  • Moderator
  • Jr. Member
  • *****
  • Posts: 75
    • View Profile
Re: Perlicun Ver3- Location of the Components
« Reply #5 on: May 05, 2022, 05:16:54 PM »
Hi Pooya,

Thanks for the feedback. I'll make the update in the next release.

Adam