jacobian_3d_fields
PURPOSE
[J] = jacobian_3d_fields(V,Ela,D,elec,vtx,simp,mat_ref,v_f,df, c2f);
SYNOPSIS
function [J] = jacobian_3d_fields(V,Ela,D,elec,vtx,simp,mat_ref,v_f,df, c2f);
DESCRIPTION
CROSS-REFERENCE INFORMATION
This function calls:
This function is called by:
- jacobian_3d function [J] = jacobian_3d(I,elec,vtx,simp,gnd_ind,mat_ref,zc,v_f,df,tol,perm_sym);
- np_calc_jacobian NP_CALC_JACOBIAN: J= np_calc_jacobian( fwd_model, img)
SOURCE CODE
0001 function [J] = jacobian_3d_fields(V,Ela,D,elec,vtx,simp,mat_ref,v_f,df, c2f);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 [vr,dim] = size(vtx);
0021
0022 if sum(df)~= size(v_f,2);
0023 error('Mismatched data input');
0024 end
0025
0026
0027 V = V(1:vr,:);
0028 v_f = v_f(1:vr,:);
0029
0030 n_elem= size(simp,1);
0031
0032 diag_Ela = diag(Ela(1:dim:size(Ela,1),1:dim:size(Ela,2)));
0033 diag_Ela = spdiags(diag_Ela, 0, n_elem, n_elem);
0034
0035 if nargin>=10
0036 J = zeros(sum(df), size(c2f,2) );
0037 diag_Ela = diag_Ela*c2f;
0038 else
0039 J = zeros(sum(df),n_elem );
0040 end
0041 cnt = 0;
0042
0043 for p=1:size(V,2)
0044
0045 DV = D*V(:,p);
0046 df_idx= sum(df(1:p-1));
0047
0048 for m=1:df(p)
0049
0050 Dvf = D*v_f(:,df_idx + m);
0051
0052 Jrow_x3 = Dvf .* DV ;
0053 Jrow_u = sum(reshape(Jrow_x3,dim,[]),1);
0054
0055
0056 Jrow = Jrow_u * diag_Ela;
0057
0058 cnt = cnt+1;
0059 J(cnt,:) = -Jrow;
0060
0061 end
0062 end
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
Generated on Tue 09-Aug-2011 11:38:31 by m2html © 2005