﻿ Numerical Methods

## Numerical Methods

### Orthogonal Collocation Revisited

On these pages I am constructing an Ebook/Tutorial on the Orthogonal Collocation, a.k.a. Pseudospectral, method, which includes source code for free download (in Matlab/Octave, C++, Fortran 90 and Excel).  It is really more than a tutorial, because it explains some aspects of the method which are not clear or wrong in much of the existing literature.

News Flash!  I have recently (March 2017) started a major update. The biggest change is the section on Parabolic problems. I would like to add more to it over time, but this first problem turned out nicely. There is also a new Appendix C and greatly expanded Appendix A. I will be updating the codes over the next month or so.

The text of this article is provided as PDF files so they can be printed with full formatting and so I don't have to fiddle with equations in HTML.  Below is an outline that includes links to all the files that are available:

I am calling this Orthogonal Collocation Revisited, because after my involvement with orthogonal collocation during the early days in the 1970’s, I had reason to use it again more recently.  I was writing a model of an automotive valve train, and OC seemed to be ideal for treating the valve springs. As I started to write a description of the model, I reviewed OC over the last 45 years and discovered that some aspects of the method have never been explained (at least not clearly) and some information is missing or just plain wrong. Documentation of the valve train model got bogged down explaining the fundamentals of OC. This problem prompted me to write this article. At first I thought I would do a short webpage and perhaps a note to a journal, but as you can see, it has blossomed well beyond that.

One change during the past 45 years is the development of two separate groups of study - the Orthogonal Collocation group and the Pseudospectral (PS) group.  The seminal works are for OC: Villadsen and Stewart (1967) and Finlayson (1972) and for PS: Orzag (1972) and Gottlieb and Orzag (1977). For polynomial approximations, these methods are equivalent when the same collocation points are selected. However, there are many implementation differences. Much of the PS work is devoted to problems with periodic solutions, which is not addressed by OC. OC is highly developed for symmetric problems in planar, cylindrical and spherical coordinates. OC uses nodal approximations, while this approach was slow to be adopted in PS implementations. PS methods frequently rely on FFTs during the solution; facilitated by the use of Chebyshev polynomials. OC uses collocation at the base points of accurate quadrature methods (Gauss or Lobatto) rather than Chebyshev roots. The PS literature seems to have developed its own unique terminology, which can be difficult to navigate.

This is a pragmatic approach to solving differential equations. I am particularly concerned about acquiring accurate engineering quantities from the solution, e.g. boundary fluxes. In most real world problems, one is primarily interested in how an object interacts with its surroundings, e.g. the transfer of heat from a fluid to a solid, and this invariably involves flux calculations. Flux calculations are virtually ignored in some of the more mathematical articles and texts about these methods.

I first lay the fundamental framework for orthogonal collocation.  Then, I show what works and what does not work using a series of examples.  In many cases the examples are solved not only with orthogonal collocation, but also with other methods for comparison, e.g. Galerkin, Moments, finite elements and finite differences.  The examples also cover a variety of problems: boundary value problems, parabolic equations, hyperbolic equations, one and two spatial dimensions.  The examples show the advantages and disadvantages of the method for each type of problem.

I started this project in 2011 and did little additional for a few years, but now I am making good progress. Unfortunately, I keep redoing the first part. On this third rendition I have included a lot more calculations with Chebyshev points, which are so popular in the PS literature. I have coded several of the other problems listed as “coming”, but have not had a chance to write them up.

There is now a lot more Matlab code as well, which was suggested in limited feedback I’ve received. As a retiree on fixed income, I couldn’t justify the corporate fat cat price for a Matlab license, so I chose to use the free clone Octave which is part of the GNU project.

I am now using C++ and Fortran compilers from GNU.  I calculate the collocation points and associated matrix operators with a native F90 module and a native C++ class. MEX (matlab executable) files are provided for Matlab and Octave based on compilations of the C++ code. I also have simpler Matlab code which involves no MEX files. All of the source code is free (see Download Page)

Due to the size of this project, I will have to economize in some areas. Some of the calculations which are done primarily for comparison will not be coded in every langauge: Matlab/Octave, C++, Fortran, and Excel.  Some calculations are not feasible with Excel anyway, due to its limitations.  However, there is some code provided for all four systems and the vast majority of the calculations will be available in Matlab and Fortran 90 code.

The code in this project is freely available for download. It provides a toolkit that far exceeds anything else available, in both capabilities and ease of use. The tools are useful for full Galerkin or moments method as well as OC.  A simple instruction manual and a test code is provided (see above) for all four programming systems.

You are visitor number

since March 21, 2011