Title: | The Simulation of the Thermistor Network |
---|---|
Description: | Given the circuit topology, simulating the Voltage vs. Temperature curve with a set of Resistors (R1, R2, R3 and R4) and Thermistors values (TH1 and TH2) for a given thermistor network shown in Seth DeLand (2024) "Optimal Component Selection Using the Mixed-Integer Genetic Algorithm" <https://ww2.mathworks.cn/matlabcentral/fileexchange/35810-optimal-component-selection-using-the-mixed-integer-genetic-algorithm> and the application in Mak and Wu (2019) <doi:10.1080/00401706.2019.1593246>. |
Authors: | Yao Xiao [aut, cre] , Kang Fu [aut] |
Maintainer: | Yao Xiao <[email protected]> |
License: | GPL-3 |
Version: | 1.1.0 |
Built: | 2024-11-05 06:45:24 UTC |
Source: | CRAN |
A list containing the standard values provided for each component. "Res" corresponds to the values of R1, R2, R3 and R4, The values in the same index of "ThBeta" and "ThVal" provides nine types of (beta, Rb) of a thermistor.
data(CompValues)
data(CompValues)
A named list containing the standard values of each component:
the standard values of R1, R2, R3 and R4
the standard values of temperature coefficient
the standard values of nominal thermistor resistances
data(EzGP_data)
data(EzGP_data)
Plot the temperature-change-voltage curve under a particular
components setting v.s. the target curve. using ggplot
.
plot_voltageCurve(Tdata, OnlyTarget = TRUE, Pdata = NULL)
plot_voltageCurve(Tdata, OnlyTarget = TRUE, Pdata = NULL)
Tdata |
a vector of temperature-change values |
OnlyTarget |
logical. If |
Pdata |
the values returning by |
the graph
### only target curve Tdata <- seq(-40, 85, by = 5) plot_voltageCurve(Tdata) ### a particular curve and the target curve data(CompValues) Tdata <- seq(-40, 85, by=5) R_id <- c(43, 36, 29, 15, 9, 3) Res <- CompValues$Res ThVal <- CompValues$ThVal ThBeta <- CompValues$ThBeta Vnew <- voltageCurve(Tdata, R_id, Res, ThVal, ThBeta) plot_voltageCurve(Tdata, OnlyTarget = FALSE, Pdata = Vnew)
### only target curve Tdata <- seq(-40, 85, by = 5) plot_voltageCurve(Tdata) ### a particular curve and the target curve data(CompValues) Tdata <- seq(-40, 85, by=5) R_id <- c(43, 36, 29, 15, 9, 3) Res <- CompValues$Res ThVal <- CompValues$ThVal ThBeta <- CompValues$ThBeta Vnew <- voltageCurve(Tdata, R_id, Res, ThVal, ThBeta) plot_voltageCurve(Tdata, OnlyTarget = FALSE, Pdata = Vnew)
Measuring the difference between the V-DeltaT Curve you get and the target curve under squared loss.
SquaredLoss(x, StdRes, StdTherm_Val, StdTherm_Beta, Tdata)
SquaredLoss(x, StdRes, StdTherm_Val, StdTherm_Beta, Tdata)
x |
a vector of the indices of each component |
StdRes |
a vector of available resistor values |
StdTherm_Val |
a vector of available nominal thermistor resistances |
StdTherm_Beta |
a vector of of thermistor temperature coefficients |
Tdata |
a vector of temperature-change values |
the squared loss
data(CompValues) Tdata <- seq(-40, 85, by=5) R_id <- c(43, 36, 29, 15, 9, 3) Res <- CompValues$Res ThVal <- CompValues$ThVal ThBeta <- CompValues$ThBeta SquaredLoss(R_id, Res, ThVal, ThBeta, Tdata) ### 0.04066336
data(CompValues) Tdata <- seq(-40, 85, by=5) R_id <- c(43, 36, 29, 15, 9, 3) Res <- CompValues$Res ThVal <- CompValues$ThVal ThBeta <- CompValues$ThBeta SquaredLoss(R_id, Res, ThVal, ThBeta, Tdata) ### 0.04066336
Calculating the temperature-change-voltage curve for a particular set of Resistor and Thermistor Values.
tempCompCurve(x, Tdata)
tempCompCurve(x, Tdata)
x |
a vector containing the values of R1 R2 R3 R4 Rb1 Beta1 Rb2 Beta2 |
Tdata |
a vector of temperature-change values |
the voltage values at Point B
Tdata <- seq(-40, 85, by=5) R_values <- c(1100, 4300, 560, 1100, 220, 3680, 1000, 3560) tempCompCurve(x = R_values, Tdata = Tdata)
Tdata <- seq(-40, 85, by=5) R_values <- c(1100, 4300, 560, 1100, 220, 3680, 1000, 3560) tempCompCurve(x = R_values, Tdata = Tdata)
Calculating the temperature-change-voltage curve for a particular set of indices for each component corresponding to the values from a standard components space.
voltageCurve(Tdata, x, StdRes, StdTherm_Val, StdTherm_Beta)
voltageCurve(Tdata, x, StdRes, StdTherm_Val, StdTherm_Beta)
Tdata |
a vector of temperature-change values |
x |
a vector of the indices of each component |
StdRes |
a vector of available resistor values |
StdTherm_Val |
a vector of available nominal thermistor resistances |
StdTherm_Beta |
a vector of of thermistor temperature coefficients |
the voltage values at Point B
data(CompValues) Tdata <- seq(-40, 85, by=5) R_id <- c(2, 1, 4, 2, 1, 3) Res <- CompValues$Res ThVal <- CompValues$ThVal ThBeta <- CompValues$ThBeta voltageCurve(Tdata, R_id, Res, ThVal, ThBeta)
data(CompValues) Tdata <- seq(-40, 85, by=5) R_id <- c(2, 1, 4, 2, 1, 3) Res <- CompValues$Res ThVal <- CompValues$ThVal ThBeta <- CompValues$ThBeta voltageCurve(Tdata, R_id, Res, ThVal, ThBeta)