|
ans = 81 Here are the original vectors 4 1 -2 1 4 1 -5 -1 -4 3 0 2 -3 -1 -4 -3 Now apply Gram-Schmidt 4.000 1.070 -0.584 0.386 4.000 1.070 -3.584 -0.269 -4.000 2.930 -0.321 0.009 -3.000 -1.053 -5.130 0.144 and after making vectors all unit vectors... 0.530 0.309 -0.093 0.784 0.530 0.309 -0.569 -0.547 -0.530 0.846 -0.051 0.018 -0.397 -0.304 -0.815 0.292 Check for orthogonality u1 with u2: 0.00000000 u1 with u3: -0.00000000 u1 with u4: 0.00000000 u2 with u3: -0.00000000 u2 with u4: 0.00000000 u3 with u4: 0.00000000 ans = 81 Here are the original vectors 4 1 -2 1 4 1 -5 -1 -4 3 0 2 -3 -1 -4 -3 Now apply Gram-Schmidt 4.000 1.070 -0.584 0.386 4.000 1.070 -3.584 -0.269 -4.000 2.930 -0.321 0.009 -3.000 -1.053 -5.130 0.144 and after making vectors all unit vectors... 0.530 0.309 -0.093 0.784 0.530 0.309 -0.569 -0.547 -0.530 0.846 -0.051 0.018 -0.397 -0.304 -0.815 0.292 Check for orthogonality u1 with u2: 0.00000000 u1 with u3: -0.00000000 u1 with u4: 0.00000000 u2 with u3: -0.00000000 u2 with u4: 0.00000000 u3 with u4: 0.00000000 |
R = 7.54983 -0.13245 -2.11925 0.13245 0.00000 3.46157 -0.94775 2.60505 0.00000 0.00000 6.29369 2.82023 0.00000 0.00000 -0.00000 0.49246 ans = 1.7764e-15 1.1102e-15 -8.8818e-16 6.6613e-16 -1.3323e-15 -3.3307e-16 8.8818e-16 -2.2204e-16 0.0000e+00 4.4409e-16 3.9311e-17 4.4409e-16 8.8818e-16 4.4409e-16 4.4409e-16 8.8818e-16 R = 7.54983 -0.13245 -2.11925 0.13245 0.00000 3.46157 -0.94775 2.60505 0.00000 0.00000 6.29369 2.82023 0.00000 0.00000 -0.00000 0.49246 ans = 1.7764e-15 1.1102e-15 -8.8818e-16 6.6613e-16 -1.3323e-15 -3.3307e-16 8.8818e-16 -2.2204e-16 0.0000e+00 4.4409e-16 3.9311e-17 4.4409e-16 8.8818e-16 4.4409e-16 4.4409e-16 8.8818e-16 |
Click to the left again to hide and once more to show the dynamic interactive window |
0 0 |
|
0 0 |
WARNING: Output truncated!full_output.txt A = 2 -3 5 1 4 0 -1 3 2 1 2 3 First we check for existing orthogonality ans = -3 ans = 11 ans = -3 Pick one to start v1 = 2 1 -1 1 Then, remove the part of the second column that is parallel to v1 v2 = -2.1429 4.4286 2.5714 2.4286 Now, remove the parts of the third column that are parallel to v1 and v2 v3 = 1.9572 -1.7782 3.4514 1.3152 And check for orthogonality of all three vectors ans = 0 ans = 6.6613e-16 ans = 4.4409e-16 Finally, let's make all the vectors 'unit vectors' v1 = 0.75593 0.37796 -0.37796 0.37796 v2 = -0.35365 0.73088 0.42438 0.40081 v3 = 0.43086 -0.39146 0.75979 ... -0.37796 0.42438 0.75979 0.37796 0.40081 0.28953 Notice that after this process, the 'A = QR' factorization can be obtained by Q'*A = R R = 2.64575 -1.13389 4.15761 0.00000 6.05923 0.28292 0.00000 -0.00000 4.54249 And we can check our factorization ans = 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -1.7764e-15 4.4409e-16 -1.1102e-16 -4.4409e-16 -8.8818e-16 0.0000e+00 -4.4409e-16 0.0000e+00 Let's solve a system using Least Squares b = 4 -2 -3 1 mat = 2 -3 5 4 1 4 0 -2 -1 3 2 -3 1 2 3 1 ans = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ans = 1.00000 0.00000 0.00000 0.98246 0.00000 1.00000 0.00000 -0.62399 0.00000 0.00000 1.00000 0.11371 x = 0.98246 -0.62399 0.11371 r = -0.40543 -0.48652 -0.37300 0.92438 ans = 1.1810 WARNING: Output truncated!full_output.txt A = 2 -3 5 1 4 0 -1 3 2 1 2 3 First we check for existing orthogonality ans = -3 ans = 11 ans = -3 Pick one to start v1 = 2 1 -1 1 Then, remove the part of the second column that is parallel to v1 v2 = -2.1429 4.4286 2.5714 2.4286 Now, remove the parts of the third column that are parallel to v1 and v2 v3 = 1.9572 -1.7782 3.4514 1.3152 And check for orthogonality of all three vectors ans = 0 ans = 6.6613e-16 ans = 4.4409e-16 Finally, let's make all the vectors 'unit vectors' v1 = 0.75593 0.37796 -0.37796 0.37796 v2 = -0.35365 0.73088 0.42438 0.40081 v3 = 0.43086 -0.39146 0.75979 ... -0.37796 0.42438 0.75979 0.37796 0.40081 0.28953 Notice that after this process, the 'A = QR' factorization can be obtained by Q'*A = R R = 2.64575 -1.13389 4.15761 0.00000 6.05923 0.28292 0.00000 -0.00000 4.54249 And we can check our factorization ans = 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -1.7764e-15 4.4409e-16 -1.1102e-16 -4.4409e-16 -8.8818e-16 0.0000e+00 -4.4409e-16 0.0000e+00 Let's solve a system using Least Squares b = 4 -2 -3 1 mat = 2 -3 5 4 1 4 0 -2 -1 3 2 -3 1 2 3 1 ans = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ans = 1.00000 0.00000 0.00000 0.98246 0.00000 1.00000 0.00000 -0.62399 0.00000 0.00000 1.00000 0.11371 x = 0.98246 -0.62399 0.11371 r = -0.40543 -0.48652 -0.37300 0.92438 ans = 1.1810 |
|