Carl Love

Carl Love

28100 Reputation

25 Badges

13 years, 106 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

In the link that you give for the Bose-Einstein statistics, there is a table for 9 quanta of energy distributed among 6 particles. The table gives the expected number of particles with each amount of energy from 0 to 9. The expected numbers for 6 through 9 is small but greater than zero. I don't understand how they cannot be zero. For example, the only way to have a single particle receive all 9 units is for the other 5 particles to receive 0. But that means that there are more than 2 particles with 0 units of energy. How can that be?

Update: I have found the problem. You are confusing Bose-Einstein statistics with Fermi-Dirac statistics. It is the Fermi-Dirac where there can be at most two particles with the same energy. This also explains the problem with my Answer to your last question: You were expecting the Fermi-Dirac numbers, but you gave me the instructions for constructing a Bose-Einstein sample.

@nilssson It is perhaps counterintuitive, but expand is often an important early step in a simplification. Although it tends to make expressions longer, the components tend to be made simpler, which means that subsequent simplifiers such as combine are more likely to be able to do something useful with them.

@Stavros So, do you need me to implement this trivial change in the code?

@gourmelens 

You need to create the animation with the display(..., insequence) command, assign that to A, and then use display again in display([A,fish]);

@gourmelens 

Assign the animation to a variable, say A, then

display([fish, A]);

@Kitonum 

You point is made. At some point the proviso that I mentioned was added. It is clearly stated at ?sort in Maple 18.

Liu,

I split off your Reply as a separate Question entitled "Counting occurences of strings in a file."

The ODE is missing from your Question.

I split this off as a separate question.

Certainly Maple can perform both of these tasks. I can't work on it for several hours yet.

Concerning the second question, do you mean to search for whole lines only? Or may it be necessary to search for substrings within the lines? If the latter, is it possible that there are multiple occurences of the target string within a single line? And in such case should the target be counted multiple times?

@Carl Love And here is the efficient implementation using PolynomialTools:-CoefficientList.

MyCoeffList:= proc(p::polynom, x::name, y::name)
uses PT= PolynomialTools;
local k, L:= map(PT:-CoefficientList, PT:-CoefficientList(p, x, termorder= reverse), y);
    [seq([L[k][], 0$k-nops(L[k])][], k= 1..nops(L))]
end proc:

MyCoeffList(p, x, y);

So, you have about 4 billion elements, each element being a fair-sized linear polynomial. Clearly this cannot be stored in the memory of any normal computer. Fortunately, the coefficients of the polynomials are only 0 or 1. Each polynomial could be represented by a binary number. You have 32 variables, right? So that would be 4-bytes per polynomial, so the minimum memory requirement would be 16Gb. That's assuming that you can get Maple to use only 4 bytes for an integer; I think it might require 8 bytes. Maybe a string representation can be packed into fewer bytes.

Maple's numerical integration seems state-of-the-art to me, but maybe I don't really know what state-of-the-art is. What would you have added?

@Kitonum It is not quite true that my code does not give an unequivocal result when two of the input vectors have the same angle. The sort command guarantees in such cases that the output will be in the same order as the input.

@k20057 5

I've tried sampling without replacement, but I get similar results: The average number of particles with 0 energy is still about 2.2.

Perhaps each 6-tuple needs to be weighted according to its frequency of occurence.

@wingjammer 

It just requires a small modification. The following should work for any Maple. Keep the procedure Angle the same, and change SortByAngle to

SortByAngle:= (A::Matrix)->
     Matrix(sort(convert(A^%T, listlist), (P,Q)-> Angle(P) < Angle(Q)))^%T
:

 

First 531 532 533 534 535 536 537 Last Page 533 of 709