Author Topic: Pelicun 3.1.b2 - Residual inter-story drift  (Read 14747 times)

rezvan

  • Newbie
  • *
  • Posts: 21
    • View Profile
Pelicun 3.1.b2 - Residual inter-story drift
« on: March 24, 2022, 02:18:06 AM »
Hi Adam,

I faced a problem regarding the residual inter-story drifts and I was wondering if you could help me with.
I am using the Pelicun module for damage and loss assessment of a special self-centering system, with almost near zero residual drift at design basis earthquake (1/475 years).
Therefore, I modified the part of the code for estimation of the residual drift, and instead, I used the results from numerical simulation.
In some cases when the residual drifts (in the demand_data.csv) are very small value (in the order of 10^-5) the following error appears, but if I increase them manually (e.g 10^-4)  the error disappears. I guess it should be due to a mathematical issue when trying to fit a distribution over a median value that is almost zero. Do you think there is any way to overcome this error?

So many thanks,
Pooya

22:13:14 Calculating damages...
         Applying task from prescribed damage process...
         Damage process task successfully applied.
         Applying task from prescribed damage process...
Traceback (most recent call last):

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

  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 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item

  File "pandas\_libs\hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item

KeyError: '1'


The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "C:\Users\pooya\Desktop\Temp\b\MainAnalysis.py", line 288, in <module>
    Analysis(buildingIndex)

  File "C:\Users\pooya\Desktop\Temp\b\MainAnalysis.py", line 283, in Analysis
    dl.getDLAssessment(buildingID, N_story, Tn, SaD, sample_size, delta_y, stripe, DL_DataDir, buildingInfoDir, replacementCost, replacementTime)

  File "C:\Users\pooya\Desktop\Temp\b\DL_AssessmentFunctions.py", line 217, in getDLAssessment
    PAL.damage.calculate(sample_size, dmg_process=dmg_process)

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

  File "C:\Users\pooya\anaconda3\lib\site-packages\pelicun\model.py", line 1775, in _perform_dmg_task
    source_ds_vals = source_cmp_df.groupby(

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

  File "C:\Users\pooya\anaconda3\lib\site-packages\pandas\core\indexes\base.py", line 3623, in get_loc
    raise KeyError(key) from err

KeyError: '1'



adamzs

  • Moderator
  • Jr. Member
  • *****
  • Posts: 84
    • View Profile
Re: Pelicun 3.1.b2 - Residual inter-story drift
« Reply #1 on: March 24, 2022, 05:41:48 PM »
Hi Pooya,

Thanks for all the feedback about pelicun3, I really appreciate it!

The demands are stored in double-precision floating-point numbers internally, so 1e-5 or 1-4 should not make a difference.

I found and fixed a bug yesterday in the method that applies damage processes and it might explain the behavior you experience. I suggest trying to run the code with the latest version of pelicun3 that I have just released this morning (3.1.b4). Let me know if you still get the same error.

Adam

rezvan

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Pelicun 3.1.b2 - Residual inter-story drift
« Reply #2 on: April 23, 2022, 04:03:34 PM »
Hi Adam,

I didn't face this problem anymore in Version 3.b4.
I appreciate it.

Pooya

adamzs

  • Moderator
  • Jr. Member
  • *****
  • Posts: 84
    • View Profile
Re: Pelicun 3.1.b2 - Residual inter-story drift
« Reply #3 on: April 29, 2022, 12:18:08 AM »
That's great to hear; thanks for letting me know!

Adam