Re: Should I get Matlab or Mathematica or ?
- To: mathgroup at smc.vnet.net
- Subject: [mg2880] Re: Should I get Matlab or Mathematica or ?
- From: groskyd at gv.ssi1.com (David Rosky)
- Date: Thu, 4 Jan 1996 03:04:57 -0500
- Organization: Silicon Systems, Inc.
In <4c2k9b$8gh at dragonfly.wri.com>, doug at sun1paztcn.wr.usgs.gov (Doug Wellington) writes: >I am in the market for a math program to do some simulations with. >I want a general purpose tool that will let me do algebra and >calculus as well as working with signal processing. I also have >interests in fuzzy logic and neural nets, chaos, fractals, etc... > >I have seen a nice package called "Calculus and Mathematica" that >makes me think Mathematica is a nice expandable program, but then >I have seem some DSP work that is done with Matlab. ...[snip]... > I went through this decision as well. One of my primary uses was to simulate various pulse detection and equalization schemes - primarily a numerical task. I also wanted symbolic capability, however, since I need to work out the mathematics of these systems before I can simulate them (transfer functions, etc.). I asked people who had used each program and the bottom line seemed to be that those who had chosen Matlab had done so because it is supposedly faster for numerical calculations, particularly those involving matrices and vectors. Those who had chosen Mathematica had done so because of its intrinsic symbolic nature and other features such as superior graphing capabilities and expandability to a wide range of problems, as well as being less costly than Matlab. I have found the speed issue to be partially true. If you begin programming in Mathematica as you would in C or FORTRAN, you will end up with slow programs. This is because Mathematica is intrinsically symbolic in nature and internally breaks down most operations into function calls who's evaluations involve alot of overhead. You can write efficient programs in Mathematica, however, by minimizing function calls (including hidden ones like array subscripting), using compiled functions where applicable, and making as much use as possible of the vast array of built-in functions. Built-in functions (such as dot product, for example) usually operate many times faster than the same function coded explicitly. There are many other things as well that can be used to improve program efficiency. It still may not be quite as fast as Matlab (or even MathCad) for numerical work, but it is not nearly as bad as one would expect just looking on the surface. The catch is that it requires a paradigm shift. I have speeded up some of my earlier Mathematica programs by as much as 10x by careful re-coding using techniques I gained after playing with it for a while. Regards, David Rosky (groskyd at gv.ssi1.com) ==== [MESSAGE SEPARATOR] ====