Axel Vogt

5936 Reputation

20 Badges

20 years, 259 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are replies submitted by Axel Vogt

@Preben Alsholm 

I did: 'eq' is (almost) like z:=(t^2+t+1)/(-t), ((-t)^5)^2=z*conjugate(z), %*t*conjugate(t).
Now fsolve/complex gives a different solution (and check it)

Then
eq:=(-t)^5-abs(z);
myRange:=x=-3/2 .. 3/2, y=-2 .. 2;
eq; eval(%, t=x+I*y); evalc(%); evala(%); simplify(%, size);
abs(%): min(%, 1);
plot3d(%, myRange, axes=boxed, numpoints=40^2);

indicates where to search (but more complicated then your way).

A more sound, but *very slow* way is to set t=x+y*I and write the above as a polynomial,
using 'Homotopy' to find ~ 120 (!) solutions and use them for a starting point of fsolve,
where one takes the real and imaginary part to be solved for.

One would like to use RootFinding[Analytic], but that seems to need _complex_ analytic,
I have not found something for _real_ analytic.

@Preben Alsholm 

I did: 'eq' is (almost) like z:=(t^2+t+1)/(-t), ((-t)^5)^2=z*conjugate(z), %*t*conjugate(t).
Now fsolve/complex gives a different solution (and check it)

Then
eq:=(-t)^5-abs(z);
myRange:=x=-3/2 .. 3/2, y=-2 .. 2;
eq; eval(%, t=x+I*y); evalc(%); evala(%); simplify(%, size);
abs(%): min(%, 1);
plot3d(%, myRange, axes=boxed, numpoints=40^2);

indicates where to search (but more complicated then your way).

A more sound, but *very slow* way is to set t=x+y*I and write the above as a polynomial,
using 'Homotopy' to find ~ 120 (!) solutions and use them for a starting point of fsolve,
where one takes the real and imaginary part to be solved for.

One would like to use RootFinding[Analytic], but that seems to need _complex_ analytic,
I have not found something for _real_ analytic.

Digits:=15;
[-1, 
  -.265933691744568+.818459745062496*I, -.265933691744568-.818459745062496*I,
  +.983800463520269+.714772875818862*I, +.983800463520269-.714772875818862*I];
map( 't -> -t^5-abs((t^2+t+1)/t)', %);
fnormal(%): simplify(%, zero);
                         [0., 0., 0., 0., 0.]

Digits:=15;
[-1, 
  -.265933691744568+.818459745062496*I, -.265933691744568-.818459745062496*I,
  +.983800463520269+.714772875818862*I, +.983800463520269-.714772875818862*I];
map( 't -> -t^5-abs((t^2+t+1)/t)', %);
fnormal(%): simplify(%, zero);
                         [0., 0., 0., 0., 0.]

Though being ashamed by Robert's solution here just for brute force:

Since x = 2011 + floor is an integer and 1016060 is an upper bound
for the solution one can do a brute search:

  tst:=proc()
  local i::integer, x::float, k::float;
 
  for i from 1 to 1016060 do
    x:= evalf(i); k:= evalf( floor(sqrt(x)) );
    if abs(x-k*k-2011.0) <= 1e-15 then break; end if;
  end do;
  return i;
  end proc;

That would be slow. However 1016060 < INT_MAX = 2147483647 and thus
one can use double precision, both of the following will do it fast:

  m0:=evalhf(tst());
                                           7
                         m0 := 0.1014047 10


  cp:=Compiler:-Compile(tst);
  m0:=cp();

                            m0 := 1014047

More carefully one would have to justify why the numerical error in
that usage is small enough, such that no smaller solution would have
been skipped.

Though being ashamed by Robert's solution here just for brute force:

Since x = 2011 + floor is an integer and 1016060 is an upper bound
for the solution one can do a brute search:

  tst:=proc()
  local i::integer, x::float, k::float;
 
  for i from 1 to 1016060 do
    x:= evalf(i); k:= evalf( floor(sqrt(x)) );
    if abs(x-k*k-2011.0) <= 1e-15 then break; end if;
  end do;
  return i;
  end proc;

That would be slow. However 1016060 < INT_MAX = 2147483647 and thus
one can use double precision, both of the following will do it fast:

  m0:=evalhf(tst());
                                           7
                         m0 := 0.1014047 10


  cp:=Compiler:-Compile(tst);
  m0:=cp();

                            m0 := 1014047

More carefully one would have to justify why the numerical error in
that usage is small enough, such that no smaller solution would have
been skipped.

but now it is - äh: would be - time to think about it ...

but now it is - äh: would be - time to think about it ...

@Preben: if this OWA, then by default (set by Microsoft) xlm files are not allowed for execute (also for the new formats in Word or Excel - they do not trust themselfs ...), however the admin can change that settings

For the uploaded file: it is empty, just checked it with a hex editor

@Preben: if this OWA, then by default (set by Microsoft) xlm files are not allowed for execute (also for the new formats in Word or Excel - they do not trust themselfs ...), however the admin can change that settings

For the uploaded file: it is empty, just checked it with a hex editor

Jimmy,

Just let me know in case you need it and the suggested way by acer is not enough.

However that summation can not heal everything (if the values are too different in
magnitude and there are too many).

PS: the 'resize' I think is already in acer's code, ?ArrayTools[Alias]

Jimmy,

Just let me know in case you need it and the suggested way by acer is not enough.

However that summation can not heal everything (if the values are too different in
magnitude and there are too many).

PS: the 'resize' I think is already in acer's code, ?ArrayTools[Alias]

acer,

If you do not mind: how do you find that external calls?
And the correct 'signature' to use them?

Axel

acer,

If you do not mind: how do you find that external calls?
And the correct 'signature' to use them?

Axel

First 121 122 123 124 125 126 127 Last Page 123 of 209