|
Chapters:
|
MuSR /
LinearRelations< Double fit in Ver. 2.0 | Index | How to recompile the *load.mex* routines > There is a newer version of these instructions here How to use Linear Relations
How shared are implemented in v. 1.04Linear Relations '+' are detected but not implemented. Remember that inside mulab four types of indices are used for different functions on each parameter:
To share the same value among more parameters, a SOURCE and one or more TARGETS, the TARGET parameter flags must be set to
The component index of the TARGET, p=par(MU_MODEL.COMPONENT(k).SHARE); generates exactly the parameters p needed by the component function, e.g. muprecession(p,data) eval(['f=[f; ' char(MU_COMPONENT.DEFINITION(kk)) '];']) How to implement Linear Relations in v 1.05Example of fit with two linear relations
Parsing correct syntax: the string must be a valid matlab expression for '~' and '!' it must be 'p(m)' for parameter n (m is the fminuit index of Menu n) for '=' it must be 'p(k)' for TARGET parameter n (k is the fminuit index of the SOURCE parameter) for '+' it must translate with a similar recipe a more complex statement, see the example above The translation makes use of the local shareglobal array to remap indices. Two passages to allow The local array share, saved in MU_MODEL.COMPONENT(kc).SHARE, is still used in extracting values, Finally command='[';
p=par; % restarts from fminuit input
for kp=1:MU_MODEL.COMPONENT(kc).PARAMETERNUMBER
command=[command MU_MODEL.COMPONENT(kc).PARAMETER(kp).MENU2MINUIT ' '];
end
command=[command '];']; % command contaiNs something like '[p(4) p(1)*0.333 p(2) ];'
p=eval(command); % now p contains the right parameters for component kc
prior to eval(['f=[f; ' char(MU_COMPONENT.DEFINITION(kc)) '];']) %calculates the component All the routines involved
checks that
as many 'p(' and ')' appear,
the intervening characters represent an integer
all integers correspond to existing variable parameters
called by
called by
called by
< Double fit in Ver. 2.0 | Index | How to recompile the *load.mex* routines > |