Re: System for which Solve and NSolve both fail
- To: mathgroup at smc.vnet.net
- Subject: [mg30580] Re: [mg30572] System for which Solve and NSolve both fail
- From: BobHanlon at aol.com
- Date: Thu, 30 Aug 2001 03:51:26 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 2001/8/29 2:11:11 AM, ben at spam.bugs.me.quickmath.com
writes:
>I noticed that Mathematica seems unable to solve this system of equations
>:
>
>3^x + 3^y = 90
>
>x + y = 6
>
>With a bit of thought, you can see by inspection that the solutions are
>
>{x , y} = {2 , 4} or {4 , 2}
>
>However, when I use the commands
>
>Solve[{3^x+3^y==90,x+y==6},{x,y}]
>
>or
>
>NSolve[{3^x+3^y==90,x+y==6},{x,y}]
>
>I get a warning message starting with
>
>Solve::incnst: Inconsistent or redundant transcendental equation
>
>Can anyone shed some light on what is going on here? Any way to get around
>this problem?
>
Needs["Graphics`ImplicitPlot`"];
Needs["Graphics`Colors`"];
Solve and NSolve are primarily for polynomial equations. Use FindRoot
eqns = {3^x + 3^y == 90, x + y == 6};
ImplicitPlot[eqns, {x, 1, 5}, {y, 1, 5}, PlotStyle -> {Red, Blue}];
FindRoot[eqns, {x, 4.1}, {y, 2.2}] // Rationalize[#, 1*^-8]&
{x -> 4, y -> 2}
FindRoot[eqns, {x, 2.2}, {y, 4.1}] // Rationalize[#, 1*^-8]&
{x -> 2, y -> 4}
eqns /. {%, %%}
{{True, True}, {True, True}}
Bob Hanlon
Chantilly, VA USA