Commit 92300c5c by ppanchal

### Cube Cube computations on ada

parent 05b529b9
 function out = G(n,alpha) out = exp(-(n+0.5).*alpha)./sinh((n+0.5)*alpha); end \ No newline at end of file
 function out = Gsum(n,alpha) % nidx = 0:n; % nidx2 = 2 * nidx; % Gvec = G(nidx', alpha * (nidx'==nidx')); % % out = sum(Gvec.*((2*nidx'+1).*Gvec - ) out = 0; for i = 0:n out = out + G(i,alpha) * ( (2*i+1)*G(i,alpha) - (2*i+2)*G(i+1,alpha) ); end end \ No newline at end of file
 function out = correction(n) for i = 0:n for j = 0:n end end end \ No newline at end of file
 % Testing the force formula % Testing convergence for some alpha values alpha1 = acosh(10); alpha2 = acosh(20); force1 = []; force2 = []; for i = 1 : 500 force1 = [force1 Gsum(i,alpha1)]; force2 = [force2 Gsum(i,alpha2)]; end figure; plot(1:500,force1); hold on; plot(1:500,force2); %alpha = acosh(1+x); % Next plot xvals = 0.001:0.001:0.01; Gvals = []; for i = 1 : size(xvals,2) Gvals = [Gvals Gsum(100,acosh(1+xvals(i)))]; end figure; plot(xvals,Gvals); \ No newline at end of file
 % Testing the force formula % Testing convergence for some alpha values alpha1 = acosh(10); alpha2 = acosh(20); force1 = []; force2 = []; for i = 1 : 500 force1 = [force1 Gsum(i,alpha1)]; force2 = [force2 Gsum(i,alpha2)]; end figure; plot(1:500,force1); hold on; plot(1:500,force2); %alpha = acosh(1+x); % Next plot xvals = 0.001:0.001:0.01;