Quantcast
Channel: PLAXIS - Knowledge Base - Tips and Tricks
Viewing all articles
Browse latest Browse all 25

Output scripting example: get maximum bending moment

$
0
0
Application:

In this example, we will use Tutorial Lesson 3 (Tied back excavation) [link] for the Plaxis file. In this case, we want to determine the maximum bending moment for the left retaining wall for each phase in which the plate is active. This left retaining wall is activated in Phase_1, and is located at X = 40 m.

In order to retrieve the maximum and minimum bending moment for the left retaining wall, we will use Output’s Remote Scripting environment with the Python wrapper:

  1. we will need to launch the Output scripting server, available via the Expert menu
  2. and we should make sure the Plaxis results are opened in the Output program
  3. then we will obtain the bending moment values for each phase in which the plate is active. Since the plate is activated in Phase_1, we can use all phases, except the InitialPhase ( g_out.Phases[1:] )
  4. for each phase we will obtain all plate results: coordinates X and Y, and the bending moment M.
  5. from which we will filter out the nodes that are part of the left retaining wall (at X= 40.0). Because the order of the nodes is the same in each of the getresults-lists, we can use the X - coordinate to filter out the correct bending moment.
  6. and from this we will obtain the maximum value for the bending moment for the left retaining wall.
localhostport_output = 10001
plaxis_path =r'C:\Program Files (x86)\Plaxis\PLAXIS 2D'#no trailing backslash!import imp
found_module = imp.find_module('plxscripting', [plaxis_path])
plxscripting = imp.load_module('plxscripting', *found_module)
from plxscripting.easy import*

s_out, g_out = new_server('localhost', localhostport_output)

#geometric limits for the left retaining wall:                    
x_left = 40.0

#for all phases, starting from the second phase (Phase_1)for phase in g_out.Phases[1:]:
    #initialize defaults:
    maxM = 0.0
    xAtMaxM = 0.0
    yAtMaxM = 0.0
    minM = 0.0
    xAtMinM = 0.0
    yAtMinM = 0.0

    #obtain result tables
    plateX = g_out.getresults(phase, g_out.Plate.X, 'node')
    plateY = g_out.getresults(phase, g_out.Plate.Y, 'node')
    plateM = g_out.getresults(phase, g_out.Plate.M2D, 'node')

    #determine minimum and maximum bending moment:for x, y, M inzip(plateX, plateY, plateM):
        if x == x_left:
            if M > maxM:
                maxM = M
                xAtMaxM = x
                yAtMaxM = y
            if M < minM:
                minM = M
                xAtMinM = x
                yAtMinM = y

    print( "{}: ".format( phase.Name ) +"Mmax = {:.2f} kNm/m at Y={:.2f} m; ".format(maxM, yAtMaxM) +"Mmin = {:.2f} kNm/m at Y={:.2f} m".format(minM, yAtMinM) )

The result from Python would look like this:

  Response from Python in IDLE >>>Phase_1: Mmax = 3.02 kNm/m at Y=26.33 m; Mmin = -0.00 kNm/m at Y=30.00 m
Phase_2: Mmax = 4.91 kNm/m at Y=20.00 m; Mmin = -40.26 kNm/m at Y=25.67 m
Phase_3: Mmax = 21.12 kNm/m at Y=22.62 m; Mmin = -95.82 kNm/m at Y=27.00 m
Phase_4: Mmax = 67.74 kNm/m at Y=23.67 m; Mmin = -91.31 kNm/m at Y=27.00 m
Phase_5: Mmax = 26.12 kNm/m at Y=19.57 m; Mmin = -142.64 kNm/m at Y=23.00 m
Phase_6: Mmax = 123.35 kNm/m at Y=20.00 m; Mmin = -140.43 kNm/m at Y=23.00 m>>>

Viewing all articles
Browse latest Browse all 25

Trending Articles