Axel Vogt

5936 Reputation

20 Badges

20 years, 252 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

I once filed Corless & Jeffrey, Graphing elementary Riemann surfaces and
supposing you want the 'spiral' for the branches here it is (and with a
bit more code one certainly could draw the brunch cuts and the z-planes
to indicate the 'sheets'):

Digits:=14;
w:=u+I*v;
z:=evalc(exp(w));
x:=evalc(Re(z));
y:=evalc(Im(z));

plot3d([x,y,v],
  u=-6 ..1, v = -3*Pi ... 3*Pi,
  labels=["x","y","v"],
  view=[-1..1, -1 .. 1, -3*Pi ... 3*Pi],
  #orientation=[-56,72],
  orientation=[-70,60],
  grid=[80,80],
  axes=frame,
  #style=surface,
  shading=zhue
  #color=u
);

There is some numerical trap for such extreme tasks

Note that your formula for the cdfN is only correct at the left wing

Then (as implicitely said by acer) you need high(er) precision

And finally - since the curve is extremely flat - you may wish to use all possible
strength of fsolve (look up the parameters in the help)

And provide a rough guess for a solution

I do not have Maple at hand now, but take asymptotics, convert to polynom and
solve to have a start value.

Or you can try to solve

 ln( erfc(x/sqrt(2)) ) = ln( y )

 

Edited to give the example:

> Digits:=18;
> 
> erfc(x/sqrt(2)); asympt(%,x, 2): convert(%, polynom);
> y=simplify(%) assuming 0 < x;
> solve(%, x);
> simplify(%) assuming 0 < y; 
> eval(%, y= 1e-18); 
> x0:=evalf(%);
> 
> fsolve(erfc(x/sqrt(2))= 1e-18, x=x0);

            8.83510978817539579

> eval(erfc(x/sqrt(2)), x=%);
> evalf(%);

         .999999999999999835e-18

> erfc(x/sqrt(2))= 1e-20; map(ln, %); fsolve(%, x=0 .. 20);

           9.33604484923406004

> eval(erfc(x/sqrt(2)), x=%);
> evalf(%);

         .999999999999999887e-20

That would be a general problem you would always have to be aware.

For some testing I tried Maple 9.5 on Win 7 (installed as 32 Bit (!!) because of the DLLs) and it seems to work. The only problem I had was saving 'style sheets'.

L:=[1,2,3,4,5];
S:=convert(L, `+`);
f(S);

                               S := 15
                                f(15)


It controls the precision, not the display, from the help: "To specify the numeric precision for an evalf computation ..."

What you want (2 correct leading decimals) can be done like this:

for i from 0 to 4 do  evalf[20](poi(i)*10000); evalf[2](%); print(%);  end do:
                                8000.
                                1800.
                                 200.
                                 15.
                                 0.82


May be that Maple is improved to be more correct?

subs(alpha=1/2, gammadist); 
int(%, x=0..infinity); 
subs(theta=-1, %); 
eval(%);

                             -infinity I

Plot it to check that:

subs(alpha=1/2, gammadist); subs(theta=-1, %);
plot(Im(%), x= 0 .. 6);

                              -I exp(x)
                              ----------
                               1/2   1/2
                              x    Pi

and since exp ---> oo this is correct.
L:=[1,2,3,4,5];
 
seq(L[i], i =3 .. nops(L)); # the seq, except the first 2
L[1], L[2]; # the first 2 
[%%, %]; # put them together and make it a list

                           [3, 4, 5, 1, 2]

For the 2nd question you may wish to state what you want instead of posting the result or code.

The FFT(m,x,y) and iFFT(m,x,y) commands compute in place the fast Fourier transform and the inverse fast Fourier transform of a complex sequence of length 2^m

You use m=0 and thus take only 1 element, no? I think you shuold take m=16 for your example 2^16

Moreover (looking in Maple 9.5) it needs arrays (lower case), not Arrays (upper Case)

 

I'm trying to find the minimum distance between two e'values of an nxn matrix

Then I would do it by sorting (as already discussed), take 1st absolute
differences and sort again. The first element is one minimal solution:


M:=LinearAlgebra[RandomMatrix](3,3,generator=-99..99): # to have an example

V:=convert(M, Vector[row]);
V:=sort(V);

d:=LinearAlgebra[Dimension](V);

f:= (j) -> abs(V[j]-V[j+1]); # you want the minimum, if applied to V
W:=Vector[row](d-1,f);
W:=sort(W);
W[1];


In case used memory is a concern:

While it is easy to re-use W (by using 'map') if the dimension is constant
for V one would have to ponder a bit (but there is some command for a fast
re-arrangement of memory, if I recall correctly).
 

I'm trying to find the minimum distance between two e'values of an nxn matrix

Then I would do it by sorting (as already discussed), take 1st absolute
differences and sort again. The first element is one minimal solution:


M:=LinearAlgebra[RandomMatrix](3,3,generator=-99..99): # to have an example

V:=convert(M, Vector[row]);
V:=sort(V);

d:=LinearAlgebra[Dimension](V);

f:= (j) -> abs(V[j]-V[j+1]); # you want the minimum, if applied to V
W:=Vector[row](d-1,f);
W:=sort(W);
W[1];


In case used memory is a concern:

While it is easy to re-use W (by using 'map') if the dimension is constant
for V one would have to ponder a bit (but there is some command for a fast
re-arrangement of memory, if I recall correctly).
 

A:=Array(1..2, 1..12); #, fill=1);
B:=convert(A, Array,datatype=float[8]);
#convert(B, Array);
C:=map(identify, B);
# show the contents:
convert(A, listlist);
convert(B, listlist);
convert(C, listlist);

I do not know what you mean by sum of Bessel functions or what you expect to see, but for example you can go as follows:

  sin(t);
  convert(%, hypergeom, include=all, only=sin);
  convert(%, Bessel);

which expresses sin as BesselJ(1/2,t)*sqrt(t*Pi/2)

Perhaps the following is your desired monster:

  myExpr:=sin(c + I * (sin (d + k * sin(t))));
  convert(myExpr, hypergeom, include=all, only=sin);
  convert(%, Bessel);
  convert(%, BesselJ);
If you use ifactor(99) and look at the actual result by lprint, then you may get an idea for experimenting:
  add( ``||i, i=1..5);
  convert(%, string): StringTools[SubstituteAll](%,"`",""): parse(%);
                          1 + 2 + 3 + 4 + 5
                                  15
Or even a bit more strange:

  ` `:= t -> ``||t;

  'add( ` `(i), i=1..5)'; '%'= %;
  convert(rhs(%), string): StringTools[SubstituteAll](%,"`",""): 
  ``=parse(%);

              add( (i), i = 1 .. 5) = 1 + 2 + 3 + 4 + 5

                                  = 15

with(Optimization); print(Interactive); shows it is a module and showstat(Interactive); tells more, but I rarely work that way and it needs a bit guessing, especially if overloading is used in the code (which makes Optimization so un-handy while the opposite was intended). may be showstat(Interactive:-Main); print(Interactive:-Main); tells you more (last line of 'interactive')

At the help pages for Dirac you find the formula you are looking for,

  Int(Dirac(x-x0)*exp(-I*x*p), x = -infinity .. infinity) = 
    inttrans[fourier](Dirac(x-x0), x, p);

and executing it in Maple gives exp(-I*x0*p) without problems.

Hence I tried it with rationals instead of floats

  convert(g, rational);
  G:=inttrans[fourier](%,t,w); #evalf(%);

and that works with Maple 12 (and some older 9.5, but with a different
error message for your original problem).
First 55 56 57 58 59 60 61 Last Page 57 of 93