Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 28 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@tuGUTS Like I've told you several times already, it is an individual permutation; it is not a permutation group.

@tuGUTS Like I've told you several times already, it is an individual permutation; it is not a permutation group.

Here's an example of using a table to construct a permutation.

perm:= proc(L1::{list, function}, L2::{list, function})
local
     n:= nops(L1),
     k,
     T:= table([seq](op(k,L1)=k, k= 1..n))
;
     if {op}(L1) <> {op}(L2) then
          error "different elements"
     elif n <> nops(L2) then
          error "repeated elements"
     else
          [seq](T[op(k,L2)], k= 1..n)
     end if
end proc:

perm(f(a,b,c,d,e), f(d,e,a,c,b));
                        [4, 5, 1, 3, 2]
convert(%, disjcyc);
                      [[1, 4, 3], [2, 5]]


Here's an example of using a table to construct a permutation.

perm:= proc(L1::{list, function}, L2::{list, function})
local
     n:= nops(L1),
     k,
     T:= table([seq](op(k,L1)=k, k= 1..n))
;
     if {op}(L1) <> {op}(L2) then
          error "different elements"
     elif n <> nops(L2) then
          error "repeated elements"
     else
          [seq](T[op(k,L2)], k= 1..n)
     end if
end proc:

perm(f(a,b,c,d,e), f(d,e,a,c,b));
                        [4, 5, 1, 3, 2]
convert(%, disjcyc);
                      [[1, 4, 3], [2, 5]]


@emma hassan Unfortunately, eval is too simplistic for applying conditions like that, but it was a natural thing for you to try. Try using simplify with side relations (see ?simplify,siderels ):

simplify(f, {eval(f - diff(f,x) - 2*diff(f,x,x), x= 0)= 5});

--which looks almost like what you had. But note that there are no ands and only two equals signs. The eval in the above is only to set x= 0.

@emma hassan Unfortunately, eval is too simplistic for applying conditions like that, but it was a natural thing for you to try. Try using simplify with side relations (see ?simplify,siderels ):

simplify(f, {eval(f - diff(f,x) - 2*diff(f,x,x), x= 0)= 5});

--which looks almost like what you had. But note that there are no ands and only two equals signs. The eval in the above is only to set x= 0.

I don't think that eval is the issue because subs and map also elicit the same behaviour from `if`.

restart:

subs(A= true, `if`(A, sin(Pi), C));

sin(Pi)

restart:

f:= x-> `if`(x::symbol, true, x):

map(f, `if`(A, sin(Pi), C));

sin(Pi)

restart:

X:= `if`(A, sin(Pi), C):

A:= true:

X;

0

Suppose that I try to write a function with the same bahvaiour as `if`.

restart:

if1:= proc(A, B::uneval, C::uneval)
local r:= evalb(A);
     `if`(r::truefalse, `if`(r, B, C), 'procname'(args))
end proc:

eval(if1(A, sin(Pi), C), A= true);

'sin(Pi)'

Notice that extra level of unevaluation.

seq(if1(A, sin(Pi), C), A= true);

sin(Pi)

E:= if1(A, sin(Pi), C);

if1(A, sin(Pi), C)

A:= true:

E;

sin(Pi)

Another version of the same thing:

restart:

if2:= proc(A, B::uneval, C::uneval)
local r:= evalb(A);
     if r::truefalse then
          if r then B else C end if
     else
          'procname'(args)
     end if
end proc:

eval(if2(A, sin(Pi), C), A= true);

'sin(Pi)'

 

 

Download `if`.mw

You have 5 equations and 6 unknowns, so, no, it is not possible. Probably you need to consider the problem further and thus get one more equation.

I attempted to simply use pdsolve for a symbolic solution with no initial or boundary conditions. I ran out of memory after about 40 minutes.

@erik10 When you run the version that is both compiled and parallelized, what is the "parallelization ratio", i.e., (cpu time)/(real time)? And what is your value of kernelopts(numcpus)?

@erik10 When you run the version that is both compiled and parallelized, what is the "parallelization ratio", i.e., (cpu time)/(real time)? And what is your value of kernelopts(numcpus)?

@digerdiga This expression contains I several times and contains no radicals. That is why evalc was my first choice. Note that evalc is a bit different from the other simplifiers in that it automatically assumes as real any variable for which there are no assumptions. 

@digerdiga This expression contains I several times and contains no radicals. That is why evalc was my first choice. Note that evalc is a bit different from the other simplifiers in that it automatically assumes as real any variable for which there are no assumptions. 

@Christopher2222 Christopher wrote:

I calculated PowerTower(5) to 15005 digits and it took 200 seconds on my machine.

What do you mean by "to 15005 digits"? Do you mean that you were trying an approximation?

Christopher wrote:

I was trying to manually find the number of digits in PowerTower(5) maybe there's an easier way?

trunc(PowerTower(4)*log10(5.))+1 = 183230

@Christopher2222

Two possibilities:

  1. Your Maple doesn't understand thisproc. Fix: Change it to procname.
  2. Your Maple doesn't understand numtheory:-phi. Fix: Change it to numtheory[phi].
First 641 642 643 644 645 646 647 Last Page 643 of 709