Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Thread function now working as expected

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74603] Re: Thread function now working as expected
  • From: dh <dh at metrohm.ch>
  • Date: Wed, 28 Mar 2007 01:38:48 -0500 (EST)
  • References: <euan64$do9$1@smc.vnet.net>


Hi,

Thread is an ordinary function and its arguments are evaluated. 

Therefore, Expand[eqn2] does nothing and returns eqn2, what is then fed 

to Thread. Having said this, what you want can be achieved e.g. by 

mapping Expand over eqn2:

Expand/@eqn2

Daniel



siewsk at bp.com wrote:

> I cannot get the Thread function to work on In[3] and I

> am forced to do it manually in In[4]

> 

> Does anyone has any idea why In[3] is not working as I expected?

> 

> In[1]:= eqn1 = Sqrt[1 + 196*x^4] == 12*x - 1 - 14*x^2

> Out[1]=

>               4                     2

> Sqrt[1 + 196 x ] == -1 + 12 x - 14 x

> 

> 

> In[2]:= eqn2 = Thread[(#1^2 & )[eqn1], Equal]

> Out[2]=

>          4                     2 2

> 1 + 196 x  == (-1 + 12 x - 14 x )

> 

> 

> In[3]:= dummy = Thread[Expand[eqn2], Equal]

> Out[3]=

>          4                     2 2

> 1 + 196 x  == (-1 + 12 x - 14 x )

> 

> 

> In[4]:= eqn3 = Equal[ eqn2[[1]] , Expand[ eqn2[[2]] ]  ]

> Out[4]=

>          4                    2        3        4

> 1 + 196 x  == 1 - 24 x + 172 x  - 336 x  + 196 x

> 

> 

> In[5]:= Simplify[eqn3]

> Out[5]=

>                   2

> x (6 - 43 x + 84 x ) == 0

> 

> 




  • Prev by Date: Re: Symbolic Calculations with Matrices
  • Next by Date: Re: Thread function now working as expected
  • Previous by thread: Re: Thread function now working as expected
  • Next by thread: Re: Thread function now working as expected