Eidors-logo    

EIDORS: Electrical Impedance Tomography and Diffuse Optical Tomography Reconstruction Software

EIDORS (mirror)
Main
Documentation
Tutorials
− Image Reconst
− Data Structures
− Applications
− FEM Modelling
− GREIT
− Old tutorials
Workshop
Install
Contrib Data
GREIT
Browse Docs
Browse SVN

News
Mailing list
(archive)
FAQ
Developer
                       

 

Hosted by
SourceForge.net Logo

 

EIDORS fwd_models

Solving the forward problem for EIT in 2D with higher order finite elements

The implementation of the high order finite elements for CEM are described in detail at
  • M G Crabb. EIT Reconstruction Algorithms for Respiratory Intensive Care. PhD Thesis, University of Manchester, 2014.
Create a common model with EIDORS and solve using default solver. Swap the default forward solvers to the higher order solvers, and the element type ('tri3' is linear, 'tri6' is quadratic and 'tri10' is cubic).
%Make an inverse model and extract forward model
imdl = mk_common_model('c2C0',16);
fmdl = imdl.fwd_model;

%Default EIDORS solver
%Make image of unit conductivity
img0 = mk_image(fmdl,1);
img0.fwd_solve.get_all_meas = 1; %Internal voltage
v0=fwd_solve(img0);
v0e=v0.meas; v0all=v0.volt; 


%High-order EIDORS solver
%Change default eidors solvers
fmdl.solve = @fwd_solve_higher_order;
fmdl.system_mat = @system_mat_higher_order;

%Add element type
fmdl.approx_type    = 'tri3'; % linear
%Make an image and get voltages using high order solver
img1 = mk_image(fmdl,1);
img1.fwd_solve.get_all_meas = 1; %Internal voltage
v1 = fwd_solve(img1); 
v1e=v1.meas; v1all=v1.volt;


%Plot electrode voltages and difference
clf;subplot(211); plot([v0e,v1e,[v0e-v1e]*100]);
legend('0','1','(1-0) x 100'); xlim([1,100]);

print_convert forward_solvers_2d_high_order01a.png


Figure: The plot reassuringly shows the two approximations (eidors default and the high order linear solver) both agree at machine precision on the electrodes.
%Get internal linear voltage distribution for first stimulation
v1all = v1.volt; 
img1n = rmfield(img1,'elem_data');
img1n.node_data = v1all(1:size(fmdl.nodes,1),1); %add first stim data

%Plot the distribution
img1n.calc_colours.cb_shrink_move = [0.5,0.5,0];
clf; subplot(221); show_fem(img1n,1);

%Get internal voltage distribution for difference eidors/high order
img11n=img1n; 
img11n.node_data=v1all(1:size(fmdl.nodes,1),1)-v0all(1:size(fmdl.nodes,1),1);

%Plot the difference of two linear approximations
img11n.calc_colours.cb_shrink_move = [0.5,0.5,0];
subplot(222); show_fem(img11n,1);

print_convert forward_solvers_2d_high_order02a.png


Figure: The left plot shows the voltage distribution for the first stimulation using the linear high order solver. The right plot shows the difference between the default eidors solver and the linear high order solver, which agree to machine precision.
We now solve the forward problem using a quadratic ('tri6') and cubic ('tri10') approximation and look at the electrode voltages and internal voltage distribution.
%Repeat with quadratic and cubic finite elements
%Quadratic FEM
fmdl.approx_type    = 'tri6'; %Quadratic
img2 = mk_image(fmdl,1);
img2.fwd_solve.get_all_meas = 1; %Internal voltage
v2 = fwd_solve(img2); 
v2e=v2.meas; v2all=v2.volt;

%Cubic FEM
fmdl.approx_type    = 'tri10'; %Cubic
img3 = mk_image(fmdl,1);
img3.fwd_solve.get_all_meas = 1; %Internal voltage
v3 = fwd_solve(img3); 
v3e=v3.meas; v3all=v3.volt;

%Electrode voltages and difference for linear, quadratic and cubic
clf;subplot(211); plot([v1e,v2e,v3e,[v2e-v0e,v3e-v0e]*10]);
legend('1','2','3','(2-0) x 10','(3-0) x 10')
xlim([1,100]);

print_convert forward_solvers_2d_high_order03a.png


Figure: The electrode voltages for linear, quadratic and cubic approximation. The linear approximation agrees with the high order approximations away from the drive electrodes, but gets worse as we move toward the drive electrodes.
%Difference between quadratic and linear approximation internal voltage
img12n=img1n; 
img12n.node_data=v2all(1:size(fmdl.nodes,1),1)-v1all(1:size(fmdl.nodes,1),1);

%Plot the difference 
clf; subplot(221); show_fem(img12n,1);

%Difference between quadratic and linear approximation internal voltage
img13n=img1n; 
img13n.node_data=v3all(1:size(fmdl.nodes,1),1)-v1all(1:size(fmdl.nodes,1),1);

%Plot the difference 
subplot(222); show_fem(img13n,1);

print_convert forward_solvers_2d_high_order04a.png


Figure: The left plot shows the difference between linear and quadratic approximation on the internal voltage distribution and the right plot shows the difference between linear and cubic approximation.

Last Modified: $Date: 2017-02-28 13:12:08 -0500 (Tue, 28 Feb 2017) $ by $Author: aadler $