HP Prime Who know how to do that ?  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: HP Prime Who know how to do that ? (/thread253594.html) 
HP Prime Who know how to do that ?  dg1969  10222013 I want to ask for a function f (X) with the command "INPUT" ... then create the function F1 = f(i*X). example: f(X)=1/(1+0.2*X+5*X^2) => F1(X)=1/(1+0.2*i*X+5*(i*X)^2)
EXPORT test() I try : F1:=expr("subst(f,'X','(i*X)')"); with another local var g :
g:=subst(f,X,'(i*X)'); CAS("F1:=subst(f,X,'(i*X)')"); I try also with string and the command REPLACE See my previous post...
I do not see it very clear... Thanks for your help.
Re: HP Prime Who know how to do that ?  Han  10222013 LOCAL f; Re: HP Prime Who know how to do that ?  dg1969  10222013 Many many thanks Han !! I owe you the most best thing that ever happened to me today ;o)
I hope that in the near future we can manipulate symbolic expressions from within a program so much easier.
Re: HP Prime Who know how to do that ?  dg1969  10222013 Unfortunately ... This does not always work ... But for my purpose it should not be annoying... LOCAL f;I add () around i*X to accept power...
for exact coef in f(X) it works great... Examples: But for example with : '0.2/(1+X)' => Crash !! Is it consistent with the expected operation of "subst" ?
Edited: 22 Oct 2013, 4:01 p.m.
Re: HP Prime Who know how to do that ?  Han  10222013 Quote: Remember that if you are using a CAS command, then by introducing a nonexact value into a CAS calculation, you have implicitly told the calculator to switch into approximate mode. What this means is that 0.2/(1+X) gets evaluated first (using whatever X value you currently have) and _then_ the result is passed to the command subst(). I will have to test when I get home on whether it crashes for me. In the meantime, if you should consider using exact(). F1:=EXPR("subst(exact('" + f + "'),'X','(i*X)');"); More info:
http://www.hpmuseum.org/cgisys/cgiwrap/hpmuseum/forum.cgi?read=253620#253620 Edited: 22 Oct 2013, 5:17 p.m.
