This article examines the differentiation of exponential function. The differentiation yields the rate of the equation. The method of differentiation can be applied to determine the unknown constants of an exponential equation.
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Determining Exponential Rate of Events Using Differentiation
1. Determining the rate of event in the exponential equation
N. Kejalakshmy
Determining the rate of event in the exponential equation
Abstract: This article examines the differentiation of exponential function. The differentiation yields the rate of the equation. The method of
differentiation can be applied to determine the unknown constants of an exponential equation.
1. Introduction:
Let’s assume output data y is dependent on the variable x and has the following form,
𝑦 = 𝐴 𝑒&'
[1]
In the above equation A and 𝜆 are constants. 𝜆 can also be called rate of the event. ‘A’ can
be named as initial population. This is because when x=0, y will be equal to A. The above
equation can be solved by taking the logarithmic on both sides as follows,
log 𝑦 = log 𝐴 + 𝜆𝑥
[2]
As in the above equation, log(y) is linearly dependent on x, traditionally Eq. [1] is solved by
applying simple linear regression analysis on Eq. [2].
In practice, y may depend on more than one rate of event. Typical scenarios:
o switching on and switching off a LED based sensor.
o Fluorescence from a mixture of dyes.
o Price of a commodity influenced by different factors.
Generally, to define these events Eq.[1] is not sufficient. We will not go into the detail of
the equation. However, we will consider for our analysis the following equation,
𝑦 = 𝐵 + 𝐴1 𝑒&0 '
[3]
Where B is a constant (eg. B=Back ground noise). This article focusses on the
differentiation of the exponential and hence extracting the parameter, rate of event, 𝜆. The
rate indicates how rapidly the curve rise or fall. Further it gives indication on the change
of pattern.
2. Methodology:
2. Determining the rate of event in the exponential equation
N. Kejalakshmy
Applying differentiation on Eq. [1] yields,
𝑑𝑦
𝑑𝑥
= 𝜆 𝐴 𝑒 𝜆𝑥
𝑑𝑦
𝑑𝑥
= 𝜆𝑦
[4]
Eq. [4] is a straight line equation with slope equal to 𝜆.
3. Algorithm used to solve the rate 𝝀
To evaluate the lambda values, the following approach has been taken in the shown R
script:
• Read input data x and y.
• The length of array of x and y is estimated.
• Define new arrays required for the calculations.
• For each point calculate the differentiation using
o
∆45607∆45
∆'5607∆'5
• For each point calculate the parameter spotlambda which is the instantaneous rate
of equation.
• Calculate the midpoint of x and y.
• Make a table with new x, y,
∆45607∆45
∆'5607∆'5
, spotlambda values.
• Fit a straight line for
∆45607∆45
∆'5607∆'5
versus y and calculate the slope which is the over all
rate of equation.
3.1 R script
Given below is R based script to solve the 𝜆 value.
expform1<-function(x,y) {
# Equation of the form y=B*exp(lambda*x)
#where x and y are variables. B and lambda are constant
#Solving for lambda
n<-length(x)
delx<-rep(0,n-1)
dely<-rep(0,n-1)
delybydelx<-rep(0,n-1)
spotlambda<-rep(0,n-1) # instantaneous lambda value.
#spotlamda value can be used during the run time.
3. Determining the rate of event in the exponential equation
N. Kejalakshmy
ymid<-rep(0,n-1)
xmid<-rep(0,n-1)
for (i in 1:n-1)
{
delx[i]<-x[i+1]-x[i]
dely[i]<-y[i+1]-y[i]
#Calculating the differentiation. Divided difference have been used.
(though other formulae also can be applied)
delybydelx[i]<-dely[i]/delx[i]
#Below we are finding a mid position between [i+1]th data AND [i]th data
xmid[i]<-(x[i+1]+x[i])/2
ymid[i]<-y[i]+((xmid[i]-x[i])*delybydelx[i])
# In the above new array of y has been calculated using divided
difference.
#Calculation of spotlambda:
spotlambda[i]<-delybydelx[i]/y[i]
}
#make it as the table for the fitting
a<-as.table(cbind(xmid,ymid,delybydelx,spotlambda))
#**********************
# Fitting for lambda
#**********************
# The above table has newly interpolated y values and dy/dx values.
# below is : Fitting straight line for the equation dy/dx Versus y
# Note down the line pass through the origin
fitted<-lm(a[,3]~a[,2]-1)
print(summary(fitted))
lambda1<-summary(fitted)$coefficients[1, 1]
print('The value of the lambda is estimated as follow')
print(c('lambda=',lambda1))
print('end of analysis')
return(a)
}
3.2 Concept of Instantaneous rate
In the above approach spotlamda is a ratio calculated as each point as follow,
𝜆89:; =
𝑑𝑦
𝑑𝑥
𝑦
[4]
This quantity can be used to continuously monitor the instantaneous rate value. Hence any
drastic change in ‘𝜆89:;’, instantaneous rate value, indicates a change in the event.
4. Determining the rate of event in the exponential equation
N. Kejalakshmy
3.3 Fitting a straight line to obtain rate of event
Differentiation at each point has been calculated for successive points. The array ‘ymid’
represents value that are interpolated between successive point. A linear interpolation has
simply implemented (assuming the successive points are closer). A liner regression fitting
of
<4
<'
versus ‘y’ yields the 𝜆 value.
In the R script the parameter ‘fitted’ is a linear regression fit of
<4
<'
against y. ‘lambda1’ is
the slope of fit and hence corresponds to required lambda value. The script returns a table
of interpolated x (‘xmid’), interpolated y values y (‘ymid’),
<4
<'
and spotlamda.
3.4 An example and the output of the R function
Let us create data x1 and y1 as follow:
>lambda <- 0.06
>x1 =seq(11,20,by=1)
>y1= (1*exp(lambda * x1))
As the focus of the article is about the approach, error term has not added at this moment. Executing the
following call function yields an output. The created object ‘a’ is an output table for analysis.
>a<-expform1(x1,y1)
Call:
lm(formula = a[, 3] ~ a[, 2] - 1)
Residuals:
Min 1Q Median 3Q Max
-7.728e-16 -1.650e-16 4.300e-17 2.510e-16 5.069e-16
Coefficients:
Estimate Std. Error t value Pr(>|t|)
a[, 2] 5.998e-02 4.980e-17 1.204e+15 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.88e-16 on 8 degrees of freedom
Multiple R-squared: 1,Adjusted R-squared: 1
F-statistic: 1.451e+30 on 1 and 8 DF, p-value: < 2.2e-16
[1] "The value of the lambda is estimated as follow"
[1] "lambda=" "0.0599820064776403"
[1] "end of analysis"
>
> a
xmid ymid delybydelx spotlambda
A 11.50000000 1.99461277 0.11964088 0.06183655
B 12.50000000 2.11795274 0.12703905 0.06183655
5. Determining the rate of event in the exponential equation
N. Kejalakshmy
C 13.50000000 2.24891962 0.13489471 0.06183655
D 14.50000000 2.38798504 0.14323613 0.06183655
E 15.50000000 2.53564979 0.15209336 0.06183655
F 16.50000000 2.69244562 0.16149829 0.06183655
G 17.50000000 2.85893716 0.17148479 0.06183655
H 18.50000000 3.03572396 0.18208881 0.06183655
I 19.50000000 3.22344264 0.19334856 0.06183655
4. Conclusion
This method is less accurate than the logarithmic method as it involves calculation of
first order difference
<4
<'
. However, this method becomes powerful tool when an output
data is continuously monitored or when the measurement interval is small. Instantaneous
rate is useful for predicting life of an event or any change in the event. It is possible that
value of instantaneous rate can be affected by error. In that case fitting
<4
<'
versus y over a
small range of data gives a better prediction of the instantaneous rate.
The method of differentiation of exponential equation can be applied for iterative
methods where an initial value will be provided. This method can easily be extended to
solve the value of B in Eq.[3] and also for the equation of the form as 𝑦 = 𝐵 𝐴 𝑒='
+ 𝐴 𝑒&'
.