Emperical Method of Fundamental Solutions solver for Python.
Project description
empirical README
==================
Getting Started
---------------
Check out the examples directory; initial development will focus on getting
these working first.
Getting the latest version
--------------------------
If the pypi releases are not up-to-date enough for your tastes, or if you'd
like to see how the development is moving along, visit
https://bitbucket.org/dhild/empirical
Empirical Interpolation
-----------------------
The empirical interpolation module included has the capability to handle
multiple dimensions in both variables and parameters.
Why does this project exist?
----------------------------
The focus of this project is to create a reduced basis solver for collocation
problems. Initially, the collocation problems will be formulated using the
method of fundamental solutions, but ideally the framework will allow for easy
extension to other collocation formulations as well.
There is an existing solver for a variety of methods using MATLAB codes, called
mpspack. (See the 'Thanks' section for details). The mfs code base is basically
a port of this code to Python.
Since mpspack is available under the GPLv3, there should be no legal issues
with creating a Python version. It should be a benefit to the mathematical
world to make code like this more widely available. Unfortunately, since
this project has no official affiliation with mpspack, or its creators Alex
Barnett and Timo Betcke, it will make it harder to keep up with any updates
or additions to their library. At the time of inception for this library, I
used the 1.31 version of mpspack.
The biggest reason to port mpspack to Python is the fact that Python is
free, and MATLAB is expensive. For my Master's thesis, I need to use their
code, but I also need to run it a huge number of times. While my school does
have MATLAB, I did not find it simple to get MATLAB to run in parallel. This
problem seems to stem from the fact that each running process must have it's
own license; my school does not have an unlimited number of such licenses,
and even if they did, I have had lots of trouble getting it to work.
The speed impacts are not anticipated to be significant; numpy benchmarks do
not typically have much difference from similar MATLAB code.
Thanks
======
mpspack
-------
Special thanks to Alex Barnett and Timo Betcke, for their MPSPACK software.
Originally, much of the code base is based upon their project, which they have
distributed MATLAB codes for under the GPLv3. They have a fantastic design and
a well documented, maintained, and complete package, at
https://code.google.com/p/mpspack/
legendre-gauss-lobatto algorithm
--------------------------------
Credit for the LGL algorithm goes to Greg von Winckel. Originally implemented in
MATLAB, I found the algorithm at
http://www.mathworks.com/matlabcentral/fileexchange/4775-legende-gauss-lobatto-nodes-and-weights
Changelog
=========
0.2
---------
* Improved the empirical interpolation interface.
- It no longer tries to perform interpolations, but leaves that to the
calling function.
- More and improved examples are added, copying a reference text, see
Aanonsen, "Empirical Interpolation with Application to Reduced Basis
Approximations", Chapter 3. 2009, Norwegian University of Science and
Technology.
* Quadrature points:
- Added a linear quadrature function.
- Added a function for genericly transforming quadrature from [-1, 1] to some
other range [a, b].
- Added a common selection method for quadratures.
* Added a couple of mesh classes for convenience. Currently only 1- and 2-
dimensional classes are implemented, but if they prove useful then a generic
version may be called for.
* Removed some of the interpolation code. It has been deemed relatively
unnecessary.
* Various asthetics:
- Added pylint configuration file, and improved from some of the suggestions.
- Made various improvements to the testing functions.
0.1
--------
What works:
* Basic support for empirical interpolation method is implemented. The API may
change significantly in future releases.
* Method of fundamental solutions, along with basic domain/segment codes.
* Quadrature generators all pass some basic tests (code is thanks to mpspack
and lglnodes.m):
- Periodic trapezoid
- Trapezoid
- Gaussian
- Clenshaw-Curtis
- Legendre-Gauss-Lobatto
* Interpolation codes have been written, using the following algorithms:
- Newton interpolating polynomial (nested form)
- Lagrange interpolating polynomial (uses slow method for cardinal
polynomials, probably numerically unstable for large number of nodes)
- Lagrange bivariate (also uses a slow method for cardinal polynomials, does
not yet interface well with the EI class)
* Example scripts for empirical interpolation and, method of fundamental
solutions.
* A variety of unit tests have been implemented.
* A few of the different classes (Domain, Segment, Scattering) can plot some of
their features using matplotlib.
* Restructured package layout (and changed name from emfs to empirical).
0.0
--------
* Initial version
What works:
* The examples/tut_scatt.py script is a port of the mpspack script of the same
name. While it is slightly different in some ways, it does successfully
calculate a plane wave scattering problem, and display the resultant fields.
* All of the unit tests written so far run successfully. However, there is only
60% coverage with these, and even that is not a thorough coverage of all the
methods called.
==================
Getting Started
---------------
Check out the examples directory; initial development will focus on getting
these working first.
Getting the latest version
--------------------------
If the pypi releases are not up-to-date enough for your tastes, or if you'd
like to see how the development is moving along, visit
https://bitbucket.org/dhild/empirical
Empirical Interpolation
-----------------------
The empirical interpolation module included has the capability to handle
multiple dimensions in both variables and parameters.
Why does this project exist?
----------------------------
The focus of this project is to create a reduced basis solver for collocation
problems. Initially, the collocation problems will be formulated using the
method of fundamental solutions, but ideally the framework will allow for easy
extension to other collocation formulations as well.
There is an existing solver for a variety of methods using MATLAB codes, called
mpspack. (See the 'Thanks' section for details). The mfs code base is basically
a port of this code to Python.
Since mpspack is available under the GPLv3, there should be no legal issues
with creating a Python version. It should be a benefit to the mathematical
world to make code like this more widely available. Unfortunately, since
this project has no official affiliation with mpspack, or its creators Alex
Barnett and Timo Betcke, it will make it harder to keep up with any updates
or additions to their library. At the time of inception for this library, I
used the 1.31 version of mpspack.
The biggest reason to port mpspack to Python is the fact that Python is
free, and MATLAB is expensive. For my Master's thesis, I need to use their
code, but I also need to run it a huge number of times. While my school does
have MATLAB, I did not find it simple to get MATLAB to run in parallel. This
problem seems to stem from the fact that each running process must have it's
own license; my school does not have an unlimited number of such licenses,
and even if they did, I have had lots of trouble getting it to work.
The speed impacts are not anticipated to be significant; numpy benchmarks do
not typically have much difference from similar MATLAB code.
Thanks
======
mpspack
-------
Special thanks to Alex Barnett and Timo Betcke, for their MPSPACK software.
Originally, much of the code base is based upon their project, which they have
distributed MATLAB codes for under the GPLv3. They have a fantastic design and
a well documented, maintained, and complete package, at
https://code.google.com/p/mpspack/
legendre-gauss-lobatto algorithm
--------------------------------
Credit for the LGL algorithm goes to Greg von Winckel. Originally implemented in
MATLAB, I found the algorithm at
http://www.mathworks.com/matlabcentral/fileexchange/4775-legende-gauss-lobatto-nodes-and-weights
Changelog
=========
0.2
---------
* Improved the empirical interpolation interface.
- It no longer tries to perform interpolations, but leaves that to the
calling function.
- More and improved examples are added, copying a reference text, see
Aanonsen, "Empirical Interpolation with Application to Reduced Basis
Approximations", Chapter 3. 2009, Norwegian University of Science and
Technology.
* Quadrature points:
- Added a linear quadrature function.
- Added a function for genericly transforming quadrature from [-1, 1] to some
other range [a, b].
- Added a common selection method for quadratures.
* Added a couple of mesh classes for convenience. Currently only 1- and 2-
dimensional classes are implemented, but if they prove useful then a generic
version may be called for.
* Removed some of the interpolation code. It has been deemed relatively
unnecessary.
* Various asthetics:
- Added pylint configuration file, and improved from some of the suggestions.
- Made various improvements to the testing functions.
0.1
--------
What works:
* Basic support for empirical interpolation method is implemented. The API may
change significantly in future releases.
* Method of fundamental solutions, along with basic domain/segment codes.
* Quadrature generators all pass some basic tests (code is thanks to mpspack
and lglnodes.m):
- Periodic trapezoid
- Trapezoid
- Gaussian
- Clenshaw-Curtis
- Legendre-Gauss-Lobatto
* Interpolation codes have been written, using the following algorithms:
- Newton interpolating polynomial (nested form)
- Lagrange interpolating polynomial (uses slow method for cardinal
polynomials, probably numerically unstable for large number of nodes)
- Lagrange bivariate (also uses a slow method for cardinal polynomials, does
not yet interface well with the EI class)
* Example scripts for empirical interpolation and, method of fundamental
solutions.
* A variety of unit tests have been implemented.
* A few of the different classes (Domain, Segment, Scattering) can plot some of
their features using matplotlib.
* Restructured package layout (and changed name from emfs to empirical).
0.0
--------
* Initial version
What works:
* The examples/tut_scatt.py script is a port of the mpspack script of the same
name. While it is slightly different in some ways, it does successfully
calculate a plane wave scattering problem, and display the resultant fields.
* All of the unit tests written so far run successfully. However, there is only
60% coverage with these, and even that is not a thorough coverage of all the
methods called.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
empirical-0.2.tar.gz
(59.2 kB
view details)
File details
Details for the file empirical-0.2.tar.gz
.
File metadata
- Download URL: empirical-0.2.tar.gz
- Upload date:
- Size: 59.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 817a59cb2a792a721be29c338652683672425f96daaf1cf340e19bc0400d2447 |
|
MD5 | 0209d6c6031060ec00b359ff0e4a80b8 |
|
BLAKE2b-256 | 46de064452f299aebcfb1df9703635faa034e022418c6c758c42830a5a305dcc |