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

Add protocols for forcing convergence of the solver #89

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

ilario
Copy link
Collaborator

@ilario ilario commented Nov 10, 2021

Here there are some files I wrote for solving some extreme parameters sets in which the PDEPE solver could not reach completion (here I refer to broken solutions as solutions that does not contain data for all the time points requested).
The simulation could break for example when trying to simulate too large times or too thick layers (in these cases it's important to tune the xmesh_coeff parameter in the input_file) or too large applied voltages/illuminations.

What the files do is trying to run a simulation splitting the time mesh in four trunks, and if the simulation breaks during one of these sub-simulations the time span is further split in 4 trunks, recursively.
Surely this is not the proper way to fix the issue, but sometimes it works.
The same result should be possible to obtain decreasing the par.MaxStepFactor but this way should be faster.
Beware that in some really extreme cases Matlab's PDEPE could enter an infinite loop and never fail nor advance.

Here a description of all the modified files:

  • Protocols/runDfFourTrunks.m runs DF recursively decreasing the simulated time span until when DF succeeds. It has been designed only for working with logarithmic time meshes.
  • Helper/mergeSolutions.m is a new helper for concatenating different solutions along their time evolution.
  • Protocols/equilibrate.m now uses runDfFourTrunks but only when running directly DF fails.
  • Protocols/jumptoV_fourTrunksSolver.m is a version of Protocols/jumptoV.m that uses runDfFourTrunks instead of executing directly DF.
  • unit_test.m added the unit testing for the new functions.
  • Analysis/compare_rec_flux.m has been adapted to not throw an error when a broken solution is provided in input. (I can move this to a separate pull request if you prefer)
  • Libraries/Index_of_Refraction_library.xls the columns for chromium and platinum has been added as found on https://www.filmetrics.com/refractive-index-database (thanks to Osbel Almora for this). (I can move this to a separate pull request if you prefer)

@ilario
Copy link
Collaborator Author

ilario commented Jan 12, 2022

The code to be merged here is evolving in parallel as I am preparing a whole branch including it. Let me know when you are going to review this and I will update.

@ilario
Copy link
Collaborator Author

ilario commented Aug 1, 2023

Ops, I used "trunks" instead of "chunks". Sorry for my poor English XD

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

Successfully merging this pull request may close these issues.

1 participant