Carl Love

Carl Love

28050 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@gkfighting I seriously doubt that Maple can put the expression into the form (23) through any mathematically valid simplification/transformation process. Actually, I can't get Maple to even verify that the two forms are equivalent. Maple's ability to manipulate symbolic sums is limited---must less than its ability to manipulate symbolic integrals. Plus, while form (23) may look simpler, in some senses it is not because it's a quadruply nested sum. The form that I put it in has no nested sums.

Regarding your second question: It's beyond my mathematical knowledge. Hopefully someone else with more knowledge will respond.

@toandhsp You can if you download the Iterator package from the Maple Applications Center.

I deleted your immediately prior cruder form of this Question.

@Markiyan Hirnyk Here is the relevant paper directly uploaded to MaplePrimes: NumericMinimalSurfaceAlgorithm.pdf

You're right: It shouldn't return NULL. I'd consider a case where it returns NULL a bug. For a transformation, Maple should return either an expression or an error message. The returned expression may be the same as the input expression (we call it returning unevaluated) if the computation is too complicated to perform. So, would you please show the expression for which you get NULL output? For the example that I tried, I get unevaluated output:

inttrans:-mellin(LerchPhi(z, 1, 2), z, s);

     mellin(LerchPhi(z, 1, 2), z, s)

@Østerbro 

These versions remove the repetition of the input:

Display:= proc(e::uneval)
uses T= Typesetting;
local
     pre:= subsindets(e, uneval(name), eval, 1),
     r:= eval(pre),
     Ty_pre:= T:-Typeset(e)
;    
     if indets(pre, And(name, satisfies(u-> u<>eval(u)))) = {} then
          print(r)
     else
          print(
               evalindets(                    
                    subs("⁢"= "*", Ty_pre),  
                    specfunc(string, T:-mi),
                    proc(n)
                    local pn:= eval(parse(op(n)));
                         if pn::numeric then T:-mn(sprintf("%a", pn))
                         else T:-Typeset(T:-EV(pn))
                         end if 
                    end proc
               ) =
               evalf(r)
          )
     end if;
     r
end proc:

And the same thing for what Acer called the "weaker" version:

Display:= proc(e::uneval)
uses T= Typesetting;
local
     pre:= subsindets(e, uneval(name), eval, 1),
     r:= eval(pre),
     Ty_pre:= T:-Typeset(e)
;    
     if indets(pre, And(name, satisfies(u-> u<>eval(u)))) = {} then
          print(r)
     else
          print(
               evalindets(                    
                    subs("⁢"= "*", Ty_pre),  
                    specfunc(string, T:-mi),
                    proc(n)
                    local pn:= eval(parse(op(n)));
                         if pn::numeric then
                              T:-mn(sprintf("%a", pn))
                         elif type(pn, numeric &* 'specfunc'('anything', Units:-Unit)) then
                              T:-Typeset(T:-EV(pn))
                         else n
                         end if  
                    end proc
               ) =
               evalf(r)
          )
     end if;
     r
end proc:

@Østerbro Of the two versions of Display that Acer posted in his most-recent Reply, which are you using in your most-recent .pdf file?

@Vic Oh, I see now that you said Maple 16, not Maple 2016 (the current version). I misread that as Maple 2016. I don't think the downloaded Iterator will work with Maple 16. Not sure.

@Vic It comes prepackaged with Maple 2016. If you have Maple 2015 or Maple 18, you can download it for free from the Maple Applications Center.

@Vic You don't need to consider a < b because you only need to search forward of the current position. You can change your procedure to this:

ListProcess:= proc(A::list)
local k,b;
     for k to nops(A)-1 do
          if member(A[k][[2,1]], A[k+1..], 'b') and b::odd then return end if
     end do;
     A
end proc:

@Vic You'll definitely want to use the CartesianProduct from the Iterator package rather than the cartprod from the combinat package. The former is much faster. This'll also use an Array rather than a list for A, which'll produce less garbage to collect.

You don't have to do anything to have the garbage collected; Maple does it automatically. However, you should be aware of what percentage of your total time is being spent on it. CodeTools:-Usage will provide this information. You can run your procedure on, say, 10,000 lists and look at the gc time.

@Preben Alsholm Thanks, it works. I should've seen that both high-order derivatives were only in the second equation, but I didn't.

@Vic 

The first version is horribly, horribly inefficient. Please don't use it. I only included it as an example to show how you could break out of multiple loops.

p::[posint$2] is a type-checking expression. It is a boolean expression that is true iff p is a list of two positive integers. x$2 is equivalent to x,x for any x.

In order to precisely maintain the logic of your original loops, I needed to make sure that both members of p are integers less than or equal to n; that's what the max(p) <= n is for. But you may already know a priori that every member of A is a list of two positive integers both less than or equal to n. In that case, you don't need to check.

Are all your pairs distinct (i.e., not equal) elements? If so, then please construct for me an example A for which a < b isn't true. If you can't construct such an example, then it's a waste of time to check a < b. If you do have pairs p such that p[1]=p[2], then you'll have a=b. Those should be handled as a special case; it'd be a waste to do the position search in that case. And, as I see it now, it's impossible to have b < a.

Regardless of needing to break out of loops, you will ultimately need to use procedures. It'll be best if you start thinking in terms of procedures now.

 

You can sometimes get some information by setting infolevel[all]:= 5. Sometimes this will be an overwhelming amount of information, and you can use an integer 1 - 4 instead of 5. Note that the infolevel setting will stay in effect until you reset it to 0. The all can be replaced with specific procedure names, such as int. Here's an example:

infolevel[all]:= 5:
int(1/x^3, x= -1..1);

This produces about two pages of output, which I won't transcribe here, with the final result being undefined.

Now, looking at this output, I can see that `simplify/do` is called several times. I'm curious why. In particular, I'd like to know what arguments it was called with. This can be found with trace:

restart:   #You must restart for this to work.
infolevel[all]:= 5:
trace(`simplify/do`):   #Procedure names with special characters (like /) must be quoted.
int(1/x^3, x= -1..1);

You'll want to turn off tracing when you're done. You can either do a restart, or untrace(`simplify/do`).

@torabi What makes you think that this latest system needs only seven BCs? It still needs eight. If you were able to convert it to a form that could be converted to a first-order system, you'd immediately get an error saying that you need eight BCs.

I don't know how to put this system into a form that can be converted to a first-order system. The usual trick is to solve for the highest-order derivatives and take one of the solution branches. But solve returns NULL in this case:

solve(sys, {diff(w(x),x$4), diff(psi(x),x$3)});

First 399 400 401 402 403 404 405 Last Page 401 of 709