An Introduction to Maple
The following was implemented in Maple by Marcus Davidsson (2009) davidsson_marcus@hotmail.com
Input text
click on "Text" and start typing
Input Math
click on "Math" and start typing
How to split the window in two
click on "Insert" and "Table"
How to draw a figure
click on "Insert" and "Canvas"
How to define a variable
How to undefine a variable
Clear definitions
Subscript
press SHIFT and _
Superscript
press SHIFT ^
Round to the Nearest Integer
How to solve for two unknowns in two equations
Launch Help
From String " " to float and from float to String ""
Number of occurrences in a list
Where is the worksheet located ?
Check Equality
A random number between -1 and 1
Procedures
or as:
or constructing factorials as follows:
How to print
How to print with Spacing
or as follows:
Check type
Display Precision
Change Default TypeSet plus Default Size
1. Open Format -> Styles, scrolled down to C 2D Input, selected it, clicked 'Modify' then modified as I'd like. Note that the leading `C' stands for `character'.2. Repeat with C 2D Output3. Open Format -> Manage Styles. Select the 'User Define Style Set' radio button. Click the New Style Set button. Click 'Select All' then 'Ok'. A menu will open that allows you to save this file. Doing this makes it the default style. After the save you are returned to the Manage Styles box. Click Ok.4. Exit Maple. Restart. It should come up with your new defaults.
Output from previous row
Output 2 rows back
Extract operander from expression
Substitute
for more algebraic substitutions we should use the command algsubs or the command applyrule
Hide output
Permutations
Pascal Triangle Maple
How to enter commands that are executed together
Note that after we have entered c: we press SHIFT ENTER to get a new row
Define variables by using subscript notation
Note that a and b are inputed by typing x_a and x_b
Define a function
Sequence in a list [ ]
Acess list elements
How to Simulate One Column with Random Numbers
How to Simulate Many Columns with Random Numbers
How to simulate a random numbers and store in list
Time derivative
or as
Note that we put the dot on top of x by pressing SHIFT, CTRL and " after the variable x
Differentiate a variable
Differentiate an expression
Differentiate f(x(t)) with respect to x(t)
Differentiate f ( x, y ) with respect to the first variable x
Differentiate f ( x, y ) with respect to the second variable y
Differentiate a function (chain rule)
Differentiate a function of a function (chain rule)
Differentiate a function of a function of a function (chain rule)
Add table elements
Apply a procedure to each operand of an expression
Isolate an expression
Solve for a variable
Combine Power Symbolic
Expand Power Symbolic ( The opposite of Combine)
Simplify an expression
Note that e does not work
Simplify an expression symbolicaly
Collect terms
Sort terms
Select Prime Numbers
Remove Prime Numbers
Maximum in List
Minimum in List
How to call a module (package)
How to extract operandor from list
How to make a drawing from a normaldistribution with mean zero and standard deviation equal to 1
How to calculate the expected value
How to calculate the standard deviation
How to calculate returns
How to Extract a PDF from a Set
How to view the code for any Maple library routine
The function blackscholes computes the present value of a call option
blackscholes(amount, exercise, rate, nperiods, sdev , hedge)
amount - current stock price exercise - exercise price of the call option rate - risk-free interest rate per period, (continuously compounded) nperiods - number of periods sdev - standard deviation per period of the continuous return on the stock hedge - (optional name) hedge ratio
How to Calculate Probabilites from an Empirical Distribution-1
Plot a Graph for Data and for a Function
We can plot data as follows
or as follows
We can plot a function as follows:
How to plot a horizontal straight line
How to plot a vertical straight lines
Plot a graph given x and y-observations
How to plot multiple plots-1
How to plot multiple plots-2
Dual Axis Plot
How to plot side by side-1
How to plot side by side-2
Horizontal Binomial Tree
Vertical Binomial Tree
Random Tree Structure
Solve and plot recursive equations
Plot 3D Equations
How to plot a Unit Root and 50 period Moving Average in Maple
PointPlot with Labels
Animations in Maple
Lagrange in Maple
Regression in Maple
we can also simulate some data and run a regression
Multiple Regression in Maple
How to plot a system of differential equations
ChiSquare Test : Are two Samples drawn from the same distribution ?
Normality Test = Shapiro and Wilk's W-Test
Remove duplicates in a list
How to make a comment in the code without problems
How to launce Debugger
Insert DEBUG(): anywhere in the text to launce the debugger window
How to count list elements
How to remove numerical range in a list
How to sum/add list elements
How to multiply list elements with each other
How to multiply list elements with a variable
Sum and multiply list elemets with a variable
How to apply a procedure to each operand of an expression ( ie Logarithm transformation )
Integrals and Integration
We can have found this results by noting that
Which is the same result we had previously
How to create a list
How to create a set
Note that duplicates are removed in set
How to create a row vector
How to create a column vector
How a column vector into seperate column vectors
How to sort one column vector descending and record a second column
How to split a Row Vector into Two Rows
How to create a matrix
Symmetrical Matrix
How to view a large Matrix
Double sum of a Matrix
Double sum of a Covariance Matrix
Double sum of a Covariance Matrix with Weights
How to turn multiple sequences into a column matrix
How to turn output from a loop into a Column Matrix
Matrix Dimensions: Number of Rows and Number of Columns
How Update a Variable with a Slider
How Update a Correlation Matrix with a Slider
How to get a random drawing with an button
How to simulate and plot a series of random numbers with an button
How to simulate a unit root with an button-2
How Retrive a Value from a Slider
How to control multiple plots with an slider
How to create a Column Matrix form a Lists
The difference between Matrix and Vector Index
How to create a matrix of vector rows
How to create a matrix of vector columns
How to delete a row in a matrix
How to delete a column in a matrix
How to add a row in a matrix
How to add a column in a matrix
How to add a specific columns to a matrix
Columns of Columns
Row of Row
Test for equality
Vector addition
Vector subtraction
Scalar multiplication
Matrix multiplication-1
Matrix multiplication-2
Matrix multiplication-3
Matrix multiplication-4
Conditional if-loop and for-loop
Ordinary if-loop and for-loop
If-loop and for-loop with Multiple If-commands
Do-loop (repeats section for printing)
Do-loop (repeats section and store results in a list)
can also be solved by using a procedure
Double for-loop
How to loop though and test values from a list
For/Do Loops and Break Points
another example
While Loops