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

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

Maple

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..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..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..CS[Neq] since I'm not able to initialize the vector W to the symbolic values W..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.

restart;
with(LinearAlgebra):
with(PDEtools):
with(CodeGeneration,Fortran):
with(codegen,fortran):

# 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;
assume(CS::real,CS<>0);
assume(CS::real,CS<>0);
assume(CS::real,CS::real,CS-CS>0,CS::real,CS>0);
assume(AA::real,Ks::real,Ks>0,Diam::real,Diam>0,DELTA::real,DELTA>0,TScr::real,TScr>0,qs::real);
interface(showassumed=2);
W := Vector(Neq);
for m from 1 to Neq do:
W[m] := CS[m];
end do;
Fx := <CS , CS^2/(CS-CS) + 1/2*GRAVIT*CS^2 - GRAVIT*CS*CS , CS*CS/(CS- CS)                              , CS*CS/(CS-CS) , 0>;
Fy := <CS , CS*CS/(CS-CS)                              , CS^2/(CS-CS) + 1/2*GRAVIT*CS^2 - GRAVIT*CS*CS , CS*CS/(CS-CS) , 0>;
equatio:=map(diff,W,t)+map(diff,Fx,x)+map(diff,Fy,y)=0; ﻿