Coder Social home page Coder Social logo

technologicat / pydgq Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 2.0 1.42 MB

ODE system solver using dG(q), time-discontinuous Galerkin with Lobatto basis.

License: BSD 2-Clause "Simplified" License

Python 99.95% Shell 0.05%
cython discontinuous-galerkin galerkin integration ivp numerical numpy ode ode-solver ordinary-differential-equations python python2 python27 python3 python34 solver

pydgq's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pydgq's Issues

Drop support for Python 2.7

Python 2.7 will be out of support January 1, 2020.

Dropping support for it allows a simple solution for #1.

A possibly incomplete list of things to remember:

  • Update metadata in setup.py.
  • Update GitHub tags.
  • Update hashbangs.
  • Drop runtests2.sh.
  • Consider migrating runtests3.sh into a runtests.py. Shell? Where we're going, we need no shell.
    • Unpythonic has a template for this.
    • Or could just use unittest from the stdlib.
    • pytest would be even nicer, but introduces a dependency.

pydgq_data.bin not found after pip3 install

When pydgq is installed under Python 3.6, both data files pydgq_data_27.bin (old, for Python 2.7) and pydgq_data_34.bin (compatible with 3.4 and later, tested also in 3.6) get installed under their own names, but the symlink (that should point to the correct version) fails to install.

Solution: drop Python 2.7 support in the next release, so we need only one universal data file for Python 3.x.

Workaround: meanwhile, go to your site-packages/pydgq in a terminal, and install the symlink manually. Assuming pydgq was installed with pip3 install pydgq --user under Python 3.6, the full path is ~/.local/lib/python3.6/site-packages/pydgq. Once there, ln -s pydgq_data_34.bin pydgq_data.bin. Or if using Windows, just copy the file.

Add Newton-Raphson iteration

Currently, pydgq only supports Picard (fixed-point) iteration in all implicit solvers (including the Galerkin solvers). This is the simplest thing that works, but the convergence rate is linear (constant number of added correct bits per iteration).

Newton-Raphson would be a useful option to have for improving performance, because it converges quadratically (number of correct bits doubled per iteration).

  • To make it easy to use, approximate the Jacobian with finite differences, to avoid the need for the user to provide a function for the Jacobian to be able to use Newton iteration.
  • Allow the user to optionally provide such a function, if they prefer.
  • The Right Thing for producing a Jacobian automatically is (forward-mode) automatic differentiation, but in a low-level language such as Cython this is not easy (if at all possible) to make conform to the same interface as standard double-precision floats.
  • Maybe optionally also allow a mixed scheme which starts by a user-configurable number of Picard iterations, then switches to Newton. This can sometimes help convergence (if the final value from the previous timestep is outside the basin of attraction of the Newton method; Picard is not that sensitive to the initial value).

Update contact email

The contact email in setup.py is outdated. PyPI uses it to provide the link to email the maintainer. Update it for the next release.

Add convergence tolerance setting

Currently, pydgq considers an iteration complete once all bits of the double-precision 64-bit float agree.

While this is useful for very sensitive equations (e.g. those in undamped vibration problems), for other real-world use a convergence tolerance setting would be useful.

  • Maybe options for absolute and relative.
  • Maybe default to 1e-6.
  • Let the user specify 0 to use the old behavior.

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.