Skip to main content
Export tensile stress-strain data from the MI_Training database, and fit a curve to the exported data. Create a new record using parameter values extracted from the fitted curve, and upload this record to the database. This example demonstrates:
  • Browsing for records
  • Extracting functional data from a Granta MI database
  • Importing a new record to a Granta MI database

Create a Granta MI Session

Import the GRANTA_MIScriptingToolkit package, and create a connection to a Granta MI server.

Browse for records

Browse for a record located within the Tensile Statistical Data table in the MI_Training database. Set the folder path for the record to browse to as: High Alloy Steel / AMS 6520 / Plate / Room Temperature °F.
Get the root node of the table of interest.
Find the record of interest, AMS 6520, Plate, Room Temperature °F.
Previous cell output:

Exporting data

Export Tensile Response (11 axis) data from the record of interest.
Check the data type of the Tensile Response (11 axis) attribute is FLOAT_FUNCTIONAL_SERIES.
Previous cell output:
Extract the data from each curve into a list.
Previous cell output:
Plot the curves using the matplotlib package.
png Fit a Ramberg-Osgood function to the data.
Previous cell output:
png

Importing data

Create a new record using the attribute values for Young’s modulus obtained from the fitted curve, and import this record into the database. Identify the folder to upload the new record to. Browse the record tree to get the record reference for that folder.
Previous cell output:
Define the record attribute to include in the new record.
Set values and units for the attributes of the new record.
Create a reference to the subset that the new record will be added to.
Import the record to the Granta MI database.
Previous cell output: