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

Update the constant-pH tutorial #4262

Merged
merged 10 commits into from
Jul 22, 2021

Conversation

kosovan
Copy link
Contributor

@kosovan kosovan commented May 27, 2021

Fixes #3941

Description of changes:

  • add prior knowledge, make equations and units more consistent
  • add a flag to run electrostatics with Debye-Hückel instead of P3M
  • accelerate tutorial with DH, cell system, non-interacting particle type
  • fix ambiguous explanations

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@kosovan
Copy link
Contributor Author

kosovan commented May 27, 2021

Some interesting observations on speedup:

  • RE.set_non_interacting_type(len(TYPES)) speeds up the calculation of interacting system roughly by a factor of 2.0.
  • Replacing P3M with DH makes the calculation with electrostatics almost as fast as without
  • If we do reaction in every cycle and integration just in some cycles, we save the amount of runtime roughly proportional to PROB_INTEGRATION. In the previous version we were doing the opposite, so we were wasting some 50% of the reaction samples.

If the non_interacting_type has such an effect on the speed, I think it is desired to give it a fixed and low value, or to set dynamically to the lowest possible value that is available.

Maybe we should consider using some of these tricks also in the tests of the RxMC and cpH algorithms. It is not important to get perfectly correct physics but to ensure that we can still reproduce the titration curve of an interacting system if we change something in the algorithm. What do you think of that? @jngrad @RudolfWeeber

@jngrad jngrad requested a review from davidbbeyer June 3, 2021 19:03
@jngrad
Copy link
Member

jngrad commented Jun 7, 2021

Maybe we should consider using some of these tricks also in the tests of the RxMC and cpH algorithms.

Good idea, I can have a look at this later this week to speed up the testsuite, and mention it in the docs too.

A couple of tests did not pass CI. Let us know when you are ready with the PR and we'll review it.

@kosovan kosovan marked this pull request as ready for review July 14, 2021 16:32
@kosovan kosovan changed the title WIP changes to the cph tutorial Changes to the cph tutorial Jul 14, 2021
@kosovan
Copy link
Contributor Author

kosovan commented Jul 14, 2021

TODO: before this PR is merged, we should change the initial set of parameters back to the ideal system and clear the cells with solutions of the excercises.

kosovan added 3 commits July 21, 2021 14:58
prob_reaction, more on Bjerrum and thermodynamics. Use easier-to-read
nested cycles for non-bonded interactions between all particle pairs.
@jngrad jngrad self-requested a review July 21, 2021 15:09
@jngrad jngrad self-assigned this Jul 21, 2021
@jngrad jngrad force-pushed the cph-tutorial-cleanup branch from b8013b6 to e0db850 Compare July 21, 2021 17:14
jngrad added 3 commits July 21, 2021 19:38
Properly stylize "pH" and "pKa" throughout the text.
Fix plot labels, typos and formatting. Address TODOs.
Make citations link to the bibliographic entries and
cleanup links to the user guide. Run the tutorial
without electrostatics to reproduce the ideal case.
@jngrad jngrad force-pushed the cph-tutorial-cleanup branch from e0db850 to b0e3b57 Compare July 21, 2021 17:47
@jngrad jngrad changed the title Changes to the cph tutorial Update the constant-pH tutorial Jul 21, 2021
@jngrad jngrad added this to the Espresso 4.2 milestone Jul 21, 2021
Copy link
Member

@jngrad jngrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvements!

@jngrad jngrad added the automerge Merge with kodiak label Jul 22, 2021
@kodiakhq kodiakhq bot merged commit 1bd1d1a into espressomd:python Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue tracker for Tutorial 12
3 participants