Re: Can anybody help me solving such a system of nonlinear equations?

• To: mathgroup at smc.vnet.net
• Subject: [mg77451] Re: Can anybody help me solving such a system of nonlinear equations?
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Sat, 9 Jun 2007 05:30:17 -0400 (EDT)
• Organization: The Open University, Milton Keynes, UK
• References: <f4b8nm\$3rc\$1@smc.vnet.net>

```loveinla at gmail.com wrote:
> Hi, guys,
>
> I have tried NSolve, Solve, Reduce, to solve the system below,
> however, the mathematica didn't return an answer. Can anybody know how
> to solve it using Mathematica?
>
> The inputs are as follows:
>
> a = 24;
> b = 5;
> c = 25;
> d = 4;
> cA = 3;
> cB = 2;
> t = 5;
> alpha = 0.2;
> Solve[{(a - b*pA - b*(pA - cA))*(0.5 - ((d/2)(
> p1^2 - p2^2) -
>     c(p1 - p2))/(2t) - ((b/2)((pA - disA)^2 - pA^2) +
>               a*disA)/(2t)) - ((p1 - cB)(
>           c - d*p1) + (
>               pA - disA - cA)(a - b*(pA - disA)) - (pA -
>                     cA)(a - b*(pA)))*(-(a - b*pA)/(2t)) ==
>               0, -(a - b*(pA - disA) - b(pA - disA - cA))*(0.5 + ((d/2)
> (
>                     p1^2 - p2^2) - c(p1 - p2))/(2t) + ((
>         b/2)((pA - disA)^2 - pA^2) + a*disA)/(2t)) - ((
>               p1 - cB)(c - d*p1) + (pA - disA - cA)(a -
>                     b*(pA - disA)) - (pA - cA)(a - b*(
>               pA)))*(-(a - b*(pA - disA))/(2t)) == 0, ((p1 -
>            cB)(c - d*p1) + alpha*(pA - disA - cA)(a - b*(
>     pA - disA)) - alpha*(pA - cA)(a - b*(pA)))*(-(
>                 c - d*p1)/(2t)) + (c - d*p1 - d(p1 - cB))(0.5 + ((d/
>               2)(p1^2 - p2^2) - c(p1 - p2))/(2t) + alpha*((
>                     b/2)((pA - disA)^2 - pA^2) + a*disA)/(
>               2t)) == 0, (c - d*p2 - d*(p2 - cB))(0.5 - ((d/
>                           2)(p1^2 - p2^2) - c(p1 - p2))/(2t) -
> alpha*((b/
>         2)((pA - disA)^2 - pA^2) + a*disA)/(2t)) + (
>               p2 - cB)(c - d*p2)(-(c - d*p2)/(2t)) == 0}, {pA, p1, p2,
> disA}]
>
>
>

Depending on the precision you need, NSolve works fine. For instance,

In[1]:= eqns =
With[{a = 24, b = 5, c = 25, d = 4, cA = 3, cB = 2, t = 5,
alpha = 2/10}, FullSimplify /@
{(a - b*pA - b*(pA - cA))*(1/2 - ((d/2)*(p1^2 - p2^2) -
c*(p1 - p2))/(2*
t) - ((b/2)*((pA - disA)^2 - pA^2) +
a*disA)/(2*t)) - ((p1 - cB)*(c - d*p1) +
(pA - disA - cA)*(a - b*(pA - disA)) - (pA -
cA)*(a - b*pA))*
(-(a - b*pA)/(2*t)) == 0,
(-(a - b*(pA - disA) - b*(pA - disA - cA)))*
(1/2 + ((d/2)*(p1^2 - p2^2) - c*(p1 - p2))/(2*t) +
((b/2)*((pA - disA)^2 - pA^2) + a*disA)/(2*t)) -
((p1 - cB)*(c - d*p1) + (pA - disA - cA)*(a -
b*(pA - disA)) -
(pA - cA)*(a - b*pA))*(-(a - b*(pA - disA))/(2*t)) ==
0,
((p1 - cB)*(c - d*p1) + alpha*(pA - disA - cA)*
(a - b*(pA - disA)) -
alpha*(pA - cA)*(a - b*pA))*
(-(c - d*p1)/(2*t)) + (c - d*p1 - d*(p1 - cB))*
(1/2 + ((d/2)*(p1^2 - p2^2) - c*(p1 - p2))/(2*t) +

alpha*(((b/2)*((pA - disA)^2 - pA^2) + a*disA)/(2*t))) ==
0,
(c - d*p2 - d*(p2 - cB))*(1/2 - ((d/2)*(p1^2 - p2^2) -
c*(p1 - p2))/(2*t) -
alpha*(((b/2)*((pA - disA)^2 - pA^2) +
a*disA)/(2*t))) + (p2 - cB)*(c - d*p2)*
(-(c - d*p2)/(2*t)) == 0}]
sols = NSolve[eqns, {pA, p1, p2, disA}]
(Chop[#1, 10^(-8)] & )[{eqns[[1, 1]] - eqns[[1, 2]],
eqns[[2, 1]] - eqns[[2, 2]], eqns[[3, 1]], eqns[[4, 1]]} /.
sols]

Out[1]= {6*(589 - 58*p1)*p1 + 10*(40 + p1*(-83 + 8*p1))*pA +
5*disA^2*(-87 + 20*pA) ==
2010 + 2*p2*(-25 + 2*p2)*(-39 + 10*pA) +
4*disA*(936 + 5*pA*(-87 + 10*pA)),
2*(1395 + 50*disA^3 + 2*p1^2*(87 - 20*pA) - 300*pA +
p2*(-25 + 2*p2)*(-39 + 10*pA) + p1*(-1767 + 415*pA) +
disA*(2172 + 5*p1*(-83 + 8*p1) + 10*(25 - 2*p2)*p2 +
10*pA*(-87 + 10*pA))) == 15*disA^2*(-87 + 20*pA),
5*disA^2*(-83 + 16*p1) + 10*(2*(-9 + p1)*p1*(-105 + 16*p1) +
200*p1*p2 + 2*(33 - 8*p1)*p2^2 - 5*(283 + 165*p2)) +
2*disA*(-1767 + 4*p1*(87 - 20*pA) + 415*pA) == 0,
(1/100)*(10*(25 - 4*p2)^2*(-2 + p2) + (-33 + 8*p2)*
(10*(5 + (25 - 2*p1)*p1 + p2*(-25 + 2*p2)) +
disA*(-48 - 5*disA + 10*pA))) == 0}

Out[2]= {{pA -> -12.06189642812917, p1 -> 8.34402234764809,
p2 -> 3.356678571144645, disA -> -32.70935236153433},
{pA -> 17.265485311392837, p1 -> 2.439609061873783,
p2 -> 4.618440545871479, disA -> 25.673938511061692},
{pA -> 13.81047581155533, p1 -> 2.4037962568088047,
p2 -> 8.791025403403523, disA -> 18.77941930142607},
{pA -> 4.699630588499789 + 3.7683838321516383*I,
p1 -> 6.359324240492989 - 1.1317601366711163*I,
p2 -> 5.833210978440062 - 1.0887366827652258*I,
disA -> 1.0215517102528369 + 7.522476139258227*I},
{pA -> 4.699630588499789 - 3.7683838321516383*I,
p1 -> 6.359324240492989 + 1.1317601366711163*I,
p2 -> 5.833210978440062 + 1.0887366827652258*I,
disA -> 1.0215517102528369 - 7.522476139258227*I},
{pA -> 4.809304762769946 + 4.311029960544415*I,
p1 -> 6.426329341619092 - 1.202035823002143*I,
p2 -> 6.502058831524984 + 1.2092489543878284*I,
disA -> 1.213663968993755 + 8.631059512781976*I},
{pA -> 4.809304762769946 - 4.311029960544415*I,
p1 -> 6.426329341619092 + 1.202035823002143*I,
p2 -> 6.502058831524984 - 1.2092489543878284*I,
disA -> 1.213663968993755 - 8.631059512781976*I},
{pA -> 1.2910505175398863, p1 -> 4.6226352739904275,
p2 -> 3.0762499216577734, disA -> -6.7743708779685505},
{pA -> 3.4635262592499094 + 0.9312186311857698*I,
p1 -> 6.223958361707435 - 1.2301621442682107*I,
p2 -> 5.9728359912537865 - 1.1334628248384875*I,
disA -> 0.20113798369291158 + 1.5505747049588072*I},
{pA -> 3.4635262592499094 - 0.9312186311857698*I,
p1 -> 6.223958361707435 + 1.2301621442682107*I,
p2 -> 5.9728359912537865 + 1.1334628248384875*I,
disA -> 0.20113798369291158 - 1.5505747049588072*I},
{pA -> 3.3884321485724955 + 0.8955222267076347*I,
p1 -> 6.297554158874207 - 1.278032188535932*I,
p2 -> 6.311322058804194 + 1.2040631070690104*I,
disA -> 0.1581399153887693 + 1.5183991645734929*I},
{pA -> 3.3884321485724955 - 0.8955222267076347*I,
p1 -> 6.297554158874207 + 1.278032188535932*I,
p2 -> 6.311322058804194 - 1.2040631070690104*I,
disA -> 0.1581399153887693 - 1.5183991645734929*I},
{pA -> 4.11571873522887 - 0.21886644927641588*I,
p1 -> 6.249580007206807 + 1.1894390540657032*I,
p2 -> 6.184694166431468 - 1.2505596012644582*I,
disA -> -0.992108747596738 + 1.003503973138894*I},
{pA -> 4.11571873522887 + 0.21886644927641588*I,
p1 -> 6.249580007206807 - 1.1894390540657032*I,
p2 -> 6.184694166431468 + 1.2505596012644582*I,
disA -> -0.992108747596738 - 1.003503973138894*I},
{pA -> 4.119992313758444 + 0.16820717551995332*I,
p1 -> 6.149972535352223 - 1.1687915102753534*I,
p2 -> 6.069091957840634 - 1.2200796383812478*I,
disA -> -1.0588801411331423 - 1.0013345567536924*I},
{pA -> 4.119992313758444 - 0.16820717551995332*I,
p1 -> 6.149972535352223 + 1.1687915102753534*I,
p2 -> 6.069091957840634 + 1.2200796383812478*I,
disA -> -1.0588801411331423 + 1.0013345567536924*I},
{pA -> 4.368275470923857 + 2.3351851286136247*I,
p1 -> 4.865111663465403 + 0.12169418355287195*I,
p2 -> 3.0268342640601227 - 0.00790086095686217*I,
disA -> -0.5200916815936684 + 2.76693245489717*I},
{pA -> 4.368275470923857 - 2.3351851286136247*I,
p1 -> 4.865111663465403 - 0.12169418355287195*I,
p2 -> 3.0268342640601227 + 0.00790086095686217*I,
disA -> -0.5200916815936684 - 2.76693245489717*I},
{pA -> 3.0983083087838876 - 0.5270861226903584*I,
p1 -> 8.138157979060834 - 0.07589264336638436*I,
p2 -> 3.0562768785310923 - 0.02384971235213621*I,
disA -> -0.33077557680568626 + 1.208000808605468*I},
{pA -> 3.0983083087838876 + 0.5270861226903584*I,
p1 -> 8.138157979060834 + 0.07589264336638436*I,
p2 -> 3.0562768785310923 + 0.02384971235213621*I,
disA -> -0.33077557680568626 - 1.208000808605468*I},
{pA -> 3.460235391222053 + 0.7393870755179917*I,
p1 -> 3.0524177544558393 + 0.03923100156390229*I,
p2 -> 7.995775247361867 + 0.016486912235177578*I,
disA -> -0.13205359263286792 + 0.5658225510181639*I},
{pA -> 3.460235391222053 - 0.7393870755179917*I,
p1 -> 3.0524177544558393 - 0.03923100156390229*I,
p2 -> 7.995775247361867 - 0.016486912235177578*I,
disA -> -0.13205359263286792 - 0.5658225510181639*I},
{pA -> 4.615634965236858 + 0.2750351897569045*I,
p1 -> 6.098240871978464 - 1.1233472240855473*I,
p2 -> 6.098624677834901 - 1.1432415363240416*I,
disA -> -0.1567139969328328 + 0.6584442274616198*I},
{pA -> 4.615634965236858 - 0.2750351897569045*I,
p1 -> 6.098240871978464 + 1.1233472240855473*I,
p2 -> 6.098624677834901 + 1.1432415363240416*I,
disA -> -0.1567139969328328 - 0.6584442274616198*I},
{pA -> 4.657126279735499 + 0.30324565471596754*I,
p1 -> 6.173299295732771 - 1.1441043218236748*I,
p2 -> 6.188531790221966 + 1.1642890309109823*I,
disA -> -0.14014979241180375 + 0.6898845975194938*I},
{pA -> 4.657126279735499 - 0.30324565471596754*I,
p1 -> 6.173299295732771 + 1.1441043218236748*I,
p2 -> 6.188531790221966 - 1.1642890309109823*I,
disA -> -0.14014979241180375 - 0.6898845975194938*I},
{pA -> 4.85856246827544 + 1.5636467453739502*I,
p1 -> 6.1670258406571286 + 1.343824684143421*I,
p2 -> 6.2301608105421025 - 1.1166971988089176*I,
disA -> 0.9840103336255757 + 1.2856940803148085*I},
{pA -> 4.85856246827544 - 1.5636467453739502*I,
p1 -> 6.1670258406571286 - 1.343824684143421*I,
p2 -> 6.2301608105421025 + 1.1166971988089176*I,
disA -> 0.9840103336255757 - 1.2856940803148085*I},
{pA -> 4.700405379706214 + 0.9602056974247697*I,
p1 -> 2.3209368999220783 - 0.047174760289443174*I,
p2 -> 2.275099928135344 - 0.03832105285008741*I,
disA -> 1.0363469218444052 + 1.3418151319164293*I},
{pA -> 4.700405379706214 - 0.9602056974247697*I,
p1 -> 2.3209368999220783 + 0.047174760289443174*I,
p2 -> 2.275099928135344 + 0.03832105285008741*I,
disA -> 1.0363469218444052 - 1.3418151319164293*I},
{pA -> 5.040374022734264 - 0.13589279464710433*I,
p1 -> 2.8523278805825223 - 0.14160058618308777*I,
p2 -> 8.054373552655694 + 0.10041942243664882*I,
disA -> 0.12306168043362546 + 1.615973433307376*I},
{pA -> 5.040374022734264 + 0.13589279464710433*I,
p1 -> 2.8523278805825223 + 0.14160058618308777*I,
p2 -> 8.054373552655694 - 0.10041942243664882*I,
disA -> 0.12306168043362546 - 1.615973433307376*I},
{pA -> 4.863849398252252 + 1.5552707941407546*I,
p1 -> 6.104990832845352 + 1.3225727032952503*I,
p2 -> 6.0739846623087335 + 1.082299067760124*I,
disA -> 1.0275698869564367 + 1.3092322851765947*I},
{pA -> 4.863849398252252 - 1.5552707941407546*I,
p1 -> 6.104990832845352 - 1.3225727032952503*I,
p2 -> 6.0739846623087335 - 1.082299067760124*I,
disA -> 1.0275698869564367 - 1.3092322851765947*I},
{pA -> 5.342633484670965 + 1.2903710461121054*I,
p1 -> 7.964533131091436 + 0.07748095383665983*I,
p2 -> 3.0218129946565244 + 0.002906769503322082*I,
disA -> 0.32570236711158396 + 1.0125321488889447*I},
{pA -> 5.342633484670965 - 1.2903710461121054*I,
p1 -> 7.964533131091436 - 0.07748095383665983*I,
p2 -> 3.0218129946565244 - 0.002906769503322082*I,
disA -> 0.32570236711158396 - 1.0125321488889447*I},
{pA -> 3.3942283180641346 + 0.6898963086021609*I,
p1 -> 3.118832641082504 + 0.041261360764756186*I,
p2 -> 4.976247479119619 - 0.007362078124791084*I,
disA -> -0.1821159831725192 + 0.514722015706369*I},
{pA -> 3.3942283180641346 - 0.6898963086021609*I,
p1 -> 3.118832641082504 - 0.041261360764756186*I,
p2 -> 4.976247479119619 + 0.007362078124791084*I,
disA -> -0.1821159831725192 - 0.514722015706369*I},
{pA -> 4.5541426008457595, p1 -> 2.300678174040287,
p2 -> 2.26998405731452, disA -> 1.1002810573705266},
{pA -> 4.128864029252393, p1 -> 4.967898884645701,
p2 -> 3.1084676076634485, disA -> -0.11886946315839667},
{pA -> 4.173297695144698 + 0.3249806946923189*I,
p1 -> 2.2909911128479843 - 0.07667394829689839*I,
p2 -> 2.30759566297336 - 0.04066254122245161*I,
disA -> -0.710154054903588 + 1.1887343511995823*I},
{pA -> 4.173297695144698 - 0.3249806946923189*I,
p1 -> 2.2909911128479843 + 0.07667394829689839*I,
p2 -> 2.30759566297336 + 0.04066254122245161*I,
disA -> -0.710154054903588 - 1.1887343511995823*I},
{pA -> 5.120086580366375 - 0.1853276105137699*I,
p1 -> 2.9136115732151318 - 0.13437247983174408*I,
p2 -> 4.946667951729195 - 0.045822623372494355*I,
disA -> 0.1732364017149688 + 1.6604645825866722*I},
{pA -> 5.120086580366375 + 0.1853276105137699*I,
p1 -> 2.9136115732151318 + 0.13437247983174408*I,
p2 -> 4.946667951729195 + 0.045822623372494355*I,
disA -> 0.1732364017149688 - 1.6604645825866722*I},
{pA -> 4.010233474014608, p1 -> 4.969276499781901,
p2 -> 3.032911941398236, disA -> 1.7213995448660353}}

Out[3]= {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0,
0, 0, 0},
{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0},
{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0},
{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0},
{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0},
{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0},
{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0},
{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0},
{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0},
{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0},
{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}
Regards,
Jean-Marc

```

• Prev by Date: Re: v6: still no multiple undo?
• Next by Date: Re: v6: still no multiple undo?
• Previous by thread: Can anybody help me solving such a system of nonlinear equations?
• Next by thread: Re: Can anybody help me solving such a system of nonlinear equations?