Title: | Tool-Kit for Dynamic Materials Model and Thermal Processing Maps |
---|---|
Description: | Provides a simple approach for constructing dynamic materials modeling suggested by Prasad and Gegel (1984) <doi:10.1007/BF02664902>. It can easily generate various processing-maps based on this model as well. The calculation result in this package contains full materials constants, information about power dissipation efficiency factor, and rheological properties, can be exported completely also, through which further analysis and customized plots will be applicable as well. |
Authors: | Chen Zhang [aut, cre, cph] |
Maintainer: | Chen Zhang <[email protected]> |
License: | GPL-3 |
Version: | 0.1.6 |
Built: | 2025-02-28 03:47:28 UTC |
Source: | https://github.com/cubiczebra/tpmplt |
Provides a simple approach for constructing dynamic materials modeling (DMM) suggested by Prasad and Gegel. It can easily generate various processing-maps based on this model as well. The calculation result in this package contains full materials constants, information about power dissipation efficiency factor, and rheological properties, can be exported completely also, through which further analysis and customized plots will be applicable as well.
Input data should be of the data frame with "VBTree" style. Full calculation result returned from the function DMMprocess builds the dynamic material model. 2D and 3D thermal processing-maps can be generated based on this model. 2D plots are built using ggplot2 while 3D plots are constructed by rgl. Especially, 3D plots will separately generate two 3D surfaces, for power dissipation efficiency eta, and rheological stability coefficient xi, respectively.
Chen Zhang
Maintainer: Chen Zhang <[email protected]>
Prasad, YVRK, Gegel, HL, Doraivelu, SM, Malas, JC, Morgan, JT, Lark, KA & Barker, DR (1984). Modeling of dynamic material behavior in hot deformation: forging of Ti-6242. Metallurgical Transactions A, 15, 1883-1892.
Prasad, YVRK, Rao, KP & Sasidhar, S (2015). Hot working guide: a compendium of processing maps. ASM international
# Check the factors in column names of input data: # Note: Temperature in layer2, Strain Rate in layer3. require(VBTree) vbt <- dl2vbt(chrvec2dl(colnames(TPMdata))) vbt # Export Strain Rate-Temperature table based on # given strain condition (epsilon): epstable <- epsExtract(TPMdata, 0.7, 2, 3) # Build dynamic materials model (DMM) from Strain # Rate-Temperature table: DMM <- DMMprocess(epstable) # Choose regression method for plots: PLTbd <- SVRModel(DMM) # 2D processing-map through selected regression method: TPM2dplt(PLTbd) # 3D processing-map through selected regression method: TPM3dplt(PLTbd)
# Check the factors in column names of input data: # Note: Temperature in layer2, Strain Rate in layer3. require(VBTree) vbt <- dl2vbt(chrvec2dl(colnames(TPMdata))) vbt # Export Strain Rate-Temperature table based on # given strain condition (epsilon): epstable <- epsExtract(TPMdata, 0.7, 2, 3) # Build dynamic materials model (DMM) from Strain # Rate-Temperature table: DMM <- DMMprocess(epstable) # Choose regression method for plots: PLTbd <- SVRModel(DMM) # 2D processing-map through selected regression method: TPM2dplt(PLTbd) # 3D processing-map through selected regression method: TPM3dplt(PLTbd)
Read data from multiple files with structurized file names, then generate a summary table. It will also be available for the files from other tester apparatus by correct setting.
API4TMZ(Cdl, wd, ftype = ".csv", Straincln = 7, Stresscln = 8, startrow = 29)
API4TMZ(Cdl, wd, ftype = ".csv", Straincln = 7, Stresscln = 8, startrow = 29)
Cdl |
An handmade double list to determine selected conditions. |
wd |
Work directory. |
ftype |
File type to be read. Default value is ".csv". |
Straincln |
An integer to specify column for Strain in your data. Default value is 7 means the 7th column contains strain data, in the files exported from Thermec Master-Z tester. |
Stresscln |
An integer to specify column for Strain in your data. Default value is 8 means the 8th column contains stress data, in the files exported from Thermec Master-Z tester. |
startrow |
An integer to ignore the prefix rows for testing conditions. Default value is 29. |
A matrix-like summary table for all input files.
variable1 <- c("factor11", "factor12", "factor13") variable2 <- c("factor21", "factor22") variable3 <- c("factor31", "factor32", "factor33", "factor34") conditions <- list(variable1, variable2, variable3) ## Not run: SummaryTable <- API4TMZ(conditions, "/Your_Data_Directory/") ## End(Not run)
variable1 <- c("factor11", "factor12", "factor13") variable2 <- c("factor21", "factor22") variable3 <- c("factor31", "factor32", "factor33", "factor34") conditions <- list(variable1, variable2, variable3) ## Not run: SummaryTable <- API4TMZ(conditions, "/Your_Data_Directory/") ## End(Not run)
Dynamic material modeling based on strain rate-temperature table returned from
the function epsExtract
. Material constants as well as power
dissipation efficiency factors and rheological stability coefficients in current conditions
will be returned.
DMMprocess( x, lgbase = 10, InteractMode = FALSE, ConsFunc = FALSE, legendcex = 0.65, legendloc = "bottomright" )
DMMprocess( x, lgbase = 10, InteractMode = FALSE, ConsFunc = FALSE, legendcex = 0.65, legendloc = "bottomright" )
x |
A strain rate-temperature table, returned from |
lgbase |
A numeric value to specify the base of the logarithm calculations for processing map. The default value uses 10. |
InteractMode |
A boolean value to control figures' output and the printout of related constants during calculations. Default value FALSE means all fitting plots will not be outputed. If these outputs are necessary, set this parameter as TRUE then follow the prompt messages. |
ConsFunc |
A boolean value to determine whether calculating for constructive equation. The default value uses FALSE. |
legendcex |
A numeric value to determine the legend scale. It is activated only when the parameter InteractMode is TRUE. The default value is 0.65. |
legendloc |
A character object to determine the location of legend. It is activated only when the parameter InteractMode is TRUE. The defualt value is "bottomright". |
Serial material constants, constructive function, eta table and xi table through dynamic material model developed by Gegel and Prasad.
require(VBTree) dl2vbt(chrvec2dl(colnames(TPMdata))) epstable <- epsExtract(TPMdata, 0.7, 2, 3) # Without calculation for constitutive equation DMM <- DMMprocess(epstable) message(DMM) # Calculating for constitutive equation but # Without plots printout. DMM <- DMMprocess(epstable, ConsFunc=TRUE) message(DMM) # Calculating for constitutive equation and # required fitting plots printout. (message and selection in prompt) ## Not run: DMMprocess(epstable, InteractMode=TRUE, ConsFunc=TRUE) ## End(Not run)
require(VBTree) dl2vbt(chrvec2dl(colnames(TPMdata))) epstable <- epsExtract(TPMdata, 0.7, 2, 3) # Without calculation for constitutive equation DMM <- DMMprocess(epstable) message(DMM) # Calculating for constitutive equation but # Without plots printout. DMM <- DMMprocess(epstable, ConsFunc=TRUE) message(DMM) # Calculating for constitutive equation and # required fitting plots printout. (message and selection in prompt) ## Not run: DMMprocess(epstable, InteractMode=TRUE, ConsFunc=TRUE) ## End(Not run)
Automatically output the strain rate vs. temperature table, by a specified strain condition.
epsExtract(data, eps, lyT, lySR, manual = NULL)
epsExtract(data, eps, lyT, lySR, manual = NULL)
data |
A data frame with |
eps |
A numeric value to specify strain condition. |
lyT |
An integer to specify the layer for temperature attribute in the vector binary tree. |
lySR |
An integer to specify the layer for strain rate attribute in the vector binary tree. |
manual |
An integer vector with the length of 3 where the 1st element denotes the layer for Stress and Strain,
the 2nd and 3rd elements represent the levels for Strain and Stress, respectively. The default setting is NULL, which
can call the function |
A list consist of a matrix table arranged by rows for strain rates while columns for temperatures, and a numeric value as strain condition for this strain rate-temperature table.
require(VBTree) # Find locations for temperature and strain rate: dl2vbt(chrvec2dl(colnames(TPMdata))) epsExtract(TPMdata, eps = 0.7, lyT = 2, lySR = 3)
require(VBTree) # Find locations for temperature and strain rate: dl2vbt(chrvec2dl(colnames(TPMdata))) epsExtract(TPMdata, eps = 0.7, lyT = 2, lySR = 3)
Kalman filter reducing the noise in raw data if it is necessary.
KFprocess(x, manual = NULL, ...)
KFprocess(x, manual = NULL, ...)
x |
A data frame with |
manual |
An integer vector with the length of 3 where the 1st element denotes the layer for Stress and
Strain, the 2nd and 3rd elements represent the levels for Strain and Stress, respectively. The default setting is
NULL, which can call the function |
... |
The arguments dV and dW passed on to |
A data frame with the identical shape as input data, but with the smoothed stress values.
# raw data without smoothing: SSplots(TPMdata, 2, mfrow=c(2, 2)) # Smoothing to reduce the noise: KFdt <-KFprocess(TPMdata, dV = 0.3, dW = 0.006) SSplots(KFdt, 2, mfrow=c(2, 2))
# raw data without smoothing: SSplots(TPMdata, 2, mfrow=c(2, 2)) # Smoothing to reduce the noise: KFdt <-KFprocess(TPMdata, dV = 0.3, dW = 0.006) SSplots(KFdt, 2, mfrow=c(2, 2))
Function for detecting the locations for Strain and Stress in data frame. It is an key component for automatic
completion in the function of epsExtract
.
lyIDdetector(data, patterns = "[Ss][Tt][Rr]")
lyIDdetector(data, patterns = "[Ss][Tt][Rr]")
data |
A data frame with |
patterns |
A regex object to determine layer of Strain and Stress. The default pattern uses "[Ss][Tt][Rr]". |
A list consisted of the layer, and the levels in this layer for Strain and Stress respectively.
require(VBTree) chrvec2dl(colnames(TPMdata)) lyIDdetector(TPMdata)
require(VBTree) chrvec2dl(colnames(TPMdata)) lyIDdetector(TPMdata)
Automatic completion for Stress-Strain plots
SSplots(x, grpby, manual = NULL, legendscale = 0.7, ...)
SSplots(x, grpby, manual = NULL, legendscale = 0.7, ...)
x |
A data frame with |
grpby |
Layer for variables to be grouped. |
manual |
A positive integer vector with length 3. The first value is layer for Stress and Strain, the sencond value
is for Strain's level in this layer, and the third is Stress's level. Default setting is NULL, to call
|
legendscale |
A positive value to determine the scale of legend. Default value is 0.7 |
... |
Arguments be passed to |
Multiple Stress-Strain plots according to specified group methods.
require(VBTree) # Find locations for temperature and strain rate: # temperature in layer2, strain rate in layer3; # Strain in layer1 level1, Stress in layer1 level2. dl2vbt(chrvec2dl(colnames(TPMdata))) # Attention: Zoom your Plots panes large enough to ensure # correct output! # Plot multiple Stress-Strain curves, grouped by strain rate: SSplots(TPMdata, 3, mfrow=c(3, 3)) # Plot multiple Stress-Strain curves, grouped by temperature: SSplots(TPMdata, 2, mfrow=c(2, 2)) # Manual setting, for Stress-Stain plots: SSplots(TPMdata, 2, manual=c(1, 1, 2), mfrow=c(2, 2))
require(VBTree) # Find locations for temperature and strain rate: # temperature in layer2, strain rate in layer3; # Strain in layer1 level1, Stress in layer1 level2. dl2vbt(chrvec2dl(colnames(TPMdata))) # Attention: Zoom your Plots panes large enough to ensure # correct output! # Plot multiple Stress-Strain curves, grouped by strain rate: SSplots(TPMdata, 3, mfrow=c(3, 3)) # Plot multiple Stress-Strain curves, grouped by temperature: SSplots(TPMdata, 2, mfrow=c(2, 2)) # Manual setting, for Stress-Stain plots: SSplots(TPMdata, 2, manual=c(1, 1, 2), mfrow=c(2, 2))
Return a table with continuous values for eta and xi, based on prediction built by support vector regression model (SVR). The kernel function in SVR is radial basis.
SVRModel(x, seqby = 80)
SVRModel(x, seqby = 80)
x |
The calculation result returned from the function |
seqby |
A numeric value to specify the grid density. Default value is 80, namely the default mesh for original plot uses 80*80. |
A data frame including continuous values for eta and xi, calculated based on the discrete values for
eta and xi returned from DMMprocess
. The strain condition in current calculation
is also included.
epstable <- epsExtract(TPMdata, 0.7, 2, 3) DMM <- DMMprocess(epstable) PLTbd <- SVRModel(DMM) PLTbd
epstable <- epsExtract(TPMdata, 0.7, 2, 3) DMM <- DMMprocess(epstable) PLTbd <- SVRModel(DMM) PLTbd
Calculating the adiabatic heating effect.
T_get(x, eta1, rho1, c1, ACorrect1 = 1, manual1 = NULL)
T_get(x, eta1, rho1, c1, ACorrect1 = 1, manual1 = NULL)
x |
A data frame with |
eta1 |
Efficiency of deformation heating. |
rho1 |
Density of materials, unit is g/cm^3. |
c1 |
Heat capacity of materials, unit is J/(kg*K). |
ACorrect1 |
Coefficient to modify for density or heat capacity using different units. Default value is 1. |
manual1 |
An integer vector with the length of 3 where the 1st element denotes the layer for Stress and Strain,
the 2nd and 3rd elements represent the levels for Strain and Stress, respectively. The default setting is NULL, which
can call the function |
A data frame with the identical shape as input data. The values of stress was replaced by adiabatic heating effect.
# Constants of steels as example: T_get(TPMdata, 0.9, 7.8, 502.416)
# Constants of steels as example: T_get(TPMdata, 0.9, 7.8, 502.416)
Adiabatic heating effect correction
TCorrect( x, lyT, lySR, eta, rho, c, StrainSeq, ACorrect = 1, manual = NULL, Amplifier = 1000 )
TCorrect( x, lyT, lySR, eta, rho, c, StrainSeq, ACorrect = 1, manual = NULL, Amplifier = 1000 )
x |
A data frame with |
lyT |
An integer to specify the layer for temperature attribute in the vector binary tree. |
lySR |
An integer to specify the layer for strain rate attribute in the vector binary tree. |
eta |
Efficiency of deformation heating. |
rho |
Density of materials, unit is g/cm^3. |
c |
Heat capacity of materials, unit is J/(kg*K). |
StrainSeq |
A vector to specify the sequence for flow strain. |
ACorrect |
Coefficient to modify for density or heat capacity using different units. Default value is 1. |
manual |
An integer vector with the length of 3 where the 1st element denotes the layer for Stress and Strain,
the 2nd and 3rd elements represent the levels for Strain and Stress, respectively. The default setting is NULL, which
can call the function |
Amplifier |
Amplifier for linear fitting. Default value is 1000. |
A data frame with VBTree
style including the adiabatic heating corrected
flow stress using the StrainSeq as conditions.
# Constants of steels as example: dt_TC <- TCorrect(TPMdata, 2, 3, 0.9, 7.8, 502.416, seq(0, 0.9, 0.005)) # Data without adiabatic heating correction SSplots(TPMdata, 2, mfrow=c(2, 2)) # Data with adiabatic heating correction SSplots(dt_TC, 2, mfrow=c(2, 2))
# Constants of steels as example: dt_TC <- TCorrect(TPMdata, 2, 3, 0.9, 7.8, 502.416, seq(0, 0.9, 0.005)) # Data without adiabatic heating correction SSplots(TPMdata, 2, mfrow=c(2, 2)) # Data with adiabatic heating correction SSplots(dt_TC, 2, mfrow=c(2, 2))
Read data from multiple files with structurized file names, then generate a summary data frame. It will also be available for the files from other tester apparatus by correct setting.
TMZdatainput(makeidx = FALSE, ...)
TMZdatainput(makeidx = FALSE, ...)
makeidx |
A boolean value to control the index column, inserted in the first column. Default setting is FALSE. |
... |
Arguments to be passed to |
A summary data frame for all input files.
variable1 <- c("factor11", "factor12", "factor13") variable2 <- c("factor21", "factor22") variable3 <- c("factor31", "factor32", "factor33", "factor34") conditions <- list(variable1, variable2, variable3) ## Not run: SummaryTable <- TMZdatainput(Cdl=conditions, wd="/Your_Data_Directory/") ## End(Not run)
variable1 <- c("factor11", "factor12", "factor13") variable2 <- c("factor21", "factor22") variable3 <- c("factor31", "factor32", "factor33", "factor34") conditions <- list(variable1, variable2, variable3) ## Not run: SummaryTable <- TMZdatainput(Cdl=conditions, wd="/Your_Data_Directory/") ## End(Not run)
Plot a 2d thermal process maps: logarithm strain rate as y axis while celsius temperature as x axis. Contours denotes the power dissipation efficiency factor, while the background with gradual colors represents rheological stability.
TPM2dplt(x, xloc = 0.09, yloc = 0.03, clrctrl = rev(rainbow(7))[-1])
TPM2dplt(x, xloc = 0.09, yloc = 0.03, clrctrl = rev(rainbow(7))[-1])
x |
Regression results from modeling functions such as |
xloc |
Location for annotatin in x axis. The default value is 0.09. |
yloc |
Location for annotatin in y axis. The default value is 0.03. |
clrctrl |
Colour vector to control eta background, the default value uses rainbow palette. |
A 2d thermal processing-map with logarithm strain rate as its y axis while celsius temperature as its x axis. Strain conditon is showed in top-left in the figure. Power dissipation efficiency factor eta is denoted by gradient blue contours, and the rheological stability coefficient are represented by gradient background.
epstable <- epsExtract(TPMdata, 0.7, 2, 3) DMM <- DMMprocess(epstable) PLTbd <- SVRModel(DMM) TPM2dplt(PLTbd)
epstable <- epsExtract(TPMdata, 0.7, 2, 3) DMM <- DMMprocess(epstable) PLTbd <- SVRModel(DMM) TPM2dplt(PLTbd)
Return a 3d thermal process result consisted of 3d surfaces for power dissipation efficiency eta and rheological stability coefficient xi respectively.
TPM3dplt(x, dvs = 5, etaclr = "heat", xiclr = "cm")
TPM3dplt(x, dvs = 5, etaclr = "heat", xiclr = "cm")
x |
Regression results from modeling functions such as |
dvs |
A positive integer to set the divisions for x, y and z labels in two 3d surface plots. The default value is 5. |
etaclr |
Colour control for eta. Optional value are "rainbow", "heat", "terrain", "topo" and "cm". "heat" is default value. |
xiclr |
Colour control for xi. Optional value are "rainbow", "heat", "terrain", "topo" and "cm". "cm" is default value. |
Two 3d surface plots: the left one denotes power dissipation efficiency factor eta, while the right one is for rheological stability xi. A zero plane, z=0, for xi value is added in the right plots for determining unstable region.
epstable <- epsExtract(TPMdata, 0.7, 2, 3) DMM <- DMMprocess(epstable) PLTbd <- SVRModel(DMM) TPM3dplt(PLTbd)
epstable <- epsExtract(TPMdata, 0.7, 2, 3) DMM <- DMMprocess(epstable) PLTbd <- SVRModel(DMM) TPM3dplt(PLTbd)