Carl Love

Carl Love

28025 Reputation

25 Badges

12 years, 308 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@samiyare The name change is done, and I added fsolve and BVP to the keywords.

@samiyare The name change is done, and I added fsolve and BVP to the keywords.

Would you please describe precisely what buttons you clicked on for the first few steps? What you've described so far makes no sense towards solving this problem (finding the antiderivative). When I click on Hint button, it suggests a rewrite. When I click on Next Step, it distributes the cos(x) over the polynomial--a reasonable first step, although my first choice would be to go directly to integration by parts.

@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. 

First 640 641 642 643 644 645 646 Last Page 642 of 708