first commit

This commit is contained in:
2025-09-26 22:16:05 -04:00
commit 4b5b5eeb4c
13 changed files with 664 additions and 0 deletions

67
project1/Project1_A1.txt Normal file
View File

@@ -0,0 +1,67 @@
Question 1(a):
Projection of b onto the column space of A(1): (Using proj function)
[1.85714286 1. 3.14285714 1.28571429 3.85714286]
Projection of b onto the column space of A(1): (Using proj_SVD function)
[1.85714286 1. 3.14285714 1.28571429 3.85714286]
Difference between the two methods:
[ 1.77635684e-15 -2.22044605e-15 -8.88178420e-16 8.88178420e-16
0.00000000e+00]
Question 1(b):
For ε = 1.0:
Projection of b onto the column space of A(1.0):
[1.85714286 1. 3.14285714 1.28571429 3.85714286]
Projection of b onto the column space of A(1.0) using SVD:
[1.85714286 1. 3.14285714 1.28571429 3.85714286]
Difference between the two methods:
[ 1.77635684e-15 -2.22044605e-15 -8.88178420e-16 8.88178420e-16
0.00000000e+00]
For ε = 0.1:
Projection of b onto the column space of A(0.1):
[1.85714286 1. 3.14285714 1.28571429 3.85714286]
Projection of b onto the column space of A(0.1) using SVD:
[1.85714286 1. 3.14285714 1.28571429 3.85714286]
Difference between the two methods:
[ 7.28306304e-14 -4.44089210e-16 -2.66453526e-14 -1.62092562e-14
-5.28466160e-14]
For ε = 0.01:
Projection of b onto the column space of A(0.01):
[1.85714286 1. 3.14285714 1.28571429 3.85714286]
Projection of b onto the column space of A(0.01) using SVD:
[1.85714286 1. 3.14285714 1.28571429 3.85714286]
Difference between the two methods:
[-5.45297141e-12 -7.28239691e-12 -3.44613227e-13 -4.24371649e-12
-4.86499729e-12]
For ε = 0.0001:
Projection of b onto the column space of A(0.0001):
[1.85714297 1.00000012 3.14285716 1.28571442 3.85714302]
Projection of b onto the column space of A(0.0001) using SVD:
[1.85714286 1. 3.14285714 1.28571429 3.85714286]
Difference between the two methods:
[1.11406275e-07 1.19209290e-07 1.91642426e-08 1.35516231e-07
1.67459071e-07]
For ε = 1e-08:
LinAlgError for eps=1e-08: Singular matrix
Projection of b onto the column space of A(1e-08) using SVD:
[1.85714286 1. 3.14285714 1.28571428 3.85714286]
Difference between the two methods:
Could not compute difference due to previous error.
For ε = 1e-16:
ValueError for eps=1e-16: Matrix A must be full rank.
Projection of b onto the column space of A(1e-16) using SVD:
[1.81820151 1. 3.18179849 2.29149804 2.89030045]
Difference between the two methods:
Could not compute difference due to previous error.
For ε = 1e-32:
ValueError for eps=1e-32: Matrix A must be full rank.
Projection of b onto the column space of A(1e-32) using SVD:
[2. 1. 3. 2.5 2.5]
Difference between the two methods:
Could not compute difference due to previous error.