Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

mySoR.m You should develop a frontend or run-xxx routine that calls and evaluates your functions. Examples to get you started for most of these codes

image text in transcribedimage text in transcribed

mySoR.m You should develop a frontend or "run-xxx" routine that calls and evaluates your functions. Examples to get you started for most of these codes are provided. Results: Evaluate the performance (timing, number of iterations) and accuracy of each of your functions against matlabs routines or the known value of X if you take a mathematical approach. Compare your codes to each other and the theoretical expectations of accuracy/timing. You should explicitly evaluate your methods for matrices of sizes nn where n=10,100,1000,10000 (or as large as possible for each method). You may use larger matrices if your computer obtains solutions in a reasonable time frame. You are free to choose any matrix or matrices you like to test your systems. You might choose some matrices with known structure, examples include: identity or diagonal matrices or the second difference matrix or a series of related matrices like we used in class to test the determinants. HINT: Some functions are provided (mymat and xmasmat) that generate random matrices, that have "good" properties. (diagonally dominant and positive definite... well maybe) HINT: Be aware that the ITERATIVE methods only work for very specific types of matrices. e.g. diagonally dominant matrices are required for the iterative methods to be guaranteed to converge. Goals: The goal of this assignment is to implement several ITERATIVE METHODS for solving systems of linear algebraic equations as modular codes or functions that you can call in matlab. Problem Description: Given an nn Matrix A and a vector b your codes should solve the matrix equation Ax=b for the unknown vectors x. You will implement the following algorithms Direct Methods: (were already done. You can use these to check your iterative methods) Cramer's Rule, Gauss Elimination, LU factorization Iterative Methods: (to be done IN THIS ASSIGNMENT AFTER THE BREAK) Gauss-Seidel, Jacobi's Method, Successive Over Relaxation. This assignment will implement the following: myGS(A,b, iter, tol), myJacobi(A,b, iter, tol), mySoR(A, b, iter, tol) Each should return the computed solution " x " such that Ax=b. Iter and tol represent the "iterations" and "tolerance" limits to be used in these codes. Your methods should be compared to known solutions for a system of questions and/or MATLAB's method and/or your own direct method developed earlier for solving a system of equations. See below: For an nn matrix A, an n1 vector x and an n1 solution vector b we can do the following: For any random A and random x we can compute b and pretend we never knew x. For example: (these are not actual matlab commands and there may be better choices than just random values for A and x ) A=random(n,n)xsoln=random(n,1)b=Axsoln; Then solving the system with (A,b) should give you x Specifically Given A and b the solution xmatlab can determined by matlab as xmatlab = Alb or xmatlab=inv(A)b Your methods should run similar so: xmyGS =myGS(A,b, iter,tol ) xmyJacobi = myJacobi (A,b, iter,tol ) xmySoR = mySoR(A,b,iter,tol ) The result will be an n1 vector from which you can determine error as follows: Err=(x-xapprox)(xxapprox)/N Where xapprox is any one of the above solutions

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

why we face Listening Challenges?

Answered: 1 week ago

Question

what is Listening in Context?

Answered: 1 week ago