Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB Project: Using Backslash to Solve Ax-b Name Purpose: To learn about backslash and why it is the preferred method for solving systems Axb Prerequisite:

image text in transcribed
image text in transcribed
image text in transcribed
MATLAB Project: Using Backslash to Solve Ax-b Name Purpose: To learn about backslash and why it is the preferred method for solving systems Axb Prerequisite: Section 2.2 and the discussion of condition number in Section 2.3 when A is invertible MATLAB functions used: , inv, format, rand, norm, diary, hilb; and ref from Laydata4 Toolbox Background: This project is about square invertible matrices only. Suppose A is such a matrix and you want to solve Ax = b. By Theorem 5 in Section 2.2, there is a unique solution to this system. MATLAB has a special operator called backslash for solving this type of system, and it usually gives excellent results. It is the method people use in professional settings. To use t, store A and b and type A\b You may know two other methods in MATLAB for solving the matrix equation Ax b. You could type ref (IA b]) to get the reduced echelon form of the augmented matrix, and then read the solution from its last column. Alternatively, since A is assumed to be invertible here, you could type inv (A)b, which by Theorem 5 must give the unique solution. Backslash is the best of these methods. It uses an algorithm that is fast and minimizes roundoff error. It also checks the condition number of the coefficient matrix. If the condition number is large, it will be hard to get an accurate answer using any numerical method. Fortunately such matrices occur rarely in real world problems. But if backslash does detect a very large condition number, it will warn you by printing a message "Matrix is close to singular or badly scaled. Results may be inaccurate." Do not ignore such a warning if you ever see it, for it means the solution is probably not correct to very many digits. If you need more ac t a numerical analyst. The inv function also checks the condition number, but calculating requires a lot more arithmetic than backslash It is definitely not wise to use ref to solve real world problems. That function was written to help students learn linear algebra, so its algorithm is not optimal, and ref will not wan you if your linear system is one of those rare ones for which it is hard to get an accurate solution. 1. (MATLAB) Here you will use the square matrices in exercises 29, 3, 39 and 41 in Section 2.2. For each of these, you will create a linear system Ax b and solve it using all three methods described above. You will not see any warnings, so these are "good" problems. You will also see that the solutions are almost identical as expected. (a) To get started, determine the path where you will store your work. For example, if you install a flash drive into the computer's drive E: drive, type diary E:\solve to open a file called "solve" on your flash drive. diary E: solve format compact format long e (this causes fewer blank lines to be printed, so more results fit on the screen) (tell MATLAB to display numbers in exponent format with 15 digit mantissas

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions