MathGroup Archive 2003

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

Search the Archive

Re: Re: Solve[] handles the same system differently

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40885] Re: [mg40868] Re: Solve[] handles the same system differently
  • From: Bobby Treat <drmajorbob+MathGroup3528 at mailblocks.com>
  • Date: Wed, 23 Apr 2003 01:16:16 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Solve can handle the system if (a) you list VgsX1 as a parameter to be 
eliminated, (b) if you list it as a variable to solve for, or (c) if 
you give Solve no second or third argument at all, and let Solve assume 
they're all variables.

So, the scenario it can't handle is that VgsX1 is a parameter not 
specifically intended to be eliminated.  But if that were all, the same 
"problem" would apply to Rx and VinX1 equally well.  They can be 
eliminated, so the following attempts would fail for the same reason 
(but they don't):

eqns = {Rx == 3300, VinX1 == 0, VgsX1 == Rx*IdsX1,
      IdsX1 == 0.001(1 - (VinX1 - VgsX1)/(-1.5))^2};
Solve[eqns, {IdsX1, VinX1, VgsX1}]
Solve[eqns, {IdsX1, Rx, VgsX1}]

Rx, VinX1, and VgsX1 are all easily eliminated using the equations that 
give their values on the right-hand side.

The difference is that an equation like parameter == numeric or 
variable == numeric is simplified away, but parameter == var1 * var2 is 
not.  Why?  Because Mathematica is thinking the parameter must be free 
to have any value, and it actually can't.  The same reasoning could (in 
principle) apply to parameter == numeric, but Mathematica doesn't do 
that.

Bobby

-----Original Message-----
From: Joe Gwinn <joegwinn at attbi.com>
To: mathgroup at smc.vnet.net
Subject: [mg40885] [mg40868] Re: Solve[] handles the same system differently

In article &lt;b80k0i$m3f$1 at smc.vnet.net&gt;, Joe Gwinn 
&lt;joegwinn at attbi.com&gt; wrote: &gt; I am running Mathematica 4.0.1.0 
under MacOS 9.1, and have encountered a &gt; little mystery: &gt; &gt; 
&gt; The following works OK: &gt; &gt; In[15]:= &gt; Solve[{Rx == 3300, 
VinX1 == 0, &gt; IdsX1 == 0.001(1 - (VinX1 - Rx*IdsX1)/(-1.5))^2}, 
{IdsX1}] &gt; &gt; Yielding: &gt; &gt; Out[15]= &gt; {{IdsX1 -&gt; 
0.000234453}, {IdsX1 -&gt; 0.00088125}} &gt; &gt; &gt; When I rearrange 
the equation system a bit, it fails to find a solution: &gt; &gt; 
In[16]:= &gt; Solve[{Rx == 3300, VinX1 == 0, VgsX1 == Rx*IdsX1, &gt; 
IdsX1 == 0.001(1 - (VinX1 - VgsX1)/(-1.5))^2}, {IdsX1}] &gt; &gt; 
Out[16]= &gt; {} &gt; &gt; &gt; What's going on? Why does a little 
algebra (the creation of the &gt; variable VgsX1) cause a problem? 
In[16] was generated by copying In[15] &gt; and doing some editing. No 
error messages were generated by either. A number of people contacted 
me offline and suggested that the difference was that Solve[] was 
interpreting VgsX1 as a parameter, so only special-case solutions 
exist, which Solve doesn't accept as a solution. If you list VgsX1 as a 
variable to be eliminated, all is well. The other proposed solution was 
to add VdsX1 to the list of variables to be solved for. Both approaches 
work. Thanks to all, Joe Gwinn 


  • Prev by Date: Re: RE: Solve[] handles the same system differently
  • Next by Date: Re: Re: Finding derivatives of a list?
  • Previous by thread: Re: RE: Solve[] handles the same system differently
  • Next by thread: books on *problem solving* using mathematica