Re: problems with parameter lumping using ReplaceAll
- To: mathgroup at smc.vnet.net
- Subject: [mg105880] Re: problems with parameter lumping using ReplaceAll
- From: dh <dh at metrohm.com>
- Date: Wed, 23 Dec 2009 02:40:58 -0500 (EST)
- References: <hgq26v$gck$1@smc.vnet.net>
Hi Sean, if you do not end: sol=... by a semicolon, mathematica prints the result of sol=.... Therefore, first you see the un-replaced expression and only afterwards the replaced one. Daniel sean wrote: > Hello Group, > > I have a pretty nasty expression that I'm trying the lump the > parameters for. > > I'm having problems making mathematica perform the following > replacement. > Like I said it's pretty nasty and hope it pastes ok. > > sol = {{C[0]->p/(-4 a+4 b)+(Sqrt[l^2-m] vd)/(-4 a+4 b)-Sqrt[u-v-2 Sqrt > [l^2-m] q vd-2 Sqrt[l^2-m] r vd]/(-4 a+4 b),M[0]->-(i/(2 V1-2 V2))-j/ > (2 V1-2 V2)+Sqrt[s^2-4 t]/(2 V1-2 V2)+V1/(2 V1-2 V2)-V2/(2 V1-2 V2),X > [0]->l/(2 V3-2 V4)+Sqrt[l^2-m]/(2 V3-2 V4)},{C[0]->p/(-4 a+4 b)+(Sqrt > [l^2-m] vd)/(-4 a+4 b)-Sqrt[u-v-2 Sqrt[l^2-m] q vd-2 Sqrt[l^2-m] r vd]/ > (-4 a+4 b),M[0]->i/(-2 V1+2 V2)+j/(-2 V1+2 V2)+Sqrt[s^2-4 t]/(-2 V1+2 > V2)-V1/(-2 V1+2 V2)+V2/(-2 V1+2 V2),X[0]->l/(2 V3-2 V4)+Sqrt[l^2-m]/(2 > V3-2 V4)},{C[0]->p/(-4 a+4 b)+(Sqrt[l^2-m] vd)/(-4 a+4 b)+Sqrt[u-v-2 > Sqrt[l^2-m] q vd-2 Sqrt[l^2-m] r vd]/(-4 a+4 b),M[0]->-(i/(2 V1-2 V2))- > j/(2 V1-2 V2)+Sqrt[s^2-4 t]/(2 V1-2 V2)+V1/(2 V1-2 V2)-V2/(2 V1-2 V2),X > [0]->l/(2 V3-2 V4)+Sqrt[l^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1/(2 V1-2 V2)-V2/(2 V1-2 V2),X[0]->f/(-2 V3+2 V4)+g/(-2 V3+2 > V4)+Sqrt[l^2-m]/(-2 V3+2 V4)-V3/(-2 V3+2 V4)+V4/(-2 V3+2 V4)},{C[0]->p/ > (-4 a+4 b)-(Sqrt[l^2-m] vd)/(-4 a+4 b)+Sqrt[u-v+2 Sqrt[l^2-m] q vd+2 > Sqrt[l^2-m] r vd]/(-4 a+4 b),M[0]->i/(-2 V1+2 V2)+j/(-2 V1+2 V2)+Sqrt > [s^2-4 t]/(-2 V1+2 V2)-V1/(-2 V1+2 V2)+V2/(-2 V1+2 V2),X[0]->f/(-2 > V3+2 V4)+g/(-2 V3+2 V4)+Sqrt[l^2-m]/(-2 V3+2 V4)-V3/(-2 V3+2 V4)+V4/ > (-2 V3+2 V4)}} > > sol//. 2 V1-2 V2-> 2w/. 2 V3-2 V4 -> 2x//Simplify > > If you try it, 2 V1- 2 V2 is only replaced in every other denominator > in the solutions. (There are 8 equilibrium points in the sol up there) > > It also fails to recognize that -V1 + V2 is -w. > > Similarly, 2 V3-2 V4 -> 2x fails to replace in some of the > expressions. > > It seems like it has to do with - sign in front of the expression that > mathematica is trying to make the replacements into. If the expression > contains the - sign, it doesn't replace the expression. > > Question is how do I make the replacements regardless the sign? > > > Thanks much in advance. > > Sean >