Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6191

How to evaluate parts of an expression, but not other parts?

From Julian Francis <julian.w.francis@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject How to evaluate parts of an expression, but not other parts?
Date 2011-11-05 09:46 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j930l9$a3d$1@smc.vnet.net> (permalink)

Show all headers | View raw


Dear all,

I'd like to use the TreePlot function to visualise the expression of a
dynamic programming problem I am working on.

If I have something like: ( (a+b) + (c+d )

Mathematica helpfully simplifies this to: a + b + c + d

But I'd prefer it to be in the original form.

I can't write Hold[ ( (a+b) + (c+d) )] because I do want a,b,c & d to
be evaluated.

I want to write something like:
Hold[ ( (Evaluate[a]+Evaluate[b]) + (Evaluate[c]+Evaluate[d]) ) ]

But this just leaves the Evaluate expressions unevaluated.

Any help greatly appreciated.

Thanks,
Julian.

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

How to evaluate parts of an expression, but not other parts? Julian Francis <julian.w.francis@gmail.com> - 2011-11-05 09:46 +0000
  Re: How to evaluate parts of an expression, but not other parts? Silvia <wyelen@gmail.com> - 2011-11-06 11:01 +0000
  Re: How to evaluate parts of an expression, but not other parts? Rui <rui.rojo@gmail.com> - 2011-11-07 10:52 +0000
  Re: How to evaluate parts of an expression, but not other parts? Alexey Popkov <lehin.p@gmail.com> - 2011-11-08 12:14 +0000

csiph-web