Post Reply 
CAS inside prgm ?!
02-05-2015, 09:15 PM
Post: #1
CAS inside prgm ?!
Hi,

I'd like something these way :
Code:

export inv_laplace(k)
begin
  local f;
  f:=CAS(ilaplace(subst(expr("F"+k),'X','x')));
  return subst(f,'x','X');
end;

But it doesn't work like these...

I try with a CAS program but without success...

Code:

#cas
Inverse_laplace(k):=
BEGIN
  local f;
  f:=ilaplace(EXPR("F"+k+"(x)"));
  return subst(f,'x','X');
END;
#end

Can you help me to learn good practise ? What can we realy do with CAS program for that kind of problem ?

Thank you for your help.
Find all posts by this user
Quote this message in a reply
02-05-2015, 09:30 PM (This post was last modified: 02-05-2015 09:34 PM by Han.)
Post: #2
RE: CAS inside prgm ?!
Code:

export inv_laplace(k)
begin
  tmp:="F" + LEFT(STRING(k),1) + "(x)";
  CAS.ilaplace(tmp);
end;

Pretty much all CAS commands that do not natively work in Home require their arguments be passed as strings. The strings may be saved as variables. Thus, CAS.command("arg1", "arg2") can be replaced by CAS.command(arg1,arg2) where arg1 and arg2 are string variables. This style does not allow string expressions as arguments, however. So CAS.command("arg1of2" + "arg2of2") would not work (generally speaking)

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
02-07-2015, 05:19 PM
Post: #3
RE: CAS inside prgm ?!
Thank you so much Han,

As always your help is invaluable. I learned a lot by reading your articles.

Have a nice day !
Find all posts by this user
Quote this message in a reply
Post Reply 




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