Applied Mechanics Lab

Mechanics of Continua and Structures

Calendar

gmail inbox

[edit]

Beginner’s Guide to Mathematica

Mathematica is a software application that goes beyond numeric and symbolic calculations. It is a modern technical computing system based on a high-level general-purpose programming language, the Wolfram Language. The Wolfram Language kernel is a text-based interface that allows you to evaluate Wolfram Language commands.

Useful resources:

Mathematica files:

Input and output cells

Comments

Variable names

Clear variables

Important conventions

Frequently used built-in functions

Mathematica has over 5000 built-in functions. Here is an alphabetical listing of these functions.

Replacement operator

Postfix Functions

Defining your own functions

It is fairly straight forward to define your own functions in Mathematica. For example, we define the function \(f(x)\) as GitHub Logo In this example,

Flow control

Lists

Lists are used as the basic method of collecting numbers, symbols, and other objects. In addition, vectors and matrices are, in fact, lists.

Lists in Mathematica are surrounded by braces { }, and matrices are just lists of lists, all having the same length. Note that a list here is a computer list, so that {a, b} is the ordered pair (a, b), unlike classic mathematical usage where {a, b} denotes the set consisting of a and b; thus in Mathematica, {a, b} is not identical to {b, a}.

Create lists

The most common way to generate a list is by using the command Table and Range.

Display lists

Operating on lists