jakobkolb / pydivest

Analytic approximation of Agent Based Models at hand of an example from fossil fuel divestment
GNU Affero General Public License v3.0
2 stars 0 forks source link

Implement a reasonable time integration scheme for differential algebraic equations #3

Closed jakobkolb closed 8 years ago

jakobkolb commented 8 years ago

Time integration of the algebraic differential equations for investment dynamics and market clearing is a shameful hack at the moment (Gaussian integration and finding roots of the market clearing conditions at each time step). This needs to be improved for sake of numeric precision (especially as the fossil resource stock asymptotically approaches zero). Frank Hellmans Numba aware implementation of a differential algebraic systems solver would be an option. It can be found at https://gitlab.com/pik-tools/solvers

jakobkolb commented 8 years ago

Assuming equal labor productivity in both sectors, the algebraic constraint for labor market clearing can be solved analytically.

jakobkolb commented 8 years ago

The problem is obsolete since the code now features an analytic solution to the algebraic constraints in the original system. The remaining ordinary differential equations can be integrated with standard methods (scipy odeint)

jakobkolb commented 8 years ago

There are some numerical issues with the analytic solution that result in negative labor shares in the dirty sector which results in nonsensical results.