jacobian_3d_with_fields

PURPOSE ^

JACOBIAN_3D_WITH_FIELDS: calculate jacobian_3d, but accept V fields as

SYNOPSIS ^

function [J] = jacobian_3d_with_fields(V,Ela,D,I,elec,vtx,simp,gnd_ind,mat_ref,zc,v_f,df,tol,sym);

DESCRIPTION ^

 JACOBIAN_3D_WITH_FIELDS: calculate jacobian_3d, but accept V fields as
    parameters. Differs from jacobian_3d in that V is not calculated inside.

I        = The currents used
elec     = the electrodes matrix
vtx      = The vertices matrix
simp     = The simplices matrix
gnd_ind  = The ground index (node)
mat_ref  = The reference conductivity vector
zc       = The electrode contact impedance vector
IntGrad  = The integrals of the gradients
v_f      = The measurement fields
df       = Measurements per current pattern as used in v_f
tol      = Tolerance
J        = The Jacobian (sensitivity) matrix with respect to conductivity

 (C) 2003-2005 Nick Polydorides and David Stephenson. Licensed under GPL
 $Id: jacobian_3d_with_fields.m 3060 2012-06-06 16:37:38Z aadler $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [J] = jacobian_3d_with_fields(V,Ela,D,I,elec,vtx,simp,gnd_ind,mat_ref,zc,v_f,df,tol,sym);
0002 % JACOBIAN_3D_WITH_FIELDS: calculate jacobian_3d, but accept V fields as
0003 %    parameters. Differs from jacobian_3d in that V is not calculated inside.
0004 %
0005 %I        = The currents used
0006 %elec     = the electrodes matrix
0007 %vtx      = The vertices matrix
0008 %simp     = The simplices matrix
0009 %gnd_ind  = The ground index (node)
0010 %mat_ref  = The reference conductivity vector
0011 %zc       = The electrode contact impedance vector
0012 %IntGrad  = The integrals of the gradients
0013 %v_f      = The measurement fields
0014 %df       = Measurements per current pattern as used in v_f
0015 %tol      = Tolerance
0016 %J        = The Jacobian (sensitivity) matrix with respect to conductivity
0017 %
0018 % (C) 2003-2005 Nick Polydorides and David Stephenson. Licensed under GPL
0019 % $Id: jacobian_3d_with_fields.m 3060 2012-06-06 16:37:38Z aadler $
0020 
0021 warning('EIDORS:deprecated','JACOBIAN_3D_WITH_FIELDS is deprecated as of 06-Jun-2012. CALC_JACOBIAN now does this.');
0022 
0023 [vr,vc] = size(vtx);
0024 [sr,sc] = size(simp);
0025 
0026 el_no = size(elec,1);
0027 
0028 if sum(df)~= size(v_f,2);
0029    error('Mismatched data input');
0030 end
0031 
0032 %Select the part referring to the interior nodes
0033 V = V(1:vr,:);
0034 v_f = v_f(1:vr,:);
0035 
0036 J = zeros(sum(df),size(simp,1));
0037 Jrow = zeros(1,size(simp,1));
0038 cnt = 0;
0039 
0040 h = waitbar(0,'Calculating Jacobian Matrix');
0041 
0042 for p=1:size(V,2)
0043 
0044    waitbar(p/(size(V,2)))
0045 
0046    DV =  D*V(:,p); %Gradient of the current fields
0047 
0048    for m=1:df(p)
0049 
0050 
0051       Dvf = D*v_f(:,sum(df(1:p-1))+m); %Gradient of the measurement fields
0052 
0053       Jrow_x3 = Dvf .* DV ;
0054       Jrow_u = Jrow_x3(1:3:end) + Jrow_x3(2:3:end) + Jrow_x3(3:3:end);
0055 
0056       Jrow = Jrow_u .* diag(Ela(1:3:end,1:3:end));
0057 
0058       cnt = cnt+1;
0059       J(cnt,:) = -Jrow.';
0060       Jrow = zeros(1,size(simp,1));
0061 
0062    end %m
0063 
0064 end %p
0065 
0066 close(h)

Generated on Wed 21-Jun-2017 09:29:07 by m2html © 2005