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


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

Re: evaluating functions and displaying results numerically

Started byBill Rowe <readnews@sbcglobal.net>
First post2012-04-22 10:10 +0000
Last post2012-04-22 10:10 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: evaluating functions and displaying results numerically Bill Rowe <readnews@sbcglobal.net> - 2012-04-22 10:10 +0000

#9742 — Re: evaluating functions and displaying results numerically

FromBill Rowe <readnews@sbcglobal.net>
Date2012-04-22 10:10 +0000
SubjectRe: evaluating functions and displaying results numerically
Message-ID<jn0ldo$4vn$1@smc.vnet.net>
On 4/21/12 at 12:33 AM, prof.eduardofontana@gmail.com (Eduardo
=46ontana) wrote:

>Once in a while a face a problem with Mathematica in which I cannot
>get a straightforward numerical output. I have a function defined in
>mathematica, I try to evaluate the function with numerical arguments
>and mathematica returns a replica of my function with the same
>arguments. It must be something I set without noticing. I cannot get
>numerical results at all. In another instance, I have a summation of
>about 1000 terms defined as a function of 3 arguments. When I use
>numerical arguments, instead of Mathematica calculating a numerical
>result it generates a symbolic output with all 1000 terms. Even if a
>try something very simple such as In[1]: Sin[1] the output is
>Out[1]: Sin[1] Could anyone give me a clue on this? regards


By default, Mathematica gives an exact answer whenever you
supply exact values. Since Sin[1] is not a rational value,
Mathematica returns the result as Sin[1] which is an exact answer.

If you want a numerical approximation to Sin[1] there are two
choices. First, would be to input Sin[1.] instead of Sin[1], i.e.,

In[1]:= Sin[1.]

Out[1]= 0.841471

This works since Mathemtica by default returns an approximate
number whenever you provide approximate numbers as inputs. The
value 1. is an approximate number.

The other way would be to use N to convert the result to an
approximate number, i.e.,

In[2]:= Sin[1] // N

Out[2]= 0.841471

[toc] | [standalone]


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


csiph-web