QuantEcon / QuantEcon.py

A community based Python library for quantitative economics
https://quantecon.org/quantecon-py/
MIT License
1.9k stars 2.25k forks source link

Orthogonal collocation solver for two-point boundary value problems #127

Open davidrpugh opened 9 years ago

davidrpugh commented 9 years ago

@jstac @albop @spencerlyon2 @mmcky

I have implemented a generic solver that uses projection methods to solve systems of non-linear differential equations with boundary conditions.

Currently I have implemented collocation using orthogonal polynomials (typically Chebyshev) as basis functions. In near future (next week?) I will finish implementing a simple finite elements approach using B-splines as basis functions.

The orthogonal collocation solver is fast and accurate. But documentation is still lacking and I only have two (slightly messy) example notebooks that demonstrate how to use the solver: one for a Solow model and another for a Ramsey-Cass-Koopmans model. I am particularly keen to provide some microeconomic examples (perhaps auction models?) in addition to gathering more macro models (Romer growth model, search and match models, Tobin's q, credit-cycles, etc)

As always, feedback is much appreciated.

davidrpugh commented 8 years ago

@jstac @albop @mmcky

I am continuing to make slow but steady progress implementing my boundary value problem solver. At the moment it mimics closely the functionality of the CompEcon colode.m routine.

Thoughts on including this in QuantEcon at some point?

davidrpugh commented 8 years ago

@jstac @cc7768 @spencerlyon2 @mmcky

I would be keen to include pyCollocation in quantecon. PyCollocation uses a collocation method to solver boundary value problems. PyCollocation mimics the functionality of the CompEcon colode.m routine, but is more general. Here is an example notebook demonstrating basic usage and functionality.

The code is well tested, but needs better documentation, a slight polish, and perhaps some more example use cases.

Thoughts are much appreciated...

D

jstac commented 8 years ago

@davidrpugh Sorry for the delay in getting back to you! Things have been a bit crazy.

This looks nice to me and the code is clean and nicely documented, as usual. (I guess the last two notebooks need a bit of discussion...)

I imagine there would be demand for this. @cc7768 @spencerlyon2 Any thoughts?

davidrpugh commented 8 years ago

@jstac

Thanks. As I said I think that the code does need a bit more polishing and I would like to include some more example notebook demonstrating usage. One question that I have is exactly where in quantecon the package belongs? One thought would be to create a odes package in quantecon and then include a bvp sub-package (probably would be a good idea to move the ivp module into this new odes package as well). Canonical import would be something like...

from quantecon import odes

...thoughts?