MathGroup Archive 1997

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

Search the Archive

Re: 'Double' FindRoot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg8695] Re: [mg8690] 'Double' FindRoot
  • From: David Withoff <withoff>
  • Date: Fri, 19 Sep 1997 02:47:38 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

> I've got another serious problem
>
> I'm trying to find a numerical solution to a set of three equations:
>
> 1)
>
> FindRoot[
>   {fa[0.1,x1]==fa[x2,x3],
>    fb[0.1,x1]==fb[x2,x3],
>    fc[0.1,x1]==fc[x2,x3]},
>   {x1,0.1},{x2,0.1},{x3,0.9}]
>
> Worst of all: fa, fb, and fc are defined as:
>
> (this is a simplified example !)
>
> 2)
>
> fa=Function[{y1,y2},
>       fr=FindRoot[
>            {a1 x + b1 y + c1 z == p1[y1,y2],
>             a2 x + b2 y + c2 z == p2[y1,y2],
>             a3 x + b3 y + c3 z == p3[y1,y2]},
>             {x,0.1},{y,0.1},{z,0.1}];
>
>             x + y + z /. fr
>    ]
>
> Just typing 'fa[1,2]' produces NO error.
>
> But as soon as I start program 1) Mathematica says that it's expecting a
> 'list of length 3'
> Again: If I calculate 'fa' all by itself it returns a number for all
> combinations of y1 and y2
>
> So what causes this error ?? Or  isn't  Mathematica able to do more than
> one FindRoot at the same time ????
>
> Michaela

Yes, Mathematica can do more than one FindRoot at the same time.

Try giving two starting values for x1, x2, and x3, so that the outer
FindRoot doesn't need to compute symbolic derivatives.  The attempt
to compute symbolic derivatives of fa[x2, x3], etc., isn't going to
work here.  My guess is that the error is coming when these functions
are called with symbolic arguments, but I'd need to see the rest of
the example in order to be sure of that.

Dave Withoff
Wolfram Research


  • Prev by Date: A Recreational Endeavour
  • Next by Date: Spline 3D
  • Previous by thread: 'Double' FindRoot
  • Next by thread: Solving " a x > 0"