vv

13805 Reputation

20 Badges

9 years, 313 days

MaplePrimes Activity


These are replies submitted by vv

@Kitonum 

Yes, and for n circles,

0 < x <= m(n) := (1-sin(Pi/n))/(1+sin(Pi/n)) = tan(Pi/4 - Pi/(2*n))^2.

Do you have a reference for this problem?

 

If you want to test intsolve you should choose some equations with known solutions.
E.g. take y(s)=sqrt(s) , compute F(s) and call intsolve(...).
And note that invlaplace could be in a distributional (generalized) sense.

@Markiyan Hirnyk 

@Markiyan Hirnyk 

It worked for me, but invlaplace could not be computed symbolically.

Your F(z) is arbitrary (generic) so you cannot hope for more.
Try e.g. replacing F(z) with a concrete expression e.g. z^2.

@Ferdinand

The theorem seems to be this:

Let C be a circle of radius 1 and center O.
For each 0 < x <= 1/3 there exists 0 <= d(x) < 1 such that the following holds.

For any circle C' having the radius x and having its center at the distance d(x) from O
and for any point P on C', denote by C(1) the unique circle which is outer-tangent to C' at P and is also inner-tangent to C.
For each k=2..6 define successively the unique (Apollonius) circle C(k) inner-tangent to C, and outer-tangent to C' and C(k-1).
Then C(6) is outer-tangent to C(1).



As the OP noticed, d(1/3)=0 and so, for x=1/3 all the circles C(k) have radius 1/3.
Is the exact expression of d(x) known as a function of x? [it should be]


Note also that the geometry package has a command Apollonius which constructs the Apollonius circles but it fails if their number is not maximal (i.e. 8). (see http://www.mapleprimes.com/questions/205718-Apollonius-geometry-Problem)

I tried to understand the statement of the theorem behind your construction.

Let C and C' be two fixed circles, C' inside C such that radius(C)=1, radius(C')=x, 0<x<=1/3.

Consider n in N and the circles C(1),...,C(n) inside C such that C(k) is tangent to
C, C', C(k+1) and C(k-1) for k=1..n where C(0)=C(n) and C(n+1)=C(1).

Then there exists x such that the existence of such circles is guaranteed. Furthermore,
given P a point on C' and imposing that the tangency point between C(1) and C' is P then n=6 and the positions of the circles C(1),...,C(n) are unique.

Is it correct? Or maybe this is valid only for a special position of center(C').
[Probably the position of center(C') is essential because of the Apollonius construction].

@Carl Love 

Let's say L has 10^5 elements, each of length 10^4 (bytes).
total for L could be 10^9 bytes = 1GB (approx);

After obtaining A, it needs only approx 10^6 bytes = 1MB, and the huge L can be deleted to make room for T.

I did not test the impact for T (in worst situation) but it should be anyway better.

 

 

@Carl Love 

If the expressions in L are huge, the table T in f5 will need much less memory.

The fact L can be replaced by
A := map(addressof,L);

can be tested via
nops(convert(L,set)) = nops(convert(A,set));

 

@emendes 

If your list L and expressions are really huge, I recommend to apply the function not to L but to

map(addressof,L)

because identical expressions will have (in principle) the same memory address.

@Carl Love 

So, f5 is the champion.

@Carl Love 

Strangely, ff with tables seems to be a bit faster than f4
restart;
R:= rand(1..9):
L:= ['R()' $ 99999]:
r1:= CodeTools:-Usage(
     {entries(((x-> x[2])~)~(ListTools:-Classify(x-> x[1], `[]`~(L, [$1..nops(L)]))), nolist)},iterations=10
):
memory used=31.09MiB, alloc change=47.02MiB, cpu time=315.10ms, real time=316.10ms, gc time=63.96ms
f4:= proc(a)
local T, u;
     for  u in `[]`~(a, [$1..nops(a)]) do T[u[1]][u[2]]:= () od;  #use NULL instead of () in math 2D
     {indices}~({entries(T, nolist)}, nolist)
end proc:
CodeTools:-Usage(f4(L),iterations=10):
memory used=22.67MiB, alloc change=0 bytes, cpu time=193.40ms, real time=193.50ms, gc time=51.48ms

fff:=proc(a)
local aa,T,u;
aa:=zip(`[]`,a,[$1..nops(a)]);
for u in aa do T[u[1]][u[2]]:=NULL od;
[indices]~([entries(T, nolist)], nolist)
end:
CodeTools:-Usage(fff(L),iterations=10):
memory used=21.90MiB, alloc change=0 bytes, cpu time=173.20ms, real time=173.90ms, gc time=43.68ms

@Carl Love 

Yes, I know that using tables is faster than appending. The main purpose was simplicity, the speed was just a by-product.

But indeed f4 seems to be both simple and fast, I like it :-)

@asa12 

arctan(x)=-Pi/2 does not have solutions in R or C. [However x=-infinity is an "extended" solution]

@asa12 

tan((45+270)*Pi/180) = -1

L:=seq( [t*cos(t),t*sin(t)],t=0..8.*Pi,Pi/36.):
plot([L],style=point);

 

First 139 140 141 142 143 144 145 Last Page 141 of 176