Carl Love

Carl Love

28035 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@lcz TSPLIB is programmed, maintained, and documented externally to Maplesoft. A Google search on "TSPLIB" turns up a huge amount of documentation. Should it be Maplesoft's responsibility to document someone else's software? 

@dharr You wrote:

  • but for the multiplicative group, 0 is excluded and the order is n-1.

To clarify that, the order of the multiplicative group is n-1 iff is prime. Not just 0, but all values not coprime with n must be excluded from the multiplicative group because they're not invertible. In general, the order of the multiplicative group is NumberTheory:-Totient(n).

@Brian Hanley I have transferred plaintext Maple code from Maple worksheets to this forum, other forums, email, and text editors many, many thousands of times (this is my 13,834th post on this forum alone), and I've never seen this unwanted single quotes issue. I wonder if you're having an OS or browser issue. My process is

  1. Select the desired code with the mouse (left click and drag)
  2. Press Ctrl-C
  3. Move mouse cursor to desired location (some other editor)
  4. Left click
  5. Press Ctrl-V.

@acer It's an (admittedly small) shame that A__* is interpreted as a symbol, because the intention may have been the symbol A__ followed by an infix operator.

@Thomas Dean If you add a with(GroupTheory), then it'll work.

@mmcdara I think that you meant to say replace all double backslashes \\ with single forward slashes /.

@wswain The OP's presented example is admittedly contrived, but a drawback to your solution in such a case is that assigning to the indices will also change the entries.

@mmcdara No, I Answered the Question, whereas you merely provided "additonal information" only. Although neither you nor the OP (@segfault) understands this yet, it is clear beyond any doubt that @segfault's Question is about catenation (sometimes called concatenation (AFAIK, the two words are defined identically)), i.e., a computer-language-coded process to automatically generate a sequence such as R1R2...Rn, where n needn't be explicitly known at the time that the code is written. I suggested to suffix as a more common-English-understandable verb, although to catenate is well-established Computer Science usage. As I said, suffixed is formally defined in Maple, and Maple's cat is obviously an abbreviation of catenate. That the Maple code needed to do that is only 9 characters, R||(1..n), is further supplementary evidence that catenation is the OP's intent.

@Christian Wolinski As Rouben said, there may have been a time when (-1)^(1/2) did not automatically simplify to I. And perhaps also sqrt(-1) at some previous time didn't return (which isn't an automatic simplification; the code that does it can be seen on line 4 of showstat(sqrt)). These are minor points which I doubt many remember from a 20+-year-old Maple version. My first Maple version was 5.4.

The major point is that the type system (which includes the commands type and indets) does purely syntactic checking of expressions; it applies no mathematical knowledge whatsoever. It's necessary that it work that way, and that's the way it worked in Maple 5.4. So it doesn't know that I = sqrt(-1) = (-1)^(1/2) (where I'm using = in the mathematical, not Maple, sense). Nor does it know that 2 = sqrt(4)/ Would you expect type(2, posint^fraction) to return true?

Mathematical equality of different numeric expressions isn't an integral component part of "Boolean logic". If you allow the only addition, multiplication, the sine function, and one real-valued variable, it's quite easy to create equations whose truth is formally undecidable. See Richardson's Theorem.

I'd guess that you know most of this already, given your extensive experience with Maple as shown by your many good Answers here, but for some reason you're choosing to ignore it at the moment.

What type of data? Zero-one (such as adjacency matrices)? Small integer? Rational? Hardware float? Symbolic (i.e., expressions with variables)? Etc.

Your computation gives me 4.61: 

exp(-0.07*05)*0.5236*12.50;
                         
4.612183547

Perhaps I don't understand $12.50. I took the to be a currency symbol.

Your code uses both lowercase theta and capitalized Theta. Was that your intention? They are different variables.

@MANUTTM The equations use F(z). Where is defined?

Since there's an equation relating w and q, there's no need for a loop. The whole thing can be done with a single call to NLPSolve.

@MANUTTM Any equations or non-strict inequalities (meaning <= rather than <) can be added as constraints to the NLPSolve command. Equations are expressed with =, not := (which are assignments). I'm not sure how to interpret what you highlighted---

q := p*(2*`&Phi;s`/(w - v) - b);
`&Phi;s` := 0.5*epsilon*(1 - F(z));

---but I think they should be equations.

@MANUTTM Obviously you must generalize the loop so that all references to wwtemp, etc., are replaced with and ywtemp and ytemp, etc., like this:

for lambdam in l do
    (wtemp, wnew, ytemp, ynew):= (60, 20, 50, 10);
    while 0.05 <= abs(wtemp - wnew) or 0.05 <= abs(ytemp - ynew) do
        (wtemp, ytemp):= (wnew, ynew);
        Etemp:= eval(eval(E1), [w,y]=~ [wtemp,ytemp]);
        Soln:= NLPSolve(Etemp, p= 5..500, q= 10000..30000, maximize);
        (ptemp, qtemp):= eval([p,q], Soln[2])[];
        `&pi;temp`:= Soln[1];
        Emanf:= eval(eval(E2), [p,q]=~ [ptemp,qtemp]);
        Soln:= NLPSolve(Emanf, w= 30..60, y= 5..50, maximize);
        (wnew, ynew):= eval([w,y], Soln[2])[]
    end do;
    print(lambda, ptemp, qtemp, wtemp, ytemp, `&pi;temp`)
end do:

 

First 63 64 65 66 67 68 69 Last Page 65 of 708