0% found this document useful (0 votes)
2 views

Assignment 3

The document presents solutions to two mathematical problems involving numerical analysis. The first problem estimates parameters for an exponential function using least squares, resulting in the function y = 3.07222e^(0.50576x). The second problem solves a system of equations using the Cholesky method, yielding a second-order polynomial approximation of the form y = -4.12251x^2 + 4.12251x - 0.050465.

Uploaded by

Philip Owusu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Assignment 3

The document presents solutions to two mathematical problems involving numerical analysis. The first problem estimates parameters for an exponential function using least squares, resulting in the function y = 3.07222e^(0.50576x). The second problem solves a system of equations using the Cholesky method, yielding a second-order polynomial approximation of the form y = -4.12251x^2 + 4.12251x - 0.050465.

Uploaded by

Philip Owusu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

ASSIGNMENT

MATH 386: NUMERICAL ANALYSIS III

April 1, 2025

Q1 Let y = ceλx , where c and λ are unknown parameters


Taking the natural log of both sides
⇒ ln y = ln(ceλx )
⇒ ln y = ln c + ln eλx
⇒ ln y = ln c + λx
Comparing to y = a0 + a1 x
⇒ y = ln y, ao = ln c, a1 = λ

Hence the formula for estimating the parameters c and λ are

Sx ln y
⇒λ= Sxx
P P P
n x ln y− x ln y
= P P 2
n x2 −( x)

P P
ln y−λ x
⇒ ln c = n

i xi yi x2i ln yi xi ln yi
1 1.0000 5.1000 1.0000 1.6292 1.6292
2 1.2500 5.7900 1.5625 1.7561 2.1951
3 1.5000 6.5300 2.2500 1.8764 2.8146
4 1.7500 7.4500 3.0625 2.0082 3.5144
5 2.0000 8.4600 4.0000 2.1353 4.2706
7.5000 33.3300 11.8750 9.4052 14.4239
P5
i=1

5(14.4239)−(7.5000)(9.4052)
⇒λ= 5(11.8750)−(7.5000)2

1
= 0.50576

(9.4052)−(0.50576)(7.5000)
⇒ ln c = 5
= 1.1224
⇒ c = e1.1224 = 3.07222
Hence from the method of least square the best approximating exponen-
tial function that ts the data is given as : y = 3.07222e0.50576x

Q2 a0 + 21 a1 + 31 a2 = π2 ............(1)

1
a
2 0
+ 31 a1 + 41 a2 = π1 ..........(2)

1
a
3 0
+ 41 a1 + 51 a2 = π 2 −4
π3
.....(3)

1 1 2
    
1 2 3
a0 π
 1 1 1 1
  a1  = 
   
 2 3 4 π 
1 1 1 1 4
3 4 5
a2 π
− π3
1 1 2
     
1 2 3
a0 π
Let A = 

1
2
1
3
1
4  , X =  a1  and B = 
    1
π


1 1 1 1 4
3 4 5
a2 π
− π3

The matrix A is
i Symmetric since A = AT
ii Positive denate
A1 = "1, det(A#1 ) > 0
1
1
A2 = 1
2
1 , det(A2 ) = 0.0833 > 0
2 3
A3 = A, det(A) = 0.00046 > 0

Hence the cholesky method can be used


Let A = LLT
    
a11 a12 a13 l11 0 0 l11 l21 l31
 a21 a22 a23  =  l21 l22 0   0 l22 l32 
    

a31 a32 a33 l31 l32 l33 0 0 l33

2
Using the cholesky
√ algorithm

l11 = a11 = 1 = 1; l21 = al1121
= 0.5
1
= 1
2
1 1 √
l31 = a31
l11
= 3
1
= 31 ; l32 = a32 −l31 l21
l22
= 12

3
= 6
3
6
q q √
1
l22 = 2
a22 − l21 = − ( 31 )2 = 3
q q3 6
√ √
1
l33 = 2
a33 − l31 2
− l32 = 5
− ( 13 )2 − ( 6
3 2
) = 5
30

 
1 0

0
Hence L = 
 1 3

 2 √6
0 
√ 
1 3 5
3 6 30

The system AX = B can be written as follow


LLT X = B
Let LT X = Y , then LY = B . Computing vector Y from the equation
LY = B
 
1 0 0 2
  
 1 √ y
 0  π
3 1

 2 √6
0  y1  = 
√ 
  π


1 4
1 3 5 y2 π
− π3
3 6 30

Using forward substitution


2
⇒ y0 = π


⇒ 12 ( π2 )√+ 63 y1 = π1
1
⇒ π√ + 63 y1 = π1
⇒ √63 y1 = ( π1 − π1 )
⇒ 63 y1 = 0
⇒ y1 = 0
√ √
⇒ 31 ( π2 ) +
√ 6
3
(0) + 305 y2 = ( π1 − 4
π3
)
2
⇒ 3π

2
+ 305 y2 = ( π π−4
3 )
5 π 2 −4 2
⇒ 30 y2 = ( π3 − 3π )
30 π 2 −4 2
⇒ y2 = √5 ( π3 − 3π )
Hence the solution of this system of equation is given by
y0 = π2 , y1 = 0, y2 = √305 ( π π−4
2 2
3 − 3π )

3
Computing the vector X from the equation LT X = Y , we have
 
1 1 2
1
  
√2 √3 a0 π
3 3 0
 
 0  a1 
=
 
6 √6

π 2 −4
 
30 2
0 0 5 a2 √
5
( π3 − 3π
)
30

Using
√ back substitution
5 30 π 2 −4 2
⇒ a
30 2
= √
5
( π3 − 3π )
2
⇒ a2 = 30

5
× √305 ( π π−4
3 − 3π2
)
900 π 2 −4 2
⇒ a2 = 5
( π3 − 3π )
⇒ a2 = −4.12251
√ √ 2
⇒ √63 a1 + 63 (180( π π−4
3
2
− 3π )) = 0
3
√ 2
π −4 2
⇒ 6 a1 + 30 3( π3 − 3π ) = 0
√ 2 2
⇒ a1 = √63 × 30 3( 3π − (π π−4)
3 )
2 (π 2 −4)
⇒ a1 = 180( 3π − π3
)
⇒ a1 = 4.12251

2 2
⇒ a0 + 180 ( 2 − (π π−4)
2 3π 3 ) − 180
3
( π π−4
3 − 3π2
) = π2
2 2
2
⇒ a0 + 90( 3π − (π π−4)
3 ) − 60( π π−4
3
2
− 3π ) = π2
2 2
⇒ a0 = π2 − 60π
+ 90(ππ3−4) − 60(ππ3−4)
2
⇒ a0 = − 18
π
+ 30(ππ3−4)
⇒ a0 = −0.050465
Hence the solution of the system is given by
a0 = −0.050465, a1 = 4.12251, a2 = −4.12251

From the method of least square the approximated 2nd order polynomial
of the data points is given as
y = a2 x 2 + a1 x + a0
= −4.12251x2 + 4.12251x − 0.050465

You might also like