solve ( X, Y -> ... )
Publié : mer. avr. 11, 2018 1:18 pm
Hello BP
In the following sequence the use of the RIGHT command is observed, I think that the SOLVE command should accept the argument of a simple function (X,Y -> ...), in this way the use of right is avoided. the left part of the definition would be the variables, in this way it would also avoid adding the variables of the second argument
Example 1:
1:
V1(X,Y):=X-2*Y=7;
V2(X,Y):= 5*X-3*Y=2;
(X,Y)->X-2*Y=7, (X,Y)->5*X-3*Y=2
2:
solve([V1,V2],[X,Y]);
"Expecting an expression, not a function Error: Bad Argument Value"
3:
solve([right(V1), right(V2) ],[X,Y]);
[[-17/7,-33/7]]
4:
list2exp( solve([right(V1), right(V2) ],[X,Y]), [X,Y]);
X=(-17/7) and Y=(-33/7)
5:
subst( [right(V1), right(V2) ], [X=(-17/7) ,Y=(-33/7)] )
[7=7,2=2]
6:
evalb( subst( [right(V1), right(V2) ], [X=(-17/7) ,Y=(-33/7)] ))
[ true, true ]
Example 2:
1:
F1(X) := X^3-1.1*X^2-65.4*X+229.5
(X)->X^3-1.1*X^2-65.4*X+229.5
2:
solve(F1,X)
" Error: Bad Argument Value"
3:
solve(right(F1),X)
[-9.0,5.0,5.1]
4:
subst(F1,X=-9)
(-9)->0.0
5:
subst(right(F1),X=-9)
0.0
In the following sequence the use of the RIGHT command is observed, I think that the SOLVE command should accept the argument of a simple function (X,Y -> ...), in this way the use of right is avoided. the left part of the definition would be the variables, in this way it would also avoid adding the variables of the second argument
Example 1:
1:
V1(X,Y):=X-2*Y=7;
V2(X,Y):= 5*X-3*Y=2;
(X,Y)->X-2*Y=7, (X,Y)->5*X-3*Y=2
2:
solve([V1,V2],[X,Y]);
"Expecting an expression, not a function Error: Bad Argument Value"
3:
solve([right(V1), right(V2) ],[X,Y]);
[[-17/7,-33/7]]
4:
list2exp( solve([right(V1), right(V2) ],[X,Y]), [X,Y]);
X=(-17/7) and Y=(-33/7)
5:
subst( [right(V1), right(V2) ], [X=(-17/7) ,Y=(-33/7)] )
[7=7,2=2]
6:
evalb( subst( [right(V1), right(V2) ], [X=(-17/7) ,Y=(-33/7)] ))
[ true, true ]
Example 2:
1:
F1(X) := X^3-1.1*X^2-65.4*X+229.5
(X)->X^3-1.1*X^2-65.4*X+229.5
2:
solve(F1,X)
" Error: Bad Argument Value"
3:
solve(right(F1),X)
[-9.0,5.0,5.1]
4:
subst(F1,X=-9)
(-9)->0.0
5:
subst(right(F1),X=-9)
0.0