Application Document Template - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Tasks : Document Templates : Task/Application

Application Document Template

© Maplesoft, a division of Waterloo Maple Inc., 2005

This document contains formatting styles similar to those used in the sample applications (also accessible from the Maple Tour Index page). You can use this template as a starting point for creating custom technical reports with Maple documentation features.

Throughout this document, various Maple features are highlighted and illustrated with simple examples. Links to further resources are included for interested users.

Section Layout

Introduction

 Template Organization   Initialization

System Definition

 Table Text Area Box Bookmark

Derivation, Analysis and Testing

 Images and Diagrams Label Reference

Deployment and Visualization

 Plots and Animations Slider and Push Button Autoexecute

Introduction

 Template Organization The formatting style for the sample applications follows a common layout. This template provides that pre-defined layout for creating custom professional technical documents with similar structure and is a starting point for modifications. To use this template, replace the text, commands, and code with the appropriate materials. Sections, subsections, execution groups, hyperlinks, bookmarks, tables, and more can be added or removed as necessary.   This template uses Worksheet mode. Document mode is also available and you are encouraged to explore this alternate option for document formatting. For details on the differences between these modes, see Document Mode vs Worksheet Mode and the online User Manual.   Several configuration settings have been set as default in this template and are listed here for reference. You are encouraged to adjust these settings in the Show Contents dialog (View>Show/Hide Contents) and observe the effects.     More options are available for customizing your Maple preferences in the Options dialog.
 Initialization All of the sample applications begin with an initialization section. This section contains commands that load built-in library functions into memory. This section also provides a central location for you to define custom functions to be used in the rest of the application. A Maple feature called a document block allows the hiding of potentially complex code. Document blocks can be expanded by the reader to reveal the underlying commands (default can be set to collapsed). This allows clarity and compactness in the presentation of technical materials while providing access to more information.   To create a document block, highlight the content to be hidden (click and drag to highlight commands and their outputs) and select Create Document Block from the Format menu. For more details, see the help page on Using Document Blocks.   The following are examples of document blocks. The code is hidden and only the output is displayed. To expand the document blocks, right-click (Control-click, for Macintosh) the document block symbols on the left panel and select Document Block>Expand Document Block. (If you do not see a panel to the left, select Markers from the View menu to enable it).

System Definition

Following the introduction and initialization sections, the next section in the sample applications is the system definition section. Here, the problem to be examined is defined. This includes defining the name and description of the input, output, and parameter variables of the system. In this template, we use a sine voltage function as our example: ${y}{}\left({t}\right){=}{A}{}{\mathrm{sin}}{}\left({\mathrm{\omega }}{}{t}\right)$

 Description Name Value Unit Input Variables Time ($t$) $⟦s⟧$ Output Variables Output Voltage ($y\left(t\right)$) $⟦V⟧$ Parameters Amplitude $⟦V⟧$ Frequency $⟦\frac{\mathrm{rad}}{s}⟧$

The parameters are then collected into a set.

 $\left\{{A}{=}{1}{,}{\mathrm{\omega }}{=}{1}\right\}$ (2.1)

Tables

The most noticeable feature in the definition section is the use of tables to organize the information. Tables can be added by selecting Table from the Insert menu. The number of rows and columns can be specified in the resulting dialog. Table attributes and operations include:

 Merge Cell Cell Alignment Show/Hide Borders Row/Column Execution Order Table Height/Width Insert/Remove Rows/Columns

For more details, see the help page on tables.

 Text Area Box Another Maple feature highlighted in this section is the use of Text Area Box embedded components. Parameter names and their corresponding values in the application are defined using these Text Area boxes. Then, the names and values are collected together into a parameter set for later use. Expand the document block to see the code used to perform the collection.   By defining the parameter names and values this way, readers can adjust parameter values in the text box, re-execute the document, and then observe the effects of the new values. This is all accomplished without readers altering a single line of Maple code, making interaction with the applications more user friendly.
 Bookmark Finally, each of the sections in this application template has been bookmarked. These bookmarks are linked to the Section Layout table at the beginning of the document for quick access to the individual sections and subsections.   The Section Layout also functions as an overview and table of contents for the document.

Derivation, Analysis and Testing

After the system variables (input, output, and parameters) are defined, the next section in the sample applications is the presentation of the actual work. In addition to computation with expressions and equations, features such as images, diagrams, and label references are used to organize the material and present the results to the audience.

Images and Diagrams

 Images and graphics can be imported from external sources. For example, the DC motor diagram at the beginning of this application template was imported using the Load Image dialog (Insert>Image). Supported graphic formats include GIF, BMP and JPEG. For more details, see the Insert an Image help page.   Maple plots and animations can be copied and pasted into custom applications. For example, the animation of the changing frequency in the example sine voltage function shown on the right was generated by Maple commands defined in the next section. It has been copied and pasted here.   Note that the animation, once pasted, is now static, meaning that if the code that generated the original animation is modified and the document re-executed, the pasted animation will not be updated. It is simply a copy of the original animation object. (The animation itself is still live in the sense that the animation sequence is intact and the reader can play through it.)

Label Reference

Another Maple feature is equation labels, which allow the output from previously executed execution groups to be referred to later. For example, we can refer to the set of parameter equations defined previously by its equation label . The numbering of equation labels is updated automatically as execution groups are added or removed.

To create a label reference, enter Ctrl+l (Command-l, for Macintosh).

Equation labels can also be used as part of Maple input to refer to previously obtained results. For example, the following command retrieves the first element in the set of equations defined in .

 > $\mathrm{op}\left(1,\right)$
 ${1}$ (3.2.1)

Deployment and Visualization

You can use several methods in Maple to summarize and present results to readers. These methods include plotting (2-D and 3-D), animation, and embedded components.

Plots and Animation

Although plots and animations are not new to Maple, significant enhancements have been made in these areas. For example, gridlines are available. Also, with the help of tables and document blocks, plots, animations, and other graphical objects can be arranged systematically to allow side-by-side comparison. The two plots below are organized with tables and the commands that generate the plots are hidden inside a document block.



Slider and Push Button

Slider and Push Button are two of the embedded components available in Maple. We have already seen Text Area embedded components above. These components are interactive tools allowing the reader to quickly and easily observe the effects of changing parameter values.

 Max A Min A A =

Max $\mathrm{ω}$

Min $\mathrm{ω}$

$\mathrm{ω}$ =

 Autoexecute Autoexecute is a feature in Maple that allows you to define a set of commands to be executed automatically. This allows pre-execution of commands that are necessary for the illustration of content when the application is opened. For example, the code for the slider and push button (as well as the animation) in the previous section were set to autoexecute so that when the application is opened, the embedded components are active (the reader does not have to re-execute the entire document).   To set a document block to autoexecute, right-click (Control-click, for Macintosh) the document block icon on the left panel and select Autoexecute>Set.   As an example, the following command is set to autoexecute when this template is opened. It will define, draw, and start the animation in the previous section. To stop the animation, click the Stop toggle button in the lower left corner of the table.
 >

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam