TPMplt package introduction
ZHANG Chen
2018-10-02
Main functions
TPMplt is a tool-kit for building and visualizing the dynmaic materials model (DMM), suggested by Prasad and Gegel. It provides an easy approach to calculate constructive functions and other related material constants based on a given strain condiiton. 2D and 3D processing-maps with temperature as its x axis, while logarithm strain rate as its y axis are also available.
Conceptual knowledge about VBTree data frame
It is necessary to build the conceptions for layers and levels in layer for variables, defined by VBTree package. For example, run the following codes to check all column names in the demo dataset in TPMplt pacakge:
colnames(TPMdata)
#> [1] "Strain-900-0.001-60%" "Stress-900-0.001-60%"
#> [3] "Strain-900-0.01-60%" "Stress-900-0.01-60%"
#> [5] "Strain-900-0.1-60%" "Stress-900-0.1-60%"
#> [7] "Strain-900-1-60%" "Stress-900-1-60%"
#> [9] "Strain-950-0.001-60%" "Stress-950-0.001-60%"
#> [11] "Strain-950-0.01-60%" "Stress-950-0.01-60%"
#> [13] "Strain-950-0.1-60%" "Stress-950-0.1-60%"
#> [15] "Strain-950-1-60%" "Stress-950-1-60%"
#> [17] "Strain-1000-0.001-60%" "Stress-1000-0.001-60%"
#> [19] "Strain-1000-0.01-60%" "Stress-1000-0.01-60%"
#> [21] "Strain-1000-0.1-60%" "Stress-1000-0.1-60%"
#> [23] "Strain-1000-1-60%" "Stress-1000-1-60%"
#> [25] "Strain-1050-0.001-60%" "Stress-1050-0.001-60%"
#> [27] "Strain-1050-0.01-60%" "Stress-1050-0.01-60%"
#> [29] "Strain-1050-0.1-60%" "Stress-1050-0.1-60%"
#> [31] "Strain-1050-1-60%" "Stress-1050-1-60%"
#> [33] "Strain-1100-0.001-60%" "Stress-1100-0.001-60%"
#> [35] "Strain-1100-0.01-60%" "Stress-1100-0.01-60%"
#> [37] "Strain-1100-0.1-60%" "Stress-1100-0.1-60%"
#> [39] "Strain-1100-1-60%" "Stress-1100-1-60%"
#> [41] "Strain-1150-0.001-60%" "Stress-1150-0.001-60%"
#> [43] "Strain-1150-0.01-60%" "Stress-1150-0.01-60%"
#> [45] "Strain-1150-0.1-60%" "Stress-1150-0.1-60%"
#> [47] "Strain-1150-1-60%" "Stress-1150-1-60%"
#> [49] "Strain-1200-0.001-60%" "Stress-1200-0.001-60%"
#> [51] "Strain-1200-0.01-60%" "Stress-1200-0.01-60%"
#> [53] "Strain-1200-0.1-60%" "Stress-1200-0.1-60%"
#> [55] "Strain-1200-1-60%" "Stress-1200-1-60%"
As we seen, all column names are arranged by the style of “(Strain&Stress)-(Temperature)-(Strain Rate)-(Other)”. Under this circumstance, we call the layer for temperature is 2, while the layer for strain rate is 3.
The function epsExtract
is capable to export a strain rate-temperature table by specifying eps
as the strain condition. However, lyT
and lySR
, the two necessary arguments corresponding to layers for temperature and strain rate respectively, require correct declaration as well.
Executinge the following codes:
require(VBTree)
#> Loading required package: VBTree
dl2vbt(chrvec2dl(colnames(TPMdata)))
#> $tree
#> $tree[[1]]
#> [1] "Strain" "Stress"
#>
#> $tree[[2]]
#> $tree[[2]][[1]]
#> [1] "900" "950" "1000" "1050" "1100" "1150" "1200"
#>
#> $tree[[2]][[2]]
#> $tree[[2]][[2]][[1]]
#> [1] "0.001" "0.01" "0.1" "1"
#>
#> $tree[[2]][[2]][[2]]
#> $tree[[2]][[2]][[2]][[1]]
#> [1] "60%"
#>
#> $tree[[2]][[2]][[2]][[2]]
#> list()
#>
#>
#>
#>
#>
#> $dims
#> [1] 2 7 4 1
#>
#> attr(,"class")
#> [1] "Vector.Binary.Tree"
The complete structure for all variables is showed. As the result showed above, there’re 7 temperatures and 4 strain rates in our summary table, therefore the numbers of level for temperature and strain rate are 7 and 4 respectively. Based on all introduced knowledge, we can easily find that all factors will be corresponded with a unique identity with the format as (layer, level). For example, we can define the factor “950” is located in layer 2, level 2.
Auto plots for stress-strain curves
SSplots
is automatic completion for stress-strain curve plots, using VBTree package group strategy. The argument grpby
determines the group methods for plots. As an instance, stress-strain curves grouped by strain rates, separated by temperature condition in each individual plot is very common. Since the layer for strain rate is 3, we can simply set the argument grpby
as 3 then run the code SSplots(TPMdata, 3, mfrow=c(3, 3))
to obtain the following plots (7 figures, therefore it is reasonable to use a 3*3 division to display):

Grouped by temperature is also available, by running SSplots(TPMdata, 2, mfrow=c(2, 2))
, four figures will be exported as:

But pay attention, multiple plots export using graphics
is very sensitive to the Plots pane’s area. Before plotting, please zoom in this pane large enough to obtain correct export.
Automatic calculation
On the basis of dynamic materials modeling (DMM), constructive function and all material constants can be calculated from a certain strain rate-temperature table. The function DMMprocess
includes all steps for DMM processing. Applying it on our previous result (strain rate-temperature table by specific value of strain), the complete output can be observed as following:
DMM <- DMMprocess(epstable)
DMM
#> $MaterialCoefficients
#> $MaterialCoefficients$m.StrainRateSensitivity
#> [1] 0.2012335 0.3470810 0.1686943 0.1742526 0.1753401 0.1996843 0.2228412
#>
#> $MaterialCoefficients$n1.StressIndex
#> [1] 4.700741
#>
#> $MaterialCoefficients$beta.StressIndex
#> [1] 0.06885769
#>
#> $MaterialCoefficients$alpha.MaterialConstant
#> [1] 0.01464826
#>
#> $MaterialCoefficients$Q.ActivatingEnergy
#> [1] 45.01241
#>
#> $MaterialCoefficients$n.PowerValue
#> [1] 1.461455
#>
#> $MaterialCoefficients$A.MaterialConstant
#> [1] 2.80227e-05
#>
#> $MaterialCoefficients$epsilon.strain
#> [1] 0.7
#>
#> $MaterialCoefficients$base
#> [1] 2.718282
#>
#>
#> $tablelist
#> $tablelist$SRTtable
#> 900 950 1000 1050 1100 1150 1200
#> 0.001 22.070 8.464 83.843 55.503 47.455 27.325 28.351
#> 0.01 41.416 17.471 159.480 118.790 81.380 88.220 40.692
#> 0.1 69.463 53.144 232.820 183.190 123.460 56.540 92.850
#> 1 87.040 83.843 269.780 183.000 158.640 146.750 119.110
#>
#> $tablelist$etatable
#> 900 950 1000 1050 1100 1150
#> 0.001 0.74653405 0.1724305 1.03752414 1.2585170 0.6829465 -8.7415766
#> 0.01 0.70983935 1.8060851 0.56194553 0.7285048 0.5341198 -0.1138792
#> 0.1 0.42203656 1.4256013 0.25153800 0.2260331 0.3476842 -0.1945707
#> 1 0.01757061 -0.1747197 0.03810044 -0.1984372 0.1425365 -14.9458514
#> 1200
#> 0.001 -0.1721890
#> 0.01 0.9978111
#> 0.1 0.8920934
#> 1 -0.2867421
#>
#> $tablelist$xitable
#> 900 950 1000 1050 1100
#> 0.001 0.2425190 0.05478584 0.30733992 0.32864754 0.23428408
#> 0.01 0.2326584 0.44993934 0.18511418 0.20942150 0.19050447
#> 0.1 0.1449581 0.39157457 0.07748920 0.04396445 0.12782984
#> 1 -0.0205817 -0.12030847 -0.01553501 -0.16772361 0.04626016
#> 1150 1200
#> 0.001 1.29046783 -0.1074511
#> 0.01 -0.06657615 0.3196005
#> 0.1 -0.11396843 0.2952133
#> 1 1.14829097 -0.1806126
#>
#>
#> attr(,"class")
#> [1] "DMMresult"
If the constructive function is the only thing we concerned about, set the argument consfuncPRT
in DMMprocess
as TRUE:
DMM <- DMMprocess(epstable, consfuncPRT = TRUE)
#> [1] "the constitutive equation in strain 0.7 is: sigma=(1/0.01)ln{(Z/2.80227019283101e-05)^(1/1.46)+[(Z/2.80227019283101e-05)^(2/1.46)+1]^(1/2)}"
Preparation for visualization
As we can see, the “etatable” and “xitable” in tablelist are two key parts for building processing-map. The former is for power dissipation efficiency factor eta, and the later is for rheological stability coefficient xi. However, since the values in both are discrete, regression process for these tables is necessary.
Support vector regression (SVR) is recommanded. The function SVRModel
will return a regression result which can be utilized by ploting functions.
The following demonstration save the returned result into the vairable “PLTbd”, for the meaning of “Plots builder”.
2D processing map visualization
Function TPM2dplt
can generate a thermal processing map from regression result easily. Following codes demonstrates the processing map from “PLTbd” with default settings:

From the plot we can find that power dissipation efficiency factor eta is denoted by contour with gradient blue, while the rheological stability coefficient xi is represented by a gradient colours from green (high) to red (low). Annotation in top-left show the strain condition for current processing map.
Locations for annotation, gradient colors for rheological stability coefficient xi is customizable in TPM2dplt
function. But since the color for eta is fixed, please try not to use blue or such like, to avoid obtaining an ambiguous result.
3D processing map visualization
Function TPM3dplt
can build a thermal processing results as similar as TPM2dplt
did. The difference is, eta and xi will be separately plotted.
By running the following code, we can easily obtain the results as shown in the next figure.

These two 3d surfaces are generated through the rgl package, therefore it will be very convenient to utilize 3d rotation on our plots for further analysis in details.
Especially, the xi plots is coupled with a specific plane, z=0, in order to make divisions for the stable and unstable regions.