Skip to content

Implement of 1D Orthogonal Spline Collocation (OSC) Method.

Notifications You must be signed in to change notification settings

cbhua/orthogonal-spine-collocation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧮 1D Orthogonal Spline Collocation Method

Implement of 1D Orthogonal Spline Collocation (OSC) Method. Show the performance on linear and nonlinear examples.

💡 Introduction

Orthogonal collocation is a method for the numerical solution of partial differential equations. It uses collocation at the zeros of some orthogonal polynomials to transform the partial differential equation (PDE) to a set of ordinary differential equations (ODEs). The ODEs can then be solved by any method. It has been shown that it is usually advantageous to choose the collocation points as the zeros of the corresponding Jacobi polynomial (independent of the PDE system) [1].

Orthogonal collocation method was famous at 1970s, mainly developed by BA Finlayson [2]. Which is a powerful collocation tool in solving partial differential equations and ordinary differential equations.

Orthogonal collocation method works for more than one variable, but here we only choose one variable cases, since this is more simple to understand and most widely used.

🏷 Features

  • Turoritals. We provide several examples, including linear and nonlinear problems to help you to understand how to use it and the performance of this model.
  • Algorithm Explanation. We provide a document to in detail explain how this alogirthm works by example, which we think it's easier to get. For more detail, please refer to Algorithm section.

⚙️ Requirement

Python Version: 3.6 or later
Python Package: numpy, matplotlib, jupyter-notebook/jupyter-lab

🔧 Structure

  • src: source code for OSC algorithm.
  • fig: algorithm output figures for readme
  • notebook: tutorial jupyter notebooks

🔦 How to use

Step 1. Download or Clone this repository.

Step 2. Refer to notebook/example.ipynb, it will introduce how to use this model in detail by examples. Main process would be

  1. collocation1d(): generate collocation points.
  2. generator1d(): generate algebra equations from PDEs to be solved.
  3. numpy.linalg.solve(): solve the algebra equations to get polynomial result,
  4. polynomial1d(): generate simulation value to check the loss.

📈 Examples

One variable, linear, 3 order Loss: <1e-4

One variable, linear, 4 order Loss: 2.2586

One variable, nonlinear Loss: 0.0447

📜 Algorithm

Here we are going to simply introduce how 1D OSC works by example. Original pdf please refer to Introduction.pdf in this repository.

📚 References

[1] Orthogonal collocation. (2018, January 30). In Wikipedia. https://en.wikipedia.org/wiki/Orthogonal_collocation.

[2] Carey, G. F., and Bruce A. Finlayson. "Orthogonal collocation on finite elements." Chemical Engineering Science 30.5-6 (1975): 587-596.