## [Reduce-algebra-developers] Problem with operators

 [Reduce-algebra-developers] Problem with operators From: Raffaele Vitolo - 2010-06-16 16:46:47 ```Dear All, I am using reduce for computing Hamiltonian operators for partial differential equations (a task which is basically a symmetry computation), and I'm facing the following problem. I have a list of identifiers {ddx,ddy,ddz,...} which are names of vector fields, introduced with a suitable procedure that has been developed by some Dutch researcher almost 20 years ago. In order to define their components I have to write down something like ddx(0,1):=... ddx(0,2):=... ... ddx(1,1):=... ... ddy(0,1):=... and so on. But reduce is refusing the automatization of the above definitions: if I write something like for i:=1:3 do << for j:=1:n do << part({ddx,ddy,ddz},i)(0,j):=...; >>; >>; I get an error message part({ddx,ddy,ddz},1)(0,1) invalid as assignment I get a similar error even if I define a list like ll:={sin} and I try to do part(ll,1)(x); the error message is part(ll,1) invalid as operator. So I guess that the problem is how to use a list of identifiers as operator names. I'm almost sure that I would manage this if I would know lisp, unfortunately I am a newcomer.. I thank you for any explanation you would provide to me for this trivial question. Best, Raffaele. -- Raffaele Vitolo, Dipartimento di Matematica 'E. De Giorgi' Universita' del Salento, via per Arnesano 73100 Lecce ITALY tel.: +39 0832 297425 (office) fax.: +39 0832 297594 home page: http://poincare.unisalento.it/vitolo ```

 [Reduce-algebra-developers] Problem with operators From: Raffaele Vitolo - 2010-06-16 16:46:47 ```Dear All, I am using reduce for computing Hamiltonian operators for partial differential equations (a task which is basically a symmetry computation), and I'm facing the following problem. I have a list of identifiers {ddx,ddy,ddz,...} which are names of vector fields, introduced with a suitable procedure that has been developed by some Dutch researcher almost 20 years ago. In order to define their components I have to write down something like ddx(0,1):=... ddx(0,2):=... ... ddx(1,1):=... ... ddy(0,1):=... and so on. But reduce is refusing the automatization of the above definitions: if I write something like for i:=1:3 do << for j:=1:n do << part({ddx,ddy,ddz},i)(0,j):=...; >>; >>; I get an error message part({ddx,ddy,ddz},1)(0,1) invalid as assignment I get a similar error even if I define a list like ll:={sin} and I try to do part(ll,1)(x); the error message is part(ll,1) invalid as operator. So I guess that the problem is how to use a list of identifiers as operator names. I'm almost sure that I would manage this if I would know lisp, unfortunately I am a newcomer.. I thank you for any explanation you would provide to me for this trivial question. Best, Raffaele. -- Raffaele Vitolo, Dipartimento di Matematica 'E. De Giorgi' Universita' del Salento, via per Arnesano 73100 Lecce ITALY tel.: +39 0832 297425 (office) fax.: +39 0832 297594 home page: http://poincare.unisalento.it/vitolo ```
 Re: [Reduce-algebra-developers] Problem with operators From: Thomas Sturm - 2010-06-16 18:49:35 Attachments: smime.p7s ```Hi Raffaele, others probably understand the concepts behind the algebraic mode better than I do but here is a hack which might help you to go on: 1: lisp operator setk0; 2: for i := 1:3 do setk0(part({a,b,c},i),i); 3: a; 1 4: b; 2 5: c; 3 This is not really a clean solution though, and I have not checked if it works with arrays on the left hand side. Thomas Am 16.06.2010 um 18:26 schrieb Raffaele Vitolo: > Dear All, > > I am using reduce for computing Hamiltonian operators for partial > differential equations (a task which is basically a symmetry > computation), and I'm facing the following problem. I have a list of > identifiers {ddx,ddy,ddz,...} which are names of vector fields, > introduced with a suitable procedure that has been developed by some > Dutch researcher almost 20 years ago. In order to define their > components I have to write down something like > ddx(0,1):=... > ddx(0,2):=... > ... > ddx(1,1):=... > ... > ddy(0,1):=... > and so on. > But reduce is refusing the automatization of the above definitions: > if I write something like > > for i:=1:3 do > << > for j:=1:n do > << > part({ddx,ddy,ddz},i)(0,j):=...; >>> ; >>> ; > > I get an error message > > part({ddx,ddy,ddz},1)(0,1) invalid as assignment > > I get a similar error even if I define a list like ll:={sin} and I > try to do part(ll,1)(x); the error message is > part(ll,1) invalid as operator. So I guess that the problem is how to > use a list of identifiers as operator names. > > I'm almost sure that I would manage this if I would know lisp, > unfortunately I am a newcomer.. I thank you for any explanation you > would provide to me for this trivial question. > > Best, > > Raffaele. > > -- > Raffaele Vitolo, Dipartimento di Matematica 'E. De Giorgi' > Universita' del Salento, via per Arnesano 73100 Lecce ITALY > tel.: +39 0832 297425 (office) fax.: +39 0832 297594 > home page: http://poincare.unisalento.it/vitolo > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Reduce-algebra-developers mailing list > Reduce-algebra-developers@... > https://lists.sourceforge.net/lists/listinfo/reduce-algebra-developers -- Dr. habil. Thomas Sturm Departamento de Matematicas, Estadistica y Computacion Universidad de Cantabria, Santander, Spain Avda. Los Castros s/n, Room 1072, +34 693 251058 http://personales.unican.es/sturmt/ ```