No
t sure I understand your proposal.
What would you return for
solve( [x=2,y=f(y)], [x], [y])
where [y] is the list of variables (not parameters) whose values are not
requested? After all, we don't know whether y=f(y) has any solutions, and
solving simultaneous equations means finding values which make *all* the
equations true. Now what if f=cos? We know that that cos(y)=y has
solutions; do we now return [x=2]? But Maxima (as far as I know) doesn't
have a routine to determine whether an equation has solutions without
actually finding them -- though you could certainly imagine such a thing.
But even then, there's a problem -- Maxima won't always be able to
determine whether an equation has solutions; what do you do in that case?
How do you communicate to the user that if only y=f(y) had solutions, then
x=2 would be a solution? Perhaps by returning y=f(y) in the solution list,
as Solve currently does in the univariate case? But that doesn't fit your
specification of not returning values for non-variables.
In the case where Maxima *can* find solutions, the simplest approach would
be to list *all* the variables and just discard the results mentioning
variables you don't care about.
But perhaps I'm somehow missing what you're after here.
-s
On Wed, Jun 12, 2013 at 2:15 PM, Henry Baker <hbaker1 at pipeline.com> wrote:
> The problem is the definition of 'parameter' vs 'variable'.
>
> Solve seems to define a 'parameter' as a variable that doesn't happen to
> be listed in the vars list.
>
> What is really needed here are _three_ different sets: 'variables' that
> are mentioned in the vars list, 'variables' that aren't mentioned in the
> vars list, and 'parameters'.
>
> It should be possible to solve a system of equations without producing
> explicit solutions of _all_ of the 'variables'; just the 'variables' whose
> values are actually requested.
>
> Thus, solve might conceivably call eliminate to eliminate the variables
> that aren't mentioned in the vars list, and then solve for the remaining
> variables whose values are explicitly requested.
>
> I just tried 'eliminate' in this fashion & not only does it seem to work,
> but it's pretty fast for this particular task.
>
> At 10:38 AM 6/12/2013, Stavros Macrakis wrote:
> >Can you suggest concise language that would clarify this? Even for
> someone as sophisticated as you, apparently my language ("Solve only gives
> solutions valid for all values of parameters (as opposed to variables)")
> wasn't clear enough.
> >
> > -s
> >
> >On Wed, Jun 12, 2013 at 1:01 PM, Henry Baker <hbaker1 at pipeline.com>
> wrote:
> >Thanks, Stavros, for putting up with my density!
> >
> >I get it now.
> >
> >However, the documentation on 'solve', 'linsolve', etc., need to be fixed
> to document this behavior.
> >
> >I just did '? solve', and the documentation said nothing about this issue.
> >
> >At 09:52 AM 6/12/2013, Stavros Macrakis wrote:
> >>Extraneous equations add parameters. As I said, solve gives solutions
> that are correct for all values of all parameters.
> >>
> >>Thus:
> >>
> >> solve([x=0],[x]) => [[x=0]]
> >>
> >>but
> >>
> >> solve([x=0,y=2],[x]) => []
> >>
> >>because there is no solution for all values of y, which is considered a
> parameter, since it is not listed as a variable.
> >>
> >>In your example, you have equations like h0 = g0 + f0 - e0 which are
> composed entirely of parameters.
> >>
> >> -s
> >>
> >>On Wed, Jun 12, 2013 at 12:21 PM, Henry Baker <hbaker1 at pipeline.com>
> wrote:
> >>Your comment doesn't appear to me to be relevant to the particular set
> of equations that I gave.
> >>
> >>The equations are all linear, and solve works fine without the
> extraneous equations:
> >>
> >>(%i22) eqn12;
> >>(%o22) [d0 = c0 + b0, d1 = c1 + b1, d2 = c2 + b2]
> >>(%i23) d;
> >>(%o23) [d0, d1, d2]
> >>(%i24) solve(eqn12,d);
> >>(%o24) [[d0 = c0 + b0, d1 = c1 + b1, d2 = c2 + b2]]
> >>(%i25)
> >>
> >>How can the extraneous (linear) equations screw up solve?
> >>
> >>At 09:08 AM 6/12/2013, Stavros Macrakis wrote:
> >>>Solve only gives solutions valid for all values of parameters (as
> opposed to variables). For example:
> >>>
> >>>(%i12) solve([x=a,x=-a],[x]); <<< no solutions for all a
> >>>(%o12) []
> >>>(%i13) solve([x=a,x=-a],[x,a]); <<< make a into a variable
> >>>(%o13) [[x = 0, a = 0]]
> >>>
> >>>On Wed, Jun 12, 2013 at 11:38 AM, Henry Baker <hbaker1 at pipeline.com>
> wrote:
> >>>Solve doesn't work, either!
> >>>
> >>>(%i7) d;
> >>>(%o7) [d0, d1, d2]
> >>>(%i8) eqns;
> >>>(%o8) [d0 = c0 + b0, d1 = c1 + b1, d2 = c2 + b2, h0 = g0 + f0 - e0,
> >>>h1 = g1 + f1 - e1, h2 = g2 + f2 - e2, f0 = e0 + b0, f1 = e1 + b1,
> >>>f2 = e2 + b2, g0 = e0 + c0, g1 = e1 + c1, g2 = e2 + c2]
> >>>(%i9) solve(eqns,d);
> >>>(%o9) []
> >>>(%i10)
>
>