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
solve ( X, Y -> ... )
Modérateur : xcasadmin
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: solve ( X, Y -> ... )
As explained in the error message, solve expects expressions. If you have a function, apply it to the variable(s) : solve([V1(X,Y),V2(X,Y)],[X,Y]); or define V1 and V2 as expressions, not functions.
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: solve ( X, Y -> ... )
solve([V1(X,Y),V2(X,Y)],[X,Y]); OK =)
when writing the next entry, xCAS is restarted
solve([Y = (X-7)/2,Y = (5*X-2)/3],Y)
when writing the next entry, xCAS is restarted
solve([Y = (X-7)/2,Y = (5*X-2)/3],Y)
Re: solve ( X, Y -> ... )
It returns [] here.
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: solve ( X, Y -> ... )
not on xcas 64 bits =(
Re: solve ( X, Y -> ... )
I checked on win64, mac 64, linux 64.