Variable use between CAS and Home.
09-15-2017, 05:02 PM (This post was last modified: 10-15-2017 12:18 PM by Rudi.)
Post: #21
 Rudi Junior Member Posts: 15 Joined: May 2015
RE: Variable use between CAS and Home.
I have compiled two sheets showing the transfer between the CAS View and the Home View. From the CAS-View to the Home-View I wrote the user function upperVar(). It is applicable up to 3-dimensional space. The function converts the CAS function (eg x -> X, y -> Y, z -> Z) to use in the app function (variable F1 ..F9, F0) or to use for the app Advanced Graphing (variable V1 .. V9,V0).

Code:
#cas
// upperVar v1.1
// by Rudi Steeger
upperVar(f):=
BEGIN
LOCAL a,b,c;
a:=lname(f);
b:=SIZE(a);
IF b>3 THEN RETURN("Error:One or two variables permissible") END;
IF b<1 THEN RETURN("Error:Function contains equations or no CAS-Variables") END;
// replace one variable with X

//RETURN lname(subst(exact(f),(a) = (['X'])));
IF b=1 THEN
RETURN subst(exact(f),(a) = (['X']));
END;
// replace two variable with X, Y
IF b=2 THEN
RETURN subst(exact(f),(a) = (['X','Y']));
END;
// replace three variable with X , Y, Z
IF b=3 THEN
RETURN subst(exact(f),(a) = (['X','Y','Z']));
END;
END;
#end
Best Regards
Rudi

Attached File(s)