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

@acer Is explicitly combining addends necessary for the OP's Maple 2015? It doesn't seem necessary in Maple 2022 (if accepting the SI unit).

b:= 7*Unit(mm)+3*Unit(m);
convert(b, unit_free);
 

@mmcdara Good Answer; voted up.

I guess that you didn't try searching "trace" in the help. The command to trace is simply trace(...procedure name(s)...). Thus IF1 can be reduced to

IF1:= (__w1, __w2, __x1, __x2, __x3)->
    evalf(
        Int(
            eval(MM, [w1= __w1, w2= __w2, x1= __x1, x2= __x2, x3= __x3])
           , [b2= 1..2, b3= 1..2]
           , method= _d01ajc
           , epsilon= 0.001
         )
    )
:

And do

trace(IF1):

before calling NLPSolve.

@The function I think that the breadth of my Reply has been misinterpreted. I was only objecting to this statement by @vv , which I thought was too simplistic:

  • For a) it's enough to compute simplify(A . B), obtaining the unit matrix, without any assumption on p.

In his followup Reply to my objection, he changed that to

  • A and B having polynomial entries, A.B = Id ==> A invertible, that's all. [Emphasis added.]

That modified statement I no longer think too simplistic. Both A and B having polynomial entries (i.e., no variables in denominators) is sufficient to guarantee that A is invertible for all p. (*1)  Regarding the determinant-based solution: If A has polynomial entries, and Determinant(A) is a nonzero constant, then A is invertible for all p. (*2)

Regarding the two proposed counterexamples, A1:= <<p>> and A2:= <p, 0; 0, 1/p>: The symbolic inverse of A1 is <<1/p>>, which is not a polynomial matrix. For A2Determinant(A2) = 1, a nonzero constant, but A2 is not a polynomial matrix. So neither of these are counterexamples to (*1) or (*2). I had proposed A1 as a counterexample to vv's initial statement, which didn't mention polynomials.

@Rouben Rostamian  The OP's plaintext transcription contains all the information needed to Answer the Question, if it can be answered at all. Yes, the so-called ODE is not an ODE in the usual sense, but nonetheless dsolve will give a symbolic solution to it (actually 3 solutions). The Question is whether any or all of those solutions are correct. 

I've tried several things, and at this point I'm leaning towards "they're not correct", but that's just a guess.

@vv The problem is simple, but it's not that simple. Suppose A = <<p>>. Both Maple and I would claim that A is non-singular with A^(-1) = <<1/p>>. (There is a formal context to make this entirely valid that I can elaborate upon if you want.) But the problem at hand asks us for the isolated singularities (without putting it in those words). For A = <<p>>p=0 is one of those isolated singularities. Maple's assumptions don't handle isolated singularities.

@JAMET Change this line:

seq(plot([[1/2*cos(Pi/6+i*1/5), 1/2*sin(Pi/6+i*1/5)],[0,0]],i=1..10),color=black)

to

seq(plot([[1/2*cos(Pi/6+i*1/5), 1/2*sin(Pi/6+i*1/5)],[0,0]], color= black),i=1..10)

The only difference is switching the position of i= 1..10 with color= black.

@nm Why not just redefine solve as a local procedure? Then the only change that you need to make is adding a half line of code. Example:

restart:
Program:= proc(expr, A)
local eq, solve:= eq-> :-solve(simplify(eq), _rest);
    eq:= expr;
    (solve(eq, _rest) assuming `if`(A::{list,set}, A[], A))
end proc
: 
Program(sqrt(exp(y))=tanh(x), [y::real, x>0], y);
                         2 ln(tanh(x))

Or you could make the local redefinition simply solve:= PDEtools:-Solve;

@nm The reason that assuming works differently from assume here is that the assume is in effect when sqrt(exp(y)) is entered, which causes that to immediately simplify to exp(y/2) under the y::real assumption. The code that causes this to happen is lines 83-85 of sqrt:-ModuleApply.

Without any assumptions in effect at the time that the sqrt is entered, it returns exp(y)^(1/2)This expression does not have an unevaluated sqrt. Thus, there's no way to go back to lines 83-85 after the assuming takes effect.

@Carl Love I wrote:

  • You can't compare what you've done in 2D Input with anything possible in Maple V because Maple V doesn't have 2D Input.

Actually, I've thought of a valid way to make the code comparison in many or most cases: Any syntactically correct[*1] 2D Input can be converted to 1D input, and indeed Maple does this conversion anyway (without showing you) for its own internal purposes before executing the code in the kernel. If you want to see this equivalent 1D input, highlight the 2D Input => right click for the context menu => 2-D Math => Convert To => 1-D Math Input. (This is the best way to debug syntactically correct 2D Input, IMO.) Then that 1D input can be copy-and-pasted to some other Maple version to make the comparison.

By converting to 1D input, you can discover many cases where identical sequences of keystrokes produce different executable results and hence different output in 2D- and 1D-Input. This case of the "extra dot" is one such; more details are below.

[*1] By syntactically correct I mean that Maple interprets the 2D Input as being something that the kernel can execute. It doesn't mean correct in the sense of doing what the user intended.
  

@C_R You wrote:

  • I overlooked the extra dot. I will delete my reply. There is nothing to investigate.

Please don't delete Replies or other material which has been responded to. Here are 3 reasons why (there are probably many others):

  1. It makes the thread confusing to read in the future.
  2. It makes the responder's response seem like a non sequitur.
  3. It  makes the responder feel that their effort was partially wasted, particularly the effort of writing a response that would remain understandable for years to come. 

Instead, you can add an addendum saying, for example, that you've been convinced otherwise about an earlier statement.


Regarding the "extra dot", I do think that there is something for Maplesoft to fix, or at least document clearly or have it trigger a warning. I don't think that "investigation" is required because it's a clear-cut case of different syntactically correct interpretations of identical character sequences of input in 2D and 1D.

It has always been the case (or at least back to my 1st Maple version---V r4) that the range operator .., when used infix, could be replaced by three or more dots (with no intervening spaces) with no difference in interpretation. So, 

0.2...2

is interpreted the same as (0.2) .. (2). But in 2D Input, it's interpreted as (0.2) .. (0.2), because the 3rd dot is parsed as a decimal point rather than as part of the range operator.

 

@jediknight You wrote:

  • In conclusion, the argument "maximize" is not optimized in Maple V. Is this correct to say so?

No, that's not quite correct. It's not an argument but rather a command and a procedureArguments are the things in parentheses that are passed to procedures. Since the documented purpose of maximize is to optimize, it presumably does that in most cases. The command has a bug for the case at hand---a deviation from its documented behavior and purpose. It should never return a nonreal value.

You can't compare what you've done in 2D Input with anything possible in Maple V because Maple V doesn't have 2D Input. In your 1st usage of the range in your most-recent Reply, the right endpoint is 0.2, so the range is the single point 0.2. In your 2nd usage, the right endpoint is 2.

Also, I didn't say that there were no discrepancies; I said that there were no forward discrepancies, meaning that the code shown in this thread that works correctly in Maple V's 1D input (its only input mode) continues to work correctly in Maple 2022 1D Input.

Also, assuming doesn't exist in Maple V, although it does have assume.

@jediknight There are no forward discrepancies in the results. The code that works in Maple V continues to work in Maple 2022. But until you said that you were using Maple V, people were giving you Answers that worked only in more-recent versions. That's only natural, because the way that things are coded in the more-recent versions is generally better, less prone to errors. (An example is the modern eval(GainQ1, params) versus Maple V's subs(params, GainQ1); the eval does some checking of the mathematical validity of the substitutions.)

The function GainQ1 is an even function of wx, i.e., GainQ1(wx) = GainQ1(-wx) for any real wx. So, any solution has a corresponding negative solution. The way that you used fsolve in your last command caused it to return a single real root of its choosing. It happened to choose a negative. You can force it to give a positive root by making the 2nd argument {wx= 0..infinity}

It's possible to give a complete symbolic solution to your overall original problem. In other words, it's possible to get Maple to return a single algebraic expression for the maximum value of GainQ1 for any m > 1 and Q1 > 0. The expression is long (about a screenful at the smallest readable Zoom level) but Maple can easily handle it. It has several square roots and cube roots of polynomials. 

@Wes My last Reply wasn't directed to you. It was meant for others who may be trying to work with your data but don't have your Excel file. And there's no need for the file now because it's easier to just copy-and-paste your column of data.

Regarding those two lines: There's nothing to "test". It's just a listing of some Maple code.

Excel and other software that can do this quickly likely have databases of the integral values. There's one common set for n <= 2000 (apparently used by the external code that Maple calls) and another for n <= 5000 (used by R, among others).  

@jediknight For Maple V, try this:

restart:
GainQ1:= 8*wx^2*(m-1)/(Pi^2*sqrt((m*wx^2-1)^2+Q1^2*wx^2*(wx^2-1)^2*(m-1)^2));
params:= [m= 6.3, Q1= 1];
a:= subs(params, GainQ1);
Top_of_Q1:= max(seq(subs(wx= x, a), x= [fsolve](numer(diff(a, wx)))));

That's based on my memory of Maple V; I have no way of testing it. (Of course, it still works in Maple 2022.)

If you're using software that's well over 20 years old, and that software has been continuously updated ever since by a whole company of programmers, and everyone who answers your questions is used to the more-recent versions, then don't you think that you should tell people upfront what version you're using? 

A hint for anyone who wants to work with this data set in Maple: An unpunctuated column of numbers, such as the OP gave above, can be directly copy-and-pasted to a 1D-input execution group. The result will be 1D code that returns the equivalent 1-column Matrix. No other commands or typing of any kind is needed.

I think that Maple does this W test with external code (which I can't see). The deepest that I dug was

kernelopts(opaquemodules= false):
eval(Statistics:-Tests:-ShapiroWilkWTest:-PerformTest);

I'm working on computing the W statistic (to compare with OP's result), but it involves over 3000 numeric integrations, most of which are double integrals. It's still doable though. It's the covariance matrix of the order-statistic distributions of 80 standard normal r.v.s.

First 72 73 74 75 76 77 78 Last Page 74 of 709