Introducing Mathematica
Introducing Mathematica John H. Lowenstein Preface This informal introduction to Mathematica®(a product of Wolfram Research, Inc.) is offered as a downloadable resource for users of the textbook Essentials of Hamiltonian Dynamics (Cambridge University Press, 2012). The aim is to familiarize the student with the core concepts and functions of Mathematica programming, so that he or she can very quickly become comfortable with computational methods in dealing with the illustrative examples and exercises in the textbook. The scope of Mathematica obviously greatly exceeds what can be covered in these few pages, and so it is highly recommended that the student take full advantage of the excellent documentation which is included with the software (accessible via the Help menu). 1. Getting started Mathematica conducts a dialogue with the user: you type in a mathematical expression, press Enter , and Mathemat- ica evaluates the expression according to rules which are either built-in or have been prescribed by you, displaying the result as output. The input/output alternation continues until you quit the session, with all steps recorded in the cells of your notebook. The simplest expressions involve ordinary numbers (e.g. 1, 2, 3, . , 1/2, 2/3, . , 3.14159), and the familiar operations and relations of arithmetic and logic. Elementary numerical operations: + (plus), - (minus), * (times), / (divided by), ^ (to the power) Elementary numerical relations: == (is equal to), != (is not equal to), < (is less than), > (is greater than), <= (is less than or equal to), >= (is greater than or equal to) Elementary logical relations: || (or), && (and), ! (not) For example, 2+2 evaluates to 4 , 1<2 evaluates to True , and !(2>1) evaluates to False .
[Show full text]