Difference between revisions of "Mathematica/Elementary"

From PrattWiki
Jump to navigation Jump to search
(first eight chapters)
 
Line 1: Line 1:
 
These are draft notes from [https://www.wolfram.com/wolfram-u/an-elementary-introduction-to-the-wolfram-language An Elementary Introduction to the Wolfram Language]
 
These are draft notes from [https://www.wolfram.com/wolfram-u/an-elementary-introduction-to-the-wolfram-language An Elementary Introduction to the Wolfram Language]
  
* Starting Out: Elementary Arithmetic (4:10)
+
# Starting Out: Elementary Arithmetic (4:10)
** Shift-Enter to perform a calculation
+
#* Shift-Enter to perform a calculation
** ^ for powers
+
#* ^ for powers
** asterisk for multiplication or space if it is clear
+
#* asterisk for multiplication or space if it is clear
** Keeps numbers as rational fractions if possible; converts to float with any floats involved
+
#* Keeps numbers as rational fractions if possible; converts to float with any floats involved
* Introducing Functions (6:09)
+
# Introducing Functions (6:09)
** Commands use CamelCase
+
#* Commands use CamelCase
** Arguments in square brackets
+
#* Arguments in square brackets
** Colors: Blue=unknown command, purple=bracket mismatch
+
#* Colors: Blue=unknown command, purple=bracket mismatch
** Plus, Times, Power, Max, Min, RandomInteger
+
#* Plus, Times, Power, Max, Min, RandomInteger
* First Look at Lists (6:26)
+
# First Look at Lists (6:26)
** Usually with { }
+
#* Usually with { }
** Edit->Extend Selection or CTRL-. will "grow" a selection to the next largest complete expression  
+
#* Edit->Extend Selection or CTRL-. will "grow" a selection to the next largest complete expression  
** ListLinePlot, ListPlot, Reverse, Range, Join
+
#* ListLinePlot, ListPlot, Reverse, Range, Join
*** Range starts with 1
+
#** Range starts with 1
* Displaying Lists (4:54)
+
# Displaying Lists (4:54)
** CTRL-= for natural language input  
+
#* CTRL-= for natural language input  
** Graphics can be part of a list
+
#* Graphics can be part of a list
** BarChart, PieChart, NumberLinePlot, Colulmn,  
+
#* BarChart, PieChart, NumberLinePlot, Colulmn,  
* Operations on Lists (6:17)
+
# Operations on Lists (6:17)
** List math operations are element-wise
+
#* List math operations are element-wise
** [[ ]] will index from list
+
#* [[ ]] will index from list
** Sort, Length, Total, First, Last, Part, Take, Drop, Count, IntegerDigits
+
#* Sort, Length, Total, First, Last, Part, Take, Drop, Count, IntegerDigits
*** Mathematica is 1-indexed
+
#** Mathematica is 1-indexed
* Making Tables (9:34)
+
# Making Tables (9:34)
** Table
+
#* Table
*** Table[item, number of items to generate]
+
#** Table[item, number of items to generate]
*** Table[fcn[var], {var, start, end}]
+
#** Table[fcn[var], {var, start, end}]
*** Table[fcn[var], {var, start, end, step}]
+
#** Table[fcn[var], {var, start, end, step}]
*** Table[fcn[var], {var, {values}}]
+
#** Table[fcn[var], {var, {values}}]
** The video has "ListPlot[Range[0, 1, 0.02]-Range[0, 1, 0.02]^2]" but "ListPlot[Table[x - x^2, {x, Range[0, 1, 0.02]}]]" seems more efficient
+
#* The video has "ListPlot[Range[0, 1, 0.02]-Range[0, 1, 0.02]^2]" but "ListPlot[Table[x - x^2, {x, Range[0, 1, 0.02]}]]" seems more efficient
* Colors and Styles (7:22)
+
# Colors and Styles (7:22)
** Red, Green, Blue, ColorNegate, Blend, RGBColor, Hue, RandomColor
+
#* Red, Green, Blue, ColorNegate, Blend, RGBColor, Hue, RandomColor
** Style takes an item along with information about color, size, and face
+
#* Style takes an item along with information about color, size, and face
* Basic Graphics Options (7:54)
+
# Basic Graphics Options (7:54)
** Graphics expression has graphics primitives that are changed by graphics directives
+
#* Graphics expression has graphics primitives that are changed by graphics directives
** Graphics, Circle, Disk, RegularPolygon, Graphics3D, Sphere, Cone
+
#* Graphics, Circle, Disk, RegularPolygon, Graphics3D, Sphere, Cone
** Wrap graphics primitives with Style to change things
+
#* Wrap graphics primitives with Style to change things
*** Thickness, Opacity
+
#** Thickness, Opacity
* Interactive Manipulation
+
# Interactive Manipulation (7:30)
 +
#* Manipulate creates a selector; effectively picks items from a list but can continuously change if variable is continuous
 +
#* Can manipulate multiple items
 +
#** polyfit example?
 +
#* ColorSetter
 +
# Images (5:22)
 +
#* Importing the sample file did not work for me, nor did CurrentImage[] so I just imported another jpg I had
 +
#* Import, Blur, Binarize, EdgeDetect, DominantColors, ImageAdd, ImageCollage, ExampleData

Revision as of 15:25, 8 June 2021

These are draft notes from An Elementary Introduction to the Wolfram Language

  1. Starting Out: Elementary Arithmetic (4:10)
    • Shift-Enter to perform a calculation
    • ^ for powers
    • asterisk for multiplication or space if it is clear
    • Keeps numbers as rational fractions if possible; converts to float with any floats involved
  2. Introducing Functions (6:09)
    • Commands use CamelCase
    • Arguments in square brackets
    • Colors: Blue=unknown command, purple=bracket mismatch
    • Plus, Times, Power, Max, Min, RandomInteger
  3. First Look at Lists (6:26)
    • Usually with { }
    • Edit->Extend Selection or CTRL-. will "grow" a selection to the next largest complete expression
    • ListLinePlot, ListPlot, Reverse, Range, Join
      • Range starts with 1
  4. Displaying Lists (4:54)
    • CTRL-= for natural language input
    • Graphics can be part of a list
    • BarChart, PieChart, NumberLinePlot, Colulmn,
  5. Operations on Lists (6:17)
    • List math operations are element-wise
    • [[ ]] will index from list
    • Sort, Length, Total, First, Last, Part, Take, Drop, Count, IntegerDigits
      • Mathematica is 1-indexed
  6. Making Tables (9:34)
    • Table
      • Table[item, number of items to generate]
      • Table[fcn[var], {var, start, end}]
      • Table[fcn[var], {var, start, end, step}]
      • Table[fcn[var], {var, {values}}]
    • The video has "ListPlot[Range[0, 1, 0.02]-Range[0, 1, 0.02]^2]" but "ListPlot[Table[x - x^2, {x, Range[0, 1, 0.02]}]]" seems more efficient
  7. Colors and Styles (7:22)
    • Red, Green, Blue, ColorNegate, Blend, RGBColor, Hue, RandomColor
    • Style takes an item along with information about color, size, and face
  8. Basic Graphics Options (7:54)
    • Graphics expression has graphics primitives that are changed by graphics directives
    • Graphics, Circle, Disk, RegularPolygon, Graphics3D, Sphere, Cone
    • Wrap graphics primitives with Style to change things
      • Thickness, Opacity
  9. Interactive Manipulation (7:30)
    • Manipulate creates a selector; effectively picks items from a list but can continuously change if variable is continuous
    • Can manipulate multiple items
      • polyfit example?
    • ColorSetter
  10. Images (5:22)
    • Importing the sample file did not work for me, nor did CurrentImage[] so I just imported another jpg I had
    • Import, Blur, Binarize, EdgeDetect, DominantColors, ImageAdd, ImageCollage, ExampleData