Question: Array loop problem

This is my code

 

am:=proc(dx,Nminus,Nplus)
global k_r,n,tau,a2,m;
k_r:=1/2;
a2:=a/2;
k=0;
u:=[]:
for n from Nminus to Nplus do
k:=k+1:
u(k):=max(exp((0.5*(k_r+1)^2)*0)*(exp(0.5*n*dx*(k_r+1))-exp(0.5*n*dx*(k_r-1))),0);
u:=[op(u),u(k)];
end do;
end proc;

 

I keep getting the error.

Error, (in am) invalid left hand side in assignment.

 

I would like to fill the array u with [u(1),u(2),...,u(Nplus-Nminus)]

 

Please help!

Please Wait...