Git Product home page Git Product logo

matrix-differentiation-operators's Introduction

Matrix-Differentiation-Operators

alt text alt text alt text

alt text

Finite difference matrix operators for performing numerical differentiation in python. The current version can handle 1D and 2D numpy arrays. 2D arrays need to be reshaped/unraveled into a column vector first. Differentiation can be performed by pre-multiplying the vector with the matrix operator. After the matrix operation, it can be reshaped to its originial dimensions. The matrix operators use secord order central differene formula (except for edge points where second order forward/backward difference formula is used). The code uses sparse matrices and therefore can handle large arrays.

Features

  • Differentiate numpy arrays using simple matrix multiplication.
  • Differentiation of 1D and 2D data (in meshgrid format) have been implemented so far.
  • The matrix operators are in the form of sparse matrices. So, the operators can handle large datasets.

Package requirements

  • NumPy alt text
  • SciPy (sparse matrices, sparse linear algebra) alt text alt text

Use

The Differentiation_testing_v1.py file contains an example differentiation problem in 1D and 2D.

Sample Output

The following plots show the first and second derivative of an one dimensional Gaussian function. The results obtained using the matrix operators are compared with the analytical results.

alt text

The following plots show the first derivative of a two dimensional Gaussian function. The results obtained using the matrix operators are compared with the analytical results.

alt text

matrix-differentiation-operators's People

Contributors

zaman13 avatar

Stargazers

João Gabriel Marques Mendes avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.