Skip to main content
Populate a functional attribute with data fitted using the Python numpy library.

Import libraries and define a polynomial fit function

This example populates a functional attribute for Ultimate Tensile Strength vs Temperature in one table from a polynomial fit of the individual attributes in another table.

Specify database and table

The source data will come from the Tensile Statistical Data table.

Export test data

Find High Alloy Steel > AMS 6520 > Plate records in which both the Ultimate Tensile Strength and Test Temperature attributes are populated.
Extract the attribute values from the returned records into x and y values.

Fit the test data

Fit a fourth-order polynomial to your x and y data.
Generate x and y values for the fitted equation, using the function you defined at the start.

Create a record to store the data in

The resulting functional data will be written into the Metals subset of the Design Data table, using the same unit system.
Create a new record to store your functional data.
Access the (empty) functional attribute, and view its column headers.
Previous cell output:

Populate the functional attribute

Add the test data to the functional attribute point-by-point, then view the attribute data. Column headers can be omitted if they aren’t required to represent the data.
Previous cell output:
Then add the fitted data to the functional attribute point-by-point, and view the attribute data with series number as an extra column.
Previous cell output:
Adjust the series linestyles (series_linestyles is a dictionary, indexed with integers).
Previous cell output:

Write your changes to MI

Set the attributes you’ve modified to update, and write the new record to the server.
Previous cell output: