Author Topic: Monte Carlo (OpenSeespy)  (Read 23467 times)

pellumbz

  • Newbie
  • *
  • Posts: 9
    • View Profile
Monte Carlo (OpenSeespy)
« on: October 04, 2022, 08:59:58 AM »
Hello,

I have a model to calculate maximum load in column.
I'm trying to run Monte Carlo simulation to get maximum load using random variables, but I'm getting this error:

Error Running SimCenterUQ: Error running FEM: results.out missing in workdir.23. *** Message from the FEM engine in workdir.23 says "" 

best regard,

Sang-ri

  • Administrator
  • Jr. Member
  • *****
  • Posts: 70
    • View Profile
Re: Monte Carlo (OpenSeespy)
« Reply #1 on: October 04, 2022, 04:07:06 PM »
Hello! Can you check if ops.out file is created in workdir.23 and share the contents with us?

pellumbz

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Monte Carlo (OpenSeespy)
« Reply #2 on: October 05, 2022, 11:41:49 AM »
Hi
Yes the file results.out is created, but the analysis is not running.
Based what I search on internet, I think my issue is how to make inside the input file the code to create the results.out file?

Sang-ri

  • Administrator
  • Jr. Member
  • *****
  • Posts: 70
    • View Profile
Re: Monte Carlo (OpenSeespy)
« Reply #3 on: October 05, 2022, 03:42:59 PM »
Can you check the below to help us identify the issue?

1. Is the 'results.out' (in workdir.23) empty?

2. Is 'ops.out' created in workdir.23? The error log from OpenSeespy should be written here. If ops.out is not there, can you try the following? (1) open Command Prompt (if Windows) or terminal (if Mac) (2) navigate to workdir.23 using 'cd' command (3) type driver.bat (windows) or ./driver (mac) (4) check if you get any errors and if results.out is properly written.

Please let me know if you have questions.

pellumbz

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Monte Carlo (OpenSeespy)
« Reply #4 on: October 06, 2022, 07:38:16 AM »
Hi again
Thank you for you replay.
The workdir file number is changing everytime I'm trying to run the analysis.
I will upload an attachment of the error for you, so maybe than is more clear what is the error.

Sang-ri

  • Administrator
  • Jr. Member
  • *****
  • Posts: 70
    • View Profile
Re: Monte Carlo (OpenSeespy)
« Reply #5 on: October 06, 2022, 03:56:51 PM »
Hi

Thanks much for sharing the input files. It was very helpful. The following was needed for me to make it run on quoFEM

1. Uncomment the last three lines
Those look like the correct way of writing results.out for the maximum load.

2. Change the python path to your own system python path
Currently, the Windows version of quoFEM is distributed with its own python exe (v3.8) and OpenSeesPy (v3.3.0.1). But I think some of your functions only work with OpenSeesPy v3.4, which requires python v3.9. To solve this issue, you can make quoFEM use your system python exe instead the default one. To do this, go to file-preferences and check 'custom python' and change the path to the system python path (You can find the system python path by typing 'where.exe python' on the command prompt). Also, to make sure all the SimCenter dependencies are installed in this python exe, do 'pip install nheri_simcenter --upgrade'

3. Comment out IPython and matplotlib
I commented out the lines related to IPython and plt.show(). When I tested the input script (by typing 'python Benchmarked_Rectangular_Encased_column_quoFEM.py'), these parts were blocking the analysis.

4. Created params.py file
I picked up the following lines from the main script and moved them to params.py
  • hp=280 #height of the profile
  • bp=280 #width of the profile
  • fy=426 #profile yield
  • Ey=210000 #profile E modul

Please do #2 and then try running the analysis with the attached scripts (to have #1,#2, and #4) and let us know how it goes!

Sang-ri


pellumbz

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Monte Carlo (OpenSeespy)
« Reply #6 on: October 07, 2022, 08:48:12 AM »
Hi again
I think my issue is with versions you are right.
I changed inside file preference and I putted the path from one I found in command prompt but now I'm getting another type of error:
it shows:
An error occurred in the Python script, the exit code is 9009
Analysis complete with errors
Filed to run the workflow

Can you please tell me how did you make it run? What version are you using since you got the results that I need!
I had similar problem also when I was running my script in spyder, and the only way to make it work is If I let the version as you can seen in attachment, otherwise was not working.
SO, since it run in your case I would try to adopt the same versions with you maybe it will work than also for me.
Thank you very much for helping me!
Best regards,

pellumbz

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Monte Carlo (OpenSeespy)
« Reply #7 on: October 07, 2022, 10:54:33 AM »
Hi again

When I'm checking the path in command prompt it shows me this one for python: C:\Users\pellumb.zogu\AppData\Local\Microsoft\WindowsApps\python.exe
But, when I go from quoFEM in this path I can't choose this path it shows me this error (please see the attachment).

BR.

Sang-ri

  • Administrator
  • Jr. Member
  • *****
  • Posts: 70
    • View Profile
Re: Monte Carlo (OpenSeespy)
« Reply #8 on: October 07, 2022, 05:25:34 PM »
This is indeed an interesting issue, and your feedback here is very helpful for us. We greatly appreciate it.

1. "File cannot be accessed" error
I think the python.exe in the WindowsApps folder is not a python executable (what we wanted), but a python installer. You can just ignore it or get rid of it by turning off the 'App installer (python.exe)' button in the Manage app execution aliases.

If you got only this path from the command prompt, that means you do not have a system default python executable, which is perfectly fine.

2. Finding the python.exe path that jupyter notebook (or spyder) uses
So instead of the system python path, we want to grab the path to python.exe that is used in the jupyter notebook - such that we know it works with your model (I presume you used jupyter notebook to develop and test the model). To get this path, you can use the following command in the jupyter notebook

import sys
sys.executable

which will show you the python exe that is currently running. Then please change the quoFEM python path to what is shows.

3. The version that worked for me
I had python 3.9.8 installed on my windows laptop which I downloaded from the python website, and I updated the openseespy package to the latest version for this testing.

Sang-ri

pellumbz

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Monte Carlo (OpenSeespy)
« Reply #9 on: October 07, 2022, 05:52:02 PM »
I tried what you suggested I found the path that is used in spyder and I putted the same in fie preference in qouFEM (as you can see in attachement)  but again is not working.
Now it shows:
 - An error occurred in the Python script, the exit code is 1.

I think somewhere is a "trick" I can't find, but since it worked for you it means that my script is working and I can implement it on quoFEM, but I just need to find this problem with version :(

Sang-ri

  • Administrator
  • Jr. Member
  • *****
  • Posts: 70
    • View Profile
Re: Monte Carlo (OpenSeespy)
« Reply #10 on: October 07, 2022, 06:52:38 PM »
I am sorry you are still getting errors. If you would like a quick Zoom meeting to solve this issue, please send me your available times by private message or email.

Otherwise, it would be helpful if you could take a screenshot of the templatedir directory (that contains the list of files created) in the local working directory.
Some of the reasons we get the python exit code 1 error are:
1. When a file inside the Local working directory is opened or used by another program
2. When the python nheri_simcenter package is not properly installed
3. Onedrive sync (when it is online-only mode) had caused issues previously, so that could be one possibility

pellumbz

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Monte Carlo (OpenSeespy)
« Reply #11 on: October 11, 2022, 07:21:13 AM »
The problem is fixed by updating NumPy and Matplotlib version!

Thank you
Best regards,
Pellumb