# How to employ a Python limit state function in STRUREL?

subject area
in short

By means of the STRUREL command pythons, you can integrate any limit state function written in Python directly in your structural reliability analysis performed with STRUREL. All you need on your system is: (i) a working Python environment and (ii) the Python interface of STRUREL.

The Python script should be placed inside the same folder that also contains your STRUREL project files and should be given a clear and short name; e.g., 'my_model.py'. At the end of the Python script file, you need to assign the value of the limit state function to a variable with name res. For example:

res = R - S

where the variable names R and S must match the names of the random variables of the stochastic model of STRUREL. The content of the variable res is later retrieved by STRUREL. Note that the variables R and S must not be assigned or defined within the Python script file.

In STRUREL, you need to define all random variables used in the Python script file (as part of the Stochastic Model). The limit state function is then linked to the Python script file 'my_model.py' using the STRUREL command pythons:

FLIM(1) = pythons("my_model")

tags