Contributing to or extending SMA-REACT
The current version of SMA-REACT begs for many more enhancements. Different loading conditions (i.e., superelasticity), different model formulations (i.e., the Brinson or extended Lagoudas models), and alternative optimization routines all could provide benefits for the SMA community. If you are interested in contributing to SMA-REACT, please raise an issue on GitHub, and the developers will coordinate the best way to incorporate your feature. This section will describe the skeleton of how to add functionality to the GUI and the sections of code for the possible enhancements listed above.
Preliminaries
SMA-REACT is built on the pyqt5 graphical user interface package. PyQt functions as the software front-end (i.e., all interactive elements), while the Lagoudas model and optimization codes form the back-end. Any new feature must be reflected in both the front- and back-ends, and hence requires knowledge of both. Thankfully, PyQt is an intuitive object-oriented package, so adding front-end elements is not too arduous. Here are a few helpful tutorials and articles on various components:
Accepting different input file types
Currently, SMA-REACT uses the pandas.read_csv() function with sep=None to load experimental data.
As such, the tool can only load tab-delimited text files robustly.
To accomodate other file formats, the following modifications could be performed:
Add a Dropdown on the
create_data_inputtab to add an input option.Modify the
open_files()andload_files()functions to accept different inputs (via if-else or otherwise).
Reformulating for different loading conditions (i.e., superelasticity)
The current model formulation calibrates isobaric experimental cycles by predicting strain as a function of applied temperature and stress.
It also assumes the material starts in Martensite; load_files() performs the reorganization of experimental data to arrange the thermal cycles to run from cold to hot.
For superelastic characterization cycles, the material stress should be predicted as a function of temperature and strain.
This requires a few distinct modifications:
Add a Dropdown on the
create_data_inputtab to delineate between isobaric and isothermal experimental data.Modify the
load_files()function to re-organize the experimental data with respect to strain, or to pass the raw data to the model.Add a new model function to calculate the material stress as a function of temperature and strain. This may seem involved, but the model formulation is much simpler.
Change the
create_calibration_progress_widgetfigures to reflect superelastic behavior (i.e., change the temperature-strain plot to a temperature-stress plot).
Adding another model formulation
The Lagoudas one-dimensional constitutive model is one of many different options popular in the SMA community. Alternative modeling approaches include the Brinson model [Bri93], the Aurrichio model [ACRU09], and various extensions for plasticity [SNG+19], finite deformation [XSBL21], and other phenomena. No matter the particular model you wish to include, the process we will detail below will be the same (if you have access to the model source code in python).
Add a Dropdown on the
create_data_inputtab to allow the user pick between different model formulations.Modify the
CalibrationParametersWidgetfunction (associated with the calibration parameters tab) to include the model parameters required for your chosen formulation. This would probably be best implemented in an if-else format.Change
main()to accomodate these different model parameters.Include another if-else statement in
evaluate()to call your chosen model formulation. If your model formulation returns a strain history given temperature and stress histories, this involves adding an if-else statement at the location where the current source code callsFull_Model_stress().Be sure to modify the
create_calibration_progress_widgetfigures to include any unique model parameters.
Including other optimization schemes
The current tool uses the Non-Sorting Genetic Algorithm (II) and Sequential-Least-Squares Quadratic Programming Algorithms to optimize the calibration. However, these algorithms are not “optimal” in any sense; rather, they were selected out of developer laziness for being “good enough.” If you are interested in implementing alternative optimization schemes that you feel would be better for calibration, follow these steps:
Adding more result export options
SMA-REACT currently can export all relevant optimization results to a JSON.
See the export_solution() for more information about the particular export quantities.
If you would like to tailor the GUI to export a particular file format, follow these steps:
Add a Dropdown on the
create_calibration_progress_widgettab to accomodate different export options.Modify the
export_solution()function to export different quantities depending on the aforementioned dropdown.