Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The routine I used for Problem 1 to generate A was: Problem 2, We will assume that the forcing is f(x) = sin 51x. (i)

image text in transcribed

image text in transcribed

The routine I used for Problem 1 to generate A was:

image text in transcribed

Problem 2, We will assume that the forcing is f(x) = sin 51x. (i) Generate b for this forcing, taking L=1 and n+1=201. Using your routine in Problem 1 to generate A, solve the corresponding linear system using matlab's backslash solver: i.e. u=A\b. Include a plot of this solution, and save it for later parts of this problem. (ii) Implement SOR for solving an nxn linear solver. The input arguments to your function should be n, A, b, initial approximation Wo the SOR parameter w, and the number of iterations, and the output should be the approximate solution w to the linear system: function (w]=SOR(n,A, b, wo, w, niterations) With n+1= 201, initial approximation 0, and w = 1, apply 3000 iterations of SOR to obtain the approximation w. Plot the residual r= b-Aw and the error e= u-W on the same plot. Repeat the same process but for w = 1.25. Compare the results for the two different parameter choices. (iii) Using the better parameter that gave a faster convergence rate, solve the system for n+1=51. Note that because the size of the systems is 4 times smaller, it requires less computation. Does the approximation have the same profile as the solution u. How can you use this fact for improving the efficiency for the n+1=201 case? (Hint: the initial approximation for SOR affects the efficiency of the computation.) Your driver should have the following structure 1. Initialize/read in Lin,w, and form Ax 2. Call generate_matrix code to form A 3. Form b, and compute the solution using matlab's backsolver 4. Obtain the approximate solution calling your SOR routine 5. Post-processing- plotting residual and error, etc. We will be consider a diffusive process in an infinitesimally thin domain of length L, which we can take to be the line segment [O, L). The problem may represent the diffusion of heat or some species in the domain. The mathematical formulation for our model is given by the equations 02u(x) 2 = f(x) 0

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

The Ultimate Guide To Rental Property Investing

Authors: John Malatesta

1st Edition

979-8394902215

More Books

Students also viewed these Finance questions

Question

Describe how offers are terminated by operation of law.

Answered: 1 week ago

Question

What is are four types of ARTS?

Answered: 1 week ago

Question

What is multiple outcomes design? Explain.

Answered: 1 week ago