Re: Mathematica hangs when solving sys. of equations w/ certain parameters

• To: mathgroup at smc.vnet.net
• Subject: [mg55611] Re: [mg55586] Mathematica hangs when solving sys. of equations w/ certain parameters
• From: "Janos D. Pinter" <jdpinter at hfx.eastlink.ca>
• Date: Thu, 31 Mar 2005 01:24:04 -0500 (EST)
• References: <200503300821.DAA21889@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Sean,

is your objective to find analytical expressions for all local optima, or
you want to find best (global) solutions for certain parameters? The first
task could be elusive; for the second you could try to use NMinimize or
MathOptimizer.

Regards,

Janos D. Pinter, PhD, DSc
PCS Inc.
Web: www.pinterconsulting.com

At 04:21 AM 3/30/2005, Sean wrote:

>I am trying to find local maxima of an objective function by solving the
>FOCs of a function of 4 control variables (pL,pH,phiL,phiH) and 3
>parameters (c, pDBS,phiDBS).
>
>The objective function is
>
>f[pL_,phiL_,pH_,phiH_,pDBS_,phiDBS_,c_] = \
>(pL-0.5c*phiL^2)*((pH-pL)/(phiH-phiL) - pL/phiL) + \
>(pH-0.5c*phiH^2)*((pDBS-pH)/(phiDBS-phiH) - (pH-pL)/(phiH-phiL))
>
>I find the FOCs by differentiating with respect to each of the 4 control
>variables, and then I solve the system using Solve[] (see details below)
>
>For certain values of the parameters (c, pDBS, phiDBS), the Solve[]
>routine works fine. But I can't figure out why Solve[] just seems to hang
>for other parameter values. I have verified that it's not because I'm
>dividing by zero or anything, and the points that are causing problems
>seem to be totally generic.
>
>For example, everything works fine when (c=0.1, pDBS=5, phiDBS=8) and when
>(c=0.1, pDBS=7, phiDBS=8), but not when (c=0.1, pDBS=6, phiDBS=8). I
>happen to know that at these latter parameter values, one of the solutions
>to the system is (pL=11.25, pH=0, phiL=15, phiH=0), and when I manually
>plug this solution into the FOCs, everything evaluates to zero as
>expected. I have also verified that I am not dividing anything by zero at
>this solution.
>
>I was wondering whether anybody else has ever experienced problems with
>Solve[] working for some parameter values but not for others, when there
>should be no obvious reason why it wouldn't work.
>
>Thanks for your help! I'm new to this forum, and did a search to make sure
>that this question hasn't been asked previously, but didn't see anything
>of this nature.
>
>---------------------------------------------
>Details
>---------------------------------------------
>focpL[pL_,phiL_,pH_,phiH_,pDBS_,phiDBS_,c_] =
>D[f[pL,phiL,pH,phiH,pDBS,phiDBS,c],pL]
>focphiL[pL_,phiL_,pH_,phiH_,pDBS_,phiDBS_,c_] =
>D[f[pL,phiL,pH,phiH,pDBS,phiDBS,c],phiL]
>focpH[pL_,phiL_,pH_,phiH_,pDBS_,phiDBS_,c_] =
>D[f[pL,phiL,pH,phiH,pDBS,phiDBS,c],pH]
>focphiH[pL_,phiL_,pH_,phiH_,pDBS_,phiDBS_,c_] =
>D[f[pL,phiL,pH,phiH,pDBS,phiDBS,c],phiH]
>
>pDBS:= 6.0
>phiDBS:= 8
>c:=0.1
>
>solution = \ Solve[{focpL[pL,phiL,pH,phiH,pDBS,phiDBS,c]==0, \
>focphiL[pL,phiL,pH,phiH,pDBS,phiDBS,c]==0, \
>focpH[pL,phiL,pH,phiH,pDBS,phiDBS,c]==0, \
>focphiH[pL,phiL,pH,phiH,pDBS,phiDBS,c]==0},{pL,phiL,pH,phiH}]
>
>
>
>
>--
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.0.308 / Virus Database: 266.8.4 - Release Date: 3/27/2005

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.6 - Release Date: 3/30/2005

```

• Prev by Date: Re: Re: Unicode Support
• Next by Date: Re: Mathematica hangs when solving sys. of equations w/certain parameters
• Previous by thread: Mathematica hangs when solving sys. of equations w/ certain parameters
• Next by thread: Re: Mathematica hangs when solving sys. of equations w/certain parameters