MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Substitute variable name for value (reverse of simplification)


I need this to happen:
var1 = 3*a
var2 = 189*a^3
output = 7*var1^3

I can do it in very simple and specific equations doing something like

substituteName2[var_,exp_] := Module[ {},
	Solve[p==exp&&"test"==var,{p},{a}]
];
test=3*a;
substituteName2[test,7*test^3]

But i need a WAY more general form of that...any ideas?



  • Prev by Date: Using SetDirectory to Set to a Remote Computer
  • Next by Date: Re: Solving this in mathematica?
  • Previous by thread: Using SetDirectory to Set to a Remote Computer
  • Next by thread: Re: Substitute variable name for value (reverse of simplification)