Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.8K Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Need help with "SolveAlways"

Posted 10 years ago

Hello, I am trying to solve for example the following equation

a + (b - y) (1 - y) x=0

where x is a variable and y is an unknown parameter.

I use:

SolveAlways[a + (b - y) (1 - y) x == 0, x]

and the solution is:

{{a -> 0, b -> y}, {a -> 0, y -> 1}}

I want only the first solution since y is an unknown parameter and in general doesn't equal 1.

Is there a way to tell the program to treat y as a parameter and not to try and solve it for a specific y?

POSTED BY: Gidon W
5 Replies

This seems to work too

Solve[Not@Eliminate[Not[a + (b - y)*(1 - y)*x == 0], x], {a, b}]

This it taken from the documentation of SolveAlways:

SolveAlways[eqns,vars] is equivalent to Solve[!Eliminate[!eqns,vars]]

By default the outer Solve solves for all the variables. You can tell it to only solve for a and b, and not for y.

POSTED BY: Gianluca Gorni
POSTED BY: Gianluca Gorni
Posted 10 years ago

Thanks but i want it from the beginning not to look for a solution for y.

When i solve an equation like this with hundreds of variables, solving it with SolveAlways takes a few seconds when looking for only one solution, and can take hours when there is more than one solution..

POSTED BY: Gidon W

You can use a First[] function to extract first solution:

First@SolveAlways[a + (b - y)*(1 - y)*x == 0, x]

Or:

SolveAlways[a + (b - y)*(1 - y)*x == 0, x][[1]]
POSTED BY: Mariusz Iwaniuk
Posted 10 years ago

In the documentation for SolveAlways, hiding behind "Details and Options", it says

SolveAlways produces relations between parameters that appear in eqns, but are not in the list of variables vars.

That, and the rest of the documentation, seems to strongly hint there is no obvious way to tell it to ignore y.

POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard