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

Deleted simple model and restructure Yukawa #315

Merged
merged 11 commits into from
Oct 24, 2024
Merged

Conversation

jorindevandevis
Copy link
Collaborator

Got rid of the simple model. This was a funny modification of the Yukawa model, implemented to present in section 2 of the paper.
The reason I didn't use the Yukawa model, was that it seemed like the equations couldn't be solved with conservation of EM and I didn't want to present that feature in the simplest model.
After a bug was found in the Yukawa model, it turned out to work well, so the simple model isn't needed anymore.

I restructured the Yukawa model into two parts:

  • one very simple file that computes vw, but needs pre-computed vws
  • a file that uses the example base class and that can also compute the collision integrals

I also changed the spatial gridsize from 50 to 20 (which only led to a very small modification of vw), because this speeds up the computation a lot.

@benoitlaurent96
Copy link
Collaborator

I pushed a commit to load the config file in yukawa.py. I noticed phaseTracerTol is set to 1e-8 in the config file, while the default is 1e-6, so that's probably what caused the problem. I also increased maxIterations to 25, otherwise it didn't have enough time to converge.

@benoitlaurent96
Copy link
Collaborator

I'm not sure what would be the best way to change the configs. Since this is supposed to be a very simple example, maybe it would be better to avoid loading a file, and just change them manually. In any case, I think it would be a good idea to include some comments to explain what configs are changed and why we didn't use the default value.

@jorindevandevis
Copy link
Collaborator Author

On the other hand, loading a file is just two lines, and updating those configuration settings compared to the defaults takes three lines. And also if we don't load the model-specific config file, we might get in trouble again if we change another default value.
But it is fine to include some comments. Did you put the phasetracertol to 1e-8 and do you remember why? @benoitlaurent96 or was it @og113 ?

@og113
Copy link
Collaborator

og113 commented Oct 23, 2024

On the other hand, loading a file is just two lines, and updating those configuration settings compared to the defaults takes three lines. And also if we don't load the model-specific config file, we might get in trouble again if we change another default value. But it is fine to include some comments. Did you put the phasetracertol to 1e-8 and do you remember why? @benoitlaurent96 or was it @og113 ?

I don't remember setting this phasetracertol, but it's not impossible that I did. If so, the reason is surely irrelevant now, given that there were bugs in the old Yukawa model implementation.

@benoitlaurent96
Copy link
Collaborator

On the other hand, loading a file is just two lines, and updating those configuration settings compared to the defaults takes three lines. And also if we don't load the model-specific config file, we might get in trouble again if we change another default value. But it is fine to include some comments. Did you put the phasetracertol to 1e-8 and do you remember why? @benoitlaurent96 or was it @og113 ?

It's a bit simpler in the python file, but you need a whole config file. The advantage of changing the configs manually is that the user could simply copy and paste the code and run it directly. But I'll let you decide, I don't really mind.
I think I'm the one who changed phaseTracerTol, but it was before the bug was fixed. In any case, it still seems to be important since that's what was causing this weird bug for some of us. My guess is that the phase tracing becomes unstable otherwise.

@jorindevandevis
Copy link
Collaborator Author

jorindevandevis commented Oct 24, 2024

Okay, you convinced me. Another reason for overwriting them explicitly is that we don't do that in any other example file, so this way we at least provide an example of that.
I removed the logging btw, I guess the users don't want to use debugging logging for this model, right?

@benoitlaurent96
Copy link
Collaborator

That looks good! Maybe you can delete the config file since it is not used anymore. Also, that would be good to add a few comments about the parameters that are modified.

@jorindevandevis jorindevandevis merged commit 40b69fa into main Oct 24, 2024
3 checks passed
@jorindevandevis jorindevandevis deleted the deleteSimpleModel branch October 24, 2024 20:52
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.

3 participants