|
From: Sathyanarayan R. <sat...@uc...> - 2017-09-19 12:48:01
|
Hello Eidors team,
I would like to know , how to set bcgnd value of Jacobian in inv_solve which is an array whose length equals no. of measurements.
Q1) when I set,
imdl.jacobian_bkgnd.value = 1./R; % where R is a homogeneous conductivity distribution,
I get the following error
In an assignment A(:) = B, the number of elements in A and B must be the
same.
Error in inv_solve_core>init_elem_data (line 450)
img.elem_data(img.params_sel{i}) = opt.prior_data{i};
Error in inv_solve_core (line 266)
img = init_elem_data(img, opt);
Error in inv_solve_gn (line 45)
img = inv_solve_core(inv_model, data1);
Error in eidors_cache>cache_shorthand (line 491)
eval(sprintf('%s = %s', output, 'feval(fhandle,args{:});'));
Error in eidors_cache (line 145)
eval(sprintf('%s = %s', output, 'cache_shorthand(command,
varargin{:});'));
Error in inv_solve (line 69)
imgc= eidors_cache( inv_model.solve, {inv_model, fdata}, 'inv_solve');
However, if I keep imdl.jacobian_bkgnd.value = 0.01 or any constant, the code runs.
Q2) What is the unit of measurement error if I inverse solve using vMes (voltage measurement)
imdl.calc_meas_icov = spdiags(1./errMeas.^2, 0, nMeas, nMeas);
imdl.meas_icov = imdl.calc_meas_icov;
Is errMeas is in volts ? or percentage error ? I evaluated the measurement voltage as
Vmes = (direct+reciprocal)./2; % mean voltage
where direct and reciprocals are measurements obtained by swapping potential and current electrodes.
errMeas = abs(direct-reciprocal); % error
Is this the right way for inserting error into inv_solve_gn ?
Q3) Why is my initial residuals always large ? For example if I use
imdl.jacobian_bkgnd.value = 0.0001;
I get
inv_solve_core: iteration 1 (residual = 1.0555e+10)
inv_solve_core: iteration 2 (residual = 4.85191e+09)
Warning: Matrix is close to singular or badly scaled. Results may be
inaccurate. RCOND = 2.583925e-26.
I thank you very much for your help.
Below is my code
clc
clear
load('matlab.mat')
imgh = mk_image(imdl.fwd_model,1);
vh = fwd_solve(imgh);
R = vh.meas./vMes;
% %----------------------------------------------------------------------
imdl.RtR_prior = @prior_tikhonov;
imdl.solve = @inv_solve_gn;
imdl.reconst_type = 'absolute';
% imdl.inv_solve_gn.min_value = 0.001;
% imdl.inv_solve_gn.max_value = 0.01;
imdl.calc_meas_icov = spdiags(1./errMeas.^2, 0, nMeas, nMeas);
imdl.meas_icov = imdl.calc_meas_icov;
imdl.hyperparameter.value = 10;
imdl.jacobian_bkgnd.value = 1./R;
imdl.inv_solve_gn.calc_solution_error = 1;
imdl.inv_solve_gn.tol = 5; % residual
imdl.inv_solve_gn.dtol = -0.0001; % stop if we dont achieve 0.01%
imdl.inv_solve_gn.max_iterations = 10;
imgr= inv_solve(imdl,vMes);
plot_image(1,2,5,imgr, 2,'inversion','\sigma(S/m)',1)
________________________________
Best Regards,
Sathyanarayan Rao, PhD student
Earth and Life Institute/Environmental Sciences (ELI-e)
Université catholique de Louvain
c.037, Croix du Sud 2, Louvain-la-Neuve, Belgium
Phone: 010473827 ( intercom 73827)
________________________________
________________________________________
From: eid...@li... <eid...@li...>
Sent: 15 September 2017 14:02
To: eid...@li...
Subject: eidors3d-help Digest, Vol 77, Issue 8
Send eidors3d-help mailing list submissions to
eid...@li...
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/eidors3d-help
or, via email, send a message with subject or body 'help' to
eid...@li...
You can reach the person managing the list at
eid...@li...
When replying, please edit your Subject line so it is more specific
than "Re: Contents of eidors3d-help digest..."
Today's Topics:
1. Re: How to set iteration numbers in INV_SOLVE_CORE
(Alistair Boyle)
----------------------------------------------------------------------
Message: 1
Date: Thu, 14 Sep 2017 11:35:34 -0400
From: Alistair Boyle <bo...@sc...>
To: Questions and discussion on EIDORS
<eid...@li...>
Cc: Mathieu Javaux <mat...@uc...>
Subject: Re: [Eidors Help] How to set iteration numbers in
INV_SOLVE_CORE
Message-ID:
<CAM...@ma...>
Content-Type: text/plain; charset="UTF-8"
Sathyanarayan,
I wrote the code in inv_solve_gn/core.
The parameters for the inverse solver need to be in the correct places
in the data structure for inv_solve_gn/core to find them:
> imdl.inv_solve_core.min_value = min(B.elem_data);
> imdl.inv_solve_core.max_value = max(B.elem_data);
Parameters being passed to inv_solve_gn (then to inv_solve_core)
should still be placed under imdl.inv_solve_gn.*.
> imdl.inv_solve_gn.min_value = min(B.elem_data);
> imdl.inv_solve_gn.max_value = max(B.elem_data);
I don't recommend that you use the max/min_value option for now. The
current implementation has a "hard" limit on the upper and lower
limits, if they are set, which does not generally result in very good
reconstructions.
> imdl.inv_solve_core.Parameters.term_tolerance = .005;
> imdl.inv_solve_core.Parameters.max_iterations = 20;
should be
imdl.inv_solve_gn.tol = 0; % stop at 1% of initial
residual (default: 0%)
imdl.inv_solve_gn.dtol = -0.0001; % stop if we don't achieve 0.01%
reduction in residual (default: -0.01%)
imdl.inv_solve_gn.max_iterations = 20;
see "help inv_solve_core" for more options.
Generally, the defaults work quite well. If the iterative solver is
stopping early it is because it is no longer making progress.
You can start from a "better place" by setting the jacobian_bkgnd. The
solver will use the jacobian_bkgnd as the prior if
imdl.inv_solve_gn.prior_data is not set. Generally, a homogeneous
estimate is used as the starting position for an absolute
reconstruction, as you've done with:
imdl.jacobian_bkgnd.value = 0.001;
You could calculate a homogeneous best fit estimate with:
imgh = mk_image(imdl.fwd_model, 1); % imgh @ 1 Ohm.m
vh = fwd_solve(imgh);
R = vh.meas \ va.meas; % va are your real measurements, R is a single
homogeneous resistivity
imdl.jacobian_bkgnd.value = 1/R; % resistivity to conductivity
or force the starting point to some arbitrary values that vary over
the reconstruction:
imdl.jacobian_bkgnd.value = B.elem_data;
The measurement noise is applied with meas_icov (the measurement
inverse covariance matrix)
noise_est = ...; % column vector, one entry per measurement
imdl.meas_icov = diag((1./noise_est).^2);
There is a somewhat trivial tutorial here:
http://eidors3d.sourceforge.net/tutorial/adv_image_reconst/basic_iterative.shtml
You could also look at the inv_solve_core help: try the working_*
parametrizations for apparent_resistivity and
log_resistivity/conductivity. These can help when there is a large
variation (orders of magnitude) between measurements
(apparent_resistivity) or reconstruction elem_data (log_resistivity).
I'm sure this could do with a good EIDORS tutorial. Its on the "to do" list.
Alistair Boyle
On Thu, Sep 14, 2017 at 10:25 AM, Sathyanarayan Rao
<sat...@uc...> wrote:
> Dear Eidors team,
>
>
> I am trying to invert a synthetic data from an image. I am using
> inv_solve_gn which then automatically uses inv_solve_core.
>
>
> My image has conductivity from 0.001 to 0.03 S/m. Even though I set maximum
> iteration to be 20, the inversion stops at
>
>
> 10 th iteration. I also tried with different synthetic data where
> conductivity varied from 0.01 to 0.03, but there the inversion
>
>
> stopped at even earlier iteration. Also the residuals are extremely large
> when they begin. I am beginner in using core solver.
>
>
> Q1) Please tell me the right way to set no. of iterations and reduce the
> initial residuals.
>
>
> Q2) The inverse model structure imdl has finer forward model and coarser rec
> model. Suppose if I have some prior information
>
>
> (Although doesn't make sense, lets say it is nothing but B.elem_data (
> original data) ) , How do I put into inverse solver
>
>
> as prior information ? ( i.e, imdl.prior_values = B.elem_data ?? )
>
>
> Q3) Suppose if I have noise information for vi2 which is the measured data,
> how do I insert into inv_solve_gn ?
>
>
> I know it exists but are there any example in EIDORS that explains how to
> insert measurement noises in absolute core solvers?
>
>
>
> Please let me know your suggestions.
>
>
>
> My code
>
>
>
> load('workspace.mat');
> vi2 = fwd_solve(B);
> imdl.RtR_prior = @prior_tikhonov;
> imdl.solve = @inv_solve_gn;
> imdl.reconst_type = 'absolute';
> imdl.inv_solve_core.min_value = min(B.elem_data);
> imdl.inv_solve_core.max_value = max(B.elem_data);
> imdl.hyperparameter.value = 10;
> imdl.jacobian_bkgnd.value = 0.001;
> imdl.inv_solve_core.calc_solution_error = 1;
> imdl.inv_solve_core.Parameters.term_tolerance = .005;
> imdl.inv_solve_core.Parameters.max_iterations = 20;
> C = inv_solve_gn(imdl,vi2);
>
>
>
>
> ________________________________
>
> Best Regards,
>
> Sathyanarayan Rao, PhD student
> Earth and Life Institute/Environmental Sciences (ELI-e)
> Universit? catholique de Louvain
> c.037, Croix du Sud 2, Louvain-la-Neuve, Belgium
> Phone: 010473827 ( intercom 73827)
>
> ________________________________
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> eidors3d-help mailing list
> eid...@li...
> https://lists.sourceforge.net/lists/listinfo/eidors3d-help
>
------------------------------
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
------------------------------
Subject: Digest Footer
_______________________________________________
eidors3d-help mailing list
eid...@li...
https://lists.sourceforge.net/lists/listinfo/eidors3d-help
------------------------------
End of eidors3d-help Digest, Vol 77, Issue 8
********************************************
|