MathGroup Archive 2006

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

Search the Archive

Re: Ask Mathematica to sub for a long expression


aaronfude at gmail.com wrote:
> Hi,
>
> Thanks for all the responses. It doesn't quite work for me, but maybe
> with a little extra expertise it will. The problem is that that pattern
> is not always obvious w/o extra algebra. The basic problem is
> summarized in the fact that the following doesn't work the way I'd like
> it to:
>
> -a-b/.a+b->c
>
> 2a+2b/.a+b->c
>
> Many thanks in advance!
>
> Aaron Fude

Replacing nontrivial patterns sometimes works, sometimes it doesnt.
It may depends on FullForm details.  This violates a basic tenet of
computer science: user-level results should not depend on internal
representation. Here is a simple example.

ClearAll[f,a,b,c,i];
f[b_,c_]:=1/(c+b^2);
v=Table[{i,f[b,i]/.b^2->16},{i,-6,6}];
ListPlot[v,PlotJoined->True];

Try to track the source of the error message and the plot gap.


  • Prev by Date: Making plots using transformation rules
  • Next by Date: Re: Solving the Cubic
  • Previous by thread: Re: Ask Mathematica to sub for a long expression
  • Next by thread: Re: Re: Ask Mathematica to sub for a long expression