ADR suggestion: Improving DiffusionModels
#190
henrikjacobsenfys
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
General
This is a work in progress, initiated by users wanting the following model, tentatively named
DeltaLorentz:where$K$ is the scale factor, $\langle u^2 \rangle$ is the mean square displacement, $Q$ is the scattering vector, $A_0$ and $A_1$ are the relative amplitudes of the delta function and Lorentzian, respectively, with the constraint that $A_0+A_1=1$ , and $L(E, \Gamma)$ is the Lorentzian function with width $\Gamma$ .
Parameters will be created for eachQ.This means the model needs to know and store what
Qis, which is a change from how the other models work. This is already an old issue #77. Since we're anyway rewriting the models, we may as well solve #76 as well (i.e. extend the test coverage).Files that will be impacted
This will require changes in all diffusion models (
DiffusionModelBase,BrownianTranslationalDiffusion,JumpDiffusion), as well as some (minor) changes toSampleModel`.ParameterAnalysiswill also need to be updated. Until now, aDiffusionModelgenerated a singleLorentzian, whichParameterAnalysiscould then handle. With the newDeltaLorentz, this will need to be generalized by updatingParameterAnalysisandFitBinding. More advanced models of diffusion, general Q dependence and general coordinate dependence (#177 ) will alsos need to be supported. A minimal working model will be implemented at first.Storing
QI will use the same approach as
SampleModeluses, which is to only allow settingQonce. This is because changingQchanges the parameters inside which may lead to loss of information if e.g. a fit has been performed`ComponentCollection's
With
DiffusionModels owningQ, they will also store their ownComponentCollections. In this way, they look more and more likeModelBase- perhaps some refactoring can/should be done there, but it will have to wait a bit since I need to get this working asap (there's a school on 12th of June where it needs to work)Storing the parameters
I'm a bit unsure what the best way to store the parameters is. A list that matches Q is probably the simplest, but is it the best? What should the parameters be named (by Q index or Q value or something else?)
get_all_variables()This method needs to be extended to take a Q index, which is something
SampleModelalso already does. The otherget_all_...methods may also need to be extended.Name change
This model not necessarily a model of diffusion. However, what it and all the present and planned
DiffusionModels have in common is their Q dependence. Therefore, they would be more aptly namedQ_dependent_modelsor something similar. Ideas are welcome. (This also generalises to later when people may wantT_dependent_modelsor similar, #177 )Beta Was this translation helpful? Give feedback.
All reactions