Maple Portal for Students Examples
Back to Student Portal Details
|
Constructing algebraic objects
|
|
|
Example 1.1 - How Do I Enter a Piecewise Function?
|
|
Follow the steps below to define the function .
Step
|
Description
|
Illustration
|
1
|
Start by writing the function definition as . See How do I... enter a function?
|
|
2
|
To enter a piecewise function, click on the piecewise template from the Expression palette. This palette is located on the left-hand side of the Maple window.
|
|
3
|
Overwrite with .
Press Tab to move to the next field, and change to .
Overwrite in the second row with .
Change to .
|
|
4
|
To add another row to the piecewise template, hold down Ctrl+Shift and press R.
|
↓
|
5
|
Now fill in the values for the third row in place of the question marks.
|
|
|
|
Back to Student Portal Details
|
|
Example 1.2 - How Do I Assign a Name to an Equation or Expression?
|
|
Assignments
|
To assign a value to a variable, enter a colon followed by an equal sign.
In the example to the right, the variable stores the expression .
|
|
Alternatively, the assignment can be made after the fact. That is, after a value is obtained from a calculation, it can be assigned to a name by using the Context Menu.
Enter and execute the calculation to be assigned. From the Context Panel for the result, select Assign to a Name from the context-sensitive options. Enter a name in the dialog that appears, and click OK.
|
|
|
|
Equations
|
In Maple, an equation is defined as two expressions separated by a single equal sign.
It is important to note the difference between an equation and an expression. The Context Panel for an expression or an equation will bring up different options, since there are some operations that can be performed on expressions but not on equations, and vice versa. For example, expressions can be factored or (explicitly) differentiated whereas equations cannot be.
|
|
It is also important to note that when Maple is asked to solve an expression, it assumes that the expression is equal to zero.
|
|
|
|
Back to Student Portal Details
|
|
Example 1.3 - How Do I Construct a Loop?
|
|
Loops are used to execute code multiple times. In Maple there are two types of loops: do loops and while loops. do loops are used to execute code a given number of times, and while loops continue execution as long as a given condition is met.
Structure of a do Loop
|
Structure of a while Loop
|
|
|
|
|
Example 1: Behavior of a basic do loop
|
|
Place the cursor in the block of code and press [Enter] to execute the code. Try replacing the semicolon after end do with a colon and press [Enter] again; notice that there is no output. Using a colon, , suppresses the output for every step, while using a semicolon, , allows the user to see the output.
|
|
|
Example 2: Use of a statement in a loop
|
|
Upon executing this code, notice that there is output even though a colon is used after end do. This is the result of the command. This is valuable if you do not want all the variables to be displayed when a complex loop is executed, but you do want to display some output.
|
|
|
Example 3: Nested while loops
|
|
Note that the calculations in the inner loop are not displayed. In Maple, only the calculations in the outermost loop display, even if a semicolon is placed after the inner loop's end do.
|
|
|
Note: While writing loops, press [Shift][Enter] to move to a new line. Pressing [Enter] alone causes Maple to execute the incomplete loop, resulting in the following error:
Back to Student Portal Details
|
|
Example 1.4 - How Do I Enter the Exponential Function, ?
|
|
To enter the exponential function in Math mode, you can use the Expression palette, Command Completion, or the command exp.
In Maple Input mode, use the command exp.
Method
|
Description
|
Illustration
|
Using the Expression Palette
|
To enter the exponential function, click on the exponential template from the Expression palette. This palette is located on the left hand side of the Maple window.
|
|
|
Overwrite with .
|
→
|
|
|
Command Completion
|
Start by typing in Math mode. You can then obtain the exponential function by using Command Completion (Press Esc).
To enter the exponential , select the first item from the list.
|
|
|
Then press Shift+^ to raise the cursor to the superscript position, and type in the power, .
|
→
→
|
|
An alternate method is to scroll down the Command Completion list and find .
|
|
|
|
exp(x)
|
This command works in both Math and Maple Input modes.
|
|
|
|
Note: Just typing does not create the exponential function. Use one of the methods above to associate the letter e with the mathematical meaning of the exponential function.
Back to Student Portal Details
|
|
Example 1.5 - How Do I Enter Using the Expression Palette?
|
|
Step
|
Description
|
Illustration
|
1
|
To enter the logarithmic function with base , click on the appropriate log template from the Expression palette. This palette is located on the left-hand side of the Maple window.
|
|
2
|
Overwrite the placeholders and with and , respectively, moving between placeholders by pressing Tab.
|
→
→
|
|
|
Back to Student Portal Details
|
|
Example 1.6 - How Do I Convert an Expression to a Function?
|
|
Step
|
Description
|
Illustration
|
1
|
Type an equation of the form
name = expression
Context Menu: Assign Name
|
|
2
|
Type the equation
Context Menu: Assign Function
|
|
Notes
|
The expression can be referenced by a name or by an equation label.
The function name can be any valid, previously unassigned name.
|
|
|
Back to Student Portal Details
|
|
|
Algebraic manipulations
|
|
|
Example 2.1 - How Do I Import Data into the Curve Fitting Assistant?
|
|
To launch the Curve Fitting Assistant, go to Tools → Tutors → Statistics → Curve Fitting ...
When the Assistant is launched, the dialog box appears as shown. Click on
Import to select a data file.
|
|
A dialog window appears where you can navigate to your data file. Maple supports various file types, so from this new dialog, select the file from which you wish to import data and select the file type.
For this simple example, data is imported from a text file called "Import data test". The image below shows the contents of this sample data file. Note that the first line is purely text, and the second is blank.
When you are done, click Next. The Import Data Dialog shown to the right appears.
The first two non-data lines in the Data file must be skipped by setting the Skip Lines parameter to 2.
The source form can also be specified. Note that the Curve Fitting Assistant only accepts Rectangular data.
When you have chosen your desired options, click Done to return to the Curve Fitting Assistant.
|
|
The imported data now appears in the table of Independent and Dependent Values, as shown to the right. Note that the third column of data in the Data file is ignored.
Click Fit to open the main window of the Curve Fitting Assistant, as shown below.
The Plot buttons on the right generate plots of different interpolating functions.
Click Done to close the Assistant and return the algebraic expression shown in the bottom left-hand corner beneath the plot, or the displayed plot.
|
|
|
|
|
Back to Student Portal Details
|
|
|
Differential calculus in one variable
|
|
|
Example 6.1 - How Do I Use the Limit Methods Tutor to Evaluate a Limit Stepwise?
|
|
Step
|
Description
|
Illustration
|
1
|
Load the Student[Calculus1] package (Tools → Load Package → Student Calculus 1), and enter the expression whose limit is to be computed. Then, from the Context Panel, select:
Student Calculus 1 → Tutors → Limit Methods.
|
|
2
|
Note that the mathematical expression has been automatically inserted into the Function field.
By default, this Tutor evaluates the limit of the function at zero, but this number can be changed. Also, the direction in which the limit is taken can be specified.
|
|
3
|
The message box displays hints and explicitly states the rules as they are applied. Note that these hints are suggestions as to what might be a reasonable next step, and do not necessarily give the best method.
Click on a Rule button to implement that rule.
Click Help in the task bar to give a more thorough explanation of all the functions of the Tutor.
|
|
4
|
Click Undo to reverse the last step. Next Step advances the calculation by one step. All Steps provides all the steps needed for a complete solution.
The Close button does not serve the same function as the x in the top right-hand corner of the window.
Click Close to close the Tutor and return all the displayed steps; click the x in the top right-hand corner to cancel the tutor and return nothing.
|
|
|
|
Back to Student Portal Details
|
|
Example 6.2 - How Do I Use the Differentiation Methods Tutor to Differentiate Stepwise?
|
|
Step
|
Description
|
Illustration
|
1
|
Load the Student Calculus 1 package (Tools → Load Package → Student Calculus 1), and enter the expression to be differentiated. Then from the Context Panel, select: Student Calculus 1 → Tutors → Differentiation Methods.
Note that the mathematical expression has been automatically inserted into the Function field.
|
|
2
|
The white box displays hints and explicitly states the rules as they are applied. Note that only for the Differentiation Methods Tutor are these hints to be taken as the best possible solution (for other Tutors, they are merely suggestions).
When you are finished with the tutor, click the x in the upper right-hand corner of the window to cancel and close the tutor, or click Close to import the last calculation into your worksheet.
Click Help in the Integration Methods Tutor task bar to give a thorough explanation of all the features of the Tutor.
|
|
|
|
Note
|
If the Context Panel is used to launch the tutor on an unevaluated derivative, Maple will evaluate the derivative before inserting it into the tutor. For example, the expression will be entered in the Tutor as .
To prevent this premature evaluation, convert the differential expression to inert form, or simply delete from the expression before launching the tutor.
To convert an expression to inert form, from the Context Menu, select: 2D-Math → Convert To → Inert Form.
An inert mathematical operator is gray (not black), as in the operation in the illustration to the right.
|
|
|
|
Back to Student Portal Details
|
|
Example 6.3 - How Do I Differentiate Using the Expression Palette?
|
|
Step
|
Description
|
Illustration
|
1
|
To enter a differential expression, click on the template from the Calculus palette. This palette is located on the left-hand side of the Maple window.
Select either the differential expression for a single-variable expression, or the partial differential expression for a multivariable expression.
|
|
2
|
Overwrite the placeholders and , using the Tab key to move to the next placeholder.
The function should be included within brackets (without brackets, only part of the function may be evaluated, giving unexpected results).
The templates and perform the same task, for a single-variable expression.
To differentiate with respect to another variable, simply change to the desired variable.
|
=
=
=
=
|
|
|
Back to Student Portal Details
|
|
Example 6.4 - How Do I Use the Derivatives Tutor to Obtain a Plot of a Function's Derivative(s)?
|
|
Step
|
Description
|
Illustration
|
1
|
Load the Student[Calculus1] package (Tools → Load Package → Student Calculus 1), and enter an expression. Then from the Context Panel, select: Student Calculus1 → Tutors → Derivatives.
|
|
2
|
Note that the function has been inserted automatically into the tutor as .
The default range for the plot can be changed. The first and second derivatives can be displayed, along with the plot of the function.
Click Display to redraw the plot. When you are finished with the tutor, click the x in the upper right-hand corner of the window to cancel and close the tutor, or click Close to export the plot to your worksheet.
Click Help in the Derivative Tutor task bar to give a thorough explanation of all the features of the Tutor.
|
|
|
|
Back to Student Portal Details
|
|
Example 6.5 - How Do I Launch the Taylor Approximation Tutor from the Context Menu?
|
|
Tools → Load Package: Student Calculus 1
|
Loading Student:-Calculus1
|
Context Menu: Student Calculus1 → Tutors → Taylor Approximation
|
|
|
Back to Student Portal Details
|
|
|
Integral calculus in one variable
|
|
|
Example 7.1 - How Do I Use the Integration Methods Tutor to Evaluate an Integral Stepwise?
|
|
Step
|
Description
|
Illustration
|
1
|
Load the Student[Calculus1] package, and then start the Integration Methods Tutor by using the Context Menu for an expression or inert integral:
Context Menu: Student Calculus1 → Tutors → Integration Methods.
Note that the integrand is automatically entered in the Function field.
|
|
2
|
Integration can be done stepwise by clicking on the appropriate rule button, or by clicking the Next Step or All Steps buttons.
The message box displays hints and explicitly states the rules as they are applied. Note that these hints are suggestions as to what might be a reasonable next step, and do not necessarily give the best possible method.
When you are finished with the tutor, click the x in the upper right-hand corner of the window to cancel and close the tutor, or click Close to import the last calculation into your worksheet.
Click Help in the Integration Methods Tutor task bar to give a thorough explanation of all the features of the Tutor.
|
|
|
|
Back to Student Portal Details
|
|
Example 7.2 - How Do I Enter and Evaluate or Using the Expression Palette?
|
|
Step
|
Description
|
Illustration
|
1
|
To enter and evaluate an integral, click on the appropriate integration template from the Calculus palette. This palette is located on the left-hand side of the Maple window.
|
|
2
|
For an indefinite integral, overwrite the placeholder with the desired function. To integrate with respect to a different variable, you must also overwrite x.
For a definite integral, the upper and lower limits, a and b, must also be overwritten. Use the Tab key to move between placeholders.
|
→
→
|
3
|
Press Enter to evaluate the integral on a new line (shown to the right), or press Ctrl+= (Command+= in Macintosh) to evaluate the integral inline (shown below).
=
|
|
|
|
Back to Student Portal Details
|
|
Example 7.3 - How Do I Enter and Evaluate an Integral Using Command Completion?
|
|
Step
|
Description
|
Illustration
|
1
|
Start by typing , and then use Command Completion (Press Esc). Select int (definite) for definite integrals or int (indefinite) for indefinite integrals.
|
|
2
|
For an indefinite integral, overwrite the placeholder with the desired function. To integrate with respect to a different variable, you must also overwrite x.
For a definite integral the upper and lower limits, a and b, must also be overwritten. Use the Tab key to move between placeholders.
|
→
→
|
3
|
Press Enter to evaluate the integral on the next line (shown to the right), or Ctrl+= (Command+= in Macintosh) to evaluate the integral inline (shown below).
=
|
|
Note
|
The integral sign itself can be found in the Common Symbols palette or in the Command Completion list if is typed. Using this symbol, you can construct an integral and evaluate it. However, to prevent the error:
the d symbol must be entered as an operator. After typing , use Command Completion. Select the first item from the list, d(differential). Note that the differential d is not italicized, while a normally typed d is italicized in Math mode.
=
|
|
|
|
Back to Student Portal Details
|
|
Example 7.4 - How Do I Use the Approximate Integration Tutor to Approximate a Definite Integral?
|
|
Step
|
Description
|
Illustration
|
1
|
Load the Student[Calculus1] package, and then start the Approximate Integration Tutor by using the Context Panel for an expression or inert integral:
Context Panel: Student Calculus1 → Tutors → Approximate Integration.
Note that the integrand is automatically inserted as .
|
|
2
|
The lower and upper limits of integration are given by and , respectively. The interval is divided into subintervals, the number of partitions.
Click on the Riemann Sums and
Newton-Cotes Formulae buttons to change the method of approximating the integral.
If partition type Normal is chosen, the function is evaluated at the number of nodes determined by , the number of partitions.
If partition type Subinterval is chosen, the function is evaluated at additional nodes between the uniformly spaced ones determined by .
Click the Display button to redraw the plot showing the approximate value of the definite integral. Click Animate to show dynamically the effect of increasing the number of partitions. Plot Options allows you to modify properties of the plot. Compare compares the values obtained by each approximation method. Close closes the Tutor and inserts the plot into the worksheet.
Click Help in the Approximate Integration Tutor task bar to give a thorough explanation of all the features of the Tutor.
|
|
|
|
Back to Student Portal Details
|
|
Example 7.5 - How Do I Launch the Function Average Tutor from the Context Menu?
|
|
Tools → Load Package: Student Calculus 1
|
Loading Student:-Calculus1
|
Context Panel: Student Calculus 1 → Tutors → Function Average
|
|
|
Back to Student Portal Details
|
|
Example 7.6 - How Do I Launch the Arc Length Tutor from the Context Menu?
|
|
Tools → Load Package: Student Calculus 1
|
Loading Student:-Calculus1
|
Context Panel: Student Calculus 1 → Tutors → Arc Lengths
|
|
|
Back to Student Portal Details
|
|
Example 7.7 - How Do I Launch the Volume of Revolution Tutor from the Context Menu?
|
|
Tools → Load Package: Student Calculus 1
|
Loading Student:-Calculus1
|
Context Panel: Student Calculus 1 → Tutors → Volume of Revolution
|
|
|
Back to Student Portal Details
|
|
Example 7.8 - How Do I Launch the Surface of Revolution Tutor from the Context Menu?
|
|
Tools → Load Package: Student Calculus 1
|
Loading Student:-Calculus1
|
Context Panel: Student Calculus 1 → Tutors → Surface of Revolution
|
|
|
Back to Student Portal Details
|
|
|
Multivariate calculus
|
|
|
Example 8.1 - How Do I Launch the Gradients Tutor from the Context Menu?
|
|
Tools → Load Package: Student Multivariate Calculus
|
Loading Student:-MultivariateCalculus
|
Context Panel: Student Multivariate Calculus → Tutors → Gradients
|
|
|
Back to Student Portal Details
|
|
Example 8.2 - How Do I Launch the DirectionalDerivative Tutor from the Context Menu?
|
|
Tools → Load Package: Student Multivariate Calculus
|
Loading Student:-MultivariateCalculus
|
Context Panel: Student Multivariate Calculus → Tutors → Directional Derivatives
|
|
|
Back to Student Portal Details
|
|
Example 8.3 - How Do I Launch the Taylor Approximation Tutor from the Context Menu?
|
|
Tools → Load Package: Student Multivariate Calculus
|
Loading Student:-MultivariateCalculus
|
Context Panel: Student Multivariate Calculus → Tutors → Taylor Approximation
|
|
|
Back to Student Portal Details
|
|
Example 8.4 - How Do I Enter an Iterated Integral with the Expression Palette?
|
|
Step
|
Description
|
Illustration
|
1
|
To enter and evaluate a definite iterated integral, click on the definite integration template from the Calculus palette. This palette is located on the left-hand side of the Maple window.
|
|
2
|
Press Tab twice to move the highlighted field over the placeholder f. Click on the definite integral template a second time. The integral is now an iterated double integral.
Repeat the process to produce a higher order iterated integral.
|
→
→
|
3
|
Press Tab to move between the placeholders, and overwrite all the colored parameters. Press Shift+Tab to move to the previous placeholder, if you have not already overwritten it.
To evaluate the integral, press Enter to display the value on a new line, or Ctrl+= (Command+= in Macintosh) to display the value inline.
|
=
=
|
|
|
Back to Student Portal Details
|
|
Example 8.5 - How Do I Launch the Approximate Integration Tutor from the Context Menu?
|
|
Tools → Load Package: Student Multivariate Calculus
|
Loading Student:-MultivariateCalculus
|
Context Panel: Student Multivariate Calculus → Tutors → Approximate Integration
|
|
|
Back to Student Portal Details
|
|
|
Vector calculus
|
|
|
Example 9.1 - How Do I Attach a Coordinate System to a Free Vector?
|
|
Tools→Load Package: Vector Calculus
|
Loading VectorCalculus
|
•
|
Use syntax such as that shown to the right to define the vector in a particular coordinate system. The default display uses explicit basis vectors.
|
|
|
•
|
To change the display of the vector to column notation, change the default value of BasisFormat.
|
|
|
•
|
Use the About command to extract information about the vector.
|
|
|
•
|
Use the GetCoordinates command to extract the coordinate system and the names of the coordinate variables.
|
|
|
•
|
Use the attributes command to extract the vector's attributes, which here are its coordinate system.
|
|
|
|
|
Back to Student Portal Details
|
|
Example 9.2 - How Do I Compute a Gradient Interactively with ?
|
|
•
|
Set a coordinate system, as, for example, with the SetCoordinate command.
|
|
|
•
|
Apply the Nabla or Del operator from the Common Symbols palette.
|
•
|
Context Menu: Evaluate and Display Inline
|
|
=
|
|
|
Back to Student Portal Details
|
|
Example 9.3 - How Do I Compute a Divergence Interactively with ?
|
|
•
|
Set a coordinate system, as, for example, with the SetCoordinate command.
|
|
|
|
|
•
|
Apply the Nabla or Del operator from the Common Symbols palette.
|
•
|
Context Menu: Evaluate and Display Inline
|
|
=
|
|
|
Back to Student Portal Details
|
|
Example 9.4 - How Do I Compute a Curl Interactively with ?
|
|
•
|
Set a coordinate system, as, for example, with the SetCoordinate command.
|
|
|
|
|
•
|
From the Common Symbols palette, apply the Nabla or Del, and the cross-product operators.
|
•
|
Context Menu: Evaluate and Display Inline
|
|
=
|
|
|
Back to Student Portal Details
|
|
Example 9.5 - How Do I Compute a Laplacian Interactively with ?
|
|
•
|
Set a coordinate system, as, for example, with the SetCoordinate command.
|
|
|
•
|
Apply the Nabla or Del operator from the Common Symbols palette.
|
•
|
Context Menu: Evaluate and Display Inline
|
|
=
|
|
|
Back to Student Portal Details
|
|
Example 9.6 - How Do I Implement the Frenet-Serret Formalism Interactively?
|
|
Tools→Load Package: Vector Calculus
|
Loading VectorCalculus
|
•
|
Enter the space-curve in a radius-vector format.
|
•
|
Context Menu: Select from any of the following options:
TNBFrame, Tangent Vector, Principal Normal, Binormal Vector, Curvature, Torsion, Radius of Curvature
|
|
|
|
|
Back to Student Portal Details
|
|
Example 9.7 - How Do I Change Coordinates of a Point ?
|
|
Tools→Load Package: Vector Calculus
|
Loading VectorCalculus
|
Enter a Cartesian point in the plane. Note that points are expressed as "free vectors" in the Vector Calculus packages.
|
|
Apply the MapToBasis command, changing from Cartesian to polar coordinates.
|
|
Note that in non-Cartesian spaces, points are represented by the analog of a free vector in a rectangular instantiation of the non-Cartesian space. This "vector" is a representation only, the "basis vectors" simply indicating the names of the new coordinates.
|
|
|
Back to Student Portal Details
|
|
Example 9.8 - How Do I Change Coordinates in a Vector Field?
|
|
Tools→Load Package: Vector Calculus
|
Loading VectorCalculus
|
In Cartesian coordinates, define a vector field F.
|
|
Express F in spherical coordinates.
|
|
Note the overbars on the basis vectors. These are true unit basis vectors, defined at all points in the field. Theoretically, these vectors are functions of position, but here in Maple, they are simply symbols that do not actually carry with them any information about the point at which they sit.
|
|
|
Back to Student Portal Details
|
|
|
Complex arithmetic
|
|
|
Example 10.1 - How Do I Enter a Complex Number?
|
|
Feature
|
Description
|
Illustration
|
Enter Complex Number
|
In Maple, the default representation of the imaginary unit is .
To enter the imaginary unit in Maple, click on one of the symbols , , or from the Common Symbols palette, found on the left-hand side of the Maple window. Typing the letter is equivalent to selecting it from this palette
|
|
|
Shown at the right are a few examples of complex numbers.
Note that simply typing will not produce the imaginary unit, but typing will.
Also, the imaginary unit is displayed with a capital , no matter which symbol was used for input.
|
=
=
Typing is not recognized as the imaginary unit.
=
=
=
=
|
Change
Symbol
|
To change the symbol used for the imaginary unit, (both for input and output), use the interface command as shown to the right. This command sets to be the imaginary unit. Thereafter, clicking on , , or in the Common Symbols palette, or typing the letter will produce the imaginary unit, and its symbol will be .
|
From the palette:
=
By typing:
=
In computations:
=
|
Command
|
The Complex command may also be used to enter complex numbers.
|
=
|
|
|
Back to Student Portal Details
|
|
|
ODEs
|
|
|
Example 11.1 - How Do I Enter an Ordinary Differential Equation?
|
|
Method
|
Description
|
Illustration
|
Palettes
|
To enter an ordinary differential equation in Math mode, type it as you would write it. The prime symbol can be entered using the Common Symbols palette or by typing an apostrophe, [']. Higher-order derivatives can be entered with multiple apostrophes, or by using the symbols in the Punctuation palette. (If you cannot see this palette, open it by selecting View → Palettes → Show Palette → Punctuation.)
By default, primes indicate differentiation with respect to .
Maple also recognizes higher derivatives expressed with exponents in parentheses: is interpreted as the fifth derivative of with respect to .
|
|
prime
versus
dot
|
Differential equations can also be entered by using dot notation. This can be done in two ways:
First, type the variable and then press Ctrl+Shift+". This will raise the cursor above the variable. Type a period [] above the variable name to indicate the derivative. Two dots indicate the second derivative.
The second method of writing differential equations using dot notation is to use the Layout palette. This palette is located on the left-hand side of the Maple window. If you cannot see this palette, select View → Palettes → Show Palette → Layout.
Click on the indicated template and replace A with the desired variable and b with a period. Several periods can be placed over the variable.
By default, dot notation indicates differentiation with respect to .
|
→
→
→
→
|
Output
|
The output display of a differential equation can be modified. This is done by changing the Typesetting settings.
By executing the command prime notation and dot notation are displayed in the output in place of the and notation, respectively.
The command Typesetting[Suppress] can be used to suppress the functional dependency from being displayed in the output.
For example, the command
suppresses from being displayed in the output.
These settings can also be accessed through the Typesetting Rules Assistant (View → Typesetting Rules) under the heading Differential Options.
|
|
Options
|
As indicated in the above examples, assumes differentiation with respect to , while assumes differentiation with respect to . This is the Maple default for the prime and dot notation. This can also be customized using either the Typesetting[Settings] command or the Typesetting Rule Assistant (View → Typesetting Rules).
|
|
Maple Input Mode
|
To enter differential equations in Maple Input mode, use the command diff.
The diff command diff(y(t),t) is equivalent to .
|
>
|
diff(y(t),t,t)+diff(y(t),t)+5*y(t)=7;
|
|
|
|
Back to Student Portal Details
|
|
Example 11.2 - How Do I Solve an ODE Numerically?
|
|
Method
|
Description
|
Illustration
|
1
|
Enter the ODE and its initial condition. Use any of of the methods described in Example 11.1 to enter the ODE.
|
|
2
|
Use the dsolve command with option numeric to obtain the solution.
Obtain the numerical value of the solution for a specific value of .
To plot the solution use the command plots[odeplot].
|
|
|
|
Back to Student Portal Details
|
|
|
Linear algebra
|
|
|
Example 12.1 - How Do I Obtain the Dot Product of Two Vectors?
|
|
Step
|
Method
|
Description
|
Illustration
|
1
|
Command
|
In Maple, a vector can be constructed by a comma-separated n-tuple of numbers within a pair of angle brackets:
|
|
|
Palette
|
A vector can also be defined by using the Matrix palette. To insert a vector from the Matrix palette, either the number of rows or the number of columns must be equal to one. This will produce a row vector or a column vector, respectively.
You can choose the dimensions of the vector (or matrix) by either entering dimension in the Rows and Columns boxes or by clicking Choose and dynamically sizing the vector (or matrix) using the mouse.
Click the Insert Vector[column] button to insert the vector into the document or worksheet. By clicking the arrow on this button, you can choose to insert a matrix or a vector. Note: this option is only available if the matrix is a single column or row.
Overwrite the fields as needed. Press Tab to move to the next placeholder, and Shift+Tab to move to the previous placeholder.
|
→
|
2
|
Command Completion
|
The dot product can be calculated by using Command Completion. After typing or inserting the first vector, type and the access the Command Completion list (by pressing Esc). Select dotproduct. Then type the second vector.
|
|
|
dot
|
The dot product can also be calculated by using the centered dot () from the Common Symbols palette.
=
|
|
3
|
Evaluate
|
Press [Enter] to evaluate the dot product on a new line, and press Ctrl+= (Command+= in Macintosh) to evaluate it inline.
|
=
|
|
Maple Input
|
To calculate the dot product in Maple Input mode, enter a period between the vectors.
|
|
|
|
Back to Student Portal Details
|
|
Example 12.2 - How Do I Calculate the Norm of a Vector?
|
|
Step
|
Method
|
Description
|
Illustration
|
1
|
|
First, load the Student[LinearAlgebra] package (Tools → Load Package → Student Linear Algebra).
|
Loading Student:-LinearAlgebra
|
2
|
Context Menu
|
From the Context Panel for an existing vector, select Norm.
|
|
|
Command Completion or Palette
|
The Norm notation for a vector can be obtained by using Command Completion. Start by typing , and then access the Command Completion list (by pressing [Esc]) and choose the first item, Norm, with double bars around the placeholder .
The Norm notation can also be found in the Layout Palette. (If this palette is not visible, select View → Palettes → Show Palette → Layout.)
|
→
→
|
3
|
|
Replace the placeholder (or ) with a vector. To enter a vector in Maple, see step 1 of Example 12.1.
Press [Enter] to display the value of the Norm on a new line, or [Ctrl][=] ([Command][=], Macintosh) to display the value inline.
|
=
|
|
Commands
|
The norm can also be constructed by typing two vertical strokes in succession both before and after the object whose norm is to be computed.
|
=
|
|
Maple Input
|
To calculate the Norm of a vector in Maple Input mode, use the command Norm. An example of this is shown to the right.
This command can also be used in Math mode.
|
=
|
|
Note
|
Typing lower case will not display the same Command Completion list as .
norm and Norm are in fact two distinct commands in Maple.
|
|
|
|
Back to Student Portal Details
|
|
Example 12.3 - How Do I Calculate the Cross-Product of Two Vectors?
|
|
Step
|
Description
|
Illustration
|
1
|
In Math mode, the cross-product of two vectors can be calculated using the cross operator ( from either the Common Symbols palette or the Operators palette.
|
|
2
|
Enter the two vectors in any format, with the cross operator between them.
|
= =
|
Maple Input Mode
|
In Maple Input mode, first load the Student[LinearAlgebra] package. Then you can use the symbol &x as the cross-product operator.
Note that in the example to the right &x has no meaning outside of the package.
|
Loading Student:-LinearAlgebra
|
|
|
Back to Student Portal Details
|
|
Example 12.4 - How Do I Calculate the Determinant of a Matrix?
|
|
Methods
|
Description
|
Illustration
|
Context Menu
|
For an existing square matrix, apply the Context Panel item: Standard Operations → Determinant.
|
|
Palette
|
Alternatively, click on the absolute-value template from the Layout palette (if this palette is not visible, select View → Palettes → Show Palette → Layout).
Replace the inside the vertical lines with the desired matrix or with a reference to it (to enter a matrix in Maple, use the Matrix palette shown in step 1 of Example 12.1).
To obtain notation that looks more traditional, the brackets on the matrix can be deleted without affecting the result.
|
→
→
|
|
Press Enter or Ctrl+= (Command+= in Macintosh) to evaluate the determinant.
|
=
|
Note
|
Note that double vertical bars on both sides will calculate the norm of the matrix and not the determinant.
|
=
|
|
|
Back to Student Portal Details
|
|
Example 12.5 - How Do I Obtain the Transpose of a Matrix?
|
|
Methods
|
Description
|
Illustration
|
Context Menu
|
For an existing matrix, apply the Context Panel item:
Standard Operations → Transpose.
|
|
Command
|
Alternatively, enter the desired matrix into your worksheet (to enter a matrix in Maple, use the Matrix palette shown in step 1 of Example 12.1).
Press Shift+^ to raise the cursor to the superscript position. Then type .
|
→
→
|
|
Press Enter or Ctrl+= (Command+= in Macintosh) to evaluate and display the transpose of the matrix.
|
=
|
Hermitian Transpose
|
The Hermitian transpose of a matrix with complex entries can be obtained by typing instead of .
|
=
|
|
|
Back to Student Portal Details
|
|
Example 12.6 - How Do I Perform Augmentation or Stacking Operations on Matrices and Vectors?
|
|
For this example, define the following matrices and vectors.
Matrix A
|
Matrix B
|
Matrix C
|
Vector a
|
Vector b
|
|
|
|
|
|
|
|
|
Stacking Matrices and Vectors
|
|
The command stacks the first matrix or vector, , on top of the second matrix or vector, . See the examples below.
|
|
|
|
|
Error, (in Matrix) this entry is too wide or too narrow: Matrix(2, 3, {(1, 1) = 1, (1, 2) = 3, (1, 3) = 5, (2, 1) = 7, (2, 2) = 9, (2, 3) = 11})
|
|
|
As expected, only matrices and vectors that have the same number of columns can be stacked on top of one another.
|
|
Augmenting Matrices and Vectors
|
|
The command augments the first matrix or vector, , with the second matrix or vector, , by placing it on the right. Multiple augmentation or stacking is possible. See the examples below.
|
|
|
|
|
Error, (in Matrix) this entry is too tall or too short: Matrix(3, 2, {(1, 1) = 1, (1, 2) = 7, (2, 1) = 3, (2, 2) = 9, (3, 1) = 5, (3, 2) = 11})
|
|
|
As expected, only matrices and vectors that have the same number of rows can be augmented together.
|
|
Solving the Linear System
|
|
Given the matrix
and the vector , find the solution to the linear system .
Step
|
Description
|
Illustration
|
1
|
Form the augmented matrix as shown in the previous example.
|
=
|
2
|
Apply the Context Panel item:
Solvers and Forms → Row-Echelon Form.
|
|
3
|
The solution, , is the right-most column of the reduced row echelon form. This can be read from the matrix itself.
Alternatively, the solution can be displayed directly by applying the Context Panel item Select Elements → Restrict Columns, and enter the index of the last column, in this case, .
|
|
|
|
|
Back to Student Portal Details
|
|
Example 12.7 - How Do I Implement Gaussian Elimination by Using the Tutor?
|
|
Use the Gaussian Elimination Tutor to solve a linear system where is , and is .
Step
|
Description
|
Illustration
|
1
|
Start by augmenting the matrix as shown in the example above.
|
=
|
2
|
Next, load the Student[LinearAlgebra] package (Tools → Load Package → Student Linear Algebra).
|
Loading Student:-LinearAlgebra
|
3
|
To access the Tutor, from the Context Panel for the output, select: Student Linear Algebra → Tutor → Linear System Solving.
A dialog appears where you can choose the method of solving. Choose Gaussian Elimination.
Note that the matrix is automatically entered into the tutor.
|
|
4
|
The Edit Matrix button allows you to edit the matrix through the Matrix Builder.
The matrix and the equations it represents are viewable in both matrix and variable form.
The check box Augmented is selected by default. For an augmented matrix, a vertical line is drawn between and in the matrix, and the Variables view pane shows the nonhomogeneous equations.
You can change the dimensions of the array by clicking the drop-down boxes under Rows and Columns. Select Square to automatically convert the matrix to a square matrix, adding rows of zeros, if needed.
Click Display to redraw the Matrix and Variables views with the applied changes. Click Close to export the new matrix back to the Gaussian Elimination Tutor.
|
|
5
|
Gaussian elimination can be performed manually on the matrix by clicking on any of the row operation buttons shown on the right.
Click Undo to remove the last step performed. Click Next Step to perform and display one Gaussian elimination step. Click All Steps to display all steps to the final step of the Gaussian elimination.
After the matrix has been reduced to row echelon form, go to Step 6.
|
|
6
|
To complete the solution by back substitution, click the Solve System button. If the matrix has not been reduced to row echelon form an error displays.
If the augmented matrix is in row echelon form, another window will open.
Click the buttons Equations, Solve x[2], Solve x[1], and Solution, in that order, to manually implement back substitution and display the solution to the linear system.
Click the Change the matrix button to launch the Matrix Builder.
|
|
7
|
Click Cancel to close the Tutor and output nothing.
Click Close to close the Tutor and output a column matrix that represents the solution to the system.
|
|
|
|
Back to Student Portal Details
|
|
Example 12.8 - How Do I Use the Matrix Inverse Tutor?
|
|
Step
|
Description
|
Illustration
|
1
|
To begin, load the Student Linear Algebra package (Tools → Load Package → Student Linear Algebra).
|
Loading Student:-LinearAlgebra
|
2
|
For any square matrix, apply the Context Panel item Student Linear Algebra → Tutors → Matrix Inverse.
Note that Tutors will not appear in the Context Menu unless the Student Linear Algebra package is loaded.
Notice that the matrix is automatically entered into the tutor and augmented with the identity matrix.
|
|
3
|
Reduce the matrix to the identity manually by clicking on any of the row operation buttons shown on the right.
|
|
4
|
Click Undo to remove the last step performed. Click Next Step to display one additional reduction step. Click All Steps to complete the reduction and show the inverse.
Click Edit Matrix to change the matrix to be reduced. This button opens the Matrix Builder assistant.
Click Help in the Tutor's task bar to give a more thorough explanation of all the functions in the Tutor.
|
|
5
|
Click Return the Inverse to close the tutor and display the inverse in your document.
Click Close to cancel the tutor.
|
|
|
|
Back to Student Portal Details
|
|
|
Numerical analysis
|
|
|
Example 13.1 - How Do I Approximate the Roots of an Expression Using Newton's Method?
|
|
Steps
|
Description
|
Illustration
|
1
|
First, load the Student[NumericalAnalysis] package (Tools → Load Package → Student Numerical Analysis).
|
Loading Student:-NumericalAnalysis
|
2
|
Enter the expression.
|
|
3
|
Use the Newton command with the initial approximation and the option tolerance to obtain the solution.
This solution is accurate to within .
To see a plot of this application of Newton's method, use the option output=plot.
|
|
|
|
Back to Student Portal Details
|
|
Example 13.2 - How Do I Approximate the Roots of an Expression Using a Specific Method?
|
|
Steps
|
Description
|
Illustration
|
1
|
First, load the Student[NumericalAnalysis] package (Tools → Load Package → Student Numerical Analysis).
|
Loading Student:-NumericalAnalysis
|
2
|
Enter the expression.
|
|
3
|
Use the Roots command with the initial approximation(s) and the method option to obtain the solution.
Here, we use the secant method, which requires a pair of initial approximates.
To see a plot of this application of the secant method, use the option output=plot.
|
|
|
|
Back to Student Portal Details
|
|
Example 13.3 - How Do I Find the Interpolating Polynomial?
|
|
Method
|
Description
|
Illustration
|
Given data points
|
First, load the Student[NumericalAnalysis] package (Tools → Load Package → Student Numerical Analysis).
Enter the data points by entering a list of - pairs.
Use the PolynomialInterpolation command with the data points and the method option to obtain the solution.
Use expand(Interpolant) to see the interpolating polynomial
|
Loading Student:-NumericalAnalysis
|
Given the function and -values
|
First, load the Student[NumericalAnalysis] package (Tools → Load Package → Student Numerical Analysis).
Enter a list of -values.
Use the PolynomialInterpolation command with the -values, a function, and the method option to obtain the solution.
Use expand(Interpolant) to see the interpolating polynomial
|
Loading Student:-NumericalAnalysis
|
Hermite interpolation
|
First, load the Student[NumericalAnalysis] package (Tools → Load Package → Student Numerical Analysis).
For Hermite interpolation, enter a list of triples giving , , and the derivative at that point.
Use the PolynomialInterpolation command with the data points and the method hermite to obtain the solution.
|
Loading Student:-NumericalAnalysis
|
Note
|
Entering the function and errorboundvar options is not required, but these options are needed if you want to find the error term (see Example 13.4).
|
|
|
Back to Student Portal Details
|
|
Example 13.4 - How Do I Find the Error Term for an Interpolating Polynomial?
|
|
Description
|
Illustration
|
First, find the Polynomial Interpolation as described in Example 13.3. You will need to specify the function and the name of the error bound variable using the function and errorboundvar options.
Then, use the command RemainderTerm to find the error term.
|
|
|
|
Back to Student Portal Details
|
|
Example 13.5 - How Do I Find the Divided Difference Table?
|
|
Description
|
Illustration
|
You can find the divided difference table for a polynomial interpolation computed with Newton's method or Hermite's method.
First, find the Polynomial Interpolation as described in Example 13.3.
Then, use the command DividedDifferenceTable.
|
|
|
|
Back to Student Portal Details
|
|
Example 13.6 - How Do I Find the Quadrature Using a Specific Method?
|
|
Steps
|
Description
|
Illustration
|
1
|
First, load the Student[NumericalAnalysis] package (Tools → Load Package → Student Numerical Analysis).
|
Loading Student:-NumericalAnalysis
|
2
|
Enter the expression.
|
|
3
|
Use the Quadrature command with the expression, interval, and the method option to obtain the solution. If desired, specify the partitions. (The default is 10 evenly spaced partitions.)
To see a plot of this application of Newton's method, use the option output=plot.
|
|
|
|
|
|
Example 13.7 - How Do I Solve an ODE Initial Value Problem Using Euler's Method?
|
|
Steps
|
Description
|
Illustration
|
1
|
First, load the Student[NumericalAnalysis] package (Tools → Load Package → Student Numerical Analysis).
|
Loading Student:-NumericalAnalysis
|
2
|
Enter the ODE. Use any of of the methods described in Example 11.1 to enter the ODE.
|
|
3
|
Use the Euler command to obtain the numerical solution to the ODE with initial value given a specific value of .
You can choose to output the solution, error, plot, or a table of information.
|
|
|
|
Back to Student Portal Details
|
|
Example 13.8 - How Do I Specify a Numerical Method for Solving Ax = b?
|
|
Steps
|
Description
|
Illustration
|
1
|
First, load the Student[NumericalAnalysis] package (Tools → Load Package → Student Numerical Analysis).
|
Loading Student:-NumericalAnalysis
|
2
|
Enter the matrix A and vector b. (To enter a matrix or a vector in Maple, see Example 12.1.)
|
|
3
|
Use the LinearSolve command with the method option to obtain the solution.
|
|
|
|
Back to Student Portal Details
|
|
|
Units, errors, and tolerances
|
|
|
Example 16.1 - How Do I Use Units?
|
|
Feature
|
Description
|
Illustration
|
1
|
The Units palette provides an easy way to find and apply units to a calculation without having to know the parent unit system that the unit resides in. For example, you may want to enter a unit for Power but do not know, or care about, the parent unit system.
If the Units palette is hidden from the palettes pane, see Show Palettes for instructions on how to display this palette.
|
|
2
|
A common and useful place to add units to a document is during variable assignment. After entering a value, click the unit you want to attach to that quantity.
|
→
→
|
3
|
Units can also be applied by using the Context Panel item: Units → Affix Unit → [desired unit].
|
|
4
|
The results of calculations performed with unit-dependent variables will also have, and display, units.
|
=
|
5
|
To simplify the units of a value or expression, use the Context Panel item: Units → Simplify.
|
|
6
|
To specify units not shown in the template, click unit from the Units palette.
Then overwrite unit with your measure of units.
|
→
→
|
|
|
Back to Student Portal Details
|
|
Example 16.2 - How Do I Convert Units?
|
|
Description
|
Illustration
|
To convert from one system of units to another use the Context Panel item: Units → Convert → System → [desired system of units].
|
|
To convert within one system of units, use the Context Panel item: Units → Replace Units.
A dialog box lets you specify the replacement units. Enter the units. The results of the conversion are shown.
|
|
|
|
Back to Student Portal Details
|
|
Example 16.3 - How Do I Use Tolerances?
|
|
Feature
|
Description
|
Illustration
|
|
A tolerance of the form is attached to the quantity by the construct .
First, load the Tolerances package (Tools → Load Package → Units and Tolerances).
|
Loading Tolerances
|
Palette
|
The symbol can be entered from the Common Symbols palette or the Operators palette.
|
=
=
=
=
|
Command Completion
|
The symbol can also be entered by typing and using Command Completion.
|
|
|
|
Back to Student Portal Details
|
|
|
Recurrence equations
|
|
|
Example 17.1 - How Do I Enter and Solve Recurrence Equations in Maple?
|
|
Step
|
Description
|
Illustration
|
1
|
A recurrence equation such as can be entered in Maple with the syntax shown to the right.
|
|
2
|
Recurrence equations can be solved by using the rsolve command.
An initial value problem for a recurrence equation is solved with the syntax as shown to the right.
|
|
|
|
Back to Student Portal Details
|
|
Back to Student Portal Details
|