e i d o r s - ejw - about i d o r s electrical impedance ... – damped gauss-newton ... part i. e i...
TRANSCRIPT
![Page 1: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/1.jpg)
E I D O R S Electrical Impedance Tomography and Diffuse Optical Tomography Reconstruction Software
Sujin Ahn
2011. 11. 24
GIST
Kyung Hee University, 2011 1
![Page 2: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/2.jpg)
Contents
• Introduction
• Part I. EIDORS
– 2D model
– 3D model
• Part II. NETGEN
• Exercise
Kyung Hee University, 2011 2
![Page 3: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/3.jpg)
• Let Ω be an imaging object with boundary 𝜕Ω.
• Forward problem
– Given current injection sources and sinks on 𝜕Ω, and admittivity 𝛾 over Ω, find the boundary electric potential 𝑉 on 𝜕Ω.
• Inverse problem
– For a given set of boundary voltage 𝑉 and injected currents 𝐼 at the boundary 𝜕Ω, recover the admittivity 𝛾 inside Ω.
Kyung Hee University, 2011 3
EIT problem
Admittivity Boundary Voltage
Forward
Inverse
Given model, injected current
![Page 4: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/4.jpg)
• Assumptions for imaging object Ω – No interior sources of charges – Quasi-static fields
𝛻 ⋅ 𝛾 𝐫 𝛻𝑢𝑗 𝐫 = 0 in Ω
𝑢𝑗 + 𝑧𝑘𝛾𝜕𝑢𝑗
𝜕𝐧 𝜀𝑘
= 𝑉𝑗,𝑘 for 𝑘 = 1, … , 𝐿
𝛾𝜕𝑢𝑗
𝜕𝐧= 0 on 𝜕Ω\ 휀𝑘
𝐿
𝑘=1
𝛾𝜕𝑢𝑗
𝜕𝐧𝜀𝑘
𝑑𝑠 = 0 if 𝑘 ∈ 1, … , 𝐿 \*𝑗 − 1, 𝑗+
𝛾𝜕𝑢𝑗
𝜕𝐧𝜀𝑗
𝑑𝑠 = 𝐼 = − 𝛾𝜕𝑢𝑗
𝜕𝐧𝜀𝑗−1
𝑑𝑠
Kyung Hee University, 2011 4
FEM formulation FEM formulation
Complete Electrode Model
![Page 5: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/5.jpg)
• Assembled Complete System
• 𝑨𝑴 𝑖, 𝑗 = 𝛾𝛻𝑢𝑖 ⋅ 𝛻𝑢𝑗𝑑𝐫 , Ω
𝑨𝒛 𝑖, 𝑗 = 1
𝑧𝑘𝑢𝑖𝑢𝑗𝜀𝑘
𝑑𝑠𝐿𝑘=1
• 𝑨𝑽 𝑖, 𝑘 = − 1
𝑧𝑘𝑢𝑖𝜀𝑘
𝑑𝑠, 𝑨𝑫 𝑠, 𝑘 =
1
𝑧𝑘𝑒𝑘 𝑖𝑓 𝑠 = 𝑘
0 𝑖𝑓 𝑠 ≠ 𝑘
1 ≤ 𝑖, 𝑗 ≤ 𝑛𝑣 # of vertices , 1 ≤ 𝑠, 𝑘 ≤ 𝐿 # of electrodes
↔ Ax=b
Kyung Hee University, 2011 5
FEM formulation FEM formulation (forward)
𝑢
v
𝐴𝑀 + 𝐴𝑧 𝐴𝑉
𝐴𝑉𝑇 𝐴𝐷
L
L
𝒏𝑽
𝒏𝑽
× =
0
I
u : nodal potential v : boundary voltage
![Page 6: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/6.jpg)
• How to solve Ax=b
– Conjugate Gradient (CG)
– General Minimal Residual (GMRes)
– Bi-Conjugated Gradients
(BiCG, CGS, BiCGStab)
– Quasi Minimal Residual
(QMR, Symmetric QMR)
,etc.
Kyung Hee University, 2011 6
FEM formulation FEM formulation (forward)
![Page 7: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/7.jpg)
• The admittivity 𝛾 is formulated by a least-square minimum of the residual error 𝐹 𝛾 − 𝑉𝑚 which is
𝛾∗ = argmin𝛾 1
2𝐹 𝛾 − 𝑉𝑚
2
where 𝐹: 𝐶𝑛𝐸 → 𝐶𝐿 (forward operator)
Kyung Hee University, 2011 7
FEM formulation FEM formulation (inverse)
![Page 8: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/8.jpg)
• Let D 𝛾 = 𝐹 𝛾 − 𝑉𝑚.
• D 𝛾 + 𝛿𝛾 ≈ 𝐷 𝛾 + 𝐷′ 𝛾 𝛿𝛾 +1
2𝐷′′ 𝛾 𝛿𝛾2 + 𝑂 𝛿𝛾3
(Taylor expansion)
• 𝐷 𝛾 + 𝛿𝛾 ≈ 0 for appropriate 𝛿𝛾
Neglecting 2nd order terms and above
𝐷 𝛾 = −𝐷′ 𝛾 𝛿𝛾
𝐷′ 𝛾 =𝜕𝐹 𝛾 𝑑𝑚
𝜕𝜎𝑘= − 𝛻𝑢 𝐼𝑑 𝛻u I𝑚 𝑑𝑉
𝑣𝑜𝑥𝑒𝑙 𝑘
where 𝑢(𝐼𝑑) is the potential for the d-th drive pattern, 𝑢 𝐼𝑚 is the hypothetical measurement potential.
Our goal is to find a proper 𝛅𝛄 to get 𝜸∗ by iterative or single step!
Kyung Hee University, 2011 8
FEM formulation FEM formulation (linearization)
![Page 9: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/9.jpg)
• For difference imaging, let 𝐽 = 𝐷′ 𝛾 , 𝐹 𝛾 ≈ 𝑉0 where 𝑉0 is the voltage when Ω is homogeneous.
𝐽 𝛿𝛾 = 𝑉𝑚 − 𝑉0
𝛿𝛾 = 𝐽†(𝑉𝑚 − 𝑉0) ,
where 𝐽† is a pseudo-inverse matrix of 𝐽.
1. When 𝐽 (with size nr x nc) is full rank, 𝐽† can be
directly calculated as follows;
– nr < nc 𝐽† = 𝐽𝑇 𝐽 𝐽𝑇 −1
– nr > nc 𝐽† = 𝐽𝑇𝐽 −1𝐽𝑇
2. When 𝐽 is not full rank, 𝐽† is generally computed
by Singular Value Decomposition (SVD)
Kyung Hee University, 2011 9
FEM formulation FEM formulation (linearization)
![Page 10: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/10.jpg)
• Let 𝐽 ∈ 𝑅𝑟 × 𝑐.
∃ 𝑈 ∈ 𝑅𝑟×𝑟 , 𝑉 ∈ 𝑅𝑐×𝑐 s. t. J = U Σ 𝑉𝑇
where U, V are orthogonal matrices and Σ ∈ 𝑅𝑟×𝑐 is a diagonal matrix whose diagonal consists of the singular values *𝜎𝑖+ of 𝐽.
𝐽† = V Σ† 𝑈𝑇
where Σ† is Σ𝑇 with nonzero 𝜎𝑖 replaced by 1/𝜎𝑖.
Kyung Hee University, 2011 10
FEM formulation FEM formulation (SVD)
![Page 11: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/11.jpg)
• In our 2D model, singular values after 50th value are almost zero.
Replace 𝜎51, … 𝜎208 by zero before taking inversion.
It is important to find the singular value at which the normalized value suddenly drops!
Kyung Hee University, 2011 11
FEM formulation FEM formulation (Truncated SVD)
𝐽 = 𝑈Σ𝑉𝑇
![Page 12: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/12.jpg)
• How to solve 𝛾∗ = argmin𝛾 1
2𝐹 𝛾 − 𝑉𝑚
2
– Truncated SVD
– Steepest Descent
– Newton-Raphson
– Damped Gauss-Newton
– Levenberg-Marquardt
– Quasi-Newton
, etc.
Kyung Hee University, 2011 12
FEM formulation FEM formulation (inversion methods)
![Page 13: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/13.jpg)
Part I. E I D O R S
Kyung Hee University, 2011 13
![Page 14: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/14.jpg)
• Free software algorithms for forward and inverse modeling for EIT and Diffusion based Optical tomography
• Requirement
– Matlab (≥ 7.0) or Octave (≥ 3.4)
– Netgen Mesher
• http://eidors3d.sourceforge.net
Kyung Hee University, 2011 14
EIDORS
![Page 15: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/15.jpg)
To try the EIDORS software, follow these steps: 1. Download the software
− Release Version: EIDORS 3.5 (14 Jul 2011)
2. Unzip the software in a directory /path/to/eidors or C:/path/to/eidors
3. Start Matlab
4. type: >>run /path/to/eidors/startup.m (windows >>run C:/path/to/eidors/startup.m)
5. Execute one of the sample programs in the /path/to/eidors/examples directory (such as demo_real.m)
Kyung Hee University, 2011 15
Getting Started
![Page 16: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/16.jpg)
Kyung Hee University, 2011 16
Flow chart for numerical simulation
Inverse computation
Visualization
Model generation
Forward computation
Dense mesh
• mk_common_model • ng_mk_cyl_models
• fwd_solve
• Recover admittivity
• inv_solve • calc_jacobian
Model generation
Forward computation
Coarse mesh
• fwd_solve
Synthetic data
𝐽 𝛿𝛾 = 𝑉𝑚 − 𝑉0
• show_fem • show_slices
![Page 17: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/17.jpg)
Startup;
% Generate 2D mesh
imb= mk_common_model('c2c',16);
e= size(imb.fwd_model.elems,1); bkgnd= 1;
% Solve Homogeneous model
img= eidors_obj('image','');
img.elem_data= bkgnd * ones(e,1);
img.fwd_model= imb.fwd_model;
vh= fwd_solve( img );
% Add Two triangular elements
img.elem_data([25, … ,121:124])=bkgnd * 2;
img.elem_data([95, … , 22])=bkgnd * 2;
vi= fwd_solve( img );
% Add -12dB SNR
vi_n= vi;
nampl= std(vi.meas - vh.meas)*10^(-18/20);
vi_n.meas = vi.meas + nampl *randn(size(vi.meas));
show_fem(img); axis square; axis off
Kyung Hee University, 2011 17
EIDORS (2D model, forward)
mk_common_model (mdlstr, n_elec) • Utility function to create common
EIT 2D/3D FEM models • Several templates for models e.g. mk_common_model('c2C',16) - 2D circ model with 576 elems)
![Page 18: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/18.jpg)
% Generate 2D mesh
imb= mk_common_model('c2c',16);
e= size(imb.fwd_model.elems,1); bkgnd= 1;
% Solve Homogeneous model
img= eidors_obj('image','');
img.elem_data= bkgnd * ones(e,1);
img.fwd_model= imb.fwd_model;
vh= fwd_solve( img );
% Add Two triangular elements
img.elem_data([25, … ,121:124])=bkgnd * 2;
img.elem_data([95, … , 22])=bkgnd * 2;
vi= fwd_solve( img );
% Add -12dB SNR
vi_n= vi;
nampl= std(vi.meas - vh.meas)*10^(-18/20);
vi_n.meas = vi.meas + nampl *randn(size(vi.meas));
show_fem(img); axis square; axis off
Kyung Hee University, 2011 18
EIDORS (2D model, forward)
![Page 19: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/19.jpg)
% Generate 2D mesh
imb= mk_common_model('c2c',16);
e= size(imb.fwd_model.elems,1); bkgnd= 1;
% Solve Homogeneous model
img= eidors_obj('image','');
img.elem_data= bkgnd * ones(e,1);
img.fwd_model= imb.fwd_model;
vh= fwd_solve( img );
% Add Two triangular elements
img.elem_data([25, … ,121:124])=bkgnd * 2;
img.elem_data([95, … , 22])=bkgnd * 2;
vi= fwd_solve( img );
% Add -12dB SNR
vi_n= vi;
nampl= std(vi.meas - vh.meas)*10^(-18/20);
vi_n.meas = vi.meas + nampl *randn(size(vi.meas));
show_fem(img); axis square; axis off
Kyung Hee University, 2011 19
EIDORS (2D model, forward)
eidors_obj (type, name, varargin) • Constructor to create a eidors
structure • USAGE: as a constructor
- type: obj type: fwd_model, inv_model, data, image
- name: text string identifier for model (may be '')
- varargin: properites and values for object
![Page 20: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/20.jpg)
% Generate 2D mesh
imb= mk_common_model('c2c',16);
e= size(imb.fwd_model.elems,1); bkgnd= 1;
% Solve Homogeneous model
img= eidors_obj('image','');
img.elem_data= bkgnd * ones(e,1);
img.fwd_model= imb.fwd_model;
vh= fwd_solve( img );
% Add Two triangular elements
img.elem_data([25, … ,121:124])=bkgnd * 2;
img.elem_data([95, … , 22])=bkgnd * 2;
vi= fwd_solve( img );
% Add -12dB SNR
vi_n= vi;
nampl= std(vi.meas - vh.meas)*10^(-18/20);
vi_n.meas = vi.meas + nampl *randn(size(vi.meas));
show_fem(img); axis square; axis off
Kyung Hee University, 2011 20
EIDORS (2D model, forward)
fwd_solve(img) • Calculate data from a fwd_model
object and an image
![Page 21: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/21.jpg)
% Generate 2D mesh
imb= mk_common_model('c2c',16);
e= size(imb.fwd_model.elems,1); bkgnd= 1;
% Solve Homogeneous model
img= eidors_obj('image','');
img.elem_data= bkgnd * ones(e,1);
img.fwd_model= imb.fwd_model;
vh= fwd_solve( img );
% Add Two triangular elements
img.elem_data([25, … ,121:124])=bkgnd * 2;
img.elem_data([95, … , 22])=bkgnd * 2;
vi= fwd_solve( img );
% Add -12dB SNR
vi_n= vi;
nampl= std(vi.meas - vh.meas)*10^(-18/20);
vi_n.meas = vi.meas + nampl *randn(size(vi.meas));
show_fem(img); axis square; axis off
Kyung Hee University, 2011 21
EIDORS (2D model, forward)
Show_fem (img, options) • Show the EIDORS finite element
model • options specifies a set of options - options(1): show colorbar - options(2): show numbering on electrodes - options(3): number elements (=1) or nodes (=2);
![Page 22: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/22.jpg)
% Create Inverse Model
inv2d= eidors_obj('inv_model', 'EIT inverse');
inv2d.reconst_type= 'difference';
inv2d.jacobian_bkgnd.value= 1;
% This is not an inverse crime;
(inv_mdl ≠ fwd_mdl)
imb= mk_common_model('b2c',16);
inv2d.fwd_model= imb.fwd_model;
inv2d.fwd_model.np_fwd_solve.perm_sym= '{y}';
% Guass-Newton solvers
inv2d.solve= @np_inv_solve;
% Tikhonov prior
inv2d.hyperparameter.value = 1e-3;
inv2d.RtR_prior= @tikhonov_image_prior;
inv2d.saveon=0;
imgr= inv_solve( inv2d, vh, vi);
Kyung Hee University, 2011 22
EIDORS (2D model, inverse)
Several options for computing prior matrix @tikhonov_image_prior; @noser_image_prior, @laplace_image_prior @gaussian_HPF_prior @ab_calc_tv_prior (total variation)
![Page 23: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/23.jpg)
% Create Inverse Model
inv2d= eidors_obj('inv_model', 'EIT inverse');
inv2d.reconst_type= 'difference';
inv2d.jacobian_bkgnd.value= 1;
% This is not an inverse crime;
(inv_mdl ≠ fwd_mdl)
imb= mk_common_model('b2c',16);
inv2d.fwd_model= imb.fwd_model;
inv2d.fwd_model.np_fwd_solve.perm_sym= '{y}';
% Guass-Newton solvers
inv2d.solve= @np_inv_solve;
% Tikhonov prior
inv2d.hyperparameter.value = 1e-3;
inv2d.RtR_prior= @tikhonov_image_prior;
inv2d.saveon=0;
imgr= inv_solve( inv2d, vh, vi);
Kyung Hee University, 2011 23
EIDORS (2D model, inverse)
inv_solve (inv_model, data1, data2) • Calculate ‘difference’ image from
an inv_model and data • data1 : reference data
(homogeneous or @low freq) • data2 : perturbed data (inhomogeneous or @high freq) inv_solve (inv_model, data) • Calculate ‘static’ image from an
inv_model and data
![Page 24: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/24.jpg)
Kyung Hee University, 2011 24
3D model I
% Generate 3d model imb= mk_common_model('n3r2',16); e= size(imb.fwd_model.elems,1); bkgnd= 1; % Homogenous Data img= eidors_obj('image','Demo Image'); img.elem_data= bkgnd*ones(e,1); img.fwd_model= imb.fwd_model; vh= fwd_solve( img ); % Inhomogenous Data load datacom A B; img.elem_data(A)= bkgnd*1.2; img.elem_data(B)= bkgnd*0.8; clear A B; vi= fwd_solve( img ); % Add 12dB noise vi_n= vi; vi_n.meas = vi.meas + std(vi.meas - vh.meas)/10^(12/20) ... *randn(size(vi.meas)); sig= sqrt(norm(vi.meas - vh.meas));
% Create Inverse Model
inv3d= eidors_obj('inv_model', 'EIT inverse');
inv3d.reconst_type= 'difference'; inv3d.jacobian_bkgnd.value = 1;
inv3d.fwd_model= imb.fwd_model; inv3d.fwd_model.np_fwd_solve.perm_sym= '{y}';
inv3d.saveon=0;
% Gauss-Newton Solver
inv3d.hyperparameter.value = 1e-3;
inv3d.solve= @np_inv_solve;
% Tikhonov prior
inv3d.R_prior= @tikhonov_image_prior;
imgr= inv_solve( inv3d, vh, vi);
Forward Inverse
![Page 25: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/25.jpg)
Kyung Hee University, 2011 25
3D model II
% Generate cylinder model
fmdl =ng_mk_cyl_models([2,1,0.1],[16,1],[0.05]); fmdl.stimulation = mk_stim_patterns(16,1,[0,1],[0,1],{},1);
% Homogeneous object
imgh= mk_image( fmdl, 1 );
% Fwd Simulation
vh = fwd_solve( imgh);
% Target Object
select_fcn = inline('(x-0.2).^2 + (y-0.5).^2 + (z-1).^2<0.1^2','x','y','z');
memb_frac = elem_select( imgh.fwd_model, select_fcn);
imgt= mk_image( fmdl, 1 + memb_frac );
% Fwd Simulation
vt = fwd_solve( imgt);
% Add SNR 2.0 noise
vn = add_noise(4, vt, vh);
% Create Inverse Model fmdlt=ng_mk_cyl_models([2,1,0.2],[16,1], 0.05); fmdlt.stimulation = mk_stim_patterns(16,1,[0,1],[0,1],{},1); img= mk_image( fmdlt, 1 ); inv3d= eidors_obj('inv_model', 'EIT inverse'); inv3d.reconst_type= 'difference'; inv3d.jacobian_bkgnd.value = 1; inv3d.fwd_model= img.fwd_model; inv3d.fwd_model.np_fwd_solve.perm_sym= '{y}'; inv3d.saveon=0; %% Gauss-Newton Solver inv3d.hyperparameter.value = 1e-3; inv3d.solve= @np_inv_solve; %% Tikhonov prior inv3d.R_prior= @tikhonov_image_prior; imgr= inv_solve( inv3d, vh, vn);
Forward Inverse
![Page 26: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/26.jpg)
Part II. Mesh generation
Kyung Hee University, 2011 26
![Page 27: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/27.jpg)
• NETGEN is an automatic 3d tetrahedral mesh generator, developed by Joachim Schöberl
• http://sourceforge.net/projects/netgen-mesher/
• Getting started 1. Go to the NETGEN path
2. Run netgen.exe
Kyung Hee University, 2011 27
FEM formulation NETGEN
![Page 28: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/28.jpg)
Kyung Hee University, 2011 28
FEM formulation NETGEN
![Page 29: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/29.jpg)
Kyung Hee University, 2011 29
FEM formulation NETGEN
![Page 30: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/30.jpg)
Kyung Hee University, 2011 30
FEM formulation NETGEN (boxcyl.geo) ## Two cylinders on a box algebraic3d #define box: solid box = plane (0, 0, 0.5; -1, 0, 0) and plane (0, 0, 0.5; 0, -1, 0) and plane (0, 0, 0.5; 0, 0, -1) and plane (2, 1.5, 1; 1, 0, 0) and plane (2, 1.5, 1; 0, 1, 0) and plane (2, 1.5, 1; 0, 0, 1); #define cylinders: solid cyls = (cylinder (0.5, 0.75, 0; 0.5, 0.75, 2; 0.3) or cylinder (1.5, 0.75, 0; 1.5, 0.75, 2; 0.3) ) and plane (0, 0, 0.7; 0, 0, -1) and plane (0, 0, 1.5; 0, 0, 1); #combine both: solid main = box or cyls; #define sub-domains: tlo main; singular edge box cyls;
Every .geo file must contain the keyword algebraic3d before any non-comment line.
![Page 31: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/31.jpg)
Kyung Hee University, 2011 31
FEM formulation NETGEN (boxcyl.geo) ## Two cylinders on a box algebraic3d #define box: solid box = plane (0, 0, 0.5; -1, 0, 0) and plane (0, 0, 0.5; 0, -1, 0) and plane (0, 0, 0.5; 0, 0, -1) and plane (2, 1.5, 1; 1, 0, 0) and plane (2, 1.5, 1; 0, 1, 0) and plane (2, 1.5, 1; 0, 0, 1); #define cylinders: solid cyls = (cylinder (0.5, 0.75, 0; 0.5, 0.75, 2; 0.3) or cylinder (1.5, 0.75, 0; 1.5, 0.75, 2; 0.3) ) and plane (0, 0, 0.7; 0, 0, -1) and plane (0, 0, 1.5; 0, 0, 1); #combine both: solid main = box or cyls; #define sub-domains: tlo main; singular edge box cyls;
The keyword solid defines a named solid, here the solid box is defined.
![Page 32: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/32.jpg)
Kyung Hee University, 2011 32
FEM formulation NETGEN (boxcyl.geo) ## Two cylinders on a box algebraic3d #define box: solid box = plane (0, 0, 0.5; -1, 0, 0) and plane (0, 0, 0.5; 0, -1, 0) and plane (0, 0, 0.5; 0, 0, -1) and plane (2, 1.5, 1; 1, 0, 0) and plane (2, 1.5, 1; 0, 1, 0) and plane (2, 1.5, 1; 0, 0, 1); #define cylinders: solid cyls = (cylinder (0.5, 0.75, 0; 0.5, 0.75, 2; 0.3) or cylinder (1.5, 0.75, 0; 1.5, 0.75, 2; 0.3) ) and plane (0, 0, 0.7; 0, 0, -1) and plane (0, 0, 1.5; 0, 0, 1); #combine both: solid main = box or cyls; #define sub-domains: tlo main; singular edge box cyls;
The definition tlo main declares the solid main as a top-level-object, what is necessary for meshing.
![Page 33: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/33.jpg)
Kyung Hee University, 2011 33
FEM formulation NETGEN (Available primitives)
1. A half space, i.e., a plane and everything on one side of it.
where p=(px, py, pz) on the plane with the outer normal n=(nx, ny, nz).
2. A cylinder of infinite length, given by a=(ax, ay, az) and b=(bx, by, bz)
on the central axis and the radius r
3. A sphere with the center c=(cx, cy, cz) and the radius r
4. A orthobrick is a brick parallel to the coordinate axis. It is specified by
two opposite corner points a=(ax, ay, az) and b=(bx, by, bz)
plane(px, py, pz; nx, ny, nz)
cylinder(ax, ay, az; bx, by, bz; r)
sphere(cx, cy, cz; r)
orthobrick(ax, ay, az; bx, by, bz)
![Page 34: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/34.jpg)
Kyung Hee University, 2011 34
FEM formulation Exercise
1. Generate the following model
(1) cylinder with radius 2, height 3, and maximum size 0.7
(2) 16 electrodes with radius 0.5 at the half of height.
(Use ng_mk_cyl_models)
2. Make a spherical object centered at (1,0,0) with radius 1.
3. Generate homogeneous data (vh.meas) and inhomogeneous
data (vi.meas) under the following conditions.
(1) Adjacent injection and adjacent measurement
(2) The conductivity is 1 in the background and 2 in the
anomaly.
4. Find the difference image using vh.meas and vi.meas using
the inverse operator in the slide 23.
![Page 35: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/35.jpg)
Kyung Hee University, 2011 35
FEM formulation Exercise
NETGEN
Generate a sphere with raidus 5 and put one circular area with radius 0.5 on the spherical surface .
![Page 36: E I D O R S - EJW - About I D O R S Electrical Impedance ... – Damped Gauss-Newton ... Part I. E I D O R S Kyung Hee University, 2011 13 •Free software algorithms for forward](https://reader034.vdocuments.pub/reader034/viewer/2022052407/5adc85c17f8b9ae1408bac14/html5/thumbnails/36.jpg)
Kyung Hee University, 2011 36
FEM formulation Homework
1. Generate the following model by using NETGEN.
(1) sphere with radius 5.
(2) equi-distanced16 electrodes on the equator with radius 0.5.
(3) a cubic object centered at (2.5,0,0) with the edge length 2.
2. Generate homogeneous data (vh.meas) and inhomogeneous
data (vi.meas) on the model from problem 1 under the following
conditions.
(1) Adjacent injection and adjacent measurement
(2) The conductivity is 1 in the background and 2 in the anomaly.
3. Find the difference image using the pseudo inverse of the
sensitivity matrix by truncated SVD.