New reasons to use Python from Abaqus 2020

Written by Miguel

22 Feb, 2021

About one month ago (January 2021), Abaqus Student Edition 2020 was released.

This new version not only includes novelties in the fields of interactions, enhanced compatibility of different finite elements, improvements in some constitutive models… But it also includes what will become a true revolution for Abaqus/Scripting users.

Updates in the Python environment

And here we go, Abaqus 2020 brings a series of updates for the Python interpreter on which Abaqus/Scripting runs. Although it is still Python 2.7, this new version includes three new libraries (or modules) that multiply the variety of actions that can be performed by means of scripting in Abaqus:


    With this library you can make all kind of graphics and plots in 2D and 3D (histograms, contoured plots, rastered images…). It is widely used for data visualization in scientific publications and all sort of reports.


    This scientific library is supported by numpy to carry out advanced mathematical operations, such as solving nonlinear equations.


    This library enables the use of symbolic mathematics by employing analytical closed-form expressions, similar to other softwares like Mathematica

    What has actually changed?

    The table below sums up the main changes from Abaqus 2019 and Abaqus 2020 regarding Python libraries:

    Abaqus 2019 Abaqus 2020
    python 2.7.3 2.7.15
    numpy 1.6.2 1.15.4
    matplotlib - 2.2.4
    scipy - 1.2.0
    sympy - 1.3

    What else can we do now in Abaqus/Scripting?

    In this post we will not dive into the details of each of these three new libraries that Abaqus 2020 has to offer, but we can point out de brand new possibility of making high quality plots directly from scripts within Abaqus thanks to Matplotlib.

    From now on, we will not only be able to export numerical results as plain text files, csv or Excel, but we can produce curves and plots to visualize the results of hundreds of different simulations or obtaining figures that we can include later in our technical reports and projects.

    A quick example in Matplotlib

    If we want to test how MAtplotlib works in Abaqus 2020, we can just copy and paste the following few lines of code on the console inside Abaqus/CAE (command line interface). We can also copy these lines in a script (with extension .py) and run it from Abaqus/CAE (File > Run Script…).


    import matplotlib.pyplot as plt
    import numpy as np
    # Create a figure with one axes
    fig, ax = plt.subplots()                    
    # Generate 100 points evenly spaced between -5 and 5
    x0 = np.linspace(-5., 5., 100)              
    # y = f(x), function to plot in the next line
    y0 = np.exp(-x0**2)                         
    # Plot x vs. y with black dots, label will be used in the legend
    ax.plot(x0, y0, 'k.', label=r'$e^{-x^2}$')  
    # Label of the x axis
    # Label of the y axis
    # Display the legend, i.e. the label of the plotted line
    # Export the figure into a pdf file (vector quality)
    # Display the figure on the screen, otherwise we will not see it  

    The previous example generates a plot with a single curve: \(y(x) = e^{-x^2}\) at \(-5 \leq x \leq 5\) with black dots. In addition, the figure is exported to a pdf file that we can visualize and use later.

    You can download the script that produces the figure shown in the image below, with this link. Notice the equations shown in the legends of the left plot using Latex expressions

    The customization options are almost infinite in Matplotlib. If you want to see more examples of what you can do with Matplotlib, I recommend you to take a look at the gallery in the official website.

    I hope that you find these tips useful!

    Download the FREE GUIDE




    You might be interested as well…


    Submit a Comment

    Personal details provided through this form will be managed by TecnoDigital School responsible for this website. The aim of collecting and treating the details required is the management of the comments made in this blog.

    Legitimation: Consent of the interested. Requests cannot be atended if personal details are not introduced in the fields marked as mandatory.

    You will be able to exercise your access, rectification, limitation rights and to suppress your personal details through, as well as the right to make a compliant through a control authority.

    You can read additional information about Personal Details Protection in the website:, as well as the privacy policy.