HP-PRIME How to do ?!!!



#4

I want to make a program which ask for a function of s and return the inv-Laplace transform in F1 (function App var) for ploting...

The calc is in function APP... I use the last emulator

I follow Cyrille De Brébisson and Han advises see here :

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?read=252384#252384

But nothing work !

Who know how to do ?

EXPORT Laplace()
BEGIN
local s,f="1/(1+s)";
INPUT(f,"F(s) definition","F(s)=", "No help!");
F1:=CAS("invlaplace("+f+",s,'X')");
END;

Thank's for your help.


#5

Hello,

This seems to work...

EXPORT Laplace()
BEGIN
local f="";
INPUT(f,"F(s) definition","F(s)=", "Enter function transfer in douple quotes """"");
f:= "CAS.ilaplace("""+f+""",""s"",'X')";
f:= expr(f);
F1:= f;
END;

It is a little bit convoluted as we need to make sure that the parameters are passed unevaluated to the CAS, but that the value of local variables are passed (ie, the local variable needs to be evaluated)...

Cyrille


#6

Wonderful!
Thank you very much Cyrille.
This machine will please me!
Do you think that in the future it will be possible to do things more simply. With less double quotes !! With a better INPUT function ? The ability to simply use the CAS functions in the program as we do in command line?

Thank's to HP calculator team For this good job !!

EXPORT Laplace()
BEGIN
local f="";
INPUT(f,"F(s) definition","F(s)=", "Enter function transfer in douple quotes """"");
f:= "CAS.ilaplace("""+f+""",""s"",'X')";
f:= expr(f);
F1:= f*'Heaviside('X')';
END;

Forum Jump: