Re: Re: classsical Programing vs a math package
- To: mathgroup at smc.vnet.net
- Subject: [mg16713] Re: [mg16668] Re: classsical Programing vs a math package
- From: Mukund Swaminathan <mukund at mail.utexas.edu>
- Date: Wed, 24 Mar 1999 02:23:38 -0500
- Organization: home
- References: <7bg334$5p3@smc.vnet.net> <199903191754.MAA09879@smc.vnet.net.>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, This is one of my favorite interests. (1) Mathematica helps in rapid prototyping compared to C. This means a new idea can be tested first in this framework. The reasons are in built functions, better interface, faster debugging (due to smaller code as well as due to interpretive nature of Mathematica and ease of visualization). (2) Deficiency of mathematica being an interpretor is slower speed of execution. In many cases execution speed is actually less important than development time. Even in cases where speed is most important it may only be in portions of the code. This portion alone can be written in compiled languages and linked via Mathlink, getting best of both worlds. Mathematica has an inbuilt compiler, but, the type checking makes it a quite clumsy to use. The other deficiency is even the compiled version is really interpreted in a Java like fashion, and while allowing portability the gain is not as much as by a compiler. In built codes match what C can give. In other words if there si a routine that is available and is just as specific as you can get, then it is just as fast as C. Smart algos these guys have thought up allows you to get better performancethan you can get by yourself. (3) Mathematica is much more readable. We can document the code then and there using the wordprocessing capabilities. (4) Symbolic programming allows quite a few advantages. I had a numerical routine thet was sped up by partly doing it analytically and the remaining by compilation. (5) Easier storage. Just say expr>>"file.m"; and you can call back expr<<"file.m"; Use of save is another option. (6) One diadvantage is mathematica not having special purpose code like IMSL. But IMSL can always be called from mathematica (7) My work does simulation and at the same time uses quite a bit of math. In many ways this allows you to do your calculation. For instance I needed Cauchy principal value (I'm a student in ECE) and believe me I won't trust my own code unless sufficient time was spent debugging. (8) I believe newer version of Mathematica will improve numerical speed considerably. (9) All in all it makes a lot of sense to use Mathematica as the base and use C, C++ to write individual routines that are intensive, and not availbale in IMSL and caonnect via Mathlink. Mukund David P. Johnson wrote: > In article <7bg334$5p3 at smc.vnet.net>, bernard keenan > <kaylob at worldnet.att.net> wrote: > > > Hi all I am compiling an article for my engineering newspaper on the > > advantages of a package like mathematica vs clasical programing like C. > > Currently my school teaches C and I am trying to do a balanced unbiased > > article. > > Any help greatly appreciated > > > > Any help is greatly appreciated. > > > > Bernard Keenan > > I teach engineering mechanics. A couple of semesters ago, I taught our > mechanics of composite materials class. Traditionally in this class, > students write their own program to perform classical lamination theory > calculations. > > This was my first time teaching the class, and I had lost the program I > wrote so many years ago, so I decided to write my own CLT program along > with my students. All of the students chose classical programming > languages like Fortran, C, and MatLab. I chose Mathematica. > > The difference was amazing, I thought. I was able to keep way ahead of > the students quite easily. No time wasted trying to get format > statements right. Matrix multiplication is trivial. > > The only drawback is that execution is not instantaneous, as it is with > a compiled program.. > > -- > David > ->(Signature continues here)
- References:
- Re: classsical Programing vs a math package
- From: "David P. Johnson" <johnson@ae.msstate.edu>
- Re: classsical Programing vs a math package