Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7004 > unrolled thread
| Started by | Tomas Garza <tgarza10@msn.com> |
|---|---|
| First post | 2011-12-08 10:24 +0000 |
| Last post | 2011-12-08 10:24 +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: Evaluate[expr] Tomas Garza <tgarza10@msn.com> - 2011-12-08 10:24 +0000
| From | Tomas Garza <tgarza10@msn.com> |
|---|---|
| Date | 2011-12-08 10:24 +0000 |
| Subject | Re: Evaluate[expr] |
| Message-ID | <jbq398$iga$1@smc.vnet.net> |
The problem seems to be with the evaluation of the derivative. The iterator
substitutes the value of x in each element of the list in order to produce
the table. It is clear, then, what the values of x and f(x) are when x
takes the successive values 0, 0.3, 0.6,... But when it comes to the
derivative, it takes D[f[0],0], D[f[0.3],0.3], etc., which are
meaningless. That is why the Evaluate is necessary, and you may get a clearer notion of what goes on if you write instead Table[{{x}, f[x], D[f[t], t] /. t -> x}, {x, 0, 2, 0.3}],which says "first obtain the derivative and then evaluate it for the successive values of x" . A more efficient procedure would be to set g[x_]=D[f[x],x], and computeTable[{{x},f[x],g[x]}, {x, 0, 2, 0.3}]
-Tomas
> Date: Wed, 7 Dec 2011 06:14:45 -0500
> From: shlwell1988@gmail.com
> Subject: Evaluate[expr]
> To: mathgroup@smc.vnet.net
>
> f[x_] = x^5 - 3 x^2 + 1; tt =
> Table[Evaluate[{{x}, f[x], D[f[x], x]}], {x, 0, 2, 0.3}]
>
> In the above expression , what's the function of Evaluate[expr]?
>
> Why doesn't it work without Evaluate[expr]?
>
> Can you help me?
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web