Message Boards Message Boards

0
|
3929 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Meaning of 1.name

Posted 10 years ago

Hi! What does the form 1.number mean? I am getting answers in the form 1.pi or 1.d where d is a variable. There is also just 1. , can someone please explain this? Example:

(-0.5 Cos[1. (-3. + 1. a + 1. c - 1. d) pi] + 
 0.5 Cos[1. (-3. + 1. a - 1. c + 1. d) pi])/((-3. + 1. a) (c - 1. d) pi^2)
POSTED BY: Maham Aftab
3 Replies
Posted 10 years ago

Thank you! This was extremely helpful!

POSTED BY: Maham Aftab

The 1.0 coefficients can be changed to exact 1's in a variety of ways. A simple method is with Rationalize.

In[1]:= expr = (-0.5 Cos[1. (-3. + 1. a + 1. c - 1. d) pi] +                            
             0.5 Cos[1. (-3. + 1. a - 1. c + 1. d) pi])/((-3. + 1. a) (c -  1. d) pi^2); 

In[2]:= rexpr = Rationalize[expr]                                                       

        -Cos[(-3 + a + c - d) pi]   Cos[(-3 + a - c + d) pi]
        ------------------------- + ------------------------
                    2                          2
Out[2]= ----------------------------------------------------
                                           2
                        (-3 + a) (c - d) pi 

In[3]:= Together[%]                                                                     

        -Cos[(-3 + a + c - d) pi] + Cos[(-3 + a - c + d) pi]
Out[3]= ----------------------------------------------------
                                            2
                       2 (-3 + a) (c - d) pi

If by "pi", you mean 3.14159..., this can be simplified further.

In[4]:= FullSimplify[rexpr /. pi -> Pi, Element[{a, c, d}, Reals] ]                     

          Sin[a Pi] Sin[(c - d) Pi]
Out[4]= -(-------------------------)
                               2
            (-3 + a) (c - d) Pi

where

In[5]:= ? /.      
expr /.rules applies a rule or list of rules in an attempt to transform each subpart of
     an expression expr. 

In[6]:= ? ->    
lhs -> rhs represents a rule that transforms lhs to rhs. 
POSTED BY: Bruce Miller

It means there is a coefficient which is the machine double precision 1.0. Since this is not an exact number (such as 1 or Pi or 7/3) it does not get "absorbed" by the rest of the term. This is important since it would be bad to give an exact result for an approximate quantity, even a symbolic one.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract