Archive for the ‘Mathematica’ Category

Musicology Research with Mathematica 9

November 30, 2012 10 comments

Musicology Research with Mathematica 9

By James H. Choi
Source Link

Mathematica 9 has one important new feature that is not even mentioned anywhere in bold fonts.  It belongs to the “other” category of improvements that interests select few.  Well, I am that select few who have been waiting version after version for this feature.

This new feature is ground-breaking-ly for those who are interested in analysis of compositions.  For example, can you algorithmically recognize if a composition is by Bach?  Or more scientifically speaking, can you calculate Bach-liness score for a piece of music?

We know it can be done because, paraphrasing a Supreme Court Justice on an unrelated case: “We know it when we hear it.”

But there is the first obstacle.  How do we enter the musical score into the computer?  One can scan music scores and recognize the notes and rests.  That’s exactly what my student Hyunjoon Song did, and he won the 4th place at ISEF in 2011 with that research.  But, as his mentor, I know what he has done still needs a great deal of improvement before we can start scanning scores of different sizes/fonts/styles.

What is more intriguing is that most of classical music pieces are already in computer readable format called MIDI (Musical Instrument Digital Interface) file format.  In other words Book↔Text File and Music↔MIDI file.  Every single note’s pitch and duration will be ready to be analyzed by your algorithm if you can import MIDI file.  “If” you can import, that is.

Mathematica has been able to export into MIDI for some time.  That’s how Hyunjoon Song above exported the result of his musical score recognition into MIDI and used a common media player to play it for the judges.

With Mathematica 9, finally you can import MIDI files:

This opens a wide gate for many research topics for those who are passionate about music and science at the same time.

Do you want to teach computers to measure your favorite composer’s greatness?  Now you have all the tools.  All you need is your insight and ability to teach the computer to act on your insight: algorithm programming.  The best tool for it is now clear.  It is Mathematica 9.

Korean version: Mathematica 9으로 하는 음악 연구

Mathematica 9 New Features

November 27, 2012 Leave a comment

Mathematica 9 New Features

By James H. Choi
Source Link

Mathematica 8 logoI just received an email from Wolfram Research with a mention (for the first time) of what is new in Mathematica 9.  I use Mathematica to teach data-driven science research for Intel STS, ISEF and Siemens level competitions.  Here, data-driven means medical image processing, brain wave (EEG) recognition, etc. where my students focus on algorithmically analyzing/processing data while the acquisition itself is left to the doctors, technicians in the field.

Thus, Mathematica’s built in curated data has been very useful to my students and so is its many other ready-made functions/features.  Every time a new version comes out, Mathematica expands our reach that much further, and that much closer to a winning research.

Thus, I am very interested in finding out what this new version of Mathematica has to offer, so that I can adjust my teaching strategy to fully utilize it.  This is my reaction to the announcement.  I will replace “reaction” with “reflection on experience”  as I start using Mathematica 9 for myself and teaching my students with it.

You can find more about it from Wolfram Research site.  The text in blue is the official descriptions and one in black is my comment.

Highly integrated units support, including free-form linguistic entry, conversions, and dimensional consistency checking across graphics and numeric and symbolic calculations

This is great for doing physics and chemistry.  I have seen MathCad having excellent functionality in this area which could be matched by Mathematica with some arm twisting.  It looks like Mathematica finally took over.  When doing hairy calculations in physics, one way to verify the sanity (not the validity) of your computation is by checking the units or dimensions.  Velocity should have some unit of distance in the numerator and some unit of time in the denominator, for instance.  It sounds like Mathematica 9 can do it.  Until now I have computed without units, carrying out the unit computation/coherence in my head.  Come to think of it, that’s how you carry the order of magnitude in your head while you work out the precision of the figure using a slide rule.

Major new data science, probability, and statistics functionality–including survival and reliability analysis, Markov chains, queueing theory, time series, and stochastic differential equations

I do not have any thing to comment on this.

R fully integrated into Mathematica workflow for seamless data and code exchange

“R” is a computer language, a functional language that is known for its strength in statistical analysis.  Many Innocentive specifies the project to be done in “R,” and nothing else.  I have been deterred from some highly attemptable projects solely by this “R” language requirement.

It is not that learning “R” is difficult or expensive.  “R” is free, and open source.  But I could do other projects that accept Mathematica with the time/effort that it would take an old dog to learn a new trick.  The waiting strategy — better known as procrastination — paid off.  I look forward to having nimble Mathematica speak “R” in behalf of an old dog. analog and digital signal processing

Analog signal processing to me is wiring circuits.  I am puzzled how you can do analog signal processing in a digital computer.  Maybe they mean they can handle continuous functions?  Laplace transform place of Z transform?I will update this page soon as I find out.  Follow this blog if you are interested.

3D volumetric image processing and out-of-core technology that scales up performance to very large 2D and 3D images and video

This is welcome news.  Volumetric processing is particularly useful in medical image processing.  There were many algorithms that were slowing down Mathematica to the point that interactivity required patience.  I especially look forward acceleration in the 3D surface rendering.

New graph and network analysis, including a built-in link for Facebook, LinkedIn, Twitter, and more

The picture below depicts the connections among Facebook members.  My students could graph this only if they had the data.  The announcement sounds like we will indeed be able to access that data.  My students will be able to explore this human connectivity, or the “degrees of separation” in more depth, and win science competition prizes, then go on to MIT.

SabioAcademy teaches science research to bright high school students.  We teach students to use real data from research clinics and perform research with a goal of 1. winning at STS/ISEF/Siemens and 2. publishing in a scientific journal.  We have produced several ISEF winners and publications.

Categories: Mathematica

Why We Use Mathematica in Our Research Courses

November 13, 2012 8 comments

Why We Use Mathematica in Our Research Courses

By James H. Choi
Source Link

Any computer language can do what other computer languages can do.  The only difference is the efficiency.  (Think of shoveling snow with a tea spoon.  It can be done, but not efficiently.)  At the same time, there is no computer language that can solve all problems efficiently.  (You can race driving a school bus, but not efficiently.)  A modern day knowledge worker in science/engineering will end up learning multiple computer languages for multiple set of problems (A spoon for tea, a shovel for snow) over his/her career.  No one can go through a modern career knowing only Mathematica, or any other one language alone. (You can have a sports car, but you need to drive a van when you move 12 people.)

Of many different and capable programming languages, many of them available for free, why does Sabio Research use the most expensive one, Mathematica?  (Professional version is $2,495)

Here are the reasons.


We are neither choosing a final computer language, nor the only computer language the student will ever know. Here we are choosing the first computer language which will be used by pre-college students not only for science projects, but also through their college, graduate school and professional career working on many different types of work. In other words, we are choosing a computer language that can handle integral equations, differential equations, number theory problems, statistics, complex analysis, signal/image processing, optimization, graphing, visualization, 3D modeling, animation, physics simulations, genomic research, protein structure analysis, stock market prediction, environmental research, etc.


While it is true that Mathematica is $2,495, student version (with the same capability) is $65/year. But rarely students need to spend even $65/year to use Mathematica. Many math and science competitions (ARML, ISEF, KSEA) also provide free Mathematica license to the participants or winners.

Many academically advanced high schools, and most prestigious universities, and graduate schools provide Mathematica license for their students for free.

Advantage over C++, C# or Java

Mathematica is an interpreted language. (It can also be locally compiled for a faster performance) Thus, students can see the results of their command immediately and this will allow students to tweak the code endlessly until it works just right. Such trial and error learning (which is the most common way of learning a computer language) would take 10 times longer on a compiled language.

Advantage over Matlab, Mathcad

Mathematica is superior in pure mathematics, and has the largest number of built-in mathematical functions. There are many advocates of Matlab, but they are all users of specialized applications for which Matlab is a superior tool. Those advocates do not have to solve a wide array of problems as our students do. And also, Matlab advocates usually don’t know much about the functional programming (as opposed to procedural programming) and how much faster it brings one’s idea to reality. Here is an example of Matlab’s code (the topic was chosen by and the code was written by Matlab to showcase Matlab’s capability) and Mathematica code (written by Mathematica to show how Mathematica handles it differently). The result: Matlab’s 90 lines vs Mathematica’s 13 lines of code to accomplish the same thing. You can see how much quicker Mathematica user would have finished the job.

Advantage over Python

Mathematica is an environment (almost an operating system) as well as a language. Mathematica not only solves problems, but also is an mathematical/technical word processor. Students can think, try, tinker, solve, then write report all in one environment. Mathematica has a massive built-in library. Whatever functions students need, they are already available in Mathematica without having to link to a third party library. In Python, students have to look for a third party library of varying quality/reliability and must go through the process of linking them. Mathematica has everything students need, and it works out of the box. Here is a comparison result with an older version of Mathematica.

Common (and incomplete) perception of Mathematica

There are many people who think they know Mathematica. These people have used Mathematica to solve some math problems. They have entered a few lines of code at most (because usually that is all it takes to solve a math problem.) These people are not even aware of what Mathematica can do, especially in the latest version. If they have never written full fledged software using the latest version, whatever they know is too limited and obsolete.

One common complaint about Mathematica by software engineers is that Mathematica’s syntax is difficult to understand. What they really mean is that they don’t understand functional programming concept because their brain got already hardened with procedural programming in their formative years, i.e., they just could not get rid of the accent, or understand other languages.


Students should master one versatile and powerful computer language early on so that they can use it for everything they work on to get answers/results in minutes, not hours or days. Mathematica is ideal for that role. By mastering Mathematica, students can turn their idea to a proof-of-concept demonstration in a record time. Here is an example.For example, if students were assigned to solve a difficult problem using a specific language (Python for example) during their summer internship, they can solve the problem quickly in Mathematica first, impress the daylight out of the supervising professor with a demonstration, then proceed to port the algorithm to the target language of supervisor’s specification.Mathematica is the only computer language that is procedural (C, C++, Java style), functional (Scheme, Haskell style), and rule-based (Prolog style) at the same time. This versatility broadens the idea of what a “computer language” is supposed to be for the students preventing them from being pigeon-holed into the peculiarities of the first computer language they learn. This is similar to speaking with a thick accent, or unable to speak, in second and third human language they learn. Those who had Mathematica as their first computer language will understand functional or rule based programming concept later in their career.

It is important to remember that students are not yet software/electrical/mechanical engineers. In fact, they are still open to all possibilities. Students working in coursework, research, internship, science competitions never compete on scalability, security, objective-oriented-ness, execution speed of their code. They compete on ideas–the algorithm development–and they complete on the cycle time–how quickly they turned an idea into a working demonstration. Mathematica is the best tool for turning your idea to a living, moving, 3D demonstration in a record time.

Writing software to sell? Test the concept/algorithm in Mathematica then hire someone else to port the code to Java/C++/C# to commercialize their creation! Remember, in this modern economy, we don’t become a technology superstar by coding. We succeed by coming up with ideas that can be demonstrated to science competition judges, college admissions officers, professors and venture capitalists.

Protected: Mathematica Graphics3D Options

November 9, 2012 Enter your password to view comments.

This content is password protected. To view it please enter your password below:

Categories: Mathematica

Protected: Mathematica File Operations

November 9, 2012 Enter your password to view comments.

This content is password protected. To view it please enter your password below:

Categories: Mathematica
%d bloggers like this: