Author Topic: Generation of Simulated Demands  (Read 19464 times)

Jiajun

  • Newbie
  • *
  • Posts: 5
    • View Profile
Generation of Simulated Demands
« on: May 01, 2022, 09:30:15 AM »
Hello Adam,

Thanks a lot for the updated version 3.1.b4 of Pelicun. After watching the video about your introduction to pelicun on youtube, I started to learn pelicun 3.0. I'm sure that pelicun will be of great help to my research work.

I have a few questions, and I would appreciate it if you could help me.

1.Generation of Simulated Demands: In FEMA P58, if we want to address the effects of modeling uncertainty and ground motion uncertainty on demand distribution, we use two factors βm and βgm(FEMA P58 vol 1 Appendix G). So can we consider the uncertainty of modeling and ground motion to do the generation of simulated demands in pelicun?

2.I learned Pelicun3.0 by the example you provided on the website of DesignSafe(PRJ-3411 | NHERI SimCenter - Pelicun Examples). The example was helpful for my initial understanding of pelicun 3.0, but clearly not enough for further study. Is it possible to get more examples or API references about pelicun3.0 (even if it is a beta version)? Pelicun is an outstanding module. And I can't wait to get good at using it.

Finally, happy Labor Day to you !

Thank you so much,
Jiajun
My email:jiajundu99@gmail.com
My edu email:jiajundu@tongji.edu.cn

rezvan

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Generation of Simulated Demands
« Reply #1 on: May 02, 2022, 12:08:53 PM »
Hello JiaJun,

Definitely, Adam would help you way better, but I (as a user) personally think if you watch the tutorial videos on YouTube, you will learn much more.
I recommend you to watch the tutorials of PBE first and then move to Ver3 of Pelicun.

Here are the links:

https://simcenter.designsafe-ci.org/research-tools/pbe-application/
https://www.youtube.com/watch?v=0Cak4sxyvCI

I hope this would help.

Pooya,

Jiajun

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Generation of Simulated Demands
« Reply #2 on: May 02, 2022, 01:08:07 PM »
Hello Pooya,

Thanks for your suggestion which is very practical, and I will take it.

Best wishes,
Jiajun

adamzs

  • Moderator
  • Jr. Member
  • *****
  • Posts: 84
    • View Profile
Re: Generation of Simulated Demands
« Reply #3 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 (https://nheri-simcenter.github.io/pelicun/) 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.

Adam

Jiajun

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Generation of Simulated Demands
« Reply #4 on: May 04, 2022, 03:59:01 PM »
Hello Adam,

Thank you for your detailed response for my questions.

In fact, what I want to do is to generate samples by the method mentioned in Appendix G of the FEMA P58 Vol1, and then use these samples to perform the damage and loss analysis. You can refer to the attachment for the exact process. This matlab code is provided by FEMA P58 in Appendix G. For this procedure, I just need to input the EDPs,βm,βgm.

Other than that, I have two questions:
1. I notice that the input of the raw demand in the example file seems to  be much different from the background document of FEMAp58, especially the log_std (I compared the input demand data with the data provided in the "Table 1-37 Demand Vectors, Intensity 3, Conditioned on No Collapse" in the BD document). I wonder about the reason for this difference.
2.This question is not related to this topic. It represents a personal expectation of mine. The environmental impact is a major update to the FEMA 2nd documentation, and the corresponding database is provided. After reading some current literature, I found that this is also a concern for many researchers. I wonder if pelicun is considering adding this feature as well. I checked the source code, it doesn't seem to be available for pelicun now. Or if I want to use pelicun to calculate the loss of carbon/energy caused by the earthquake, do you have any good suggestions?

Jiajun

adamzs

  • Moderator
  • Jr. Member
  • *****
  • Posts: 84
    • View Profile
Re: Generation of Simulated Demands
« Reply #5 on: May 05, 2022, 01:43:37 AM »
Hi Jiajun,

Do you want to use the Matlab code provided by FEMA P58 or you want to reproduce the method from Appendix G in Pelicun?
That method describes fitting a multivariate lognormal distribution to EDP data, increasing the log standard deviations, and then sampling it. Pelicun can certainly do this if you are interested.

 1 The values in the example are indeed different from the data provided in the tables that you pasted. I wanted to have EDPs for two directions and those tables only provide one value per floor. Furthermore, I could not find in the document what those values are. They might be the average, geometric mean, maximum, or some other combination of the results in the two directions.
The nonlinear analysis results from Figure 1-14 - 1-21 gave me the 10th percentile, median, and 90th percentile of EDPs in two directions on each floor at each intensity level. Those were sufficient information to fit a lognormal distribution and I considered them the raw results of the analysis. Note that these do not match the results in Table 1-35 - 1-42, so those must have been processed in some way.
If you have some suggestions of how to reconcile those differences, please let me know.

2. I have good news: adding environmental impact is high on our list. The framework is ready to support it, but the actual timeline depends on who gets the job done. The worst-case scenario is I have to do it, which means it will be available sometime around the end of this year. I might get some help from graduate students that could expedite this development by a few months.
If you are interested in adding this feature, that's also an option and I would be more than happy to guide you on the way. To give you an idea of what such a development would entail:
- You'd need to create a new consequence function table that describes the parameters of functions used for environmental impacts. This is similar to the repair cost/time table I already have prepared in a CSV file.
- Then, you'd need to add a new child class of the LossModel in the model.py module that handles the calculation of such impacts. Based on my superficial understanding of the environmental impact calculation, you might be able to use most of the BldgRepairModel and perhaps even have the EnvironmentalImpactModel be a child of that class to make the calculation simpler.
That's all we need to get this done. Let me know if you're interested.

Adam

Jiajun

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Generation of Simulated Demands
« Reply #6 on: May 05, 2022, 04:12:06 PM »
Hello Adam,

As you said, I want to reproduce the method from Appendix G in pelicun, but I don't know how to do it. It would be useful for me if pelicun can handle the raw demand as the method from Appendix G directly. This shows how powerful and flexible the pelicun is. So can you tell me how to do this or give me some guidance?

1.Thank you so much for your detailed and patient response about this question, they solved my doubts.

2.Although I am not familiar with the development work you mentioned, I am very interested in it. My only regret is that I am currently a new PhD student and have limited time and energy. But I will continue to learn about it and try to do this work in my free time. If I make any progress, I would be happy to share my results with you.

Finally, thank you for your patience and professional response!

Jiajun

adamzs

  • Moderator
  • Jr. Member
  • *****
  • Posts: 84
    • View Profile
Re: Generation of Simulated Demands
« Reply #7 on: May 05, 2022, 05:19:50 PM »
Hi Jiajun,

Are you familiar with Google Colab? I could prepare a notebook that shows you an example usage. If not, I can just post a series of commands here that you can use as a template.

As for the environmental impact, please don't feel any pressure about this. I will get the feature added before the end of the year anyway, so the only reason for you to get involved is if you want to have it available before then.

Let me know your preference on Colab and I'll share the template for demand calibration.

Adam

Jiajun

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Generation of Simulated Demands
« Reply #8 on: May 06, 2022, 04:29:02 AM »
Hi Adam,

I have used Google Colab before, you can share the notebook with me through this colab account:"jiajundu99@gmail.com“ or share a link with me here.

As for the environmental impact, I would really like to have this feature as soon as possible, so I would appreciate if any help you can give me.

Jiajun

adamzs

  • Moderator
  • Jr. Member
  • *****
  • Posts: 84
    • View Profile
Re: Generation of Simulated Demands
« Reply #9 on: May 25, 2022, 01:30:20 AM »
Hi Jiajun,

I am writing to let you know that the calibration notebook is on my list of todos and I'll get to it shortly.

Thank you for your patience.

Adam