Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

## [Reduce-algebra-developers] pattern matching problems with repart, impart and conj

 [Reduce-algebra-developers] pattern matching problems with repart, impart and conj From: Tony Roberts - 2012-05-16 01:03:46 ```-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, in a problem I want an operator cis(q) to denote exp(i*q). And I also need complex conjugation, so conj(cis(q)) => cis(-q) is needed. But I cannot get reduce to do this with a "let" statement. Nor does repart and impart (unless the expression is trivial). However, the conjugation does seem to work with the "where" clause. See below for what works and what does not. Can anyone fix reduce so such "let" works? or is there a good reason why it should fail in this context? Tony % want cis(q) to denote exp(i*q) operator cis; let conj(cis(~u))=>cis(-u); let { repart(r)=>r, impart(r)=>0 }; % following works emiq:=conj(cis(q)); % but anything more complex fails psibar:=conj(r^2*cis(q)); % following fails let { repart(cis(~u))=>cis(-u), impart(cis(~u))=>0 }; psibar:=conj(r*cis(q)); % following works!! psibar:=(conj(r^3*cis(q)) where { repart(cis(~u))=>cis(-u), impart(cis(~u))=>0 }); % following works!! psibar:=(conj(r^3*cis(q)) where conj(cis(~u))=>cis(-u) ); end; - -- PS interested in Dynamical Systems Mathematics and Modelling? Perhaps join http://www.linkedin.com/groups?gid=4338634 - --------------------------------------------------------------------- Professor A.J. Roberts School of Mathematical Sciences phone: +61 8 8313 3035 University of Adelaide fax: +61 8 8313 3696 South Australia 5005. mailto:anthony.roberts@... http://www.maths.adelaide.edu.au/anthony.roberts/ ==.0000001000000100000110001000011010001111110010111011101000010000== -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+y/OkACgkQ7TX8dTbro1vwpgCdEs8lIVCiEzjtsm6Wo/NTnSge 72IAnjdfEm1GlAYDqB/queTgYq6hx1Ky =i3eN -----END PGP SIGNATURE----- ```

 [Reduce-algebra-developers] pattern matching problems with repart, impart and conj From: Tony Roberts - 2012-05-16 01:03:46 ```-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, in a problem I want an operator cis(q) to denote exp(i*q). And I also need complex conjugation, so conj(cis(q)) => cis(-q) is needed. But I cannot get reduce to do this with a "let" statement. Nor does repart and impart (unless the expression is trivial). However, the conjugation does seem to work with the "where" clause. See below for what works and what does not. Can anyone fix reduce so such "let" works? or is there a good reason why it should fail in this context? Tony % want cis(q) to denote exp(i*q) operator cis; let conj(cis(~u))=>cis(-u); let { repart(r)=>r, impart(r)=>0 }; % following works emiq:=conj(cis(q)); % but anything more complex fails psibar:=conj(r^2*cis(q)); % following fails let { repart(cis(~u))=>cis(-u), impart(cis(~u))=>0 }; psibar:=conj(r*cis(q)); % following works!! psibar:=(conj(r^3*cis(q)) where { repart(cis(~u))=>cis(-u), impart(cis(~u))=>0 }); % following works!! psibar:=(conj(r^3*cis(q)) where conj(cis(~u))=>cis(-u) ); end; - -- PS interested in Dynamical Systems Mathematics and Modelling? Perhaps join http://www.linkedin.com/groups?gid=4338634 - --------------------------------------------------------------------- Professor A.J. Roberts School of Mathematical Sciences phone: +61 8 8313 3035 University of Adelaide fax: +61 8 8313 3696 South Australia 5005. mailto:anthony.roberts@... http://www.maths.adelaide.edu.au/anthony.roberts/ ==.0000001000000100000110001000011010001111110010111011101000010000== -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+y/OkACgkQ7TX8dTbro1vwpgCdEs8lIVCiEzjtsm6Wo/NTnSge 72IAnjdfEm1GlAYDqB/queTgYq6hx1Ky =i3eN -----END PGP SIGNATURE----- ```