Elasticity with Mathematica: An Introduction to Continuum Mechanics and Linear Elasticity

This appendix is devoted to a brief discussion of the somewhat less than common MATHEMATICA constructs that are used in the main text. Because the presentation below does not systematically cover the range of MATHEMATICA techniques available, we recommend that, in case of need, readers seek details through other MATHEMATICA resources: notebook help files and the MATHEMATICA book (Wolfram, 1999). Within the large literature on this subject we refer to an entry-level introduction by Nancy Blachman (1992), or else to one of the highly structured monographs of Roman Maeder (1997).
The subject matter of this appendix is split into four sections devoted to list manipulation, definition of functions, algebraic handling of expressions, and graphics.
Lists are important items within MATHEMATICA, because most objects are internally represented by general lists,
<b class="bold">mylist1 = { item 1, item2 , .... , itemn}</b><b class="bold">mylist2 = {item 1 , {item21, item22, {item231, item232, item233}} ,</b><b class="bold"> item3 ... , itemn}</b>where the items represent different MATHEMATICA objects. Note, for example, that mylist2 consists of a series of sublists.
A command that allows one to get rid of the sublists and to bring all elements within the list to one level is Flatten:
<b class="bold">In [.] := Flatten[ mylist2 ]</b><b class="bold">Out[.] = { item 1 , {item21, item22, ,item231, item232, item233 ,</b><b class="bold"> item3 ..., itemn}.</b>A finer level of manipulation is afforded by using options; for example, Flatten [mylist, n] permits flattening of the...