File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -158,11 +158,16 @@ function onSettingsChanged(obj)
158158 % [P2, D] = eig(nfLy);
159159
160160 % We can represent the eigenvalues as
161- dLambda = (4 /(hx ^ 2 ) * (sin(pi *(1 : nx )/(2 *(nx + 1 ))).^2 )).' ;
162- dD = (4 /(hy ^ 2 ) * (sin(pi *(1 : ny )/(2 *(ny + 1 ))).^2 )).' ;
163- L12 = 1 ./(dLambda + dD .' );
164- P1 = sqrt(2 /(nx + 1 ))*sin((1 : nx ).' *(1 : nx )*pi /(nx + 1 ));
165- P2 = sqrt(2 /(ny + 1 ))*sin((1 : ny ).' *(1 : ny )*pi /(ny + 1 ));
161+ % dLambda = ((2*sinpi((1:nx)/(2*(nx + 1)))/hx).^2).';
162+ % dD = ((2*sinpi((1:ny)/(2*(ny + 1)))/hy).^2).';
163+ % L12 = 1./(dLambda + dD.');
164+ hx2 = hx ^ 2 ;
165+ hy2 = hy ^ 2 ;
166+ cx = (1 : nx )/(nx + 1 );
167+ cy = (1 : ny )/(ny + 1 );
168+ L12 = -(hx2 * hy2 ./(2 *(-hx2 - hy2 + hy2 * cospi(cx ).' + hx2 * cospi(cy ))));
169+ P1 = sqrt(2 /(nx + 1 ))*sinpi((1 : nx ).' *(1 : nx )/(nx + 1 ));
170+ P2 = sqrt(2 /(ny + 1 ))*sinpi((1 : ny ).' *(1 : ny )/(ny + 1 ));
166171
167172
168173 % L12 = 1./(diag(Lambda) + diag(D).');
You can’t perform that action at this time.
0 commit comments