Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.5K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Constructing matrix elements using functions and looping

Posted 13 years ago

Hi I'm trying to construct a tridiagonal matrix which contains a function f(x,y)=2(cos x+cosy). My code is:

, {d2o, _Integer}, {e1oN, _mRaexa = 2};, {e2o,
, {d2o, _Integer}, {e1oN, _mRaexa = 2};, {e2o, _RealFo,r [i
 = {1Xo,,  i_wR e<a=l,  51 ,i w{+V+o,,  
Real ,A [1x_},,
y_]   :Mod=u l
[{k1   = Nk1o, k2 = k2o, n1 = n1o, n2 = n2o, d1 = d1o, o2r m=a ld[2So, a
seAr  r a ye[{ =_ ,e 1jo_,}  /2 =j e2o,i  X: >=  
, V  =   V o , Xu ,+  V2u,  (jCadsr[oxX, +j aCdorso[Vy, ]
, {i  _ ,  od_e}zva;  j mea n=}=
1 :>   
jadr o X   =  k11,* T{abl_e,[ (j1_ }-  /i;/ di1 )-^ jn 1=,=  {1i ,: >0 ,1}d, {N])a;x
 Nma  } ]j]a;

Matri x F oXru m=[ SPig/n2[,X ]*iA/b2][]X ]^/e/1;N
Matri x F oXru m=[ SPig/n2[,X ]*iA/b2][]X ]^/e/1;N
   ] 
Vu = tSrginx[FVr*mA[bAs[PVi]/^2e2Pi/
]] // 
N

Why does it fail to show the matrix inside the For-loop?

Thanks

POSTED BY: hbar omega
POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard