Recent Posts

Pages: 1 2 [3] 4 5 ... 10
Educational Applications / Re: Save the results in TFT
« Last post by parduino on May 03, 2022, 10:58:41 PM »
This is a very valid request.
We will include and option to save transfer functions in the next release of the tool.
Thanks for testing our tool.
Damage & Loss (PELICUN) / Perlicun Ver3- Location of the Components
« Last post by rezvan on May 03, 2022, 10:32:35 PM »
Hello Adam,

I faced a bug 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.


Drift-sensitive components

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

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

  File "C:\Users\pooya\anaconda3\lib\site-packages\pelicun\", 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\", line 3504, in __getitem__
    return self._getitem_multilevel(key)

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

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\indexes\", 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\", line 1994, in calculate
    ds_sample = self._evaluate_damage_state(demand, capacity_sample, lsds_sample)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pelicun\", 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\", line 447, in f
    new_data = self._dispatch_frame_op(other, op)

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\", 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\", line 302, in apply
    applied = b.apply(f, **kwargs)

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

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

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

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\computation\", 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\", line 128, in _evaluate_numexpr
    result = _evaluate_standard(op, op_str, a, b)

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

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

KeyError: 101
Performance Based Engineering (PBE) / Re: Fragility Data
« Last post by adamzs on May 03, 2022, 09:57:14 PM »
Hi Aram,

I hope you could successfully import the fragility database.

As for the components you asked about earlier, I took a look at the NQET spreadsheet. As far as I understand, the spreadsheet is designed to provide you the quantity of those missing ("None found") component types, but FEMA P58 does not have a corresponding fragility function to use to describe their damage. I assume the spreadsheet and the fragilities were developed by different working groups in the project and not everything lined up perfectly in the end.

You can confirm this by looking at the "Normative Quantity Database" sheet where you'll see those broad component groups listed in Column J. The quantities assigned to various occupancy types are to the right and the components assigned to each group are to the left (column D). Now, the groups you highlighted all have NONE AVAILABLE in column D. Furthermore, if you take a note of the group ID listed in column C for them (that is, D302, D309, and D502, respectively), and go to the "Fragility Database" sheet, you'll see that those IDs are not available in column B.

If this was a consulting project, I would encourage you to look at the literature and try to find a way to model the fragility of those components. Since this is a homework assignment, I suggest checking with your instructor to make sure they're okay with you leaving these out.

Damage & Loss (PELICUN) / Re: Probability of repairable damage
« Last post by adamzs on May 03, 2022, 09:37:41 PM »
Hi Pooya,

I see, thank you for the clarification.

Your understanding is correct; my answer is yes to your first and second questions.

As for your third question, I picked 2e7 because the replacement cost was set to 2.16e7 (see the additional_consequences table in the Consequence data section) and I was focusing on removing total losses from the results.

The 50% you suggest I assume comes from your literature review - FEMA P58 indeed suggests using 0.4-0.5 of the replacement cost as the threshold beyond which an owner would not choose to repair. I did not consider that in the Jupyter notebook because my objective with this filter was to create a nice plot that focuses on the distribution of repair costs and times. You can think about those 'repairable' cases as damages that can be repaired but might not be economical to repair. So, the actual proportion of repaired realization is less than or equal to the repairable ones.

I hope this makes sense. Let me know if you have any follow-up questions.

Damage & Loss (PELICUN) / Re: Probability of repairable damage
« Last post by rezvan on May 03, 2022, 01:50:55 PM »
Thank you, Adam

I am asking about the following line of codes which are located in the last part of the example you provided in the Jupyyter notebook:

# get only the results that describe repairable damage
agg_DF_ = agg_DF.loc[agg_DF['repair_cost'] < 2.0e7]

print('\nProbability of experiencing repairable damage:', agg_DF_.shape[0] / agg_DF.shape[0])

 I guess :

1-The probability of "repairable damage" is defined as the number of realizations whose repair cost is less than (2.0E+7) over the total number of realizations. Is that right?

2- In the realization that the building experiences collapse or excessive drift, the repair cost is taken equal to the replacement cost which is more than 2.0E+07, therefore, they will not be considered repairable cases. Is that right?

3- How did you define 2.0E+07? Is it almost half of the replacement cost? Meaning that if the repair cost is more than 50% of the replacement cost, it is not reasonable to repair the building?

Again, I really appreciate your endless support.

Damage & Loss (PELICUN) / Re: Component Quantity and Units
« Last post by adamzs on May 03, 2022, 06:12:41 AM »
Hi Pooya,

Thank you for these questions; I can assure you, they are very well received and welcome. Please don't hesitate to ask.

The short answer is that you do not need to worry about what the unit specified in the database as long as you use the same type of unit (i.e., length, area, volume, etc.).

The C10.11.001a is a perfect example of a case where I did not follow that rule: I should've used 'ft' for the partition walls. Pelicun cannot convert between area and length units because it does not know what the missing dimension of the partition wall should be. You can see all of the available units in the module of Pelicun here:
I will fix the portion wall units and update the notebook.

In the databases, I kept the units used in the original document to show that a person who develops fragility or consequence functions does not need to worry about what units they used to define those functions because pelicun will automatically perform the conversions in the background.

As for the low-voltage switchgear, the units provided in the FEMA P58 documentation are somewhat misleading. I double-checked this with researchers who were involved in the development of the P58 methodology: all components that have TN, AP, CF, or KV units should be calculated as if they had EA. The rationale is that you would need to know how many of those equipment you have rather than providing a measure of their weight, capacity, or performance. That's why I replaced these measures with EA even in the supporting database.

I hope this helps and thanks for catching that error with the ft2.

Let me know if you have more questions.


Damage & Loss (PELICUN) / Re: Probability of repairable damage
« Last post by adamzs on May 03, 2022, 05:55:08 AM »
Hi Pooya,

Could you provide more context for this question?

I suspect that you meant to ask about irreparable damage. Please confirm that and I am happy to explain how irreparable damage is assessed in the FEMA P58 example.

Damage & Loss (PELICUN) / Re: Generation of Simulated Demands
« Last post by adamzs on May 03, 2022, 05:50:03 AM »
Hi Jiajun,

Thank you for your interest in Pelicun; I am happy to hear that you find it helpful for your work!

Pooya: thank you for suggesting those resources for Jiajun; I agree that they are good starting points and help understand the framework.

However, the API changed with pelicun3 and most of the inputs have been streamlined. As soon as pelicun3 gets out of beta, the documentation ( will describe the behavior of the new version and provide an API to every method in it. Until then, your best resource is the forum and the Jupyter notebooks I prepare for the live expert tips.

As for your specific question on adding uncertainty to the calibrated demand distribution. Calibration of demands, unfortunately, did not fit in that FEMA P58 example. Pelicun3 does provide a function to calibrate a multivariate distribution to raw demand data. The result of such calibration is the demand parameter description that we prepare in the FEMA P58 example. We only provide the marginal distributions and assume uncorrelated marginals in the example for the sake of brevity, but you can provide a correlation matrix as well if you have such data available.

Would you like to first calibrate a distribution to raw data, or you already have the distribution parameters available and all you need to do is add the modeling and ground motion uncertainties? Both are possible in pelicun, but I'd recommend different procedures depending on what your objectives are. Let me know what you're looking for and I'll explain which methods to use to get the job done.

Educational Applications / Save the results in TFT
« Last post by Amin on May 03, 2022, 03:30:56 AM »
TFT seems an interesting educational tool.
I try to verify it with other tools (I know the developer did their part already).
However, the results of TFT are just images with no access to the data. How is it useful for the community?
Performance Based Engineering (PBE) / Re: Fragility Data
« Last post by aramsubramanian on May 02, 2022, 10:00:55 PM »
Hey Adam,

Thank you so much for your reply. I'll import the folder to the respective damage loss folder.

Yes, those four components come from the FEMA NQET excel sheet. Since we are designing a retail building, we thought electrical wiring and cable trays might be an essential part of damage estimation. Is it okay to ignore their contribution while calculating loss since we don't have the fragility data ?

Aram Valartha Nayaki Subramanian
Pages: 1 2 [3] 4 5 ... 10