Ask Your Question

nacitar's profile - activity

2019-01-04 17:29:22 +0200 received badge  Popular Question (source)
2019-01-04 17:29:22 +0200 received badge  Notable Question (source)
2016-06-29 17:51:56 +0200 received badge  Editor (source)
2016-06-29 17:36:53 +0200 commented answer How do I coerce solve to solve for each of the variables in the system?

I'm basically trying to use this for basic algebra, getting a single variable on the LHS of the equation, for each of the variables included in my system of equations. If not using solve in this way, how could I do it?

2016-06-29 17:36:03 +0200 received badge  Scholar (source)
2016-06-29 17:35:14 +0200 commented answer How do I coerce solve to solve for each of the variables in the system?

Rephrased, I'm basically trying to use this for basic algebra, getting a single variable on the LHS of the equation, for each of the variables included in my system of equations. If not using solve in this way, how could I do it?

2016-06-29 17:31:51 +0200 commented answer How do I coerce solve to solve for each of the variables in the system?

What I'm after here, though, is to just have the equation rearranged (solved) so I can get VAR = EXPRESSION for all variables. In a system where there's 6 variables in play, all of which are dependent on other variables (which are not defined), I'd want solve to give me equations solved for each of those values. If not by specifying a list of all of the variables, how else would I ask for this?

I could invoke solve N times, once for each of the N variables I need the equations for, but that's quite slow. It seems like asking for them all at once should be the same thing as asking for each one individually, but in one invocation... It really seems unintuitive to me that asking for [X,Y] is not the same thing as asking for X and Y separately and combining the results.

2016-06-29 16:26:28 +0200 asked a question How do I coerce solve to solve for each of the variables in the system?

EDITED QUESTION FOR CLARITY

X, Y = var('x y')
eq = (Y == 90 + X)
# Properly prints [y == x + 90]
print(solve(eq,[Y]))
# Properly prints [x == y - 90]
print(solve(eq,[X]))

# Rather than printing what I expected: [x == y - 90, y == x + 90]
# It prints: [x == r1 - 90, y == r1]
print(solve(eq,[X,Y]))

How can I get the result I expect out of this? In my actual usage, I could have 10+ unknowns, each of which I want the equations rearranged(solved) for those variables, that way I can fetch an equation for each one as needed, already solved for with just that one variable on the left hand side. If solve doesn't do this, what will? It seems like I should be able to do this with one invocation.. but perhaps I'm mistaken.