//sfb: Notes added in editing are marked with //sfb -->scf(5); -->t=0:0.1:4; -->plot(t,sin(t),'rx-') -->xs2eps(5,'foo.eps') -->clf() -->P = !--error 2 invalid factor --> 1.7951238 - 1.5233159 ans = 0.2718079 --> - 1.5233159 1.2926637 !--error 276 Missing operator, comma, or semicolon -->A=[ --> 1.7951238 - 1.5233159 --> - 1.5233159 1.2926637 ] !--error 6 inconsistent row/column dimensions -->A=[ --> 1.7951238 - 1.5233159 ; --> - 1.5233159 1.2926637 ] !--error 6 inconsistent row/column dimensions --> A=[ 1.7951238 - 1.5233159 ; --> - 1.5233159 1.2926637 ] !--error 6 inconsistent row/column dimensions //sfb finally figured out it was the space between the - and the number --> A=[ 1.7951238 -1.5233159 ; --> -1.5233159 1.2926637 ] A = 1.7951238 - 1.5233159 - 1.5233159 1.2926637 //sfb cut and pasted from plot.in -->theta = 0:%pi/50:2*%pi; // %pi is scilab for the constant pi -->n = size(theta,2); // theta is a 1 x n row vector -->x = zeros(theta); // x and y start as zero vectors -->y = zeros(theta); -->for i = 1:n, --> angle = theta(i); // this angle --> c = cos(angle); --> s = sin(angle); --> X = [ c, s ]; --> r = sqrt(1/abs(X*A*X')); // formula from section 4 --> x(i) = r*c; // r cos(theta) --> y(i) = r*s; -->end; -->plot(x,y,'r*-'); //sfb cut and pasted from contour.in -- needed to make arrows orthogonal -->a=get("current_axes"); a.isoview="on"; // aspect ratio 1:1 -->square(-2,-2,2,2); // window ratio 1:1 -->X=[1;0] X = 1. 0. -->exec('iterate2d.in') !--error 241 File iterate2d.in does not exist or read access denied -->chdir('\\tecad\tecad\I_TDrive\bellenot\Desktop'); -->exec('iterate2d.in') -->for i = 1:10, --> X = A*X; --> N = norm(X); --> X = X/N; --> printf("N = %f, X = [%f; %f], i = %d\n", N, X(1,1), X(2,1), i); -->end; N = 2.354349, X = [0.762471; -0.647022], i = 1 N = 3.087787, X = [0.762471; -0.647022], i = 2 N = 3.087787, X = [0.762471; -0.647022], i = 3 N = 3.087787, X = [0.762471; -0.647022], i = 4 N = 3.087787, X = [0.762471; -0.647022], i = 5 N = 3.087787, X = [0.762471; -0.647022], i = 6 N = 3.087787, X = [0.762471; -0.647022], i = 7 N = 3.087787, X = [0.762471; -0.647022], i = 8 N = 3.087787, X = [0.762471; -0.647022], i = 9 N = 3.087787, X = [0.762471; -0.647022], i = 10 -->X1=X X1 = 0.7624713 - 0.6470220 -->L1=N L1 = 3.0877875 //sfb parallel case does not have an inverse //sfb but round off error makes scilab thinks there is one. -->inv(A) warning matrix is close to singular or badly scaled. rcond = 3.8207D-09 ans = 30724123. 36206281. 36206281. 42666630. -->det(A) ans = 4.207D-08 -->// non zero solution to A*X=0 -->rref([A;[0;0]) !--error 2 invalid factor -->rref([A [0;0]) !--error 2 invalid factor -->rref([A [0;0]]) ans = 1. 0. 0. 0. 1. 0. -->A A = 1.7951238 - 1.5233159 - 1.5233159 1.2926637 //sfb we interchanged the row values and one sign (and made it a column) -->Y=[1.5233159; 1.7951238] Y = 1.5233159 1.7951238 -->A*Y ans = 0. 4.207D-08 -->X2=Y/norm(Y) X2 = 0.6470220 0.7624713 //sfb check for orthogonality -->X1'*X2 ans = - 3.745D-09 -->L2=0 L2 = 0. -->L2=16 L2 = 16. //sfb from arrows.in -->xarrows([0; X1(1,1)/sqrt(abs(L1))], [0; X1(2,1)/sqrt(abs(L1))], 1, 5); -->xarrows([0; X2(1,1)/sqrt(abs(L2))], [0; X2(2,1)/sqrt(abs(L2))], 1, 3); -->xstring(X1(1,1)/L1, X1(2,1)/L1,"Largest L-value, E-vector/sqrt(L-value)"); -->xstring(X2(1,1)/L1, X2(2,1)/L1,"Smallest L-value, E-vector/sqrt(L-value)"); -->L2=1/16 L2 = 0.0625 -->xarrows([0; X1(1,1)/sqrt(abs(L1))], [0; X1(2,1)/sqrt(abs(L1))], 1, 5); -->xarrows([0; X2(1,1)/sqrt(abs(L2))], [0; X2(2,1)/sqrt(abs(L2))], 1, 3); -->xstring(X1(1,1)/L1, X1(2,1)/L1,"Largest L-value, E-vector/sqrt(L-value)"); -->xstring(X2(1,1)/L1, X2(2,1)/L1,"Smallest L-value, E-vector/sqrt(L-value)"); -->L2=1/2 L2 = 0.5 -->xarrows([0; X1(1,1)/sqrt(abs(L1))], [0; X1(2,1)/sqrt(abs(L1))], 1, 5); -->xarrows([0; X2(1,1)/sqrt(abs(L2))], [0; X2(2,1)/sqrt(abs(L2))], 1, 3); -->xstring(X1(1,1)/L1, X1(2,1)/L1,"Largest L-value, E-vector/sqrt(L-value)"); -->xstring(X2(1,1)/L1, X2(2,1)/L1,"Smallest L-value, E-vector/sqrt(L-value)"); -->L2=1/sqrt(2) L2 = 0.7071068 -->xarrows([0; X1(1,1)/sqrt(abs(L1))], [0; X1(2,1)/sqrt(abs(L1))], 1, 5); -->xarrows([0; X2(1,1)/sqrt(abs(L2))], [0; X2(2,1)/sqrt(abs(L2))], 1, 3); -->xstring(X1(1,1)/L1, X1(2,1)/L1,"Largest L-value, E-vector/sqrt(L-value)"); -->xstring(X2(1,1)/L1, X2(2,1)/L1,"Smallest L-value, E-vector/sqrt(L-value)"); -->L2=1/4 L2 = 0.25 -->xarrows([0; X1(1,1)/sqrt(abs(L1))], [0; X1(2,1)/sqrt(abs(L1))], 1, 5); -->xarrows([0; X2(1,1)/sqrt(abs(L2))], [0; X2(2,1)/sqrt(abs(L2))], 1, 3); -->xstring(X1(1,1)/L1, X1(2,1)/L1,"Largest L-value, E-vector/sqrt(L-value)"); -->xstring(X2(1,1)/L1, X2(2,1)/L1,"Smallest L-value, E-vector/sqrt(L-value)"); //sfb start the graph over -->clf -->xarrows([0; X1(1,1)/sqrt(abs(L1))], [0; X1(2,1)/sqrt(abs(L1))], 1, 5); -->xarrows([0; X2(1,1)/sqrt(abs(L2))], [0; X2(2,1)/sqrt(abs(L2))], 1, 3); -->xstring(X1(1,1)/L1, X1(2,1)/L1,"Largest L-value, E-vector/sqrt(L-value)"); -->xstring(X2(1,1)/L1, X2(2,1)/L1,"Smallest L-value, E-vector/sqrt(L-value)"); -->theta = 0:%pi/50:2*%pi; // %pi is scilab for the constant pi -->n = size(theta,2); // theta is a 1 x n row vector -->x = zeros(theta); // x and y start as zero vectors -->y = zeros(theta); -->for i = 1:n, --> angle = theta(i); // this angle --> c = cos(angle); --> s = sin(angle); --> X = [ c, s ]; --> r = sqrt(1/abs(X*A*X')); // formula from section 4 --> x(i) = r*c; // r cos(theta) --> y(i) = r*s; -->end; -->plot(x,y,'r*-'); -->theta = 0:%pi/50:2*%pi; // %pi is scilab for the constant pi -->n = size(theta,2); // theta is a 1 x n row vector -->x = zeros(theta); // x and y start as zero vectors -->y = zeros(theta); -->for i = 1:n, --> angle = theta(i); // this angle --> c = cos(angle); --> s = sin(angle); --> X = [ c, s ]; --> r = sqrt(1/abs(X*A*X')); // formula from section 4 --> x(i) = r*c; // r cos(theta) --> y(i) = r*s; -->end; -->plot(x,y,'r*-'); -->a=get("current_axes"); a.isoview="on"; // aspect ratio 1:1 -->square(-2,-2,2,2); // window ratio 1:1 -->xs2eps(5,'parallel6.eps') [] !--error 9999 Problem generating file , perhaps directory is not writable at line 53 of function xs2eps called by : xs2eps(5,'parallel6.eps') -->chdir('\\tecad\tecad\I_TDrive\bellenot\Desktop'); -->xs2eps(5,'parallel6.eps') [] !--error 9999 Problem generating file , perhaps directory is not writable at line 53 of function xs2eps called by : xs2eps(5,'parallel6.eps') -->chdir('T:\'); //sfb parallel6.eps and parallel6.pdf are also in this directory -->xs2eps(5,'parallel6.eps') -->help(); -->diary(0)