Package 'Thermistor'

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

Help Index


Dataset for the standard components values

Description

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.

Usage

data(CompValues)

Format

A named list containing the standard values of each component:

"Res"

the standard values of R1, R2, R3 and R4

"ThBeta"

the standard values of temperature coefficient

"ThVal"

the standard values of nominal thermistor resistances

Examples

data(EzGP_data)

Plot the V-DeltaT Curve

Description

Plot the temperature-change-voltage curve under a particular components setting v.s. the target curve. using ggplot.

Usage

plot_voltageCurve(Tdata, OnlyTarget = TRUE, Pdata = NULL)

Arguments

Tdata

a vector of temperature-change values

OnlyTarget

logical. If TRUE, plot the target curve only.

Pdata

the values returning by voltageCurve or tempCompCurve

Value

the graph

Examples

### 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)

Squared Loss of Objective

Description

Measuring the difference between the V-DeltaT Curve you get and the target curve under squared loss.

Usage

SquaredLoss(x, StdRes, StdTherm_Val, StdTherm_Beta, Tdata)

Arguments

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

Value

the squared loss

Examples

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

Calculate V-DeltaT Curve

Description

Calculating the temperature-change-voltage curve for a particular set of Resistor and Thermistor Values.

Usage

tempCompCurve(x, Tdata)

Arguments

x

a vector containing the values of R1 R2 R3 R4 Rb1 Beta1 Rb2 Beta2

Tdata

a vector of temperature-change values

Value

the voltage values at Point B

Examples

Tdata <- seq(-40, 85, by=5)
R_values <- c(1100, 4300, 560, 1100, 220, 3680, 1000, 3560)
tempCompCurve(x = R_values, Tdata = Tdata)

Calculate V-DeltaT Curve for Given Indices

Description

Calculating the temperature-change-voltage curve for a particular set of indices for each component corresponding to the values from a standard components space.

Usage

voltageCurve(Tdata, x, StdRes, StdTherm_Val, StdTherm_Beta)

Arguments

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

Value

the voltage values at Point B

Examples

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)