Applied Numerical Methods Midterm 1

Ace your homework & exams now with Quizwiz!

Tracks the values of variables as they are created and/or modified

Workspace

The Gauss-Seidel method is guaranteed to converge if the system is _____________________.

diagonally dominant

MATLAB's LU function may use partial pivoting depending on the input. The new order of rows is stored in the ____________________ matrix that is third in the output list from LU.

permutation

Below are some MATLAB commands for working with polynomials. Match each function with the correct description of what it does. - polyval(a,x) - roots(a) - a = [2 0 3 4]; - poly(a)

polyval(a,x) - Evaluates a polynomial roots(a) - Determines the roots o a = [2 0 3 4]; - Assigns a vector to the poly(a) - Generates the coefficient

For a single system of 1000 equations and one right hand side vector, solving with LU factorization will take roughly _____________ number of flops as Gauss elimination

the same

Model coefficients in a nonlinear equation of the form y= a1xe^(a2x^2) can be determined using which of the following algorithms

- General linear least squares - Linear regression using the linearized data and linearized model - Nonlinear regression

Which of the following methods are used in the fzero function. Select all that apply.

- Inverse quadratic interpolation - Secant method - Bisection

Which of the following methods can be applied to the solution of nonlinear systems of equations. 1 - Gauss-Seidel Iteration 2 - Newton-Raphson Iteration 3 - Gaussian Elimination 4 - Successive Substitution 5 - LU Factorization 6 - Jacobi iteration

- Newton-Raphson Iteration - Successive Substitution

The Jacobian matrix can be calculated using a finite difference approach in cases where derivation of the analytical partial derivatives is tedious. Which of the following statements is/are true about this approach?

- The approach does not introduce error into the method because the derivatives in the Jacobian are only used to inform the guess for the next iteration. - The accuracy of the Newton-Raphson method is ultimately determined by the stopping criterion regardless of whether the derivatives are exact or approximated. - The approach uses perturbation of one of the variables by a small factor (e.g. 1e-6*xi) to approximate the partial derivatives with finite difference approximations.

Which of the following are indications the solution of a linear system may be vulnerable to round off error.

- The elements of the coefficient matrix span several orders of magnitude. - The determinant of the coefficient matrix is close to zero. - The condition number of the coefficient matrix is much larger than one. - The solution is very sensitive to small changes in even a single element of the coefficient matrix.

Partial pivoting is commonly used along with Gauss elimination to _____________________.

- rearrange the equations so the largest coefficients in each column are on the diagonal - avoid division by zero problems - minimize round off error

When writing mathematical expressions involving vectors, it is often necessary to include a period before multiplication (e.g. .*) when we desire element-by-element multiplication because (select all that apply):

-the default is matrix multiplication as defined in linear algebra, not element-by-element multiplication. -failure to do so may result in an error. -failure to do so may yield unexpected numerical results

Below is a list of operations that may all be included in a single command. Please put these in the order by which MATLAB evaluates them when executing the command. Note operations on the same precedence level are executed left to right. Also, the order of operations can be overridden using parentheses. -exponentiation (^) -multiplication and division (* /) -addition and subtraction (+ -) -parentheses ()

1 - parentheses () 2 - exponentiation (^) 3 - multiplication and division (* /) 4 - addition and subtraction (+ -)

Which of the following commands creates a column vector of the integers 1 through 5? Select all correct answers. 1 - x = linspace(1,5,5)'; 2 - x = [1; 2; 3; 4; 5]; 3 - x = [1:1:5]; 4 - x = [1 2 3 4 5]'; 5 - x = [1, 2, 3, 4, 5];

1,2,4

The list below shows a variety of assignment commands. Select the ones that will return errors or an incorrect/unexpected numerical answer if both x and y are vectors of the same length: 1 - z = atand(y/x); 2 - z = 5*x.^2.*y+3*x.*y.^3 3 - z = 2*x.^2+1/y 4 - z = (x + y)/sqrt(x.^2+y.^2) 5 - z = 10*exp(-5*x).*cos(pi*y-pi/2) 6 - z = 10*cos(pi*x).*sin(pi*y).^2;

1,3,4

If a floating point number is stored in 32-bit single precision, there is 1 bit for the sign, 8 bits for the exponent, and 23 bits for the mantissa. What is the machine epsilon in single precision (Enter the mantissa to four decimal places and an integer for the exponent)?

1.1921 x 10^(-7)

The function below is to be fit to a data set using linear regression. y = Ae^(B/x) The correct linearization of the data needed to calculate the model coefficients A and B is:

1/x and ln(y)

Suppose you need to solve a linear system with 1000 equations and 1000 unknowns for 100 different right hand side vectors (Note this is representative of a common task in many differential equation solution algorithms). Approximately how many operations would you save by using LU factorization?

10^11

You are using MATLAB to find one of the sides of a right triangle. The hypotenuse is 7 and the known side is 4. Which of the following commands is correct? (More than one option may be correct. Select all the correct options.) 1 - >>a = 4; c = 7; a^2 + b^2 = c^2 2 - >>a = 4; c = 7; b = sqrt(c^2 - a^2) 3 - >>a = 4; c = 7; b^2 = c^2 - a^2 4 - >>a = 4; c = 7; b = (c^2 - a^2)^0.5 5 - All of the above are correct

2,4

Which of the following are statistics that indicate the quality of a curve fit? (Select all that apply) 1 - Mean of the data 2 - Euclidean norm of the residuals with respect to the model 3 - Standard deviation 4 - Standard error of the estimate 5 - Curve fit coefficients 6 - Coefficient of determination

2,4,6

Which of the following are NOT correct uses of MATLAB's built-in functions to do the calculation indicated. Select all that are incorrect. 1 - >>x = sind(30) to calculate the sine of 30 degrees 2 - >>x = sin(30) to calculate the sine of 30 degrees 3 - >>x = sin(30*pi/180) to calculate the sine of 30 degrees 4 - >>y = e^5 to calculate e raised to the power 5 5 - >>y = exp(5) to calculate e raised to the power 5 6 - >>z = ln(8) to calculate the natural log of 8 7 - >>z = log(8) to calculate the natural log of 8 8 - >>y = exp^5 to calculate e raised to the power 5

2,4,6,8

Reorder the equations below so that the coefficient matrix is diagonally dominant 1 - 3a + 9b -3c + d = 20 2 - 4a - 3b + 12c +2d = 10 3 - 4a + b + 2c + 10d = 8 4 - 12a + 6b + 4c - 1d = -5

4,1,2,3

Compute the Euclidean norm of the following matrix (round to four decimal places): 2 -1 3 1 5 -2 0 3 4

8.3066

In the general linear least squares formulation, the _________ functions can be any function of the independent variable(s), but can not include the fit coefficients.

Basis

The coefficient of determination (r2) for a "good" fit will be

Close to but not exceeding 1

Records all previous commands

Command History

Where you enter MATLAB commands at the prompt

Command Window

Indicates the folder on the computer where MATLAB is looking for files

Current Folder

Newton-Raphson iteration is to be used to solve the following system of equations: x^2 = 5-y^2 y+1 = x^3 Calculate the elements of the Jacobian matrix (to 2 decimal places) if the values of x and y in the current iteration are x = 1 and y = 1.5. Rearrange the equations to formulate the roots problems so that the constants (5 in the first equation and 1 in the second equation) are positive before taking the partial derivatives.

J_11 = -2 J_12 = -3 J_21 = -3 J_22 = 1

A script m-file is simply a list of MATLAB commands saved to a file. When the script is run, these commands are executed sequentially using the same workspace as the command window. True/False

True

For a system of linear equations, the Gauss-Seidel method should converge faster than the Jacobi method because the Gauss-Seidel method takes advantage of the latest information as each iteration of the solution vector is calculated. T/F

True

Many built-in functions will accept scalars or vectors as input arguments. In general they operate element by element when the input is a vector. T/F

True

The equation for the standard error must be modified depending on the number of coefficients in the mathematical model that is being fit to the data. T/F

True

You have performed a curve fit to a data set using nonlinear regression. The standard error of the curve fit is 0.5. Which of the following statements is(are) accurate?

We can expect the model to predict the data to within +/- 1.0 approximately 95% of the time. We can expect the model to predict the data to within +/- 0.5 approximately 68% of the time.

A numerical algorithm is used to solve the following system of equations: 3(x1) - 2(x2) = 1 (x1) - 4(x2) = -3 The numerical results are x1 = 0.997 and x2 = 1.002. The absolute values of the residuals associated with this numerical solution are (to four decimal places):

e1 = 0.013 e2 = 0.011

The computational cost of the Gauss elimination algorithm is concentrated in the ________________ step and is proportional to the cube of the size (n) of the n x n system of equations.

forward elimination

In general, open methods such as Newton-Raphson and the Secant Method converge on the root ________________ than bracketing methods such as bisection.

in less iterations

Perform an LU factorization of the matrix below (by hand to make sure you understand how) and enter the results in the appropriate boxes: 8 2 3 1 4 1 1 1 4

l_21 = 0.125 l_31 = 0.125 l_32 = 0.200 u_22 = 3.750 u_23 = 0.625 u_33 = 3.500

In the general linear least squares algorithm, the fit coefficients can be determine once the Z matrix is generated using which MATLAB command?

left division

In general, open methods such as Newton-Raphson and the Secant Method are ____________________ to fail (diverge) compared to bracketing methods such as Bisection

more likely

In any least-squares curve fit...

the fit coefficients are determined by minimizing the squared Euclidean norm of the residuals in the model predictions of the data.

LU factorization can significantly reduce the computational cost of solving linear systems when _________________________.

the system is going to be solved for multiple right-hand-side vectors.

Match the MATLAB command with the appropriate verbal explanation of what the command is doing. All of these commands refer to a vector x = [2 -1 3 1.7 99 8] z = x([2 5]).^2 z = x(1:4) z = x(end-1:end); z = x(4)

z = x([2 5]).^2 - Square the second and z = x(1:4) -Assign the first through z = x(end-1:end); -Assign the last two elements z = x(4) -Assign the fourth element


Related study sets

Esthetics Chapter #3: Physiology and Histology of the Skin

View Set

Principles of Finance - Chapter 13 and Smartbook

View Set

Chapter 6: Performance management

View Set