Products & Services Solutions Academia Support User Community Company

Learn more about Partial Differential Equation Toolbox   

Using the pdetool Menus

Introduction

The graphical user interface (GUI) has a pull-down menu bar that you can use to control the modeling. It conforms to common pull-down menu standards.

Menu items followed by a right arrow lead to a submenu. Menu items followed by an ellipsis lead to a dialog box. Stand-alone menu items lead to direct action. Some menu items can be executed by using keyboard accelerators.

pdetool also contains a toolbar with icon buttons for quick and easy access to some of the most important pdetool functions.

The following sections describe the contents of the pdetool menus and the dialog boxes associated with menu items.

File Menu

New

Create a new (empty) Constructive Solid Geometry (CSG) model.

Open

Load a model M-file from disk.

Save

Save the GUI session to a model M-file.

Save As

Save the GUI session to a new model M-file.

Print

Print a hardcopy of a figure.

Exit

Exit the pdetool graphical user interface.

New

New deletes the current CSG model and creates a new, empty model called "Untitled."

Open

Open displays a dialog box with a list of existing M-files from which you can select the file that you want to load. You can list the contents of a different folder by changing the path in the Selection text box. You can use the scroll bar to display more filenames. You can select a file by double-clicking the filename or by clicking the filename and then clicking the Done button. When you select a file, the CSG model that is stored in the model M-file is loaded into the workspace and displayed. Also, the equation, the boundary conditions, and information about the mesh and the solution are loaded if present, and the modeling and solution process continues to the same status as when you saved the file.

Save As

Save As displays a dialog box in which you can specify the name of the file in which to save the CSG model and other information regarding the GUI session. You can also change the folder in which it is saved. If the filename is given without a .m extension, .m is appended automatically.

The GUI session is stored in a model M-file, which contains a sequence of drawing commands and commands to recreate the modeling environment (axes scaling, grid, etc.). If you have already defined boundary conditions, PDE coefficients, created a triangular mesh, and solved the PDE, further commands to recreate the modeling and solution of the PDE problem are also included in the model M-file. The pdetool GUI can be started from the command line by entering the name of a model M-file. The model in the file is then directly loaded into the GUI.

Print

Print displays a dialog box for printing a hardcopy of a figure. Only the main part of the figure is printed, not the upper and lower menu and information parts. In the dialog box, you can enter any device option that is available for the MATLAB print command. The default device option is -dps (PostScript® for black and white printers). The paper orientation can be set to portrait, landscape, or tall, and you can print to a printer or to file.

Edit Menu

Undo

Undo the last line when drawing a polygon.

Cut

Move the selected solid objects to the Clipboard.

Copy

Copy the selected objects to the Clipboard, leaving them intact in their original location.

Paste

Copy the contents of the Clipboard to the current CSG model.

Clear

Delete the selected objects.

Select All

Select all solid objects in the current CSG model. Also, select all outer boundaries or select all subdomains.

Paste

Paste displays a dialog box for pasting the contents of the Clipboard on to the current CSG model. The Clipboard contents can be repeatedly pasted adding a specified x- and y-axis displacement to the positions of the Clipboard objects.

Using the default values—zero displacement and one repetition—the Clipboard contents is inserted at its original position.

Options Menu

Grid

Turn grid on/off.

Grid Spacing

Adjust the grid spacing.

Snap

Turn the "snap-to-grid" feature on/off.

Axis Limits

Change the scaling of the drawing axes.

Axis Equal

Turn the "axis equal" feature on/off.

Turn off Toolbar Help

Turn off help texts for the toolbar buttons.

Zoom

Turn zoom feature on/off.

Application

Select application mode.

Refresh

Redisplay all graphical objects in the pdetool graphical user interface.

Grid Spacing

In the Grid Spacing dialog box, you can adjust the x-axis and y-axis grid spacing. By default, the MATLAB automatic linear grid spacing is used. If you turn off the Auto check box, the edit fields for linear spacing and extra ticks are enabled. For example, the default linear spacing -1.5:0.5:1.5 can be changed to -1.5:0.2:1.5. In addition, you can add extra ticks so that the grid can be customized to aid in drawing the desired 2-D domain. Extra tick entries can be separated using spaces, commas, semicolons, or brackets.

Examples:

pi
2/3, 0.78, 1.1
-0.123; pi/4

Clicking the Apply button applies the entered grid spacing; clicking the Done button ends the Grid Spacing dialog.

Axes Limits

In the Axes Limits dialog box, the range of the x-axis and the y-axis can be adjusted. The axis range should be entered as a 1-by-2 MATLAB vector such as [-10 10]. If you select the Auto check box, automatic scaling of the axis is used.

Clicking the Apply button applies the entered axis ranges; clicking the Close button ends the Axes Limits dialog.

Application

From the Application submenu, you can select from 10 available application modes. The application modes can also be selected using the pop-up menu in the upper right corner of the GUI.

The available application modes are:

See Application Modes for more details.

Draw Menu

Draw Mode

Enter draw mode.

Rectangle/square

Draw a rectangle/square starting at a corner. Using the left mouse button, click-and-drag to create a rectangle. Using the right mouse button (or Ctrl+click), click-and-drag to create a square.

Rectangle/square (centered)

Draw a rectangle/square starting at the center. Using the left mouse button, click-and-drag to create a rectangle. Using the right mouse button (or Ctrl+click), click-and-drag to create a square.

Ellipse/circle

Draw an ellipse/circle starting at the perimeter. Using the left mouse button, click-and-drag to create an ellipse. Using the right mouse button (or Ctrl+click), click-and-drag to create a circle.

Ellipse/circle (centered)

Draw an ellipse/circle starting at the center. Using the left mouse button, click-and-drag to create an ellipse. Using the right mouse button (or Ctrl+click), click-and-drag to create a circle.

Polygon

Draw a polygon. You can close the polygon by pressing the right mouse button. Clicking at the starting vertex also closes the polygon.

Rotate

Rotate selected objects.

Export Geometry Description, Set Formula, Labels

Export the Geometry Description matrix gd, the set formula string sf, and the Name Space matrix ns (labels) to the main workspace.

Rotate

Rotate opens a dialog box where you can enter the angle of rotation in degrees. The selected objects are then rotated by the number of degrees that you specify. The rotation is done counter clockwise for positive rotation angles. By default, the rotation center is the center-of-mass of the selected objects. If the Use center-of-mass option is not selected, you can enter a rotation center (xc,yc) as a 1-by-2 MATLAB vector such as [-0.4 0.3].

Boundary Menu

Boundary Mode

Enter the boundary mode.

Specify Boundary Conditions

Specify boundary conditions for the selected boundaries. If no boundaries are selected, the entered boundary condition applies to all boundaries.

Show Edge Labels

Toggle the labeling of the edges (outer boundaries and subdomain borders) on/off. The edges are labeled using the column number in the Decomposed Geometry matrix.

Show Subdomains
Labels

Toggle the labeling of the subdomains on/off. The subdomains are labeled using the subdomain numbering in the Decomposed Geometry matrix.

Remove Subdomain Border

Remove selected subdomain borders.

Remove All Subdomain Borders

Remove all subdomain borders.

Export Decomposed Geometry, Boundary Cond's

Export the Decomposed Geometry matrix g and the Boundary Condition matrix b to the main workspace.

Specify Boundary Conditions

Specify boundary conditions displays a dialog box in which you can specify the boundary condition for the selected boundary segments. There are three different condition types:

The following figure shows the boundary condition dialog box for the generic system PDE.

For boundary condition entries you can use the following variables in a valid MATLAB expression:

Examples: (100-80*s).*nx, and cos(x.^2)

In the nongeneric application modes, the Description column contains descriptions of the physical interpretation of the boundary condition parameters.

PDE Menu

PDE Mode

Enter the partial differential equation mode.

Show Subdomain Labels

Toggle the labeling of the subdomains on/off. The subdomains are labeled using the subdomain numbering in the decomposed geometry matrix.

PDE Specification

Open dialog box for entering PDE coefficients and types.

Export PDE Coefficients

Export current PDE coefficients to the main workspace. The resulting workspace variables are strings.

PDE Specification

PDE Specification opens a dialog box where you enter the type of partial differential equation and the applicable parameters. The dimension of the parameters is dependent on the dimension of the PDE. The following description applies to scalar PDEs. If a nongeneric application mode is selected, application-specific PDEs and parameters replace the standard PDE coefficients. For a thorough description of the different application modes, see Application Modes.

Each of the coefficients c, a, f, and d can be given as a valid MATLAB expression for computing coefficient values at the triangle centers of mass. The following variables are available:

You can also enter the name of a user-defined MATLAB function that accepts the arguments (p,t,u,time). For an example, type the function circlef.

c can be a scalar or a 2-by-2 matrix. The matrix c can be used to model, e.g., problems with anisotropic material properties.

If c contains two rows, they are the c1,1 and c2,2 elements of a 2-by-2 symmetric matrix

If c contains three rows, they are the c1,1, c1,2, and c2,2 elements of a 2-by-2 symmetric matrix (c2,1 = c1,2)

If c contains four rows, they are the c1,1, c2,1, c1,2, and c2,2 elements of the 2-by-2 preceding matrix.

The available types of PDEs are

In the system case, c is a rank four tensor, which can be represented by four 2-by-2 matrices, c11, c12, c21, and c22. They can be entered as one, two, three, or four rows—see the preceding scalar case. a and d are 2-by-2 matrices, and f is a 2-by-1 vector. The PDE Specification dialog box for the system case is shown in the following figure.

Mesh Menu

Mesh Mode

Enter mesh mode.

Initialize Mesh

Build and display an initial triangular mesh.

Refine Mesh

Uniformly refine the current triangular mesh.

Jiggle Mesh

Jiggle the mesh.

Undo Mesh Change

Undo the last mesh change. All mesh generations are saved, so repeated Undo Mesh Change eventually brings you back to the initial mesh.

Display Triangle Quality

Display a plot of the triangular mesh where the individual triangles are colored according to their quality. The quality measure is a number between 0 and 1, where triangles with a quality measure greater than 0.6 are acceptable. For details on the triangle quality measure, see pdetriq.

Show Node Labels

Toggle the mesh node labels on/off. The node labels are the column numbers in the Point matrix p.

Show Triangle Labels

Toggle the mesh triangle labels on/off. The triangle labels are the column numbers in the triangle matrix t.

Parameters

Open dialog box for modification of mesh generation parameters.

Export Mesh

Export Point matrix p, Edge matrix e, and Triangle matrix t to the main workspace.

Parameters

Parameters opens a dialog box containing mesh generation parameters. The parameters used by the mesh initialization algorithm initmesh are:

The parameters used by the mesh jiggling algorithm jigglemesh are:

Finally, for the mesh refinement algorithm refinemesh, the Refinement method can be regular or longest. The default refinement method is regular, which results in a uniform mesh. The refinement method longest always refines the longest edge on each triangle.

Solve Menu

Solve PDE

Solve the partial differential equation for the current CSG model and triangular mesh, and plot the solution (the automatic solution plot can be disabled).

Parameters

Open dialog box for entry of PDE solve parameters.

Export Solution

Export the PDE solution vector u and, if applicable, the computed eigenvalues l to the main workspace.

Parameters

Solve Parameters Dialog Box for Elliptic PDEs

Parameters opens a dialog box where you can enter the solve parameters. The set of solve parameters differs depending on the type of PDE.

Plot Menu

Plot Solution

Display a plot of the solution.

Parameters

Open dialog box for plot selection.

Export Movie

If a movie has been recorded, the movie matrix M is exported to the main workspace.

Parameters

Plot Selection Dialog Box

Parameters opens a dialog box containing options controlling the plotting and visualization.

The upper part of the dialog box contains four columns:

A color bar is added to the plots to map the colors in the plot to the magnitude of the property that is represented using color or contour lines.

For the generic system case, the properties available for visualization using color, contour lines, or z-height are u, v, abs(u,v), and a user entry. For visualization using arrows or a deformed mesh, you can choose (u,v) or a user entry. For applications in structural mechanics, u and v are the x- and y-displacements, respectively.

For the visualization options in the other application modes, see Application Modes. The variables available in the local workspace for a user entered expression are the same for all scalar and system modes (the solution is always referred to as u and, in the system case, v).

A total of three properties of the solution—two scalar properties and one vector field—can be visualized simultaneously. If the Height (3-D plot) option is turned off, the solution plot is a 2-D plot and is plotted in the main axes of the pdetool GUI. If the Height (3-D plot) option is used, the solution plot is a 3-D plot in a separate figure window. If possible, the 3-D plot uses an existing figure window. If you would like to plot in a new figure window, simply type figure at the MATLAB command line.

Additional Plot Control Options

In the middle of the dialog box are a number of additional plot control options:

For the parabolic and hyperbolic PDEs, the bottom right portion of the Plot Selection dialog box contains the Time for plot parameter.

Time for plot. A pop-up menu allows you to select which of the solutions to plot by selecting the corresponding time. By default, the last solution is plotted.

Also, the Animation plot type is enabled. In its property field you find an Options button. If you press it, an additional dialog box appears. It contains parameters that control the animation:

For eigenvalue problems, the bottom right part of the dialog box contains a pop-up menu with all eigenvalues. The plotted solution is the eigenvector associated with the selected eigenvalue. By default, the smallest eigenvalue is selected.

You can rotate the 3-D plots by clicking the plot and, while keeping the mouse button down, moving the mouse. For guidance, a surrounding box appears. When you release the mouse, the plot is redrawn using the new viewpoint. Initially, the solution is plotted using -37.5 degrees horizontal rotation and 30 degrees elevation.

If you click the Plot button, the solution is plotted immediately using the current plot setup. If there is no current solution available, the PDE is first solved. The new solution is then plotted. The dialog box remains on the screen.

If you click the Done button, the dialog box is closed. The current setup is saved but no additional plotting takes place.

If you click the Cancel button, the dialog box is closed. The setup remains unchanged since the last plot.

Window Menu

From the Window menu, you can select all currently open MATLAB figure windows. The selected window is brought to the front.

Help Menu

Help

Display a brief help window.

About

Display a window with some program information.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS