€¦ · web viewmathematica is a program great suitable for both numeric, algebraic, graphical and...

12
Begin with Mathematica – Extract IOPROG Begin with Mathematica 1 Core Elements Table of Contents Getting Started Installing/enabling Mathematice Installation Introduction Learning Phases User Interface/Main Window of Mathematica Basic Use of Mathematica Toolbar Evaluate expression Help system Notation Drawing without or with minor mathematics in Mathematica Assigning variable/names in Mathematica Notebook cells Interactive input InputField Manipulate – slider - animation Deploying interactivity/dynamic Mathematica notebooks on the web Interactivity and Drawing using Locator object Numeric Foundations Geometry buttons/tools: characteristics and concepts Basic geometric constructions – Graphics object Interactivity and Drawing using Locator A connection between Geometry and Algebra- Bezier Curves A classic connection between Geometry and Algebra – Pythagoras’ Theorem Linear functions, polynomials of 1 st degree Quadric functions, polynomials of 2 nd degree 1

Upload: lemien

Post on 29-Aug-2019

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: €¦ · Web viewMathematica is a program great suitable for both numeric, algebraic, graphical and symbolic work, and it has a remarkable word-processing capabilities as well

Begin with Mathematica – Extract IOPROG

Begin with Mathematica 1Core Elements

Table of Contents

Getting StartedInstalling/enabling MathematiceInstallationIntroductionLearning PhasesUser Interface/Main Window of MathematicaBasic Use of Mathematica ToolbarEvaluate expressionHelp systemNotationDrawing without or with minor mathematics in MathematicaAssigning variable/names in MathematicaNotebook cellsInteractive input

InputFieldManipulate – slider - animation

Deploying interactivity/dynamic Mathematica notebooks on the webInteractivity and Drawing using Locator objectNumeric FoundationsGeometry buttons/tools: characteristics and conceptsBasic geometric constructions – Graphics objectInteractivity and Drawing using Locator A connection between Geometry and Algebra- Bezier CurvesA classic connection between Geometry and Algebra – Pythagoras’ TheoremLinear functions, polynomials of 1st degreeQuadric functions, polynomials of 2nd degree

©www.ioprog.se …………………………………………………………………………………………………………………

1

Page 2: €¦ · Web viewMathematica is a program great suitable for both numeric, algebraic, graphical and symbolic work, and it has a remarkable word-processing capabilities as well

Begin with Mathematica – Extract IOPROG

IntroductionMathematica is a program great suitable for both numeric, algebraic, graphical and symbolic work, and it has a remarkable word-processing capabilities as well. For the new user, the learning curve for Mathematica can be somewhat steep and Mathematica can seem opaque and threatening. but in the mid-to-long term Mathematica is a very easy-to-use, enjoyable tool.Mathematica was created by a mathematician for other mathematicians. A user of Mathematica should be comfortable dealing with abstraction, generalization, and pattern discovery.

Learning PhasesAn important idea in the material “Begin with Mathematica” is built on three learning phases:

- collaboration phase with construction protocol and jointly adapted worksheets and work-outs with step-by-step guidance in discussion with teacher/instructor

- elaboration phase with discovery/self-study/self-reviewed worksheets and work-outs, typically performed as investigation of additional concepts, parallel concepts or attack concept/problem from another angle

- exploration phase/”e-learning” supported by interactively modifyable worksheets/work-outs to foster experimental as well as discovery learning to strengthen and confirm the understanding and use of

concepts, patterns and models. Every Mathematica construction can be exported as a Web Page (html), known as a Dynamic Worksheet. Computer on local base or access to the internet is all that is needed to interact with it!

Those three phases will be practiced through the “Begin with Mathematica” material.

User Interface/Main Window of MathematicaWhen Mathematica is started the following screen is shown.

Press the Notebook button to create a new Notebook.A notebook is a collection of Mathematica statements, output, and graphics. The concept is like that of a "document" in a word processor. You enter information and commands into the notebook window, and the output (if any) is displayed there.

…………………………………………………………………………………………………………………

2

Page 3: €¦ · Web viewMathematica is a program great suitable for both numeric, algebraic, graphical and symbolic work, and it has a remarkable word-processing capabilities as well

Begin with Mathematica – Extract IOPROG

Deploying the interactivity/dynamic notebooks on the webWikipediA: Computable Document Format (CDF) is an electronic document format designed to allow easy authoring of dynamically generated interactive content. It was created by Wolfram Research.Computable document format supports GUI elements such as sliders, menus and buttons. Content is updated using embedded computation in response to GUI interaction. Contents can include formatted text, tables, images, sounds and animations. CDF supports Mathematica typesetting and technical notation. Paginated layout, structured drill down layout and slide-show mode are supported. Styles can be controlled using a cascading style sheet.CDF files can be read using a proprietary CDF Player with a restrictive license, which can be downloaded free of charge from Wolfram Research. In contrast to static formats such as PDF and pre-generated interactive content provided by formats such as Adobe Flash the CDF Player contains an entire runtime library of Mathematica allowing document content to be generated in response to user interaction using any algorithms or visualizations which can be described in Mathematica. This makes it particularly suited to scientific, engineering and other technical content and digital textbooks.CDF reader support is available for Microsoft Windows, Macintosh and Linux but not for ebooks or tablets. The reader supports a plugin mode for Internet Explorer, Mozilla Firefox, Google Chrome, Opera and Safari, which allows CDF content to be embedded inline in HTML pages.

Example – Collaboration, elaboration, e-learning

Follow those steps to make a notebook, for example the earlier example for the coordinate system, available on the web.

Open the .nb file in the Mathematica tool, for example Coordinate_System.nb.

Open the menu Deploy -> Embedded in HTMLThe following window is opened.

Select CONTINUE

3

Page 4: €¦ · Web viewMathematica is a program great suitable for both numeric, algebraic, graphical and symbolic work, and it has a remarkable word-processing capabilities as well

Begin with Mathematica – Extract IOPROG

Specify a location/file system path and a .cdf file name, currently Coordinate_System.cdf, probably the same name as for the starting notebook .nb file.Select CONTINUE.

Use the same location and same name for the new created .html file for the embedded JavaScript code as for the .nb and the .cdf file. This alternative is chosen in advance.

Copy the JavaScript code in the scrollist window. Create a new .html (HTML5) file with a common webdesign texteditor (Notepad++, Dreamweaver, . . .).

4

Page 5: €¦ · Web viewMathematica is a program great suitable for both numeric, algebraic, graphical and symbolic work, and it has a remarkable word-processing capabilities as well

Begin with Mathematica – Extract IOPROG

<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Untitled Document</title></head>

<body></body></html>

Invoke the JavaScript code in this .html file (HTML5), currently Coordinate_Syst.html, at the usual place for JavaScript code.

<!doctype html><html><head><meta charset="utf-8"><title>Untitled Document</title> <script type="text/javascript" src="http://www.wolfram.com/cdf-player/plugin/v2.1/cdfplugin.js"></script> <script type="text/javascript"> var cdf = new cdfplugin(); cdf.embed('Coordinate_Syst.cdf', 626, 490); </script></head>

<body><h1> Exploration </h1><p> 1) Use the manual Step button (Forward/Backward) to visualize the points with the coordinates (0,0), (-1,-1), (1,5).</p><p> 2) Use the Play button to animate/visualize points in the coordinate system.</p><body></body></html>

Open the .html file in an ordinary web browser. All the functionality in the notebook example can now be examined in the web browser. Navigate to the link http://www.ioprog.se/Mathematica/Coordinate_Syst.html

……………………………………………………………………………………………………………………Example – Collaboration, elaboration – e-learning

5

Page 6: €¦ · Web viewMathematica is a program great suitable for both numeric, algebraic, graphical and symbolic work, and it has a remarkable word-processing capabilities as well

Begin with Mathematica – Extract IOPROG

Create an interactive webpage of the last example following the steps in the windows open by the menu Deploy -> Embed in HTML for the file with the current optional filename Add5.nb shown in the earlier example and create the files Add5.cdf and Add5.htmlNavigate to the link http://www.ioprog.se/Mathematica/Add5.html

……………………………………………………………………………………………………………………

6

Page 7: €¦ · Web viewMathematica is a program great suitable for both numeric, algebraic, graphical and symbolic work, and it has a remarkable word-processing capabilities as well

Begin with Mathematica – Extract IOPROG

A classic connection between Geometry and Algebra – Pythagoras’ TheoremTheorem of PythagorasThis is a classic connection between a geometry construction and algebraic expression.In order to demonstrate Pythagoras' theorem we must show the square of the hypotenuse, hyp, and the sum of the squares of the shorter sides (leg1 and leg2):

leg12 + leg 22 = hyp12

Example – collaboration - elaborationThis example shows an animation of the original Euclid’s proof of Pythagoras theorem. Navigate to the Wikipedia link http://en.wikipedia.org/wiki/Pythagorean_theorem and read the paragraph Euclid’s proof.

Example – Collaboratio, elaboration, e-learningCreate an interactive webpage of the last example following the steps in the windows open by the menu Deploy -> Embed in HTML for the file with the current optional filename Pythagoras3.nb shown in the earlier example and create the files Pythagoras3.cdf and Pythagoras3.html

7

Page 8: €¦ · Web viewMathematica is a program great suitable for both numeric, algebraic, graphical and symbolic work, and it has a remarkable word-processing capabilities as well

Begin with Mathematica – Extract IOPROG

Navigate to the link http://www.ioprog.se/Mathematica/ Pythagoras3 .html

……………………………………………………………………………………………………………………

Quadratic functions, polynomial of 2nd degree

8

Page 9: €¦ · Web viewMathematica is a program great suitable for both numeric, algebraic, graphical and symbolic work, and it has a remarkable word-processing capabilities as well

Begin with Mathematica – Extract IOPROG

A quadratic equation is an equation of a polynomial of degree two. When graphed, a quadratic equation makes a parabola with a vertical “symmetric axis” or “mirror line”.

A quadratic function can be expressed in three formats:

f(x) = ax2 + bx + c is called the general form,

f(x) = a(x – x1)(x – x2) is called the factored form, where x1 and x2 are the roots of the quadratic equation,

f(x) = a(x – x0)2 + y0 is called the vertex form (or standard form), where x0 and y0 are the x and y coordinates of the vertex, respectively.

To convert the general form to factored form, one needs only the quadratic formula to determine the two roots x1 and x2. To convert the general form to standard form, one needs a process called completing the square. To convert the factored form (or standard form) to general form, one needs to multiply, expand and/or distribute the factors.

General formThe general form of a quadratic equation is f(x) = ax2 + bx + c or y = ax2 + bx + c where a, b and c are constant coefficients and a≠0.

Example – Collaboration, elaborationCreate 3 sliders a, b and c from the Manipulate function interface..Use f(x) = a*x^2 + b*x + c or y = a*x^2 + b*x + c.Exercise the quadratic expression with different values for a, b and c for the sliders.

Exercise - ElaborationGive the sliders new values for a, b and c, giving the discriminant value zero (one real “double” root) and negative value (no real roots = no intersection between the parabola and the x-axis)

9

Page 10: €¦ · Web viewMathematica is a program great suitable for both numeric, algebraic, graphical and symbolic work, and it has a remarkable word-processing capabilities as well

Begin with Mathematica – Extract IOPROG

Example – Collaboratio, elaboration, e-learningCreate an interactive webpage of the last example following the steps in the windows open by the menu Deploy -> Embed in HTML for the file with the current optional filename Quadratic_General.nb shown in the earlier example and create the files Quadratic_General.cdf and Quadratic_general.htmlNavigate to the Wikipedia link http://www.ioprog.se/Mathematica/ Quadartic_General .html

10