[Date Index] [Thread Index] [Author Index]
Re: Algebraic substitutions. HOW?
A more general approach to the problem of algebraic substitution is required, since controlling the level and extent of replacement can be almost as tedious as doing it by hand (that's 'almost', so please don't flame me :) A very useful utility for anyone needing to do this kind of task on complex expressions is provided by Salford consulting and involves being able to limit replacement rules to specific sub-expressions easily, indicating the restricted area by color coding it (i.e. apply the replacement rule to only the 'red' expression). A handy palette accompanies this utility, and I for one am delighted that the authors have made it available at their web site: http://www.ftn95.com/mathematica/ A. Sharma MD Peter Breitfeld wrote in message <7i80pj$p9 at smc.vnet.net>... >Alessio Massaro <alessio at mail.cern.ch> schrieb: >> Hi, >> >> say I have an expression like (a^2)/(b^2) and I want to change it by >> introducing c:=a/b in order to obtain c^2. >> >> Euivalent exaple: h^3/t^2 -> (z:=h^2/t^2) -> z*h >> >> How do I get Mathematica to perform this kind of algebraic >> substitutions (on complex formulas)? >> > >Alessio, >I think all you can do is something like this: > >In:= a^2/b^2 /. a->c b >Out= c^2 > >In:= h^3/t^2 /. t->h/Sqrt[z] >Out= h z > >You can't do eg. >a^2/b^2 /. a/b->z >because the pattern a/b doesn't match anything in the FullForm of >a^2/b^2, which is Times[Power[a,2],Power[b,-2]] > >Es gruesst Peter >-- >=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--= > Peter Breitfeld, Saulgau, Germany PGP public key: 08548045 >