Question: Please don't use any AI ( MATLAB programming ) Consider the system of 2 n + 1 equations: ( a ) ( 6 points )

Please don't use any AI
(MATLAB programming) Consider the system of 2n+1 equations:
(a)(6 points) Write two function M-files to solve this system using the GENP and GEPP approaches, respectively. Your programs
have to make use of the structure of this system so that they do not do unnecessary computations and do not waste storage.
How many flops are involved in your programs?
How many memory locations are needed?
(b)(3 points) Write a script M-file to test your two programs on the same data: random elements ai,di produced by MATLAB
built-in function randn (note that an+1 should be equal to dn+1), and bi defined by bi=di+a2n+2-i for in+1, and
bn+1=dn+1. Notice that the exact solution x=[1,1,dots,1]T. Let xnp and xpp be the computed solutions by your two programs,
respectively. Compute ||x-xnp||2||x||2,||x-xpp||2||x||2 and lon||A||2||A-1||2. Here for the test purpose in MATLAB, A is used
to store the coefficient matrix. In your test, you may take n=9. Comment on your results.
Note: Check MTALAB built-in functions or constants norm, cond, ones and eps, which can be used in your programs.
(c)(2 points) Now you change d1 in your previous test example to 10-15, and correspondingly you change b1 so that b1 still
satisfies b1=d1+a2n+1. Do the same thing as in 3(b).
(d)(2 points) Now you make other changes as well in your test example: change a1 to 10-8, and correspondingly change b2n+1
so that
b2n+1=a1+d2n+1 still holds. Again do the same thing as in 3(b).
Print out the data and computed results.
Please don't use any AI ( MATLAB programming )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!