Advertisement
Guest User

crank

a guest
Nov 20th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. function crank(L,tau,k,K)
  2. x=linspace(-L/2,L/2,K);
  3. xp=L/K;
  4. Tl=(L^2)/(8*k);
  5. t=linspace(0,5*Tl,K);
  6. a=(k*tau)/xp^2;
  7. o=[];
  8. for b=1:K
  9. C(b,b)= 2*(1+a);
  10. D(b,b)=2*(1-a);
  11. end
  12. for f=1:K-1
  13. C(f,f+1)=-a;
  14. D(f,f+1)=a;
  15. end
  16. for h= 2:K
  17. C(h,h-1)=-a;
  18. D(h,h-1)=a;
  19. end
  20. M=C\D;
  21. for q= 1:K
  22. T(1,q)=exp(-(x(1,q)^2)/((.1*L)^2));
  23. end
  24. for martin=1:K
  25. j=M^martin;
  26. Fr=j*T;
  27. R(1,martin)=Fr;
  28. end
  29. imagesc(R)
  30. D
  31. C
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement