Dinver: dinvermatlab

From GeopsyWiki
Revision as of 15:40, 11 March 2010 by Clotaire Michel (talk | contribs) (New page: '''dinvermatlab''' is an external plugin for dinver. It implements forward computations for any Inverse problem using Matlab. ==Installing ''dinvermatlab...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

dinvermatlab is an external plugin for dinver. It implements forward computations for any Inverse problem using Matlab.

Installing dinvermatlab

This is a hard task

Invoking dinvermatlab

Plugin selection at dinver startup

Upon dinver startup, select the Matlab forward computation module by checking the corresponding check box. See Dinver plugins for more details, especially if Matlab forward computation module does not appear by default.

The module selection can be set also directly in the command line invoking dinver:

 dinver -i dinvermatlab

Target panel

Target panel

If this panel does not appear, you can show it with menu Tools. It lets you select the information about your Matlab forward code. The different text boxes are:

  • Matlab startup is the command line that should be invoked by dinvermatlab to start Matlab. The default command is matlab -nosplash. Other options are available like -nojvm of -nodisplay to accelerate Matlab startup. See the Matlab documentation.
  • Script path is the path to the Matlab scripts the user wrote for the forward computation.
  • Init script is the Matlab script necessary to initialize the forward computation. This script is used to load data etc. This line is executed as it would be in Matlab. In case of simple commands, it is even not necessary to create a .m file.
  • Forward script is the Matlab script of the user that computes the forward model and the misfit between the forward model and the data. This line is executed as it would be in Matlab. Among its input, it should receive the DinverModel variable, a vector of real values containing the model parameters as defined in the Parameters panel. It has to output the variable DinverMisfit, containing the misfit value (real number).


Parameters panel

Parameter panel

If this panel does not appear, you can show it with menu Tools.

It defines the parameters of the forward model. The order of definition sets the order in the DinverModel vector.

Definition of a parameter

A parameter is defined writing the following command in the Parameters panel:

parameter("WritingTime","s",10,3600,"linear",1)

All the parameters should be provided. The two first variables are strings setting the name of the parameter and its unit. The variable name is used to set the conditions, for display purposes but not in the Matlab scripting. The vector containing the parameters is DinverModel (see above). The two next variables are the minimum and maximum values that can take the parameter. The fifth parameter is the scale of the parameter grid, either "linear" or "log". The last variable is the precision of the parameter grid. In "linear" scale, the precision is absolute, in "log" scale, the precision is relative. 0 is the default parameter producing 500 bins in the parameter grid. In the example, the parameter "WritingTime" can vary between 10 and 3600 seconds on a linear scale with a precision of 1 second.

Definition of conditions

Conditions between parameters can be set using the following functions in the Parameters panel, after the definition of the parameters:

  • linear is used to define a linear condition, as for example:
linear("WritingTime","<",1.5,"SleepingTime",0);

This means: . The first variable is the left hand-side parameter name, the second variable is the inequality sign "<" or ">", the third variable is the constant to multiply to the right hand-side parameter, then the right hand-side parameter and finally the constant to add to the right-hand side.

  • Any other condition type could be implemented on request to [1]