100% Guaranteed Results


MA202 – IIIT Vadodara Solved
$ 20.99
Category:

Description

5/5 – (1 vote)

MA202 Numerical Techniques
LAB#2 Numerical errors and System of linear equations
1. Condition number and singularity kAk is the 2-norm of a matrix A. The MATLAB command norm(A,2) returns the 2-norm of A.The condition number of a matrix A,i.e., cond(A) = kAkkAk−1with kAk = largest eigenvalue of ATA i.e., largest singular value of A. The MATLAB command cond(A) returns the 2-norm condition number (the ratio of the largest singular value of X to the smallest). Large condition numbers indicate a nearly singular matrix.
Q. 1: Write a MATLAB function docondition() to make use of matlab commands cond() and det() to compute the condition number and det(A)det(A−1) where A is for example, Hilbert matrix defined by
. (1)
1/0 for a well-/badly conditioned matrix.)
2. Numerical errors and analysis
There are various numerical errors in the computing results made by digital systems, mostly coming from representing the numbers in finite bits, which is an intrinsic limitation of dig- ital world.
• Truncation Error: It is caused by adding up to a finite number of terms, while we should add infinitely many terms to get the exact answer in theory.
• Round-off Error: It is caused by representing/storing numeric data in finite bits.
• Overflow/Underflow: Caused by too large or too small numbers to be represented/stored properly in finite bits—more specifically, the numbers having absolute values larger/smaller than the maximum (fmax)/minimum(fmin) number that can be represented in MATLAB.
• Negligible Addition: It is caused by adding two numbers of magnitudes differing by over 52 bits.
• Loss of Significance: It is caused by a “bad subtraction,” which means a subtraction of a number from another one that is almost equal in value.
• Error Magnification: It is caused and magnified/propagated by multiplying/dividing a number containing a small error by a large/small number.
• Errors depending on the numerical algorithms, step size, and so on.
Q. 2: consider the following two formulae:
√ √ √
f1(x) = x( x + 1 − x (2)
(3)
Write a MATLAB program to compute the values of the equation (4) and equation (5) at x = 1, 10, 100, 1000, 10000, 100000. Observe what happens as x increases and what kind of computing error has occured upon execution.
Q. 3: For 100 values of x over the interval [1014,1016], evaluate the following two expressions that are mathematically equivalent, plot them, and based on the graphs, tell which is better in terms of resisting the loss of significance.
p
2×2 + 1 − 1 (4)
(5)
Q. 4: Write a matlab program to compute
yn/enx, (6)
with x = 36, y = 1e16, and for n = [-20 -19 19 20] with 1, and also
(y/ex)n. (7)
Which is the right one to avoid overflow/underflow?
Q. 5: For x = 9.8201 and y = 10.2199, evaluate the following two expressions that are mathematically equivalent and tell which is better in terms of the power of resisting the overflow.
(8)
+ 1 (9)
Q. 6: Also for x = 9.8−201 and y = 10.2−199, evaluate the equation (8) and equation(9) and tell which is better in terms of the power of resisting the underflow.
3. Systems of linear equations There are several numerical schemes for solving a system
of equations Am×nxn×1 = bm×1 Consider the three cases:
(i) (m = n), i.e., the case where the number of equations (m) and the number of unknowns (n) are equal so that the coefficient matrix AM×N is square.
(ii) (m < n), i.e.,the case where the number of equations is smaller than the number of unknowns so that we might have to find the minimum-norm solution among the numerous solutions. (iii) (m > n), i.e.,the case where the number of equations is greater than the number of unknowns so that there might exist no exact solution and we must find a solution based on global error minimization, like the “least-squares error (LSE) solution.”
Q. 7: Write a MATLAB routine lineq() to solve a given set of equations, covering all of the three cases
Q. 8: Solve the linear equations using lineq() function created in Q.7 with given A and b
(a) A = [1 2;3 4]; b = [-1;-1]
(b) A = [1 2;2 4]; b = [-1;-1]
(c)[1 2]; b = 3
(d) A = [1; 2]; b = [2.1; 3.9]

Reviews

There are no reviews yet.

Be the first to review “MA202 – IIIT Vadodara Solved”

Your email address will not be published. Required fields are marked *

Related products