Axel Vogt

5936 Reputation

20 Badges

20 years, 258 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are replies submitted by Axel Vogt

You should upload documents here.

There is an issue with google docs: profiling those, who access.

For me it is unclear what you are asking, may be you say it in mathematical words
and not by linking to pages?

I agree, though I do not have Matlab, since Maple is not primarily for Numerics.
However a task like the one mentioned would make me to switch.

When I used Maple towards that I usually coded stuff and translated to C (or did
in parallel), created a runtime library and then had the chance to use Maple for
quality checks.

So the mentioned example shows annoying weakness mostly I use 'Compiler' to speed
up in a easy way.

Example:

s = the above
S:=identify(s);

Then after playing with that for some time one sees:

  S='((k+q)^2+t)/sqrt((k+q)^4 + t^2)';
  eval(%, t=2*omega*m);
  is(%);

           true

where some silent assumptions seems to have been made (Reals ?).

Pure Numerics would not show that. That's what I like above pure 'compiling'.
I agree, though I do not have Matlab, since Maple is not primarily for Numerics.
However a task like the one mentioned would make me to switch.

When I used Maple towards that I usually coded stuff and translated to C (or did
in parallel), created a runtime library and then had the chance to use Maple for
quality checks.

So the mentioned example shows annoying weakness mostly I use 'Compiler' to speed
up in a easy way.

Example:

s = the above
S:=identify(s);

Then after playing with that for some time one sees:

  S='((k+q)^2+t)/sqrt((k+q)^4 + t^2)';
  eval(%, t=2*omega*m);
  is(%);

           true

where some silent assumptions seems to have been made (Reals ?).

Pure Numerics would not show that. That's what I like above pure 'compiling'.
I remember ... yes, that is lame

I remember ... yes, that is lame. Here is a first work-around. May be the seniors
are willing to provide a sound solution (I recall a way shown by Robert Israel in
quite general form, where he applies a command to a whole procedure, but can not
find it anymore).

Here I silently replaced your I=sqrt(-1), since I=me think, that complex arithmetics
is not handeled (it is classical C only ... mostly ... not sure)

  s:= (2.*omega*m+k^2+q^2+2.*q*k)/
      (6.*k^2*q^2+4.*q*k^3+4.*q^3*k+k^4+q^4+4.*omega^2*m^2)^(1/2);
  vars:= [U, kF1, kF2, m, k, omega, q];   # how to provide the type ?

Then

  evalindets(s, algebraic^(rational), t -> op(1,t)^(evalf( op(2,t) )));

would do too much (but covers cube root), however the following should do, it
replace pow(something, +-1/2) by pow(something, +-0.5):

  evalindets(s, anything^({1/2, -1/2}), t -> op(1,t)^(evalf( op(2,t) )));
  codegen[makeproc](%, vars);
  Compiler:-Compile(%);


This is not satisfactory. And one can only hope, that the C-compiler optimizes
that to sqrt again and does not use pow(float, +- 0,5).
I remember ... yes, that is lame

I remember ... yes, that is lame. Here is a first work-around. May be the seniors
are willing to provide a sound solution (I recall a way shown by Robert Israel in
quite general form, where he applies a command to a whole procedure, but can not
find it anymore).

Here I silently replaced your I=sqrt(-1), since I=me think, that complex arithmetics
is not handeled (it is classical C only ... mostly ... not sure)

  s:= (2.*omega*m+k^2+q^2+2.*q*k)/
      (6.*k^2*q^2+4.*q*k^3+4.*q^3*k+k^4+q^4+4.*omega^2*m^2)^(1/2);
  vars:= [U, kF1, kF2, m, k, omega, q];   # how to provide the type ?

Then

  evalindets(s, algebraic^(rational), t -> op(1,t)^(evalf( op(2,t) )));

would do too much (but covers cube root), however the following should do, it
replace pow(something, +-1/2) by pow(something, +-0.5):

  evalindets(s, anything^({1/2, -1/2}), t -> op(1,t)^(evalf( op(2,t) )));
  codegen[makeproc](%, vars);
  Compiler:-Compile(%);


This is not satisfactory. And one can only hope, that the C-compiler optimizes
that to sqrt again and does not use pow(float, +- 0,5).
It means, that you should not mix integer and floats:
sqr1 := proc (x) 1.0/x^(1/2) end proc; # that works
#                ^^^
But there are limitations in translating Maple to C, yes.
It means, that you should not mix integer and floats:
sqr1 := proc (x) 1.0/x^(1/2) end proc; # that works
#                ^^^
But there are limitations in translating Maple to C, yes.

I never used Maple for abstract Algebra and I am not aware of good packages for
that (but just remember complains that plain Maple is not good for that, as an
example you may try to consider vector spaces without giving a dimension).

For example it may be tedious to show that 1 and sqrt(3) (which is just the X)
are independent, i.e. 0=a+b*sqrt(3) has only the trivial solution over Z, though
in Math it is clear, since that sqrt is not rational.

While the group law is almost evident.

However Maple provides some stuff, but in terms of Algebra (via Krull dimension
and rank), but not in purley elementary terms.

I never used Maple for abstract Algebra and I am not aware of good packages for
that (but just remember complains that plain Maple is not good for that, as an
example you may try to consider vector spaces without giving a dimension).

For example it may be tedious to show that 1 and sqrt(3) (which is just the X)
are independent, i.e. 0=a+b*sqrt(3) has only the trivial solution over Z, though
in Math it is clear, since that sqrt is not rational.

While the group law is almost evident.

However Maple provides some stuff, but in terms of Algebra (via Krull dimension
and rank), but not in purley elementary terms.

Then I would say, that you have to provide your numerical input with more
precision and would have to switch to better working precision, no?

Then I would say, that you have to provide your numerical input with more
precision and would have to switch to better working precision, no?

theta = Pi/4 and 3*Pi/4 seem to 'work' as well (for alpha_ij = +- Pi/2)
theta = Pi/4 and 3*Pi/4 seem to 'work' as well (for alpha_ij = +- Pi/2)
I would not use Maple for such things, but paper and pencil, which is faster and easy here.

Or would just look at it via the ring Z[X]/(X^2-3), which has more mathematical sense.
First 95 96 97 98 99 100 101 Last Page 97 of 209