Generate a SumMsf vs. Displacement curve using Python in PLAXIS


Application PLAXIS 2D
PLAXIS 3D
Version PLAXIS 2D 2025.1 and newer
PLAXIS 3D 2025.1 and newer
Date created 23 April 2026
Date modified 23 April 2026
Original author Wei Zhang - Technical Support Group
Keywords PLAXIS, Python, API, summsf, safety factor, displacement, deformation, curve, matplotlib, pyplot, plot

The Strength Reduction Method (SRM) in PLAXIS is a powerful tool for conducting safety analyses within a stress-deformation framework. It provides a representative factor of safety (FoS) that can be directly compared with values obtained from traditional limit equilibrium methods, such as those obtained using GeoStudio's SLOPE/W.

A key output of SRM in PLAXIS is ΣMsf vs. displacement curve, which is commonly used to interpret the safety factor at a monitoring point located in a critical area of the slope. ΣMsf, the cumulative strength reduction factor, represents the ratio between the input and reduced soil strength parameters at each stage of the analysis:

equation.png

During the analysis, PLAXIS incrementally reduces the material’s strength parameters such as friction angle, cohesion, and tensile strength, until the model reaches a failure condition, typically indicated by large deformations. The stable value of ΣMsf at large deformation is then interpreted as the Factor of Safety against shear failure.

As the strength parameters are progressively reduced, displacements increase. Once critical failure is initiated, ΣMsf stabilizes while displacements continue to grow. This results in a flattening of the ΣMsf vs. displacement curve, indicating that the failure mechanism has been fully mobilized and a reliable safety factor has been established.

Automating the curve generation with Python

While the Curves Manager in PLAXIS Output allows manual generation of ΣMsf vs. displacement plots at selected monitoring points, the PLAXIS Python API provides a more streamlined and versatile solution. By integrating a Python script into your workflow, these plots can be automatically generated and exported upon completion of the calculation, offering greater efficiency and customization.

The example script below is based on Tutorial 9 of PLAXIS 2D - Construction of a road embankment, and with minor adjustments, it can be effectively applied to any safety analysis in both PLAXIS 2D and 3D.
The script extracts total displacement and ΣMsf values from each safety calculation phase, and with the help of Python module matplotlib, plots them with customized legends and color schemes. 

The figures below show this example script and the safety plots generated using it. The structure of the script includes:

  1. Initialization with PLAXIS boilerplate code
  2. Navigation to the staged construction phase and configuration of safety phases to retrieve results
  3. Extraction of results from PLAXIS Output
  4. Plot creation and customisation
  5. Exporting the plot as a PNG image

The Python script in this example considers the following:

 

With the release of PLAXIS 2025.1, the application’s calculation input and calculated results as well as its storage have been redesigned, resulting in many improvements and better consistency of the PLAXIS data. This improves the performance of PLAXIS Output, as well, especially concerning the retrieval of the .Reached results of the Phase and Step objects.

 

main_code.png

generated_curve.png

 

Usage instructions for the Python script

The code example above is based on Tutorial 9 of PLAXIS 2D - Construction of a road embankment, but can be edited according to your preferences.

To use this Python script with the example follow the steps below:

  1. Click here to access the PLAXIS 2D Tutorial 09: Construction of a road embankment, find and download the command log to create the model.
  2. Run the model and save it to a designated location on your system.
  3. Download the script found in the Downloads section - FoS_Python.py
  4. In PLAXIS 2D Input, start the Remote Scripting Server. Then go to Expert > Python > Editor, open the script.
  5. Ensure your Port and Password are correct, and run it with under Tools > Go (F5) to automatically extract and visualize the safety results. 
    The generated SumMsf vs. displacement curves are saved as a PNG file in the same folder where the FoS_Python.py is stored.

Alternatively, for a complete workflow:

  1. Download Tutorial_2D_09_road_embankment.py from the Downloads section. This script integrates both the model setup and safety plotting in a single file.
    2. Repeat the same procedure by executing the code in the Editor to automatically create the model and extract and visualize the safety results.

Downloads

See also