roman_pearce

Mr. Roman Pearce

1678 Reputation

19 Badges

20 years, 217 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

Software developers are a very Lucky bunch.
I am using a 1GHz iBook G4. I only went to 10^7 not 10^9, and I am using an empty for loop not a while loop with a variable. TIMER := time(): for i to 10^7 do end do: time()-TIMER; # about 7.5 seconds Python is another interpreted language similar to Maple. It does the empty loop in 4.5 seconds. For Maple to go to 10^9 would require about 12.5 minutes on my machine. With Maple 10's compiled code you can do somewhat better: test := proc(n) option autocompile; to n do end do end: test(10): # dry run to compile procedure time(test(10^7)); This takes .380 seconds, which is about 20 times faster than the interpreted Maple code. If you're running some sort of numeric simulation and you can live with hardware precision you would be well advised to try option autocompile. It doesn't translate higher level Maple objects or fancy Maple language features, but it does support rtables, so you can code your numeric routines in the Maple language and debug them interactively. All in all, a brilliant feature which is easy to use.
I am using a 1GHz iBook G4. I only went to 10^7 not 10^9, and I am using an empty for loop not a while loop with a variable. TIMER := time(): for i to 10^7 do end do: time()-TIMER; # about 7.5 seconds Python is another interpreted language similar to Maple. It does the empty loop in 4.5 seconds. For Maple to go to 10^9 would require about 12.5 minutes on my machine. With Maple 10's compiled code you can do somewhat better: test := proc(n) option autocompile; to n do end do end: test(10): # dry run to compile procedure time(test(10^7)); This takes .380 seconds, which is about 20 times faster than the interpreted Maple code. If you're running some sort of numeric simulation and you can live with hardware precision you would be well advised to try option autocompile. It doesn't translate higher level Maple objects or fancy Maple language features, but it does support rtables, so you can code your numeric routines in the Maple language and debug them interactively. All in all, a brilliant feature which is easy to use.
It should take only a few seconds for Maple to go to 10^7. It's nowhere near as fast as compiled code, but it stacks up reasonably well against other interpreted languages like Python. On my machine Maple and Python take 7.4 and 4.4 seconds, respectively.
It should take only a few seconds for Maple to go to 10^7. It's nowhere near as fast as compiled code, but it stacks up reasonably well against other interpreted languages like Python. On my machine Maple and Python take 7.4 and 4.4 seconds, respectively.
By "radical" I meant that Maple is able to express the result using fractions and nth roots. So, for example x^3-2 has three solutions: 2^(1/3),-1/2*2^(1/3)+1/2*I*3^(1/2)*2^(1/3),-1/2*2^(1/3)-1/2*I*3^(1/2)*2^(1/3) Polynomials up to degree 4 can be solved using radicals, ie: there exists a formula like the quadratic formula which gives you the roots. Most equations of higher degree can not be solved by a formula so Maple uses RootOf notation to represent the answer. If you think about it, it's not really any different than writing sqrt(2). It's just a symbol for a number with a property, that property being (sqrt(2))^2=2. In RootOf notation sqrt(2) could be written as RootOf(Z^2-2, Z). Your problem has a degree 4 polynomial in T, so Maple actually is able to compute explicitly the "answers". I showed you how to do it in my previous post, using the allvalues command. The problem is the "answer" is a big mess of fractions, radicals, and the complex number I. You can't look at it and know what it is, so the result is probably not useful.
By "radical" I meant that Maple is able to express the result using fractions and nth roots. So, for example x^3-2 has three solutions: 2^(1/3),-1/2*2^(1/3)+1/2*I*3^(1/2)*2^(1/3),-1/2*2^(1/3)-1/2*I*3^(1/2)*2^(1/3) Polynomials up to degree 4 can be solved using radicals, ie: there exists a formula like the quadratic formula which gives you the roots. Most equations of higher degree can not be solved by a formula so Maple uses RootOf notation to represent the answer. If you think about it, it's not really any different than writing sqrt(2). It's just a symbol for a number with a property, that property being (sqrt(2))^2=2. In RootOf notation sqrt(2) could be written as RootOf(Z^2-2, Z). Your problem has a degree 4 polynomial in T, so Maple actually is able to compute explicitly the "answers". I showed you how to do it in my previous post, using the allvalues command. The problem is the "answer" is a big mess of fractions, radicals, and the complex number I. You can't look at it and know what it is, so the result is probably not useful.
The Matrix constructor is known to be slow. In this case it creates a rather expensive initialization procedure which is called for each entry of the result. You can see what I mean in the following example: A := Matrix([[1,2],[3,4]]); B := Matrix([[5,6],[7,8]]); trace(Matrix); Matrix([A,B]); If you look closely at that initializer, you will see that it evaluates the submatrices. This happens for each index (i,j) in the result.
Sorry I can only offer limited help, since I don't have a 64-bit machine here. It is a Java problem, and you essentially have two choices. One is to make sure Maple is using the included copy of Java, which is a 64-bit version of Java 1.4. This is the best option. Alternatively, if you are using 64-bit Java 1.5, you can install the Apache Crimson Component (which was removed from 1.5) which Maple needs to work. This is unlikely to work in your situation however, because Gentoo and probably Ubuntu often install a 32-bit browser to run 32-bit binary plugins like Flash, along with a 32-bit version of Java. For Gentoo, you should refer to this document: http://www.gentoo.org/doc/en/java.xml The first thing is to use "java-config --list-available-vms" to see what versions of Java are installed. You may want to try setting the default system VM to 64-bit Java 1.4. Let us know how it works, and we'll see if we can come up with more suggestions.
You should interview Vladimir Bondarenko. It may not sound like fun if you're shy about it, but you could ask him tough questions and I guarantee everybody would listen :)
This is a good suggestion. For what it's worth, space scrolls down a page, but other than that the TTY help is pretty basic. I attribute that to the fact that the entire program is designed around line output. I'm not sure if that can be changed, but I would love to see some upgrades to TTY Maple. I use it all the time.
Actually I was thinking more along the lines of using this as a new matrix data structure...
Sounds like someone's numerical analysis homework.
It's important to note that this won't evaluate. For example, eval(cos(x), x=0); # gives 1 subs(x=0, cos(x)); # gives cos(0), which would evaluate to 1.
It's important to note that this won't evaluate. For example, eval(cos(x), x=0); # gives 1 subs(x=0, cos(x)); # gives cos(0), which would evaluate to 1.
First 30 31 32 33 34 35 36 Page 32 of 39