Post Reply 
Probs solving sys. of eqs. programatically.
10-25-2018, 08:33 PM
Post: #1
Probs solving sys. of eqs. programatically.
How do I enter system of eqs using program, ex. PROG(sys_eqs,vars). I try variable as strings with/without curly/square brackets and nothing works. What I do wrong? Strings as arguments to programs used to work with CAS(),EXPR(). Does that changed in the latest beta? I use the latest beta firmware. In the PRGM in CAS I use solve or fsolve.
Find all posts by this user
Quote this message in a reply
10-26-2018, 05:52 AM (This post was last modified: 10-26-2018 06:07 AM by sasa.)
Post: #2
RE: Probs solving sys. of eqs. programatically.
Perhaps it is more convenient to work directly with objects.

For instance:
Code:

#cas
SZ_T1(eq_list)
begin

  local n:= size(eq_list);
  local i, eq; 

  print ("");
  print ("There is " + n + " objects");

  for i from 1 to n do
    eq:= eq_list[i];    
    print (i + ": " + eq);    
  end;
   
end;
#end

#cas
SZ_T2(eq_list, var_list)
begin
  local n:= size(eq_list);
  local i, eq; 

  print ("");
  print ("There is " + n + " objects");

  for i from 1 to n do
    eq:= eq_list[i];    
    print (i + ": " + eq);    
  end;

  print(" ");
  print("Var list: ")
  print(var_list);

  print(" ");
  print("Solution: ");
  print(solve(eq_list,var_list));
 
end;
#end

Examples:

SZ_T1( (2*x+3*y)=1, (x+y) = 2 )
SZ_T2([(2*x+3*y) = 1,(x+y) = 2],[x,y])
Find all posts by this user
Quote this message in a reply
10-26-2018, 04:42 PM
Post: #3
RE: Probs solving sys. of eqs. programatically.
Thank you sasa.
Find all posts by this user
Quote this message in a reply
Post Reply 




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