Page 1 sur 2

equivalent to HP48 ISOL ?

Publié : mar. mars 09, 2010 10:46 am
par timrichardson1
Sorry for the English post.

If there is an equation
g = m/(m+1)
then on the HP calculator CAS one can put this on the stack
'g = m/(m+1)'
'm'
ISOL

which rewrites as
m=-g/(g-1)

In xcas, I only know how to do this

solve(g-m(m+1)=0.m)

to get the same rewriting

If I had previouslydefined
g:=m/(m+1)
it would be nice to do
isol(g,m)

Perhaps I am missing an easier way to use xcas?

Re: equivalent to HP48 ISOL ?

Publié : mar. mars 09, 2010 11:58 am
par parisse
You can simulate the isol function like this
g:=m/(m+1);
solve('g'-g,m)
If you are using a function like isol on a regular basis in your field, then I might add it to the giac kernel.

Re: equivalent to HP48 ISOL ?

Publié : mer. mars 10, 2010 2:04 am
par timrichardson1
I use xcas for ad-hoc algebra, and I would find the isol function convenient. Thanks for the workaround, it's more convenient than my technique.

Re: equivalent to HP48 ISOL ?

Publié : mar. avr. 06, 2010 2:17 am
par XcasEngGuy
I use:

eq1:=g=m/(m+1)

eq2:=m=solve(eq1,m)

Am I doing it wrong?

Matt

Re: equivalent to HP48 ISOL ?

Publié : mar. avr. 06, 2010 7:18 am
par parisse
XcasEngGuy a écrit :I use:

eq1:=g=m/(m+1)

eq2:=m=solve(eq1,m)

Am I doing it wrong?

Matt
Indeed, you can do it that way with a little modification
eq2:=m=solve(eq1,m)[0]

Re: equivalent to HP48 ISOL ?

Publié : mer. avr. 07, 2010 10:36 pm
par XcasEngGuy
Indeed, you can do it that way with a little modification
eq2:=m=solve(eq1,m)[0]
True, I forgot the [0]. Very important. I like using eqn1 eqn2 eq3... for my equations and then after solving I can use subst like this :

eq5:=subst(eq2,eq4)

to then substitute equation 4 into equation 2, for example.

Re: equivalent to HP48 ISOL ?

Publié : mer. avr. 07, 2010 11:06 pm
par XcasEngGuy
I also use this (for example):

eq1:=E*x**4+a*x**3+b*x**2+c*x+d
params1:=[ E = 1.00089141940653, a = -156038.340075414, b = 37528.5851458057, c = -3049.65142318376, d = 83.7181186492909 ]
eq1a:=subs(eq1,params1)

to substitute a large numbers of parameters.

Re: equivalent to HP48 ISOL ?

Publié : lun. avr. 12, 2010 8:06 am
par timrichardson1
Thanks for those posts. Some great ideas; the syntax is much more powerful than I realised.

Re: equivalent to HP48 ISOL ?

Publié : mar. avr. 13, 2010 4:22 pm
par XcasEngGuy
By the way, I use:

eq1:=m*d2x+b*dx+k*x=Ut
chg:=list2mat([ d2x=s^2*X-s*x0-dx0, dx=s*X-x0, x=X, Ut=Us ],1)
eq2:=subst(eq1,mat2list(chg))

to do substitution of multiple variables. the lit2mat command makes the equations much more readable in the viewing window. If the subst command would accept a single column matrix as well as a list, it would not be needed. I that a hard change to make? (I put this here, but maybe I should be starting a new string...)

Thanks
Matt

Re: equivalent to HP48 ISOL ?

Publié : mar. avr. 13, 2010 4:43 pm
par parisse
No, it should not be hard, I think there is no problem using a matrix of substitution rules instead of a list.

Re: equivalent to HP48 ISOL ?

Publié : jeu. oct. 21, 2010 5:28 am
par XcasEngGuy
Using a matrix in the subst command does not work.

Re: equivalent to HP48 ISOL ?

Publié : jeu. oct. 21, 2010 7:18 am
par parisse
Can you provide an example? I just checked with
subst(x+y+z+t,[[x=1,z=2],[y=2,t=3]])
and it works (returns 8 ).

Re: equivalent to HP48 ISOL ?

Publié : jeu. oct. 21, 2010 7:26 am
par alain974
Hi and welcome 8)
timrichardson1 a écrit :Thanks for those posts. Some great ideas; the syntax is much more powerful than I realised.
Well, I know how you could help: Translating the French help made by R. deGraeve in English... :twisted:

As it may be rather long, may I suggest that you make it with a (virtual) team, and consider that you don't really need to be faithful as long as the help is complete.

Also when there are new features to be included in Xcas the English help file will have to be updated every now and then. But don't feel discouraged, I guess Renée will be glad to answer to all your questions :D

Re: equivalent to HP48 ISOL ?

Publié : ven. janv. 21, 2011 4:34 pm
par XcasEngGuy
The following demonstrates what I found:

eq1:=m*(s^2*x-s*dx0-x0)+b*(s*x-x0)+k*x=0
vars:=[ m=2, b=8, k=26, xo=1, dx0=0 ] :;
vars1:=list2mat(vars,1)
subs(eq1,vars)
subs(eq1,vars1)

Note that substituting vars works, substituting vars1 does not.

Thank you,
Matt

Re: equivalent to HP48 ISOL ?

Publié : sam. févr. 26, 2011 6:40 pm
par XcasEngGuy
parisse a écrit :Can you provide an example? I just checked with
subst(x+y+z+t,[[x=1,z=2],[y=2,t=3]])
and it works (returns 8 ).
I tried this and it didn't work. What version are you using? I am using "xcas 0.8.5 (c) 2000-8"

Matt