Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@nm You're making several mistakes:

1. Semicolons are not part of statements.

2. Nor do semicolons terminate, complete, or finish statements; rather, just like in English, semicolons separate statements. In this way Maple syntax differs from the corrupted, impure syntax of the C family of languages. Rather, Maple syntax is derived from the beautiful syntax of the Algol family of languages.

3. A procedure definition is not a statement; it's an expression, a data structure just like lists, sets, etc. Only if it's assigned to something does it become a statement. (An isolated expression can be considered a form of statement. This is only useful if a procedure has side effects.)

4. A pair of parentheses in isolation, (), is equivalent to the NULL expression sequence; it's a valid expression sequence like any other.

5. P:= proc() whatever end proc() is not equivalent to P(), nor did I say it was. The things that are equivalent are

P:= proc() whatever end proc;  E:= P();  P:= 'P';

and

E:= proc() whatever end proc();  or  E:= (()-> whatever)();

These latter forms avoid the wasted syntax and memory of giving a name to a procedure which will never be used again. All these forms produce the same result, E.

It follows from (2) that a semicolon is never required immediately before end, else, elif, fi, od, or catch. It follows from (4) that although such semicolons aren't required, they are allowed. It follows from (3) that an anonymous procedure definition can be passed as an argument; indeed, such passing is very commonly seen as the first argument of map, select, etc.

Everything that I've said above is about the allowances and flexibility of the syntax; there's nothing about its restrictions. This is the antithesis of "fussy". If you want more things to generate syntax errors, then it's you who wants a fussy language.

@taro In Maple, you never need to copy the output and modify it manually. The following procedure will take any function expression and distribute the functional operator over the first argument if the first argument is a sum (but not a sum or Sum):

Distribute:= (f::function)-> maptype(:-`+`, op(0,f), op(f)):
L:= Limit(f(a+h)-f(a), h= 0);
Distribute(L);

Please provide your complete code. In the context that you've given so far, diff(conjugate(phi(X)), x1) is obviously 0.

Please provide example code.

@firmaulana No, I don't think that it's worth it to try a faster computer. If the limitation had been memory, it might be worth it to try a larger computer.

I believe that different processors may use a different number of clock cycles per operation, so the ratio 3.2/3.5 doesn't apply. Also, using more nodes will incur a higher percentage of administrative costs, so you should run your test using the same number of nodes on each machine.

@Christopher2222 My guess is that this web page has a way of detecting that it is being queried by a computer program rather than by a regular person, and in that case it sends back an essentially null response. If you can get some other program to read the page, I've figured out exactly how to get the today's price off of it.

@Østerbro I'm not very familiar with the Units package---and I have no familiarity whatsoever with embedded components like tables---and your worksheet is overwhelming. Please send me a few examples that show the system not working, and please describe what you would like the output to look like. Please point out exactly where the output is incorrect. Please make it a straightforward worksheet with no startup code, no tables, and no use of non-stock packages like Gympack. If I can make that work, then we can graduate to tables, etc.  Also please note that I have zero knowledge of your field of study or your native language. I do however have familiarity with scientific literature in general: I know what units are, I know all the standard units, and I know how they are supposed to be displayed. 

@tomleslie The raw unnormalized Laplacian matrix L is also symmetric and positive semidefinite. Perhaps you were misled by the word symmetric in symmetric normalized Laplacian matrix. The word is there to distinguish that normalization from the other, the random-walk normalized Laplacian matrix, which isn't symmetric.

@firmaulana Yes, that's the correct syntax. I didn't expect it to finish instantly, but I expect it to take much less than 12 hours. Let me know how long it actually takes.

@firmaulana Are you sure that you executed the statement that assigns the constraints to kendala? In other words, you must hit the Return key (or Enter key) on that assignment statement before it takes effect.

It may be best to re-execute the entire worksheet.

@firmaulana 

I'm suggesting that you remove assume= binary and give all variables bounds 0..1. This can be done with a very small modifcation of your code. Take the set of constraints out of the LPSolve command and assign the set to a variable, let's say Kendali. Then change the LPSolve command to

Sol:= LPSolve(z, Kendali, (indets({z, Kendali}, name)=~ 0..1)[], maximize);

I'm not saying for sure that this will work. It's just worth a try. It should take much less time. I vaguely recall a theorem (it's been 30 years) that under certain fairly common conditions, a binary ILP can be solved as a regular LP and the solution will turn out to be binary anyway.

 

@tomleslie wrote:

Using "%m" gives output in Maple ".m" format, and it seems(?) to be identical to the results when using save(expr,filename) when 'filename' has a '.m' extension.

As far as I can tell, this use of save with unnamed expressions is undocumented. When E is a named expression, there is a slight difference between

save E, filename;

and

fprintf(filename, "%m", E);

The difference is that with the save, the name E is also stored, so that the saved expression is equivalent to E:= <value of E> rather than just <value of E>.

The only other place I can find a reference to 'dotm' is as an option in the MapleTA[ToString] command.

That command (without the dotm option) looks like a useful way to put an expression into a mostly human-readable but also machine rereadable form.

@acer Oh, how boring and cryptically documented! I thought that this was an exciting new way to write directly to worksheets. But actually it's just a patch to maintain backward compatibility. I see that if

p:= 1+x+x^2:

then

sprintf("%m", p) <> sprintf("%Zm", p).

Do you have any example where one would need to use this? Are expressions in worksheets stored in .m (or .Zm) format?

What you describe is totally normal. Integer linear programming problems are hard. You have a lot of constraints and, more significantly, a huge number of variables. I only looked at your worksheet briefly, but it looks like 18^3 = 5832 variables. Try relaxing the assume= binary constraint to all variables being between 0 and 1. In other words, make it a linear program. You may get an answer that is binary anyway.

You should practice on a smaller version of your problem.

First 402 403 404 405 406 407 408 Last Page 404 of 709