Post Reply 
Program code with solve function
06-20-2024, 10:04 PM
Post: #2
RE: Program code with solve function
Here are some examples. In your example you have to use a 'HOME' variable like 'X', and not 'x'

Code:

rooty();
EXPORT rooty()
BEGIN
LOCAL y1=0;

// working SOLVES  
//CAS
y1:=CAS("solve(X^2=2 , X,1)"); 
y1:=fsolve(x^2-2,x);

// variable as a function (in CAS)
LOCAL ss1:="x^2-2";
y1:= CAS.solve(EVAL(ss1) , x,1);
y1:=CAS.fsolve(EVAL(ss1),x,1);

//HOME FNROOT part of Solve App
y1:=FNROOT(X^2-2,X,300); // or
y1:=FNROOT(X^2-2=0,X,300); 
y1:=FNROOT({'X^2-2'},{'X'},{300}); 

// use Function ROOT 
y1:= Function.ROOT( X^2-2, 300);

F1:='X^2-4';
y1:= Function.ROOT( F1, 3);

//use Solve.Solve 
y1:= Solve.SOLVE(X^2-2, X);

E0:="x^2-2";
y1:= Solve.SOLVE(E0, x);
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Program code with solve function - SoxxoZ - 06-19-2024, 02:23 PM
RE: Program code with solve function - gehakte_bits - 06-20-2024 10:04 PM



User(s) browsing this thread: 4 Guest(s)