Tampilkan postingan dengan label linear transformation. Tampilkan semua postingan
Tampilkan postingan dengan label linear transformation. Tampilkan semua postingan

Calculus: Scaled Integration

Calculus:  Scaled Integration


Introduction


The take the integral:


∫( f(x) dx, A, B) 


The integral can be transformed to new limits C and D via linear transformation:



∫( f(x) dx, A, B) → ∫( g(y) dy, C, D)


Where the interval [ C, D ] has the smaller range than [ A, B ].


Set the transformation to:


y = m*x + β


C = m*A + β

D = m*B + β


Solving for m, β:


(C - D) = (A - B) * m

m = (C - D) / (A - B)


and


β = C - A * m = D - B * m


Solving y = m*x + β for x:


x = 1/m * (y - β)


Taking the derivative of both sides:


dx = 1/m  dy


The transformed integral:


∫( f(x) dx, A, B) → 1/m * ∫( f(1/m * (y - β)) dy, C, D)


Examples


Example 1:  


∫(x^2 - 5 dx, 10 ,16) but scale the integration interval to [1, 2].


A = 10, B = 16, C = 1, D = 2

m = (1 - 2)/(10 - 16) = 1/6,  1/m = 6

β = 1 - 10 * 1/6 = -2/3

x = 6 * (y + 2/3) = 6 * y + 4


Transformed Integral:

6 * ∫( (6*y + 4)^2 - 5 dy, 1, 2) = 1008


Example 2:


∫( e^x * ln(x + 2) dx, 0, 5) but scale the integration to [0, 1].


A = 0, B = 5, C = 0, D = 1

m = -1/-5 = 1/5,  1/m = 5

β = 0 - 0 * 1/5 = 0

x = 5 * y


Transformed Integral:

5 * ∫( e^(5 * y) * ln(5 * y + 2) dy, 0, 1) ≈ 262.8586594


Numerical integrals were calculated with the TI-36X Pro.  


When trying the Simpson's rule or Trapezoid rule, I find the smaller range does not really give better estimates.  But I am presenting the technique and if this helps in the future, great.  


Coming up:


July 11 - July 15, 2022:  TI-58 and TI-59 Week

Next Regular Blog:  July 23, 2022


Eddie  


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


TI 84 Plus CE and HP 33S: Scaled Data for Statistics

TI 84 Plus CE and HP 33S:  Scaled Data for Statistics


Introduction and the Mathematics


The goal of the programs posted today is to take a data set of real numbers and scale it down to the range [1,10].  Why?  Sometimes scaling data by applying a linear transformation, it could make curve fitting and data analysis more accessible and open up regression analysis previously not available, such as logarithmic or power regression.   


Let:


max = maximum value of the data set

min = minimum  value of the data set


And:


min * a + b = 1

max * a + b = 10


Solving for a and b:


a = 9/(max - min)

b = 1 - a * min = 10 - a * max


Apply this transformation to the data set to get:


x' = a*x + b


And to convert back:


x = (b - x')/a



TI-84 Plus CE Program:  DSCALE   (TI-Basic)


Disp "DATA SCALE TO [1,10]","BY EDWARD SHORE"

Input "XLIST: ",L5

9/(max(L5)-min(L5))→A

1-A*min(L5)→B

Disp "FORMULA:","X'="+toString(A)+"X+"+toString(B)

Pause

A*L5+B→L6

Disp "SCALED DATA:"

Pause L6


Note:

L5:  List 5, used for input, [ 2nd ] [ 5 ]

L6:  List 6, used for output, [ 2nd ] [ 6 ]


HP 33S Programs


LBL Y:  determine A and B.  Stack:  Y:  max, X:  min

HP 33S Size:  LN = 72, CK = B830


Y0001  LBL Y

Y0002  -

Y0003  LASTx

Y0004  x<>y

Y0005  1/x

Y0006  9

Y0007  ×

Y0008  STO A

Y0009  VIEW A

Y0010  ×

Y0011  1

Y0012  x<>y

Y0013  -

Y0014  STO B

Y0015  VIEW B

Y0016  RTN


LBL X:  Calculate x'

HP 33S Size:  LN = 15, CK = 08B6


X0001  LBL X

X0002  RCL- B

X0003  RCL÷ A

X0004  STOP

X0005  GTO X    // this allows for repeated calculations by pressing R/S


LBL Z:  Calculate x

HP 33S Size: LN = 15, CK = 4552


Z0001  LBL Z

Z0002  RCL× A

Z0003  RCL+ B

Z0004  STOP

Z0005  GTO Z   // this allows for repeated calculations by pressing R/S


Instructions:

1.  Do this first:  max [ ENTER ] min [ XEQ ] Y  

2.  XEQ Z  to calculate X'.  XEQ X to calculate X'. 


X' = A * X + B


Example


Data Set:  [-5, -3, 2, 3, 6]


max = 6

min = -5


(results are rounded to six decimal places)

a = 0.818182

b = 5.090909


Translated Data: 


x to x':

x = -5,  x' = 1.000000

x = -3,  x' = 2.636364

x = 2, x' = 6.727273

x = 3, x' = 7.545455

x = 6, x' = 10.000000


x' to x:

x' = 2.5, x = -3.16667

x' = 5,  x = -0.111111

x' = 7.5, x = 2.944444


Hope you find this helpful.  Next week is a retro review of the HP 33S Calculator, once abhorred now held as valuable.  


Eddie


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Backlink 9999 Traffic Super

Order Now...!!!!