Introduction to Manipulate

Math 213 - Math with Mathematica
Christopher Hanusa
Supplement to the tutorial “tutorial/IntroductionToManipulate” in the Documentation Center

Overview

In this tutorial, we will be following along the tutorial “tutorial/IntroductionToManipulate” in Mathematica’s Documentation Center.  We will cover the sections:

1. Manipulate Is as Easy as Table

2. Symbolic Output and Step Sizes

3. Types of Controls

4. Initial Values and Labels

5. Beautifying the Control Area

6. 2D Sliders

(WE WILL SKIP 7. Graphics beyond Plotting and 8. Locator)

9. 3D Graphics

10. All Types of Output Are Supported

As you follow the tutorial, when you get to the end of Section N, answer Comprehension Question N, listed below.

Comprehension Questions

1. Create a Manipulate command that will output the value of (x^n) for values of x that vary from -10 to 10 and values of n that vary from 0 to 8.  What do you notice as you move the sliders?  Why does it happen?

2. Modify your code from Question 1 to create TWO Manipulate commands:

Create one Manipulate command in which the exponents are integers from -10 to 10.

Create one Manipulate command in which you calculate integer roots of x.  (Have it calculate Square root, Cube root, Fourth root, etc., for integers 1 through 20)

3. Read through the Documentation Center about “ref/ControlType”.
Copy or Create one Manipulate command that generates each of the following types of control: Slider, SetterBar, PopupMenu, Checkbox.

4a. What are the benefits of being able to specify an initial value for a Manipulate command?

4b. For the graphics object that is on input line 22  (The beginning of the code block says In[22]), click on the + box to the right of the n1 variable to open the menu that allows you to see the value that n1 is presently taking on.  Then Click the “Play” button to see how the graphic changes when the n1 variable is modified.  Use the Double Arrow to slow down the change of n1 so that you can see the pretty patterns that happen in the output as n1 changes slowly.

5&6. Compare the design of the three Manipulate commands output on input lines 25, 26, 30.  Which do you think has the controls placed in a better fashion? Why? What definition of “better” are you using here?

*We are not yet covering Sections 7&8, but you are of course welcome to play around with them.

9.  An interesting set of surfaces that you learn about in Math 201, Multivariable Calculus are the Quadric Surfaces, which have one of two forms: ax^2+by^2+cz^2=k or z=ax^2+by^2+k.  Use Manipulate to explore the range of possible quadric surfaces by modifying the following two pieces of code

ContourPlot3D[x^2+2y^2-3z^2==5,{x,-10,10},{y,-10,10},{z,-10,10}]

Plot3D[3x^2-4y^2+6,{x,-10,10},{y,-10,10}]

10.  Modify the Mathematica code given on line 45 to change the ControlType to something different than Slider.  Do you like the new output better or worse? Why?