Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y...

13
Exponential Model ) , ( , ... ), , ( ), , ( 2 2 1 1 n n y x y x y x Give n best fit bx ae y to the data. Figure. Exponential model of nonlinear regression for y vs. x data bx ae y ) , ( n n y x ) , ( 1 1 y x ) , ( 2 2 y x ) , ( i i y x i bx i ae y http:// numericalmethods.eng.usf.edu 1

Transcript of Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y...

Page 1: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Exponential Model),( , ... ),,(),,( 2211 nn yxyx yxGive

nbest fit

bxaey to the data.

Figure. Exponential model of nonlinear regression for y vs. x data

bxaey

),(nn

yx

),(11

yx

),(22

yx

),(ii

yxibx

i aey

http://numericalmethods.eng.usf.edu1

Page 2: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Finding Constants of Exponential Model

n

i

bx

ir iaeyS

1

2

The sum of the square of the residuals is defined as

Differentiate with respect to a and b

021

ii bxn

i

bxi

r eaeya

S

021

ii bxi

n

i

bxi

r eaxaeyb

S

http://numericalmethods.eng.usf.edu2

Page 3: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Finding Constants of Exponential Model

Rewriting the equations, we obtain

01

2

1

n

i

bxn

i

bxi

ii eaey

01

2

1

n

i

bxi

n

i

bxii

ii exaexy

http://numericalmethods.eng.usf.edu3

Page 4: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Finding constants of Exponential Model

Substituting back into the previous equation

01

2

1

2

1

1

n

i

bxin

i

bx

bxn

ii

bxi

n

ii

i

i

i

i exe

eyexy

The constant b can be found through numerical methods such as bisection method.

n

i

bx

n

i

bxi

i

i

e

eya

1

2

1

Solving the first equation for a yields

http://numericalmethods.eng.usf.edu4

Page 5: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Example 1-Exponential Model

t(hrs) 0 1 3 5 7 9

1.000 0.891 0.708 0.562 0.447 0.355

Many patients get concerned when a test involves injection of a radioactive material. For example for scanning a gallbladder, a few drops of Technetium-99m isotope is used. Half of the Technetium-99m would be gone in about 6 hours. It, however, takes about 24 hours for the radiation levels to reach what we are exposed to in day-to-day activities. Below is given the relative intensity of radiation as a function of time.

Table. Relative intensity of radiation as a function of time.

http://numericalmethods.eng.usf.edu5

Page 6: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Example 1-Exponential Model cont.

Find: a) The value of the regression

constants A an

db) The half-life of Technetium-99m

c) Radiation intensity after 24 hours

The relative intensity is related to time by the equation tAe

http://numericalmethods.eng.usf.edu6

Page 7: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Plot of data

http://numericalmethods.eng.usf.edu7

Page 8: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Constants of the Model

The value of λ is found by solving the nonlinear equation

01

2

1

2

1

1

n

i

tin

i

t

n

i

ti

ti

n

ii

i

i

i

i ete

eetf

n

i

t

n

i

ti

i

i

e

eA

1

2

1

tAe

http://numericalmethods.eng.usf.edu8

Page 9: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Setting up the Equation in MATLAB

01

2

1

2

1

1

n

i

tin

i

t

n

i

ti

ti

n

ii

i

i

i

i ete

eetf

t (hrs) 0 1 3 5 7 9

γ 1.000

0.891

0.708

0.562

0.447

0.355

http://numericalmethods.eng.usf.edu9

Page 10: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Setting up the Equation in MATLAB

01

2

1

2

1

1

n

i

tin

i

t

n

i

ti

ti

n

ii

i

i

i

i ete

eetf

t=[0 1 3 5 7 9]gamma=[1 0.891 0.708 0.562 0.447 0.355]syms lamdasum1=sum(gamma.*t.*exp(lamda*t));sum2=sum(gamma.*exp(lamda*t));sum3=sum(exp(2*lamda*t));sum4=sum(t.*exp(2*lamda*t));f=sum1-sum2/sum3*sum4;

1151.0

http://numericalmethods.eng.usf.edu10

Page 11: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Calculating the Other Constant

The value of A can now be calculated

6

1

2

6

1

i

t

i

ti

i

i

e

eA

9998.0

The exponential regression model then is te 1151.0 9998.0

http://numericalmethods.eng.usf.edu11

Page 12: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Plot of data and regression curve

te 1151.0 9998.0

http://numericalmethods.eng.usf.edu12

Page 13: Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data  1.

Relative Intensity After 24 hrs

The relative intensity of radiation after 24 hours 241151.09998.0 e

2103160.6 This result implies that only

%317.61009998.0

10316.6 2

radioactive intensity is left after 24 hours.http://

numericalmethods.eng.usf.edu13