Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Non trivial substitution in a very long output

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123132] Non trivial substitution in a very long output
  • From: Demind <demind at gmail.com>
  • Date: Thu, 24 Nov 2011 06:56:33 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Hello, my name is Marco. I am experiencing an annoying problem using Mathematica. I am dealing with a huge expression, some hundreds of lines. I can find 3/4 patterns repeating inside it, and I would really like to substitute thme with dummy variables, namely D1, D2, D3, D4. I'm expecting the readibility of the equation to be improved after this process. As it is right now, it's totally unreadable. I went through past topics to find solutions to my problem, but unfortunately none of the tricks I tried worked (mainly /. and //.).

I give you a sample of what I would like to do, hoping that someone will give me some help:

In my equation, Out[1] = ...
the following pattern is repeated:

Abs[b41]^2 + Abs[b51]^2 + Abs[b61]^2 + Abs[(b61 x1 + b51 x2 + b41 x3)/x4]^2 + Abs[(b61 x2 + b51 x3 + b41 x4)/x1]^2 + Abs[(b61 x1 x3 + b51 (x2 x3 - x1 x4) + b41 (x3^2 - x2 x4))/x4^2]^2 + Abs[(b61 (x1 x3^2 - x1 x2 x4) + b51 (x2 x3^2 - x2^2 x4 - x1 x3 x4) + b41 (x3^3 - 2 x2 x3 x4 + x1 x4^2))/x4^3]^2  

I'm doing:

Out[1] //. Abs[b41]^2 + Abs[b51]^2 + Abs[b61]^2 + Abs[(b61 x1 + b51 x2 + b41 x3)/x4]^2 + Abs[(b61 x2 + b51 x3 + b41 x4)/x1]^2 + Abs[(b61 x1 x3 + b51 (x2 x3 - x1 x4) + b41 (x3^2 - x2 x4))/x4^2]^2 + Abs[(b61 (x1 x3^2 - x1 x2 x4) + b51 (x2 x3^2 - x2^2 x4 - x1 x3 x4) + b41 (x3^3 - 2 x2 x3 x4 + x1 x4^2))/x4^3]^2 -> D1

Here the text is attached in "InputForm", where in my notebook I have it in "StandardForm" (I use the latter in my notebook, but here I can't reproduce it for obvious reasons). I tried to use the command above both in StandardForm and in InputForm with no result.

Thank you very much

Marco



  • Prev by Date: Re: Sorting strings
  • Next by Date: Re: Piecewise bug in Mathematica 8.01?
  • Previous by thread: Color discontinuity with ColorFunction in ContourPlot
  • Next by thread: Re: Non trivial substitution in a very long output