What's going wrong here? (slight repost)

  • Thread starter Thread starter Jamin2112
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on solving the equation Ax = b using QR decomposition, where Q is an orthonormal basis and R is an upper triangular matrix. The user reports an issue where the solutions for variables x and y yield the same results, which is incorrect given their distinct roles in solving for alpha, beta, and gamma. The key takeaway emphasizes the importance of data rescaling to mitigate roundoff errors in matrix computations, recommending a transformation of the independent variable data to enhance numerical stability.

PREREQUISITES
  • Understanding of QR decomposition in linear algebra
  • Familiarity with matrix manipulation and upper triangular matrices
  • Knowledge of numerical stability and roundoff errors
  • Experience with data rescaling techniques in computational mathematics
NEXT STEPS
  • Research QR decomposition methods in MATLAB or Python
  • Learn about numerical stability and techniques to avoid roundoff errors
  • Explore data rescaling methods for improving computational accuracy
  • Study the implications of using single-precision vs. double-precision in numerical computations
USEFUL FOR

Students and professionals in mathematics, engineering, and data science who are working with linear algebra, numerical methods, or computational modeling will benefit from this discussion.

Jamin2112
Messages
973
Reaction score
12

Homework Statement



screen-capture-1-27.png


Homework Equations



The way to solve is basically

Ax = b ---> QRx = b, where Q is an orthonormal basis for A and R is an upper triangular basis ---> Rx = QTb ----> x = R-1QTb

The Attempt at a Solution



No bugs, but for some reason I'm getting the same answer for x and y ... which doesn't make sense, since x is solving for alpha and beta, while y is solving for alpha, beta, and gamma.


screen-capture-2-18.png
 
Physics news on Phys.org
In problems of this type (even when using software) it is always a good idea to re-scale the data to avoid big numbers, because solution procedures may involve squares, or cubes, or fourth powers of those big numbers, leading to matrix manipulation problems that are unstable due to roundoff errors. You should re-scale to something like s = (t - 1900)/10, so your independent variable data are s = 0, 1, 2, 3,..., 11 instead of t = 1900, 1910 1920,..., 2010. Subtracting 1900 is more important than dividing by 10, but since doing both is so easy, why not go all the way? Personally, throughout my professional life I have encountered many examples where using even sophisticated software and double-precision computation gives horribly wrong answers in an un-scaled problem but gives great accuracy, even using single-precision computation, in the scaled version.

RGV
 
Last edited:

Similar threads

  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
1K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 27 ·
Replies
27
Views
4K