ADR suggestion: More advanced models
#195
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.
General
This is work in progress, and not the highest priority, but I need to get the thoughts written down.
Right now, the model for each data set (intensity as function of energy at a particular coordinate) is a
ComponentCollection, which is a sum of components. These can be standard components or custom components through theExpressionComponent. However, some users have more advanced needs.A simple example is the recently implemented
DeltaLorentzmodel, which includes a delta function and a Lorentzian, both multiplied by the Debye-Waller factor:where$K$ is the scale factor, $\langle u^2 \rangle$ is the mean square displacement, $Q$ is$A_0$ and $A_1$ are the relative amplitudes of the delta function and$A_0+A_1=1$ , and $L(E, \Gamma)$ is the$\Gamma$ . $A_0$ , $A_1$ and the width of the Lorentzian can be$Q$ or be allowed to vary with $Q$ .
the scattering vector,
Lorentzian, respectively, with the constraint that
Lorentzian function with width
the same at all
A more advanced example that has been requested is this beast:

Clearly, I will not be able to implement all models that user needs one by one. A more general approach is needed.
Abandon or extend
ComponentCollection?The
ComponentCollectionas the model for each coordinate may be too simple a concept, and maybe something more advanced is needed. I'm not sure yet. Perhaps the concept of a component can be expanded, or a concept of multiplying components can be introduced?A possible solution part one:
ExpressionComponentExpressionComponentcan be extended to allow standard components already in the library. So a user may writeand
A,Gamma,Gamma2would be created asParameters, and the area and center of theLorentzianwould be fixed at their default valuesA possible solution part two:
ExpressionModelThis would be a model that depends e.g. on
Qin addition toenergy. Right now I imagine the user writes the expression they want, and are allowed to makeParameters dependent on otherParameters, e.g. for Brownian diffusion:It could also be possible to specify which coordinates there are, e.g. "energy" and "Q", but I'm unsure yet.. this is just a quick draft.
There should also be a way to indicate which parameters are global and which should be allowed to be independently fitted at each Q. Something like
I'll keep thinking about this, but your thoughts are also very welcome :)
All reactions