Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am not sure this question is suitable for this site. Please let me know if my question is too vague or if it is hard to give a clear anwser.

I'm a new user of Mathematica. My Mathematica use began with version 8. I think I'm reasonably familiar with the core language of Mathematica, but I want to get better acquainted with it's applications to various fields such as visualization.

I find Michael Trott's four big volumes, The Mathematica Guidebook, a very good resource, but find it a problem that the books are written for V4 and V5.

As I stated above, I am a user of a later version of Mathematica, so I have little knowledge of versions before V6. The core language of Mathematica hasn't changed a lot since V5, but other parts did (the graphics capabilities for example).

So, my question are:

  • Are there any tips/suggestions/references for making the best use of this rather old book?

  • How do I deal with the code compatibility issues?

share|improve this question
related, but not a duplicate, might be interesting for you:… – Pinguin Dirk Oct 6 '13 at 7:22
@PinguinDirk Thank you. Leonid's book is one of my favorate! The books listed in that question focus on the core language of Mathematica so the version issues is not so important. – mm.Jang Oct 6 '13 at 7:27
@YvesKlett I can't do anything with my poor English :p – mm.Jang Oct 6 '13 at 8:16
Even if references and API in previous versions may be obsolete but documentation still maintains info on these and suggests new APIs. – Rorschach Oct 6 '13 at 8:19
I would think that being a little out of date is an advantage for these books, to be used for learning, rather than a disadvantage (it certainly is a disadvantage if they are used as a reference). This gives you a chance to figure out the differences and make the learning process more active :) – Leonid Shifrin Oct 6 '13 at 10:37

(too long for a comment)

I think there isn't many problems about the code compatibility. You can learn a lot from the book without focusing on any code details.

It's a pity that the book doesn't get up-to-date with the newest MMA version. (I guess it's mainly because MMA has been updated much more frequently after version 5.) But I think it's still worth reading.

What I like the Guidebook most is that it has lots and lots of very interesting examples on varied topics, everyone can easily dive in from their interested aspects, math/physics/etc., and drift into Mathematica at last. You will see how to realize some well-known algorithms, or see how to model some physical systems, or how to draw some beautiful visualizations, with MMA style. You can read it like a "collected stories" written in MMA, follow the references you're interested in. Also, you can of course think about how you would solve the very problems with the current version of MMA. I bet it would be fun. :)

share|improve this answer

Some of the more graphics-related issues (eg GraphicsArray) seem to be fixed automatically by Mathematica version 9:

graphics array

Others are more problematic, unfortunately - but perhaps you could post a question. There are people here who have been using Mathematica for longer than some other people have lived...:)

The interactive features of the notebooks don't appear to work every time, but you might consider copying some of the code into a new notebook, to get the default stylesheet (and useful syntax colouring). Each section is self-contained, which is useful.

I think enough of the code works for the books to be very useful resources:

Module[{newVs, startVs, used, s = Sqrt[3], c = 0, iter = 7},
 (* attach new Vs to given one *)
 newVs[v : Polygon[{p1_, p2_, p3_, p4_, p5_, p6_}]] :=
  Block[{\[ScriptD]2 = (p2 - p1)/4, \[ScriptD]4 = (p4 - p1)/2, p7, 
    p8, p9, p10,   p11, p12, p13, p14, p15, p16, p17, p18, p19},
          p7 = p2 + \[ScriptD]4; p8 = p3 + 2 \[ScriptD]4; 
   p9 = p4 + \[ScriptD]4; p10 = p5 + 2 \[ScriptD]4; 
          p11 = p6 + \[ScriptD]4; p12 = p3 + \[ScriptD]2; 
   p13 = p12 + \[ScriptD]4; p14 = p8 - \[ScriptD]2; 
          p15 = p9 + \[ScriptD]2; p16 = p5 + \[ScriptD]2; 
   p17 = p16 + \[ScriptD]4; p18 = p10 - \[ScriptD]2; 
          p19 = p18 - \[ScriptD]4;
     If[(* only two Vs can have a common edge *) 
           used[#1/2] >= 2, 
      Sequence @@ {}, (used[#] = used[#] + 1) & /@
            (*   mark midpoints of new edges *)
            (Plus @@@ 
          Partition[Append[#2, #2[[1]]], 2, 1]/2); 
      Polygon[#2]] & @@@
        (* the four new Vs *) 
      Transpose[{{p2 + p3, p3 + p4, p4 + p5, p5 + p6},
                {{p3, p2, p7, p12, p13, p8}, {p3, p8, p14, p15, p9, p4},
                  {p5, p4, p9, p16, p17, p10}, {p5, p10, p18, p19, 
        p11, p6}}}]];
 (* three initial Vs *) 
 startVs = Polygon /@ (* use rational vertices *) Rationalize[N[
     {{{0, 0}, {2 s, 2}, {2 s, 0}, {s, -1}, {s, -3}, {0, -4}}, 
        {{0, 0}, {0, -4}, {-s, -3}, {-s, -1}, {-2 s, 0}, {-2 s, 2}}, 
        {{0, 0}, {-2 s, 2}, {-s, 3}, {0, 2}, {s, 3}, {2 s, 2}}}/4, 
     30], 0];   
 (* no edge is used yet *) used[_] := 0;
    pseudorandom coloring *) {Hue[Cos[Sec[c++]]], #} &  /@ 
      (* iterate attaching new Vs *)
     Flatten[NestList[Flatten[newVs /@ #] &, startVs, iter]]] /.
   Polygon[l_] :> {Polygon[l], {GrayLevel[0], 
      Line[Append[l, l[[1]]]]}},
    AspectRatio -> Automatic]]


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.