Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semi-analytic solution for DA solver using Green's function method #205

Closed
vathomass opened this issue Nov 2, 2021 · 3 comments
Closed

Comments

@vathomass
Copy link
Contributor

Hi,

Background:

The depletion approximation (DA) module currently employs the scipy boundary value numerical solver (solve_bvp) to determine the profile of the carrier concentration inside a given junction. Note that for calculating the QE and IV curves we are only interested in the derivative of the carrier concentration at a single point to compute the junction current density.

Proposal:

The differential equation in question is linear and a semi-analytic solution can be found using the Green's function method (see this wikipedia article for example). This allows to perform the calculation at a single point, substituting the boundary value problem with a numerical integration. A detailed derivation of the solution for the carrier concentration using the Green's function method can be found here, in appendix A. The mathematical model behind the DA module (the boundary value problem itself and the accompanying boundary conditions) remains totally unaffected, only the solution method changes.

Benefits:

  • Green's function method is not an approximation, but an exact (in theory) solution. The numerical approximation of the integral does introduce errors though.
  • A significant speedup is expected.
  • The main implementation (not accounting for selecting between bvp or Green's method) is few lines of code.
  • No extra dependencies are introduced into the code.

Experiment:

To quantify the 2nd point from above, I added the code to compute the solution using the Green's method into the DA solver. I can switch between the two implementation (scipy's solve_bvp and Green's method) by commenting and uncommenting specific lines of code manually. As a benchmark I used the example "3J with the DA solver" (btw the title in the documentation seems off, it reads "2J cell with the PDD solver"). The attached figures show the comparison between the results obtained using the two methods, which in my opinion are indistinguishable.
compare_iv
compare_qe

For the shake of completeness, I computed the infinity norm (maximum absolute point-wise difference) between the curves obtained from the two methods and found to be 0.002 for the QE curves and 0.133 for the IV curves.
The speedup for the QE computation for the cell including 3 junction was measured from 7.8 sec with the solve_bvp to 0.94 secs with the Green's method. The computation time for the IV curve was measured at 0.12 secs and 0.10 secs for the two methods respectively (measurement using the python datetime module).

Would you be interested in adding this solution method in Solcore5?

Best Regards,
Thomas

@jmllorens
Copy link
Contributor

Hi Thomas,

I find your approach very interesting, especially on the time reduction that might help in the inverse design of solar cells where many function evaluations are involved. Your results show a very good agreement with respect to the numerical approach. In addition, I also think that others could benefit from your implementation of the Green's function method when learning about solar cells.

Thank you for sharing.

Best regards,

José.

@dalonsoa
Copy link
Collaborator

dalonsoa commented Nov 4, 2021

Hi Thomas,

Thank you very much for taking the time to look into this. Adding the Green Functions method to the available options in Solcore has been a long standing desire for us, but never found the time - nor expertise - for doing it. So, absolutely, it will be really good to have your contribution incorporated into Solcore.

Given that you have some code already running and comparing with the existing results, I gather that much of the work is already done, but let us know if you need guidance or support of where exactly the changes should be made. Maybe the simplest thing to kick this off would be for you to open a draft PR and work on this from there.

Best wishes,
Diego

@vathomass
Copy link
Contributor Author

Hi Diego and Jose,

Thank you very for the comments.

I will proceed as Diego suggests, I will fork the project and make a draft pull request as soon as I have something concrete for you to review. For sure at some point I will need some guidance on which is the best way to implement the switching between different solving methods, but we can leave this for later.

I hope to have something probably in one week or two.

Best Regards,
Thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants