1 | initial version |
The equation you are trying to solve is :
sage: eq0
y_1 == x_00*y_1 + x_01*y_2 + x_02*y_3 + x_03*y_4 + x_04*y_5
As you want to solve it, this is a linear equation with five unknowns (x_00
, x_01
, x_02
, x_03
, x_04
) and five parameters (y_1
through y_5
). This equation has for general solution a 4-dimensional vector space (see any linear algebra textbook, available in all good groceries and convenience stores...). That's what the initial solution states :
sage: S
[x_00 == -(r8*y_2 + r7*y_3 + r6*y_4 + r5*y_5 - y_1)/y_1,
x_01 == r8,
x_02 == r7,
x_03 == r6,
x_04 == r5]
meaning that x_01
through y_4
have arbitrary values.
Your "cleanup" arbitrarily replaces these arbitrary values with 0 ; as a consequence, the x
values disappear from the (sole) equation defining your solution. You lose the meaning of this solution.
A better solution to understand the structure of this solution is to solve for just one variable (i. e. tour equation is now a linear equation of one unknown and nine parameters) ; for examples :
sage: solve(eq0, x_00)
[x_00 == -(x_01*y_2 + x_02*y_3 + x_03*y_4 + x_04*y_5 - y_1)/y_1]
(identical to Sage's choice of expression)
sage: solve(eq0, x_02)
[x_02 == -((x_00 - 1)*y_1 + x_01*y_2 + x_03*y_4 + x_04*y_5)/y_3]
(if you want to express x_02
as a function of the others)
or to use Sympy, which returns (a) set of relations necessary an sufficient to define your solution space :
sage: solve(eq0, varsX[:5], algorithm="sympy")
[x_00 == -(x_01*y_2 + x_02*y_3 + x_03*y_4 + x_04*y_5 - y_1)/y_1]
The first choice lets you pick the variable you want to solve for ; the second one (and the initial solution) let Sage (i. e. Sympy) pick it.
HTH...
2 | No.2 Revision |
The equation you are trying to solve is :
sage: eq0
y_1 == x_00*y_1 + x_01*y_2 + x_02*y_3 + x_03*y_4 + x_04*y_5
As you want to solve it, this is a linear equation with five unknowns (x_00
, x_01
, x_02
, x_03
, x_04
) and five parameters (y_1
through y_5
). This equation has for general solution a 4-dimensional vector space (see any linear algebra textbook, available in all good groceries and convenience stores...). That's what the initial solution states :
sage: S
[x_00 == -(r8*y_2 + r7*y_3 + r6*y_4 + r5*y_5 - y_1)/y_1,
x_01 == r8,
x_02 == r7,
x_03 == r6,
x_04 == r5]
meaning that x_01
through
have arbitrary values.y_4x_04
Your "cleanup" arbitrarily replaces these arbitrary values with 0 ; as a consequence, the x
values disappear from the (sole) equation defining your solution. You lose the meaning of this solution.
A better solution to understand the structure of this solution is to solve for just one variable (i. e. tour equation is now a linear equation of one unknown and nine parameters) ; for examples :
sage: solve(eq0, x_00)
[x_00 == -(x_01*y_2 + x_02*y_3 + x_03*y_4 + x_04*y_5 - y_1)/y_1]
(identical to Sage's choice of expression)
sage: solve(eq0, x_02)
[x_02 == -((x_00 - 1)*y_1 + x_01*y_2 + x_03*y_4 + x_04*y_5)/y_3]
(if you want to express x_02
as a function of the others)
or to use Sympy, which returns (a) set of relations necessary an sufficient to define your solution space :
sage: solve(eq0, varsX[:5], algorithm="sympy")
[x_00 == -(x_01*y_2 + x_02*y_3 + x_03*y_4 + x_04*y_5 - y_1)/y_1]
The first choice lets you pick the variable you want to solve for ; the second one (and the initial solution) let Sage (i. e. Sympy) pick it.
HTH...