Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6716 > unrolled thread
| Started by | Marco Maso <demind@gmail.com> |
|---|---|
| First post | 2011-11-25 09:58 +0000 |
| Last post | 2011-11-25 09:58 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Non trivial substitution in a very long output Marco Maso <demind@gmail.com> - 2011-11-25 09:58 +0000
| From | Marco Maso <demind@gmail.com> |
|---|---|
| Date | 2011-11-25 09:58 +0000 |
| Subject | Re: Non trivial substitution in a very long output |
| Message-ID | <janoro$av6$1@smc.vnet.net> |
Ok, this is not exactly what I was looking for but gave me an idea on how I can find a workaround to this problem...I will report here in a while with the outcome! Thanks Marco Il giorno Thu, 24 Nov 2011 11:30:25 -0600 DrMajorBob <btreat1@austin.rr.com> ha scritto: > It seems to work fine in this example: > > piece = 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; > expr = piece + piece^2 - Sin@piece; > expr //. piece -> p > > p + p^2 - Sin[p] > > Bobby > > On Thu, 24 Nov 2011 05:56:33 -0600, Demind <demind@gmail.com> wrote: > > > 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 > > > >
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web