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


Groups > comp.soft-sys.math.mathematica > #5040 > unrolled thread

Re: output forms

Started by"David Park" <djmpark@comcast.net>
First post2011-09-18 08:10 +0000
Last post2011-09-18 08:10 +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.


Contents

  Re: output forms "David Park" <djmpark@comcast.net> - 2011-09-18 08:10 +0000

#5040 — Re: output forms

From"David Park" <djmpark@comcast.net>
Date2011-09-18 08:10 +0000
SubjectRe: output forms
Message-ID<j5491c$64q$1@smc.vnet.net>
Your ultimate objective is not clear here. In any case, Mathematica always
evaluates everything, applying all definitions until there are no more that
can be applied.

I probably wouldn't define values for a, b and c but use Rules instead to
substitute their values (or a With statement). This preserves their use as
symbols.

To prevent automatic evaluation you have to use HoldForm. Then you can get
evaluation by using ReleaseHold. But suppose you want to do selective
evaluation of a held expression? The Presentations package has an
EvaluateAtPattern command that allows you to do selective evaluations.

If you are new to Mathematica % refers to the previous output.

<< Presentations` 

HoldForm[a + b c]
% /. {a -> 1, b -> 2, c -> 3}
% // EvaluateAtPattern[_Times]
% // EvaluateAtPattern[_Plus] 

This gives the successive outputs:

a + b c
1 + 2 x 3
1 + 6
7

Mathematica is not, out of the box, very good at teaching or illustrating
elementary or basic math, but with a little effort, using HoldForm, or
bypassing the more powerful automatic routines such as Integrate and Solve,
it is certainly possible to do a very good job at this.


David Park
djmpark@comcast.net
http://home.comcast.net/~djmpark/  



From: klkj fukyfl [mailto:kitas11@yahoo.com] 


Hello, I need Matheamtica to do the following:

in:

a=1;
b=2;
c=3;
d=a+b*c

out: 

d=1+2*3
and so on...

previously I was using another system, but I found that this kind of stuff
is impossible

Can this be performed on Mathematica?

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web