Hello, 

In the interpreter I have this single line :

fct (n, x) == eval (real ((c + %i * s)^n), [c, s], [cos x, sin x])

I want to add this function in manip.spad... :-(

So I add theses macros :

  CI      ==> Complex Integer
  LV      ==> OrderedVariableList [c,s]
  PCI     ==> SparseMultivariatePolynomial(Complex Integer, LV)
  PI      ==> SparseMultivariatePolynomial(Integer, LV)

I add theses variables :

  v1c := ((variable (c))@Union (OrderedVariableList [c,s], "failed"))::LV
  v1s := ((variable (s))@Union (OrderedVariableList [c,s], "failed"))::LV
  vc := v1c :: PCI
  vs := v1s :: PCI
  ve : PCI := vc + (imaginary()::CI) * vs             -- the (c + %i * s)

The interpreter is fine : 8 caracters for the Moivre formula.
I become stupid in front of the compiler : I must type theses 5 lines. 

And now after hours, axiom reject both 

  real (ve^n)
  map (t +-> real t, ve^n)

How can I coerce this SMP Complex Integer to SMP Integer ?

How can I use eval from SMP (Integer, [c,s]) to SMP (R, K) ?
where R is the basis Ring of the Expression
  and K are the kernels? functions of Expression.

I hope the end of my program is easier to translate in *.spad.

If someone can help me, again...

the Mupad code for this is :

    if t = DOM_INT then
      y := y / n;
      S:= genident("S");
      C:= genident("C");
      return(subs(expand(((C+I*S)^n-(C-I*S)^n)/2/I),[C=cos(y),S=sin(y)]))
    end_if

If possible I prefer use real and imag, and no C+I*S and C-I*S.
But today I can't get any results.

François, in France
And thanks a lot for your reponses about cartesian product, types, etc. 


_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to