MathGroup Archive 2013

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

Search the Archive

How to speed up FindRoot with Map or MapThread

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129355] How to speed up FindRoot with Map or MapThread
  • From: o.sandig at googlemail.com
  • Date: Mon, 7 Jan 2013 00:39:14 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

Hi,
I would like to speed up FindRoot. 
In this special case I'm looking for roots of the equation 

sin[2*theta]+2*h*sin[theta - phi]

for different h's and phi's.
To do this I specify for each h the region within which the solution has to be found: X = {x_middle, x_left, x_right}, e.g.:

FindRoot[sin[2*theta] + 2*h1*sin[theta - phi1] == 0 , {theta, x_middle, x_left, x_right}]

That means that h is an mx1 matrix and X is an nx3 matrix (X = {x_middle, x_left, x_right}).

The question:
How can I use Map or MapThread to combine each element of h with the whole matrix X inside FindRoot to speed it up?

Thanks for any idea.



  • Prev by Date: Re: Precision
  • Next by Date: Re: Attaching a notebook to a message
  • Previous by thread: "Directional" light and ImageScaled coordinates (a bug?)
  • Next by thread: Re: How to speed up FindRoot with Map or MapThread