This page demonstrates the use of the 'getMostRelevantRun' method. This method is intended to help users to find those simulation runs in SMDB's tree.xml file whose input parameters best match the given solar wind conditions. For each simulation run in the tree.xml file the method computes a 'difference index'. This 'difference index' is a sum of individual difference indices (one for each solar wind parameter defined in the input parameter set). If valuesw, scalesw and weightsw denote the value, scale and weight, respectively, of given input value for solar wind parameter 'sw' and valuesw(i) is the value of this solar wind parameter for i'th run then the difference index for this run (i) is computed as
S_diff(i) = ∑ weight_sw * [(value_sw - value_sw(i))/scale_sw]^2
where the sum runs over all given solar wind parameters 'sw'. The smaller the 'difference index' the better the match. A perfect match will give 'difference index' zero.
As an output the method returns the list of matching runs ordered according to the total difference index in ascending order. So the 'most relevat run' is the first element. The list is in json format. The structure of the json string is displayed when clicking in the 'Show json' button at the bottom of the page.
To use this demo fill all necessary fields in the 'Input parameters' table below. For those solar wind parameters that you want to be taken into account in the fitting procedure set the 'value' to the desired value, for other fields leave the 'value' field empty. The 'weight' and 'scale' fields are set to default values but may be freely edited. Note that the input solar wind parameters in the getMostRelevantRun method must be expressed in base SI units (m, m/s, T, 1/m^3, ...) !
The SW_function input parameter allows user to define his/her own input parameter which is a combination of other solar wind input parameters. The SW_Function's 'function' parameter is a string which defines the expression how this input parameter is constructed. The variable names for the solar wind parameters used in this string are same as the names of the input parameters (i.e. 'SW_Density', 'SW_Temperature', 'SW_Bot', ...). Standard math functions (sqrt, sin, abs, ...) which are available in PHP may be used.
An example: The user wants to find runs where the ratio |Bx/Btot| is near to one. Then he/she may set the function string as 'abs(SW_Bx/SW_Btot)' and value -> 1, weight -> 1 and scale -> 1.