[Axiom-mail] How to expand a fraction (like Maple does with 'expand')?

2007-01-25 Thread Wiesner Thomas

I'm sorry that i bug you with this (probably) simple problem:

How can i do the following (from Maple) in Axiom:


expand(((-r1*r2*uoff)+((r2+r1)*r3+r1*r2)*ue)/(r2*r3));

  r1 uoffue r1   ue r1
- --- + ue + - + -
r3r2  r3

I've been trying and googling for hours. I've tried MPOLY but have only  
managed
to to pull one variable in front of the fraction and didn't find out how  
to split it up completely.


I found the MPOLY approach in the Rosetta pages  
(http://wiki.axiom-developer.org/RosettaStone)

but it doesn't do what i want.

This seems to be such a simple task and I can't find out.

I am writing a quit overview about CA Systems for hobby electronics and  
want to explain some usual tasks in different CA Systems.



   Thanks in advance,
   Wiesner Thomas

PS: Please CC me, as I am not in the list.


___
Axiom-mail mailing list
Axiom-mail@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-mail


RE: [Axiom-mail] How to expand a fraction (like Maple does with'expand')?

2007-01-25 Thread Bill Page
On January 23, 2007 2:02 PM Wiesner Thomas wrote:
 
 I'm sorry that i bug you with this (probably) simple
 problem:
 
 How can i do the following (from Maple) in Axiom:
 
  expand(((-r1*r2*uoff)+((r2+r1)*r3+r1*r2)*ue)/(r2*r3));
r1 uoffue r1   ue r1
  - --- + ue + - + -
  r3r2  r3
 
 I've been trying and googling for hours. I've tried MPOLY but 
 have only managed to to pull one variable in front of the
 fraction and didn't find out how to split it up completely.
 
 I found the MPOLY approach in the Rosetta pages  
 (http://wiki.axiom-developer.org/RosettaStone)
 but it doesn't do what i want.
 
 This seems to be such a simple task and I can't find out.
 
 I am writing a quit overview about CA Systems for hobby 
 electronics and want to explain some usual tasks in
 different CA Systems.
 

I would suggest the following computation:

(1) - ex1:=((-r1*r2*uoff)+((r2+r1)*r3+r1*r2)*ue)/(r2*r3)

- r1 r2 uoff + ((r2 + r1)r3 + r1 r2)ue
   (1)  --
 r2 r3
Type: Fraction Polynomial Integer

(2) - ex1::DMP([r1,ue,uoff],FRAC POLY INT)

r3 + r2  1
   (2)  --- r1 ue - -- r1 uoff + ue
 r2 r3  r3
Type: DistributedMultivariatePolynomial([r1,ue,uoff],
Fraction Polynomial Integer)

The reason why this apparently simple task might seem difficult
at first to a novice Axiom user is because Axiom is strongly-
typed. Unlike Maple (and most other CA systems) expressions in
Axiom always have some type (domain) that explicitly defines the
operations appearing in the expression. Instead of expanding
an expression within a given domain, we are often faced with
coercing (represented by the :: symbol) expressions from one
domain to another more suitable for our task.

In my opinion learning to deal with the Axiom type system is
what makes Axiom's learning curve very steep at the beginning,
but this initial investment pays off later in more sophisticated
applications.

In (2) above, the reason that the first term is not expanded
further is that Axiom does not have any domain (as far as I
know) that has

   ue r1   ue r1
   - + -
r2  r3

as separate terms.

Regards,
Bill Page.




___
Axiom-mail mailing list
Axiom-mail@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-mail


Re: [Axiom-mail] How to expand a fraction (like Maple does with 'expand')?

2007-01-25 Thread Francois Maltey
Hello Thomas, 

Thanks for your interest for axiom !

  expand(((-r1*r2*uoff)+((r2+r1)*r3+r1*r2)*ue)/(r2*r3));
r1 uoffue r1   ue r1
  - --- + ue + - + -
  r3r2  r3
 

So you are looking for expand fraction as maple and mupad :
(A+B+C+D)/E gives A/E + B/E + C/E + D/E where (A, B, C, D) are monomials.

Are you also looking for a  partFrac  functions as :

   x/(x^2-1) = (1/2)/(x-1) + (1/2)/(x+1)
or x/(x+1)^2 = 1/(x+1) - 1/(x+1)^2.

I don't know if this is possible.

Axiom doesn't play with expressions as 
x^2-y^2 or (x-y)(x+y) but only with expanded or sparse polynomials.

So (x-y)(x+y) doesn't exist, but only x^2-y^2.

The great advantage of this data structure is his normal form :
((x+y)-x*y) + z - ((x+y)-x*y) * z 
and ((y+z)-y*z) + x - ((y+z)-y*z) * x 
are equal without any expand command. Axiom uses expanded form.

It's also possible to factor polynoms : try factor (x^2-y^2).

But it's (almost) impossible to factor a fraction as 
(cos x + 1) * (cos x + 2) * (cos x + 3) / (cos x + 4) / (cos x + 5)

And other transforms as x^2/(x-1) = 1 + x + 1/(x-1) aren't so obvious.

 I am writing a quit overview about CA Systems for hobby electronics
 and  want to explain some usual tasks in different CA Systems.

What CAS do you explain ?

Have a nice day !

Francois


___
Axiom-mail mailing list
Axiom-mail@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-mail


Re: [Axiom-mail] Few questions about expressions...

2007-01-25 Thread Francois Maltey
A previous mail asks about :

  expand(((-r1*r2*uoff)+((r2+r1)*r3+r1*r2)*ue)/(r2*r3));
r1 uoffue r1   ue r1
  - --- + ue + - + -
  r3r2  r3
 

// A //

Has someone already tested an hold function for Expression as mupad had ?

So the expression 1+x + hold (1/(x-1)) remains as.
It's easy to eval/remove the hold form and then axiom gets x^2/(x-1).
And it's possible to have the reverse function partFrac.

Do you have any idea about it ?

This hold function allows expanded fractions, factorised Expression, 
 partFrac , series in (x-a)^k, products of sum, and so.

// B //

What is the goal of AlgebraicNumber ?

Is it an algebraic domain in which 
  2^(1/2) = -2^(1/2) and sqrt(6*sqrt(5)+14) = - 3 - sqrt 5 
without any branch-cut.

Or is it a Complex domain near from RealClosure Fraction Integer in 
which axiom chooses the good branch : sqrt (%i*2) = + 1 + %i, 
not any other root.

// C // 

What is the goal of Expression ? 
to compute with an  algebraic point of view  
  or a  calculus point of view  ?

A calculus point of view near of the other cas may be useful for my 
(and other) calculus for scientifics students.

Is it more effective to look arround Expression 
or to write an other domain Calculus, with duplicate parts of code ?

Thanks a lot for your points of view.

Francois


___
Axiom-mail mailing list
Axiom-mail@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-mail