equivalent to HP48 ISOL ?
Modérateur : xcasadmin
-
- Messages : 3
- Inscription : sam. mars 06, 2010 11:44 am
equivalent to HP48 ISOL ?
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?
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 ?
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.
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.
-
- Messages : 3
- Inscription : sam. mars 06, 2010 11:44 am
Re: equivalent to HP48 ISOL ?
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.
-
- Messages : 164
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: equivalent to HP48 ISOL ?
I use:
eq1:=g=m/(m+1)
eq2:=m=solve(eq1,m)
Am I doing it wrong?
Matt
eq1:=g=m/(m+1)
eq2:=m=solve(eq1,m)
Am I doing it wrong?
Matt
Re: equivalent to HP48 ISOL ?
Indeed, you can do it that way with a little modificationXcasEngGuy a écrit :I use:
eq1:=g=m/(m+1)
eq2:=m=solve(eq1,m)
Am I doing it wrong?
Matt
eq2:=m=solve(eq1,m)[0]
-
- Messages : 164
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: equivalent to HP48 ISOL ?
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 :Indeed, you can do it that way with a little modification
eq2:=m=solve(eq1,m)[0]
eq5:=subst(eq2,eq4)
to then substitute equation 4 into equation 2, for example.
-
- Messages : 164
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: equivalent to HP48 ISOL ?
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.
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.
-
- Messages : 3
- Inscription : sam. mars 06, 2010 11:44 am
Re: equivalent to HP48 ISOL ?
Thanks for those posts. Some great ideas; the syntax is much more powerful than I realised.
-
- Messages : 164
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: equivalent to HP48 ISOL ?
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
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 ?
No, it should not be hard, I think there is no problem using a matrix of substitution rules instead of a list.
-
- Messages : 164
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: equivalent to HP48 ISOL ?
Using a matrix in the subst command does not work.
Re: equivalent to HP48 ISOL ?
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 ).
subst(x+y+z+t,[[x=1,z=2],[y=2,t=3]])
and it works (returns 8 ).
Re: equivalent to HP48 ISOL ?
Hi and welcome
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

Well, I know how you could help: Translating the French help made by R. deGraeve in English...timrichardson1 a écrit :Thanks for those posts. Some great ideas; the syntax is much more powerful than I realised.

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

-
- Messages : 164
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: equivalent to HP48 ISOL ?
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
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
-
- Messages : 164
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: equivalent to HP48 ISOL ?
I tried this and it didn't work. What version are you using? I am using "xcas 0.8.5 (c) 2000-8"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 ).
Matt