MathGroup Archive 2004

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

Search the Archive

Re: Symbolic use of numerical function FindRoot via ?NumericQ

  • To: mathgroup at
  • Subject: [mg48611] Re: Symbolic use of numerical function FindRoot via ?NumericQ
  • From: "Peter Pein" <petsie at>
  • Date: Mon, 7 Jun 2004 05:33:51 -0400 (EDT)
  • References: <c9pddv$nuf$>
  • Sender: owner-wri-mathgroup at

"Michael Beqq" <mbekkali at> schrieb im Newsbeitrag
news:c9pddv$nuf$1 at
> I've use symbolical evalution of numerical functions all the time but
> have not mastered it.  Now I got stuck on the following problem:
> I have a function g[x1,x2,y1,y2].  I need to solve for x1,x2 and y1,y2
> maximize g[x1,x2,y1,y2] in 2 steps,- in step 1 I need to find
> and x2*=x2[y1,y2].  Then I substitute solutions, *'s, into g[.] to get
> g[y1,y2] and then solve for solve for y1* and y2*.   This is a classical
> 2-stage problem in Economics.
> Is there a way to do that in Mathematica 5 using FindRoot command.  I
> using SetDelayed and ?NumericQ options however get error messages that the
> function g[.]'s is not a list of numbers with dimension {2} at {2 values}.
> Here is more precise code:
> g[x1_x2_,y1_,y2_]=g[x1,x2,y1,y2]"g is some function of 4 variables";
> te[{D[g[x1,x2,y1,y2],x1]]==0,D[g[x1,x2,y1,y2],x2]]==0},{x1,x10},{x2,x20}]]
> (* another website showed different code, i.e. x[(y1_,y2_)?Number] but I
> assume it is just semantics*)
> ]
> where {x10,x20,y10,y20}=some numbers.
> Thank you in advance.
Hi Michael,
calling a function of 4 variables with 2 variables will not work. I've got
difficulties to understand, why you do not solve all the 4 derivatives in
one step? And since x1* and x2* depend on y1 and y2 you have to use the
chain rule, when building the derivatives w.r.t. y1 and y2, or did I get
sth. wrong?

Peter Pein, Berlin
to write to me, start the subject with [

  • Prev by Date: Re: Re: Re: What is zero divided by zero?
  • Next by Date: Re: Random Matrix of Integers
  • Previous by thread: Symbolic use of numerical function FindRoot via ?NumericQ
  • Next by thread: Re: Symbolic use of numerical function FindRoot via ?NumericQ