Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

From your previous recent Questions, I know that you're working with an obscure coordinate transformation (you called it OPToroid). In order to integrate, you need to multiply the integrand by the absolute value of the determinant of the jacobian of the transformation[*1]. That may be the purpose of your factor r^4*sin(6*theta)*sin(3*phi), but that's not clearly stated.

[*1] Does anyone here know a briefer, yet mathematically precise, way to say "multiply the integrand by the absolute value of the determinant of the jacobian of the transformation"? 

@radaar 

Would you please post a worksheet showing some minimal evidence (and it needn't be hard or conclusive evidence) of these two statements:

  1. "Actually, direct search packages stopped working."
  2. "I dont think direct search will work for black box functions."

Both statements are quite contrary to my experience.

@9009134 If you look at your expressions with lprint, you'll see that the function names are actually u__r`u__φ`, and `u__θ` rather than u__ru__phi, and u__theta. This is not really your fault. It has something to do with 2D input: I think getting the names from palettes. I'm not certain because I never use it (because it's total garbage that leads to errors like these).

@Nadeem_Malik My use of declare(U[]) rather than declare(u(x,t)) makes absolutely no difference! The important thing is that you use square brackets---not underscores---to input the derivatives. The way that things "appear" in your Maple doesn't matter. What matters is the keystrokes that you used while entering the expressions. Two different inputs may lead to outputs that appear identical (when prettyprinted, which is the default output format) but which in reality are different. That's why I suggested that you look at the output with lprint.

The underscore character is treated by Maple exactly like an alphabetic character (a, b, c, etc.). It has no other syntactic meaning, but you are using it as if it did. This is different from LaTeX, where the underscore is very significant syntactically.

To save a worksheet, use the File menu, just like any other desktop application.

To upload a worksheet to this website, use the green uparrow that appears on the toolbar of the editor of this website.

@Joe Riel 

Yes, elementwise operators (as opposed to elementwise function symbols) can be applied to multi-term expression sequences as if they were lists (of course, with the result being an expression sequence rather than a list). It's often useful (and more efficient) to not need to place and then to remove the list brackets, such as when the output becomes the input of a multi-argument function.

@Joe Riel Perhaps this is too clever, but it fits on one line, starting with the original equation, eqn:

`=`((1,-1)*~selectremove(has, (expand@(lhs-rhs))(eqn), diff));

Compositions of multi-argument functions are tricky.

@vv Yes, LOC and lambda are escaped locals. Like anything else, they'll be gc'd when there's nothing pointing to them. That they're escaped locals doesn't cause any special consideration wrt gc, nor should it. Did you have in mind an example where such behavior might be problematic? I think that upon closer examination, you'll see that it all works out.

None of this changes my Answer, except that I might possibly add a footnote:

  • "For what it's worth, lambda in this situation is called an escaped local, which may sound like the name of some erroneous condition, but actually it's innocuous. Escaped locals can even be useful sometimes; they're closely related to module exports."

@Joe Riel I think that the variable order in that third argument to simplify matters in this case. In order to get the desired result, I must make this [e2,e1].

@MDD I think that you've mixed up the argument order and that what you should have is

... elif ormap(HasSubexpression, [n*a, n*b], [a*n*z^3+t-1, -m*x]) then ....

The first argument of HasSubexpression is the subexpression to search for; the second argument is the polynomial or set or list of polynomials to be searched through.
 

Also, ormap always returns truefalse, or FAIL[*1] so 

... elif ormap(...) = true then ... 

can always be simplified to

... elif ormap(...) then ....


[*1] In general, ormap can return any of the three values of Maple's three-valued logic: truefalseFAIL. But in the present context, it'll always be true or false.

What does "to separate" mean in this context? I'm familiar with the term meaning to get all occurences of one variable on one side of  an equation and all occurences of another on the other side, but that doesn't seem to apply here.

@tomleslie Was this Answer possibly intended for another Question? I can't see any relationship between this Answer and this Question (with its atttached worksheet).

@MDD Since 3-b = 2 - (b-1), in some sense it does contain b-1 (and this is the way that algsubs, but not has, views it). So, in order for me to proceed, you'll need to give a precise definition of what it means for a subexpression to "appear" in a polynomial.

@MDD 

I wrote it to work exclusively for products because that's what I thought that you wanted. But that can be easily changed:

HasSubexpression:= proc(s::algebraic, e)
local S;
   has(algsubs(s= S, e), S)
end proc:

Note the reversed argument order, as discussed two Replies above.

@MDD The order of the arguments of has seems unnatural to me, and it's usually inconvenient. For any membership-testing procedure, the item being looked up ought to be the first argument, and item being searched through ought to be the second. I continued that wrong order with HasProduct. It ought to be changed to

HasProduct:= proc(p::`*`, e)
local P;
   has(algsubs(p= P, e), P)
end proc:

Then the ormap can be done more naturallly, without the need to curry HasProduct:

ormap(HasProduct, A, B)

@MDD 

ormap(a-> HasProduct(B,a), A);

First 265 266 267 268 269 270 271 Last Page 267 of 709