Question: Problem with declaration of Vector a functions of x,y,z

I'm working with a PDE system, I want to bring it from the conservative(or divergent) to not-conservative form. So I have to do some derivatives. I'm working in vectorial form.
I want to declare the unwnown vector W as function of x,y,t and I have problems to do that. I tried in different way and I read a lot of stuff in the help but nothing worked. I tried to use declare but in the help there is not explanation how to use it with a vector. So I used it  with all the component CS[1]..CS[Neq] and then I put them in the vector W.  But it didn't work, when I derive W it returns me a zero vector!! And it's wierd that when I derive the flux vectors Fx and Fy that are functions of CS[1]..CS[Neq] it derives perfectly!! At the end my problem is: I want to work with a simbolic vector W , whose components (I colled them CS[1]..CS[Neq] since I'm not able to initialize the vector W to the symbolic values W[1]..W[Neq] )are function of x,y,t. And then I need to do the x and y derivative of Fx and Fy that are functions of W!! Below is the code. Thanks so much for your help.Alberto.


# Number of equations to solve
 Neq := 5;
 printlevel := 2;
 for m from 1 to Neq do:    
    alias(CS[m] = CS[m](x, y, t));
    declare(CS[m](x, y, t));
 end do;
 W := Vector(Neq);    
  for m from 1 to Neq do:    
    W[m] := CS[m];
 end do;
 Fx := <CS[2] , CS[2]^2/(CS[1]-CS[5]) + 1/2*GRAVIT*CS[1]^2 - GRAVIT*CS[5]*CS[1] , CS[2]*CS[3]/(CS[1]- CS[5])                              , CS[4]*CS[2]/(CS[1]-CS[5]) , 0>;
 Fy := <CS[3] , CS[2]*CS[3]/(CS[1]-CS[5])                              , CS[3]^2/(CS[1]-CS[5]) + 1/2*GRAVIT*CS[1]^2 - GRAVIT*CS[5]*CS[1] , CS[4]*CS[3]/(CS[1]-CS[5]) , 0>;


Please Wait...