roman_pearce

Mr. Roman Pearce

1678 Reputation

19 Badges

20 years, 215 days
CECM/SFU
Research Associate
Abbotsford, British Columbia, Canada

I am a research associate at Simon Fraser University and a member of the Computer Algebra Group at the CECM.

MaplePrimes Activity


These are replies submitted by roman_pearce

If your list is large, I suggest sorting with attributes. You will need a bound B on the absolute value of the largest element:
# generate list
r := rand(-1000..1000):
L := [seq([seq(r(),j=1..3)], i=1..10^4)]:
# compute bound B and n = number of elements
B := 1001: n := nops(L[1]):
# we will sort on values of the dot product with X
X := [seq(B^(n-j), j=1..n)]:
# this should be fast
S := map(attributes, sort([seq(setattribute(Float(add(X[j]*i[j],j=1..n),0),i), i=L)], `<`)):
The method is fast because it avoids computing an expensive function n*log(n) times. Despite the use of floating point numbers, you should never have issues with precision because the value X.L[i] is computed exactly and a float is constructed with full precision..
At first I assumed this was due to the Groebner changes in Maple 11, but that seems to not be the case. Thank you for the interesting benchmark. Try the following:
sys := {...your system...}:
sol := Groebner[Solve](sys):
sol := map(a->[solve(a[1],[op(a[2])]), map(`<>`, a[3], 0)], sol):
sol := {seq(seq([i,j[2]], i=j[1]), j=sol)}:
This should write the solutions in a nice form. There may be duplicate or equivalent solutions, but you shouldn't lose any.
Maple 11 has new options that provide some measure of security. You will have to open the "Options" or "Preferences" dialog (depending on the platform) and under the Security tab check "enable ssystem calls".
The included worksheet uses the currentdir command to change Maple's working directory so that the library can be loaded. Nothing is installed. If you wanted to install it you could copy the dynamic library to the appropriate directory in your Maple installation and save the sdmp module and `type/SDMP` and `print/SDMP` to a Maple repository. As for memory, the library allocates its own memory and it retains some in between calls to speed up calculations. You can free this memory at any time by calling sdmp:-free_memory(). It is commented out in ModuleUnload because if you read in sdmp.mpl twice then the library can crash itself (two copies of the module are in Maple's memory and the first one can free memory that is being used by the other). As for the other questions, the answer is generally no, although I appreciate your good suggestions. This library is by no means complete, and we are just putting out an interim version so that people who are interested can use it.
The included worksheet uses the currentdir command to change Maple's working directory so that the library can be loaded. Nothing is installed. If you wanted to install it you could copy the dynamic library to the appropriate directory in your Maple installation and save the sdmp module and `type/SDMP` and `print/SDMP` to a Maple repository. As for memory, the library allocates its own memory and it retains some in between calls to speed up calculations. You can free this memory at any time by calling sdmp:-free_memory(). It is commented out in ModuleUnload because if you read in sdmp.mpl twice then the library can crash itself (two copies of the module are in Maple's memory and the first one can free memory that is being used by the other). As for the other questions, the answer is generally no, although I appreciate your good suggestions. This library is by no means complete, and we are just putting out an interim version so that people who are interested can use it.
I'm pretty sure this is part of the autosave feature. You can turn it off entirely under the "preferences" menu, or you can avoid the issue (but still get the benefits of autosave) by saving your worksheet to a file at the start of the session. Not exactly what you want, but it might help.
Maple itself is a closed platform, so there is a disincentive to develop open source software for it. There are already open source computer algebra projects: Maxima, SAGE, Octave, etc, which attract that talent. There is established model to attract outsiders to Maple development however. This has produced the toolboxes, but it has also added functionality to Maple itself.
Maple itself is a closed platform, so there is a disincentive to develop open source software for it. There are already open source computer algebra projects: Maxima, SAGE, Octave, etc, which attract that talent. There is established model to attract outsiders to Maple development however. This has produced the toolboxes, but it has also added functionality to Maple itself.
For whatever reason (somebody's bug) your text box appears to the right of the icons (italic, bold, terminal, Maple leaf, etc). It should appear below. Try clearing your browser's cache and reloading the page. Perhaps you have a bad copy of the stylesheet for the site, or there is a bug in the stylesheet, or there is a bug in Internet Explorer. In any case, it should look like this:
For whatever reason (somebody's bug) your text box appears to the right of the icons (italic, bold, terminal, Maple leaf, etc). It should appear below. Try clearing your browser's cache and reloading the page. Perhaps you have a bad copy of the stylesheet for the site, or there is a bug in the stylesheet, or there is a bug in Internet Explorer. In any case, it should look like this:
You're right, that was sloppy of me.
This is one way to compute a correct solution.
eqn := 1/2*((b^2+a^2) + sqrt((b^2+a^2)^2-4*a^2*c^2)) -c;
We introduce a new variable _z1=sqrt((b^2+a^2)^2-4*a^2*c^2) and construct a system of equations:
sys := [b^2+a^2+_z1-2*c, _z1^2-b^4-2*b^2*a^2-a^4+4*a^2*c^2];
Now, the easy mistake is to solve the system for {_z1,c} or {_z1,a,b,c}, but _z1 is not algebraically independent of {a,b,c}. If you solve this system for just c you will get that there is no general solution for all c. If you solve for {a,b,c} you will get the correct solutions.
sol := [solve(sys, {a,b,c})];  # now get rid of _z1
sol := subs(_z1 = (b^4+2*b^2*a^2+a^4-4*a^2*c^2)^(1/2), sol);
Now the solutions check out:
simplify(subs(sol[1],eqn));
simplify(subs(sol[2],eqn));
Solve is doing something pretty dumb, I will report this as a bug.
I don't see what could be so impossible about LaTeX output. It should be a no-brainer for any software that claims to produce "mathematical documents", because people may want to publish those documents and now you need LaTeX. Now I will grant that improving the current latex code would be a nightmare, but writing new code from scratch with a clean and efficient design could work well.
Thanks for posting your code, this is pretty neat. I liked seeing the algorithms.
First 21 22 23 24 25 26 27 Last Page 23 of 39