Difference between revisions of "Dinver: dinvermatlab"

From GeopsyWiki
Jump to navigation Jump to search
(New page: '''dinvermatlab''' is an external plugin for dinver. It implements forward computations for any Inverse problem using Matlab. ==Installing ''dinvermatlab...)
 
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''dinvermatlab''' is an external plugin for [[dinver]]. It implements forward computations for any [[Wikipedia:Inverse problem|Inverse problem]] using Matlab.
+
'''dinvermatlab''' is an external plugin for [[dinver]]. It implements forward computations for any [[Wikipedia:Inverse problem|Inverse problem]] using [http://www.mathworks.com Matlab].
  
 
==Installing ''dinvermatlab''==
 
==Installing ''dinvermatlab''==
This is a hard task
+
During Geopsy installation, Matlab path has to be configured, see the [[Installation:Linux#Matlab_.28Optional.29|Installation instructions]].
  
 
== Invoking ''dinvermatlab'' ==
 
== Invoking ''dinvermatlab'' ==
Line 13: Line 13:
  
 
   dinver -i dinvermatlab
 
   dinver -i dinvermatlab
 +
 +
The use of this plugin is mostly common to [[Dinver#Generic Dinver interface|Generic Dinver interface]] except the [[#Target panel|Target]] and [[#Parameters panel|Parameters]] panels.
  
 
== Target panel ==
 
== Target panel ==
Line 18: Line 20:
 
[[Image:Dinvermat_target_panel.png|thumb|left|300px|Target panel]]
 
[[Image:Dinvermat_target_panel.png|thumb|left|300px|Target panel]]
  
If this panel does not appear, you can show it with menu [[Dinver:Menus:Tools|Tools]]. It lets you select the information about your Matlab forward code. The different text boxes are:
+
If this panel does not appear, you can show it with [[Dinver: Tools menu|Tools menu]]. 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.
 
*''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.
Line 28: Line 30:
 
== Parameters panel ==
 
== Parameters panel ==
  
[[Image:Dinvermat_parameter_panel.png|thumb|center|800px|Parameter panel]]
+
This panel is exactly the same as for the [[Dinver: dinverext#Parameters panel|External forward computation plugin]].
 
 
If this panel does not appear, you can show it with menu [[Dinver:Menus:Tools|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 [[#Target panel|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: <math>WritingTime<1.5*SleepingTime+0</math>. 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 [mailto:bug@geopsy.org]
 

Latest revision as of 16:30, 18 January 2013

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

Installing dinvermatlab

During Geopsy installation, Matlab path has to be configured, see the Installation instructions.

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

The use of this plugin is mostly common to Generic Dinver interface except the Target and Parameters panels.

Target panel

Target panel

If this panel does not appear, you can show it with Tools menu. 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

This panel is exactly the same as for the External forward computation plugin.