Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Expression comparison in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg48028] Expression comparison in Mathematica
  • From: David Dalton <dalton at nfld.com>
  • Date: Fri, 7 May 2004 04:29:45 -0400 (EDT)
  • Organization: Memorial University of Newfoundland
  • Sender: owner-wri-mathgroup at wolfram.com

I have three expressions obtained by different methods (partly
by math on paper, partly by Mathematica) that should be the
same, all three for the general anisotropic elasticity matrix
with 21 independent components, and all three reduce to
the correct expression for isotropy when the isotropic
elasticity matrix is inserted, so they all pass that test.

However the expressions are not the same in the anisotropic
case and I would like to know good methods of comparing 
them and seeing how they differ with Mathematica in
order to trace my possible typo(s).   Of course I will
also review my paper math and Mathematica coding again.

Expression1 is actually a ratio of two polynomials,
NUM/DEN .   So lets say I want to compare Expression1
and Expression2.

Some things I have tried (or am trying now) are

FullSimplify[Expression1-Expression2]

(which should ideally be zero)

FullSimplify[Expression1/Expression2]

(which should ideally be one)

and

FullSimplify[PolynomialRemainder[Expression1*DEN,Expression2*DEN,f1]]

(where they are actually polynomials in f1, f2, f3 so I would
repeat that for f2 and f3)

(the remainder should ideally be zero)

So what do you think of that, and can you recommend
any other methods of comparing two expressions that
should be identical, including in the case where
one is fairly long and perhaps not being reduced as
well as it could by FullSimplify , or maybe that is
not true?

I also asked this of support at wolfram.com (though
I was mainly e-mailing to complain about a couple
of little other things) on Monday afternoon and
they haven't gotten back to me yet so perhaps
they don't have any suggestions.   (But the automatic
reply said usual turnaround is three days so I
guess it can sometimes be a little longer.)

I'm leaving the office now and heading home and
leaving some Mathematica running and the results
should be ready when I come in in mid-morning.

David



  • Prev by Date: RE: color in SphericalPlot3D
  • Next by Date: Drawing diagrams easily
  • Previous by thread: RE: color in SphericalPlot3D
  • Next by thread: Drawing diagrams easily