200 likes | 376 Views
Stability and Sensitivity of Certain Computational Methods: A Symbolic-Numeric Treatment with Mathematica. Ali YAZICI Software Engineering Department Atilim University Ankara, Turkey 06836 aliyazici@atilim.edu.tr. Introduction.
E N D
Stability and Sensitivity of Certain ComputationalMethods: A Symbolic-Numeric Treatment withMathematica Ali YAZICISoftware Engineering DepartmentAtilim UniversityAnkara, Turkey 06836aliyazici@atilim.edu.tr
Introduction • Computer Algebra Systems (CAS) such as Mathematica, Maple and Matlab offer so many different capabilities, which can be used as an aid in Computer Assisted Instruction. • The use of Mathematica (especially its symbolic power) in teaching some of the numerical methods is shown to be effective ([1], [2],[3], [4]). • In this study, symbolic and numerical properties of stability and sensitivity of some basic computational procedures are given using Mathematica. SYNASC 2010 - Timisoara
Definitions • Sensitivity: The question how much does a function change under perturbations of its arguments is of importance in numerical computations. • Stability: An algorithm, is numerically stable if an error, whatever the reason is, does not grow unexpectedly larger during the calculation. • In this work, Mathematica notebooks have been prepared to demonstrate the issues of sensitivity and stability problems for some introductory numerical computations. SYNASC 2010 - Timisoara
Sensitivity of Polynomials Obviously, the zeros of p(x) are 1,2,...,10 and are simple. However, it can be shown that a small change in the coefficient of x9 from -55 to -55 + eps for very small values of eps may change some of the real roots of p(x) to be complex (Wilkinson). The roots of the perturbed polynomial are simply calculated (Mathematica) as: {x->1}, {x->2}, {x->2.9998}, {x->4:0061}, {x-> 4.9396},{x-> 10.194}, {x->6.3473-0.37935i}, {x->6.3473 + 0.37935i},{x->8.5828-0.69933i}, {x->8.5828 + 0.69933i} SYNASC 2010 - Timisoara
Sensitivity animated SYNASC 2010 - Timisoara
Analysis • By differentiating the equation p(x,eps) = 0 with respect to eps, one gets [10] • This equation can be used to compute the measure of sensitivity against the roots 1,2,3,...,9, and 10. SYNASC 2010 - Timisoara
Analysis by Mathematica SYNASC 2010 - Timisoara
...Mathematica • The input commands 1-3 below computes the sensitivity constants by invoking the module above. SYNASC 2010 - Timisoara
Stability of Gram-Schmidt &QR • Let A = (a1, a2, ... , an) be a mxn matrix with real values with m ¸ n and rank(A) = n. The CGS process produces an orthogonal basis Q = (q1, q2, ... , qn) of span(A), such that A = QR where R is an upper triangular matrix of order n. • This factorization can be utilized to determine the eigenvalues of A. SYNASC 2010 - Timisoara
CGS Algorithm SYNASC 2010 - Timisoara
Stability Measures • The accuracy of the QR factorization based on the CGS process can be simply measured by computing the norm ||A-QR|| • The measure of orthogonalization can be obtained similarly by computing the norm ||QTQ -I|| SYNASC 2010 - Timisoara
Mathematica Implementation of CGS SYNASC 2010 - Timisoara
Running CGS • To display the instability numerically, Hilbert’s matrix (highly ill-conditioned) of order n is chosen. • Mathematica commands to produce the Hilbert matrix of order 5 and running the CGS program SYNASC 2010 - Timisoara
...Running CGS SYNASC 2010 - Timisoara
Results SYNASC 2010 - Timisoara
Divided Differences SYNASC 2010 - Timisoara
Mathematica in action SYNASC 2010 - Timisoara
Propagation of initial error SYNASC 2010 - Timisoara
Conclusions • This study is about using one of the well-known CAS, namely, Mathematica to demonstrate rather complicated concepts just mentioned in a numerical computing course taught to engineering undergraduates. • The code segments produced in this study have been successfully used and class tested in the Numerical Methods courses taught at the undergraduate level. • The learner with some intermediate knowledge of Mathematica can easily modify the codes at his/her wish and perform additional experiments to understand the concepts of stability, sensitivity and error analysis in scientific problems. • This study can be expanded to cover the stability of other (more sophisticated) computational methods. A GUI based interactive tool is also necessary to provide an educational environment for computational problems of similar nature. SYNASC 2010 - Timisoara