digerdiga

390 Reputation

8 Badges

11 years, 227 days

MaplePrimes Activity


These are replies submitted by digerdiga

@Carl Love No I don't. Here is what I was trying to do. Maybe it is possible to do it better some other way, so let me know.

 

 

 

restart; n := 4; s := [1, 2]; define(A, 'linear'); define(B, 'linear'); OL := proc (s::list) local r; r := s; r[1] := -s[1]; r[2] := s[2]+1; r end proc; o1 := OL(s); OR := proc (s::list) local r; r := [s[1], 2, seq(s[i], i = 2 .. nops(s))] end proc; o2 := OR(s); Oe := proc (s::list) local r; r := s[1]*(product(1/factorial(s[i]), i = 2 .. nops(s))) end proc; `~`[Oe]([o1, o2]); ((A+B)@@(n-1))(s); o := [op(%)]; eval(o, [A = OL, B = OR]); r := `~`[Oe](%); factorial(n)*add(r), bernoulli(n)

4

 

[1, 2]

 

proc (s::list) local r; r := s; r[1] := -s[1]; r[2] := s[2]+1; r end proc

 

[-1, 3]

 

proc (s::list) local r; r := [s[1], 2, seq(s[i], i = 2 .. nops(s))] end proc

 

[1, 2, 2]

 

proc (s::list) local r; r := s[1]*(product(1/factorial(s[i]), i = 2 .. nops(s))) end proc

 

[-1/6, 1/4]

 

A(A(A([1, 2])))+A(A(B([1, 2])))+A(B(A([1, 2])))+A(B(B([1, 2])))+B(A(A([1, 2])))+B(A(B([1, 2])))+B(B(A([1, 2])))+B(B(B([1, 2])))

 

[A(A(A([1, 2]))), A(A(B([1, 2]))), A(B(A([1, 2]))), A(B(B([1, 2]))), B(A(A([1, 2]))), B(A(B([1, 2]))), B(B(A([1, 2]))), B(B(B([1, 2])))]

 

[[-1, 5], [1, 4, 2], [1, 3, 3], [-1, 3, 2, 2], [1, 2, 4], [-1, 2, 3, 2], [-1, 2, 2, 3], [1, 2, 2, 2, 2]]

 

[-1/120, 1/48, 1/36, -1/24, 1/48, -1/24, -1/24, 1/16]

 

-1/30, -1/30

(1)

``

 

 

Download binary_tree_-_mapleprimes.mw

@Carl Love hm, ok.

Though now I'm stuck here:

((A+B)@@2)(s)=A(A([1, 2])+B([1, 2]))+B(A([1, 2])+B([1, 2]))

And maple can't evaluate, because my functions return lists of different length which can not be added.

I guess I need to tell maple that A and B are linear operators and evaluate each operand separately.

 

Can I specify A and B being linear?

edit: I guess define(A,linear) will do.

@acer Actually it seems when I use plot(f2(m),m=3..10) it is very slow but plot(f2,3..10) is quick.

Why is that?

@Kitonum Note that the complex integral (as a continuous contour) yields

int(exp(-z)/(1-z),z=0..infinity) = int(exp(-z)/(1-z),z=0..infinity,CauchyPrincipalValue=true) + int(exp(-1-epsilon*exp(I*t))/(-epsilon*exp(I*t))*I*epsilon*exp(I*t),t=Pi..0)

The second integral is in the limit epsilon=0 just

I*int(exp(-1),t=0..Pi) = I*Pi*exp(-1)

 

So I presume Maple evaluates the LHS to Ei(1)/exp(1) and not the CPV.

@Mariusz Iwaniuk Is add() faster than sum() ??

@Carl Love This was new to me. Thanks!

@sand15 Yes I'm aware of that...

As I said; I just oversaw that the double, triple, ... terms actually diverge too. Otherwise there would have been some serious flaw.

@vv Ah you are right. The double sum is indeed infinity

1/2*1/3 + 1/2*1/4 + ... + 1/3*1/4 + ... = 1/2*( (1/2 + 1/3 + 1/4 + ...)^2 - (1/2^2 + 1/3^2 + 1/4^2 + ...) )

where the first square is infinite....

@mmcdara Shouldn't the expanded series and the product coincide? In particular as you showed that the product converges...

@Kitonum I did, but are you trying to tell me that there is a point y € Y which is mapped onto at least twice?

Which one?

 

Did you understand my question 3. ?

@Kitonum 2. Are you sure? Because the mapping

r=sqrt(x*y)

t=ln(sqrt(x/y))

seems fine to me...

 

3. I mean:

seq([x, t, t = 0 .. 1], x = 0.1 .. 1, 0.5) gives

[0.1, t, t = 0 .. 1], [0.6, t, t = 0 .. 1]

 

Now commands like linspace(0.1,1,3) in Matlab or Julia specify that the interval [0.1,1] in the above example is sliced in 3 points, namely [0.1,0.55,1]. For the map in 2. I have to omit the point zero, but I don't want to omit the point 1.

@Kitonum 2. So what is the reason that one side is a straight line? And what do you mean by "it is easy to verify that it is not straight" ??

Do you mean the not straight line is given by r=1, so

plot([exp(t), exp(-t), t = 0 .. 1])

is curved?

So is that map bugged?

 

3. No I really mean that in

x=r*exp(t)

y=r*exp(-t)

x€[0,1] and y€[0,1], so

r^2=xy

exp(2t)=x/y

 

However how do you proceed if you cannot solve for r and t ?

Is there some build in stuff or do you need to use RootOf?

 

4. Is there something like

linspace(0,1,10) ?

using

seq([x, t, t = 0 .. 1], x = 0.1e-1 .. 1, 0.5e-1)

does not have the other endpoint at 1, because the intervals do not match up to 1.

@Kitonum When I do your old version F(S) seems to work the same as F(plots:-display(S))

 

Actually I just noticed that you started with (r,t) € [0,1] x [0,1]

However here: (x,y) € [0,1] x [0,1], so I would have to take the inverse first which is sort of doable, but what if I can not solve for (r,t) ???

@Kitonum Thank you.

I'm wondering about plots:-display(F(plots:-display(S)), scaling=constrained);

why did you write F(plots:-display(S))

and not F(S)

which also seems to work.

 

PS: Why does you new plot not map onto a triangle anymore?

@vv `infolevel[`evalf/int`]:=5;`

Thanks. I always forget about that.

4 5 6 7 8 9 10 Last Page 6 of 19