1 / 20

MA557/MA578/CS557 Lecture 10

MA557/MA578/CS557 Lecture 10. Spring 2003 Prof. Tim Warburton timwar@math.unm.edu. This Lecture. HW3 answers Coding time. HW3 Q1.

selah
Télécharger la présentation

MA557/MA578/CS557 Lecture 10

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MA557/MA578/CS557Lecture 10 Spring 2003 Prof. Tim Warburton timwar@math.unm.edu

  2. This Lecture • HW3 answers • Coding time.

  3. HW3 Q1 Q1) Code up a function (LEGENDRE) which takes a vector x and m as arguments and computes the m’th order Legendre polynomial at x using the stable recurrence relation. A1) We use the following recurrence relationship:

  4. HW3 Q1 cont

  5. HW3 Q1 cont • Let’s plot those Legendre polynomials and see how they behave over the interval [-1,1] p=0 p=1 p=3 p=4 p=2 p=4

  6. HW3 Q2 Q2) Create a function (LEGdiff) which takes p as argument and returns the coefficient differentiation matrix D A2) The differentiation matrix which maps the Legendre coefficients to the Legendre coefficients of the derivative of the function:

  7. HW3 Q2 cont A2cont) The Matlab code is:

  8. HW3 Q2 cont • Let’s test the output for p=5: Spot on!. Note that there are onlyp + (p-2) + (p-4).. Non-zero entries

  9. HW3 Q2 cont • The form of Dhat

  10. HW 3 Q3 Q3) Create a function (LEGmass) which takes p as argument and returns the mass matrix M A3) Definition of the mass matrix:

  11. HW3 Q3 cont

  12. HW3 Q4 Q4) Create a function LEGvdm which returns the following matrix: A4)

  13. HW3 Q4 cont p=0 p=1 p=2

  14. HW3 Q5 Q5) Test them with the following matlab routine:

  15. HW3 Q5 cont • Note that x^m is exactly interpolated for m<=p when we use p+1 points and up to p’th order polynomials. x^(p+1) is only approximately interpolated – and hence the derivative is only approximate.

  16. Note on Q5 • If we were to repeat this on an interval • We would need to use:

  17. HW3 Q6 Q6) Compute the condition number of the generalized Vandermonde matrix constructed with p=0,…40 and p+1 Chebychev points.

  18. Asymptotic Behavior cond(V) as p->infinity

  19. Cliff note version of DG advection equation

  20. Workshop Code • Using your own routines or those on the web site code up the DG advection equation solver by Wednesday end of class. • Spare time this class for coding…

More Related