Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask MATLAB Expert

Exercise 1 (Jacobi and Gauss-Seidel Iterations) Consider the following linear system

1406_Jacobi and Gauss-Seidel Iterations.png

This is a discrete version of Poisson's equation: ΔΦ = ρ = , which may be written in partial derivatives as ∂2Φ/∂x2 = ρ. Poisson's equation is ubiquitous in physics, arising in electrostatics (Φ is the electric potential and -ρ is the charge density), in gravitation (Φ is the gravitational potential and ρ is the mass density), in uid dynamics (Φ is the velocity and ρ is the negative curl of vorticity), etc. It is also important in image analysis. We will see how this relates to the above matrix equation later in the course.

Construct the A matrix above for a 49 x 49 system. Use the >> help diag command for information about constructing a tridiagonal matrix in MATLAB. Set k = 45 and construct a (rho) vector according to the following rule:

533_Jacobi and Gauss-Seidel Iterations1.png

Verify that the solution Φ* (phistar) that satis es AΦ* = ρ is given by

258_Jacobi and Gauss-Seidel Iterations2.png

Now, program both the Jacobi and Gauss-Seidel methods for solving this problem, and in each case, start the iterations with an initial guess Φ as a column of ones. Continue to iterate each method until every term in the vector Φ converges to within 10-4 of the same term in the previous iteration (this corresponds to norm(phi(:,k+1)-phi(:,k),Inf)<=1.e-4.).

Exercise 2 Consider the following graph representing the probability of the weather tomorrow, given the weather today.

558_Jacobi and Gauss-Seidel Iterations3.png

We may represent these probabilities in a Markov matrix, leading to the following equation:

1614_Jacobi and Gauss-Seidel Iterations4.png

More concisely, we may write

2191_Jacobi and Gauss-Seidel Iterations5.png

(a) Compute the eigenvalues and eigenvectors of the matrix A using the eig command. Rear-range the eigenvalues as a single column vector (hint: use the diag command).

Exercise 3: Consider the following temperature data taken over a 24-hour (military time) cycle:

75 at 1, 77 at 2, 76 at 3, 73 at 4, 69 at 5, 68 at 6, 63 at 7, 59 at 8, 57 at 9, 55 at 10, 54 at 11,52 at 12, 50 at 13, 50 at 14, 49 at 15, 49 at 16, 49 at 17, 50 at 18, 54 at 19, 56 at 20, 59 at 21, 63at 22, 67 at 23, 72 at 24.

(a) Fit the data with the parabolic fi t

f(x) = Ax2 + Bx + C

and calculate the E2 error. Use polyfit and polyval to get your results. Evaluate the curve f(x) for x = 1 : 0:01 : 24 and save this in a column vector.

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M9132452
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in MATLAB

Discrete optimisation- solve the following two problems

Discrete Optimisation - Solve the following two problems with both exhaustive enumeration and branch and bound - Problem 1 is a mixed integer linear optimisation problem (the problem has both discrete and continuous vari ...

Assignment details -need to write a code for connecting

Assignment Details - Need to write a code for connecting segments (Lines) a special case of TSP. The problem is to connect lines in 2d/ 3d space with path obstructions. Can you help me write the code for this? Hope you m ...

Suppose that you have used some concept learning algorithm

Suppose that you have used some concept learning algorithm to learn a hypothesis h1 from some training data. You are interested in knowing the accuracy that the hypothesis can be expected to achieve on the underlying pop ...

Assignmentq1 find the laplace transforms of the following

Assignment Q.1 Find the Laplace transforms of the following functions: (a) t 2 + at + b and (b) sin(2nΠt/T) Q.2 Find f (t) for the following F(s) = α[ f (t)]. (i) 5/(s + 3), (ii) 1/s 2 + 25, (iii) 1/s(s+1) Q.3 Find the L ...

Lab assignment - matlab matrix relationallogical operators

Lab Assignment - MATLAB Matrix, Relational/Logical Operators and Plotting This laboratory exercise/assignment will involve you 1) practicing multiplication operators in MATLAB; 2) practicing relational and logical operat ...

Assignment -we have daily gridded rainfall data of 40 years

Assignment - We have daily gridded rainfall data of 40 years and structure of the dataset is like below; Lat = [6.5:0.25:38.5]; Lon = [66.5:0.25:100]; Rainfall (135x129x365x40) (Lon, Lat, days, years). Now, we looking fo ...

Assignment - matlab programmingusing appropriate matlab

Assignment - MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Question a safe prime is a prime number that can be written

Question : A safe prime is a prime number that can be written in the form 2p + 1 where p is also a prime number. Write a MATLAB script file that finds and displays all safe primes between 1 and 1000.

Assignment -data is given on which want to do computational

Assignment - Data is given on which want to do computational production planning using Metaheuristic MATLAB Programming: 1) Ant Colony Algorithm on both Partial and Total Flexible Problem. 2) Bee Algorithm on both Partia ...

Prepare a 3 - 10 pages long reportprepare a presentation

Prepare a 3 - 10 pages long report Prepare a presentation with 5 - 9 slides. The slides will include introduction (need and similar work), theoretical background (tested neural networks), Data, Results (Comparison of the ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As