Output scripting example: get heave of excavation bottom


ApplicationPLAXIS 2D
VersionPLAXIS 2D
Date created29 April 2015
Date modified29 April 2015

 

In this example, we will use Tutorial Lesson 3 (Tied back excavation) [link] as an example. In this case, we want to determine the maximum heave of the excavation bottom. In the final phase, Phase_6, the bottom of the excavation is located at Y = 20.0 m, with the left retaining wall at X = 40 m and the right retaining wall at X = 60 m.

In order to retrieve the maximum heave for this excavation bottom, we will use Output’s Remote Scripting environment with the Python wrapper:

Below is an example code how to achieve this.

localhostport_output = 10001 
s_o, g_o = new_server('localhost', localhostport_output, password='yourpassword')  

# geometric limits for the bottom of the excavation: 
x_left = 40.0 
x_right = 60.0 
y_bottom = 20.0  

# initialize defaults 
maxUy = 0.0 
xAtMaxUy = 0.0 
yAtMaxUy = 0.0  

# obtain result tables from Output: 
soilX = g_o.getresults(g_o.Phase_6, g_o.ResultTypes.Soil.X, 'node') 
soilY = g_o.getresults(g_o.Phase_6, g_o.ResultTypes.Soil.Y, 'node') 
soilUy = g_o.getresults(g_o.Phase_6, g_o.ResultTypes.Soil.Uy, 'node')  

# determine maximum heave
for x, y, uy in zip(soilX, soilY, soilUy):
    if x_left < x < x_right: 
        if abs(y - y_bottom) < 1E-5: 
            if uy > maxUy: 
                maxUy = uy 
                xAtMaxUy = x 
                yAtMaxUy = y 
print("Maximum heave of excavation bottom: uy={:.3f} m " 
    "at (X,Y)=({:.2f},{:.2f})".format(maxUy, xAtMaxUy, yAtMaxUy))

The result from Python would look like this:

   Response from Python in IDLE  

>>>  
Maximum heave of excavation bottom: uy=0.050 m at (X,Y)=(50.00,20.00)
>>>

See also