Original Voce-Chaboche Model Fitting Example 1

An example of fitting the original Voce-Chaboche model to a set of test data is provided.

Documentation for all the functions used in this example can be found by either looking at docstrings for any of the functions.


In [1]:
import RESSPyLab as rpl
import numpy as np

Run optimization with multiple test data set

This is a simple example for fitting the Voce-Chaboche model to a set of test data. We only use two backstresses in this model, additional backstresses can be specified by adding pairs of 0.1's to the list of x_0. E.g., three backstresses would be

x_0 = [200000., 355., 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]

Likewise, one backstress can be specified by removing a pair of 0.1's from the list below.

The overall steps to calibrate the model parameters are as follows:

  1. Load the set of test data
  2. Choose a starting point
  3. Set the location to save the analysis history
  4. Run the analysis

In [2]:
# Specify the true stress-strain to be used in the calibration
data_files = ['example_1.csv', 'example_2.csv']

# Set initial parameters for the Voce-Chaboche model with two backstresses
# [E, \sigma_{y0}, Q_\infty, b, C_1, \gamma_1, C_2, \gamma_2]
x_0 = [200000., 355., 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]

# Log files for the parameters at each step, and values of the objective function at each step
x_log = './output/x_log.txt'
fxn_log = './output/fxn_log.txt'

# Run the calibration
# Set filter_data=True if you have NOT already filtered/reduced the data
# We recommend that you filter/reduce the data beforehand (i.e., filter_data=False is recommended)
x_sol = rpl.vc_param_opt(x_0, data_files, x_log, fxn_log, filter_data=False)


##########      New Lagrangian Step      ###########

It. = 1:	f(x) = 1.776900e+04 ; ||grad[L]|| = 4.457609e+03
x =  [195950.328    358.78       0.103      0.103      0.103      0.103
      0.103      0.103]

It. = 2:	f(x) = 1.678451e+04 ; ||grad[L]|| = 3.637696e+03
x =  [188235.796    366.279      0.111      0.111      0.111      0.111
      0.111      0.111]

It. = 3:	f(x) = 1.503061e+04 ; ||grad[L]|| = 2.315072e+03
x =  [174044.419    380.87       0.129      0.129      0.129      0.128
      0.129      0.128]

It. = 4:	f(x) = 1.229817e+04 ; ||grad[L]|| = 9.774096e+02
x =  [161424.996    393.164      0.172      0.172      0.171      0.171
      0.171      0.171]

It. = 5:	f(x) = 1.082905e+04 ; ||grad[L]|| = 4.142153e+02
x =  [156018.713    395.592      0.229      0.229      0.229      0.228
      0.229      0.228]

It. = 6:	f(x) = 1.051169e+04 ; ||grad[L]|| = 1.766804e+02
x =  [152554.241    396.755      0.309      0.308      0.306      0.305
      0.306      0.305]

It. = 7:	f(x) = 1.038428e+04 ; ||grad[L]|| = 7.980495e+01
x =  [151592.67     397.049      0.423      0.421      0.411      0.406
      0.411      0.406]

It. = 8:	f(x) = 1.033330e+04 ; ||grad[L]|| = 3.690334e+01
x =  [146410.779    398.379      0.619      0.609      0.558      0.541
      0.558      0.541]

It. = 9:	f(x) = 1.015103e+04 ; ||grad[L]|| = 2.494366e+01
x =  [144859.295    398.715      1.233      1.133      0.775      0.722
      0.775      0.722]

It. = 10:	f(x) = 1.010973e+04 ; ||grad[L]|| = 2.494366e+01
x =  [144859.295    398.715      1.233      1.133      0.775      0.722
      0.775      0.722]

It. = 11:	f(x) = 1.010973e+04 ; ||grad[L]|| = 2.494366e+01
x =  [144859.295    398.715      1.233      1.133      0.775      0.722
      0.775      0.722]

It. = 12:	f(x) = 1.010973e+04 ; ||grad[L]|| = 2.494366e+01
x =  [144859.295    398.715      1.233      1.133      0.775      0.722
      0.775      0.722]

It. = 13:	f(x) = 1.010973e+04 ; ||grad[L]|| = 2.494366e+01
x =  [144859.295    398.715      1.233      1.133      0.775      0.722
      0.775      0.722]

It. = 14:	f(x) = 1.010973e+04 ; ||grad[L]|| = 2.494366e+01
x =  [144859.295    398.715      1.233      1.133      0.775      0.722
      0.775      0.722]

It. = 15:	f(x) = 1.010973e+04 ; ||grad[L]|| = 3.717033e+01
x =  [141917.912    401.043     21.559      5.66       2.07       1.56
      2.07       1.56 ]

It. = 16:	f(x) = 9.648878e+03 ; ||grad[L]|| = 4.627679e+01
x =  [132114.874    370.28      52.456      5.508     15.766      3.053
     15.766      3.053]

It. = 17:	f(x) = 8.734314e+03 ; ||grad[L]|| = 1.441629e+02
x =  [142980.113    357.168     61.476      5.508   3313.434    183.212
   3313.434    183.212]

It. = 18:	f(x) = 6.534136e+03 ; ||grad[L]|| = 2.713615e+02
x =  [144113.513    352.303     56.537      1.292   3676.229    152.563
   3676.229    152.563]

It. = 19:	f(x) = 5.471284e+03 ; ||grad[L]|| = 7.972219e+02
x =  [147560.491    352.162     68.787      1.57    5571.866     82.744
   5571.866     82.744]

It. = 20:	f(x) = 5.106684e+03 ; ||grad[L]|| = 5.399373e+02
x =  [150179.85     347.821     60.337      0.242   5110.161     88.831
   5110.161     88.831]

It. = 21:	f(x) = 3.610870e+03 ; ||grad[L]|| = 5.630666e+02
x =  [157359.235    344.713    108.689      0.335   5000.677     93.178
   5000.677     93.178]

It. = 22:	f(x) = 3.029764e+03 ; ||grad[L]|| = 5.151730e+02
x =  [170536.675    334.133    171.52       0.518   5274.014     80.629
   5274.014     80.629]

It. = 23:	f(x) = 2.390952e+03 ; ||grad[L]|| = 5.084616e+02
x =  [170578.967    306.335    123.698      0.713   7530.061    119.108
   7530.061    119.108]

It. = 24:	f(x) = 2.131244e+03 ; ||grad[L]|| = 5.084616e+02
x =  [170578.967    306.335    123.698      0.713   7530.061    119.108
   7530.061    119.108]

It. = 25:	f(x) = 2.131244e+03 ; ||grad[L]|| = 5.084616e+02
x =  [170578.967    306.335    123.698      0.713   7530.061    119.108
   7530.061    119.108]

It. = 26:	f(x) = 2.131244e+03 ; ||grad[L]|| = 9.325054e+01
x =  [177070.145    301.581    140.517      0.885   7495.21     107.057
   7495.21     107.057]

It. = 27:	f(x) = 1.995434e+03 ; ||grad[L]|| = 9.325054e+01
x =  [177070.145    301.581    140.517      0.885   7495.21     107.057
   7495.21     107.057]

It. = 28:	f(x) = 1.995434e+03 ; ||grad[L]|| = 1.364284e+02
x =  [178134.784    301.367    105.234      0.995   8028.254    114.319
   8028.254    114.319]

It. = 29:	f(x) = 1.981278e+03 ; ||grad[L]|| = 1.188440e+02
x =  [179279.517    296.713     94.421      1.413   7991.747    106.134
   7963.808    120.215]

It. = 30:	f(x) = 1.948806e+03 ; ||grad[L]|| = 1.986318e+02
x =  [180598.67     289.138     74.696      2.477   7921.761     85.089
   7864.854    141.049]

It. = 31:	f(x) = 1.927117e+03 ; ||grad[L]|| = 6.107712e+01
x =  [182952.802    282.906     83.41       3.756   7904.882     66.97
   8551.302    191.797]

It. = 32:	f(x) = 1.765902e+03 ; ||grad[L]|| = 8.794762e+01
x =  [184054.613    264.068     72.258      7.117   6273.029     56.571
  14243.455    254.426]

It. = 33:	f(x) = 1.744036e+03 ; ||grad[L]|| = 8.794762e+01
x =  [184054.613    264.068     72.258      7.117   6273.029     56.571
  14243.455    254.426]

It. = 34:	f(x) = 1.744036e+03 ; ||grad[L]|| = 1.287984e+01
x =  [187460.36     260.039     89.136      6.472   5012.269     46.007
  15924.002    199.794]

It. = 35:	f(x) = 1.563493e+03 ; ||grad[L]|| = 1.287984e+01
x =  [187460.36     260.039     89.136      6.472   5012.269     46.007
  15924.002    199.794]

It. = 36:	f(x) = 1.563493e+03 ; ||grad[L]|| = 5.311848e+00
x =  [182451.676    261.202     88.642      7.893   4466.672     38.246
  15689.531    216.775]

It. = 37:	f(x) = 1.457976e+03 ; ||grad[L]|| = 5.311848e+00
x =  [182451.676    261.202     88.642      7.893   4466.672     38.246
  15689.531    216.775]

It. = 38:	f(x) = 1.457976e+03 ; ||grad[L]|| = 3.556416e+00
x =  [187249.815    261.465     91.526      8.262   3926.161     25.413
  16492.589    220.296]

It. = 39:	f(x) = 1.436456e+03 ; ||grad[L]|| = 5.138170e+00
x =  [184053.347    258.308     90.273      7.575   3400.427     24.474
  17560.826    197.687]

It. = 40:	f(x) = 1.393906e+03 ; ||grad[L]|| = 3.220818e+00
x =  [184404.616    258.375     91.948      8.625   2734.495     14.599
  17804.318    196.063]

It. = 41:	f(x) = 1.364005e+03 ; ||grad[L]|| = 3.929958e+00
x =  [185506.571    255.54      90.732      8.814   2289.317     12.119
  17991.712    171.953]

It. = 42:	f(x) = 1.336513e+03 ; ||grad[L]|| = 1.546656e+01
x =  [185096.576    255.377     92.57       9.189   1741.119      1.087
  17976.811    162.761]

It. = 43:	f(x) = 1.333506e+03 ; ||grad[L]|| = 4.908371e+00
x =  [185322.898    255.632     91.629      9.689   1689.9        1.732
  17284.43     153.639]

It. = 44:	f(x) = 1.317729e+03 ; ||grad[L]|| = 1.434433e+00
x =  [185174.287    255.434     91.748      9.652   1729.583      2.764
  17393.313    156.02 ]

It. = 45:	f(x) = 1.314805e+03 ; ||grad[L]|| = 2.459665e-01
x =  [185126.411    255.414     91.731      9.606   1755.196      3.386
  17425.296    157.037]

It. = 46:	f(x) = 1.314330e+03 ; ||grad[L]|| = 1.102491e-02
x =  [185115.563    255.416     91.727      9.595   1761.662      3.541
  17430.302    157.268]
##########      New Lagrangian Step      ###########

It. = 47:	f(x) = 1.314311e+03 ; ||grad[L]|| = 2.509373e-05
x =  [185115.048    255.416     91.727      9.595   1761.99       3.549
  17430.518    157.279]
##########      New Lagrangian Step      ###########

It. = 48:	f(x) = 1.314311e+03 ; ||grad[L]|| = 1.313621e-10
x =  [185115.047    255.416     91.727      9.595   1761.991      3.549
  17430.519    157.279]
####################################################
### SUCCESSFUL AUGMENTED LAGRANGIAN OPTIMIZATION ###
####################################################
########## TERMINATING AUGMENTED LAGRANGIAN ########
####################################################
('x = ', array([185115.047,    255.416,     91.727,      9.595,   1761.991,
            3.549,  17430.519,    157.279]))

Plot results

After the analysis is finished we can plot the test data versus the fitted model. Note that we add two dummy parameters to the list of final parameters because the plotting function was written for the updated Voce-Chaboche model that has two additional parameters. Setting the first of these two additional parameters equal to zero neglects the effects of the updated model.

If we set output_dir='./output/', for example, instead of output_dir='' the uvc_data_plotter function will save pdf's of all the plots instead of displaying them below.

The function uvc_data_multi_plotter is also provided to give more fine-grained control over the plotting process, and can compare multiple analyses.


In [3]:
data = rpl.load_data_set(data_files)
# Added parameters are necessary for plotting the Voce-Chaboche model
x_sol_2 = np.insert(x_sol, 4, [0., 1.])
rpl.uvc_data_plotter(x_sol_2, data, output_dir='', file_name='vc_example_plots', plot_label='Fitted')


Out[3]:
[<Figure size 432x288 with 1 Axes>, <Figure size 432x288 with 1 Axes>]

In [ ]: