Connect to Granta MI
Specify a database and tables.Search for records with statistical data
This script will perform a fatigue analysis on the first record whose Statistical Analysis Status is set to ‘In Progress’, but it can easily be generalised to operate on multiple statistical data records. First, perform a criteria search to find the target record.Get the source data for the record
Get the R-Ratio and Test Temperature values from the record, and fetch the corresponding test results. Then read the attribute values from the test result records into apandas DataFrame for plotting and analysis.
Fit the data
Fit the fatigue test data using the SciPycurve_fit() function, and create a new DataFrame for the fitted data and
the lower bound.
| Cyclic life | Type | Maximum stress | |
|---|---|---|---|
| 0 | 5000.000000 | Fitted Data | 527.961774 |
| 1 | 5870.634799 | Fitted Data | 520.792043 |
| 2 | 6892.870589 | Fitted Data | 513.719678 |
| 3 | 8093.105189 | Fitted Data | 506.743355 |
| 4 | 9502.332991 | Fitted Data | 499.861771 |
Plot the data
Create a scatter plot of the source data (Maximum stress vs Number of cycles).

Import the fitted data to Granta MI
Replace the data in the original record’s functional attribute Maximum Stress v Cycles (Equivalent Stress) with the fitted data. UseSession.update() to push the changes to Granta MI.
Create traceability links
Add a record link group, and useSession.update_links() to push the changes to Granta MI.