logo资料库

MatLab偏微分方程工具箱使用手册.pdf

第1页 / 共284页
第2页 / 共284页
第3页 / 共284页
第4页 / 共284页
第5页 / 共284页
第6页 / 共284页
第7页 / 共284页
第8页 / 共284页
资料共284页,剩余部分请下载后查看
1
Tutorial
Examples
The Graphical User Interface
The Finite Element Method
Reference
Index
Tutorial
Introduction
What Does this Toolbox Do?
Can I Use the PDE Toolbox?
What Problems Can I Solve?
In Which Areas Can the Toolbox Be Used?
How Do I Define a PDE Problem?
How Can I Solve a PDE Problem?
Can I Use the Toolbox for Nonstandard Problems?
How Can I Visualize My Results?
Are There Any Applications Already Implemented?
Can I Extend the Functionality of the Toolbox?
How Can I Solve 3-D Problems by 2-D Models?
Getting Started
Basics of The Finite Element Method
Using the Graphical User Interface
The PDE Toolbox Graphical User Interface
The Menus
The Toolbar
The GUI Modes
The CSG Model and the Set Formula
Creating Rounded Corners
Suggested Modeling Method
Object Selection Methods
Display Additional Information
Entering Parameter Values as MATLAB Expressions
Using PDE Toolbox version 1.0 Model M-files
Using Command-Line Functions
Data Structures and Utility Functions
Constructive Solid Geometry Model
Decomposed Geometry
Boundary Conditions
Equation Coefficients
Mesh
Solution
Post Processing and Presentation
Hints and Suggestions for Using Command-Line Funct...
Examples
Examples of Elliptic Problems
Poisson’s Equation on Unit Disk
Using the Graphical User Interface
Using Command-Line Functions
A Scattering Problem
Using the Graphical User Interface
A Minimal Surface Problem
Using the Graphical User Interface
Using Command-Line Functions
Domain Decomposition
Examples of Parabolic Problems
The Heat Equation: A Heated Metal Block
Using the Graphical User Interface
Using Command-Line Functions
Heat Distribution in Radioactive Rod
Using the Graphical User Interface
Examples of Hyperbolic Problems
The Wave Equation
Using the Graphical User Interface
Using Command-Line Functions
Examples of Eigenvalue Problems
Eigenvalues and Eigenfunctions for the L-Shaped Me...
Using the Graphical User Interface
Using Command-Line Functions
L-Shaped Membrane with Rounded Corner
Eigenvalues and Eigenmodes of a Square
Using the Graphical User Interface
Using Command-Line Functions
Application Modes
The Application Modes and the GUI
Structural Mechanics - Plane Stress
Example
Using the Graphical User Interface
Structural Mechanics - Plane Strain
Electrostatics
Example
Using the Graphical User Interface
Magnetostatics
Example
Using the Graphical User Interface
AC Power Electromagnetics
Example
Using the Graphical User Interface
Conductive Media DC
Example
Using the Graphical User Interface
Heat Transfer
Example
Using the Graphical User Interface
Diffusion
The Graphical User Interface
PDE Toolbox Menus
File Menu
New
Open . . .
Save As . . .
Print . . .
Edit Menu
Paste . . .
Options Menu
Grid Spacing . . .
Axes Limits . . .
Application
Draw Menu
Rotate . . .
Boundary Menu
Specify Boundary Conditions . . .
PDE Menu
PDE Specification . . .
Mesh Menu
Parameters . . .
Solve Menu
Parameters . . .
Plot Menu
Parameters . . .
Additional Plot Control Options
Window Menu
Help Menu
The Toolbar
The Finite Element Method
The Elliptic Equation
The Elliptic System
The Parabolic Equation
The Hyperbolic Equation
The Eigenvalue Equation
Nonlinear Equations
Adaptive Mesh Refinement
The Error Indicator Function
The Mesh Refiner
The Termination Criteria
Fast Solution of Poisson’s Equation
Reference
Commands Grouped by Function
PDE Algorithms
User Interface Algorithms
Geometry Algorithms
Plot Functions
Utility Algorithms
User Defined Algorithms
Demonstration Programs
adaptmesh
assema
assemb
assempde
PDE Coefficients for Scalar Case
PDE Coefficients for System Case
csgchk
csgdel
decsg
dst, idst
hyperbolic
initmesh
jigglemesh
parabolic
pdeadgsc
pdeadworst
pdearcl
pdebound
pdecgrad
pdecirc
pdecont
pdeeig
pdeellip
pdeent
pdegeom
pdegplot
pdegrad
pdeintrp
pdejmps
pdemdlcv
pdemesh
pdenonlin
pdeplot
pdepoly
pdeprtni
pderect
pdesdp, pdesde, pdesdt
pdesmech
pdesurf
pdetool
Boundary Condition Dialog Box
Model M-file
pdetrg
pdetriq
poiasma
poicalc
poiindex
poimesh
poisolv
refinemesh
sptarn
tri2grid
wbound
wgeom
A
B
C
D
E
F
G
H
I
J
L
M
N
O
P
R
S
T
V
W
Partial Differential Equation Toolbox For Use with MATLAB® Computer Solutions Europe AB Computation Visualization Programming User’s Guide
% FAX) @ How to Contact The MathWorks: 508-647-7000 508-647-7001 The MathWorks, Inc. 24 Prime Park Way Natick, MA 01760-1500 Phone Fax Mail http://www.mathworks.com ftp.mathworks.com comp.soft-sys.matlab support@mathworks.com suggest@mathworks.com bugs@mathworks.com doc@mathworks.com subscribe@mathworks.com service@mathworks.com info@mathworks.com Web Anonymous FTP server Newsgroup Technical support Product enhancement suggestions Bug reports Documentation error reports Subscribing user registration Order status, license renewals, passcodes Sales, pricing, and general information Partial Differential Equation Toolbox User’s Guide COPYRIGHT 1984 - 1997 by The MathWorks, Inc. All Rights Reserved. The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or repro- duced in any form without prior written consent from The MathWorks, Inc. U.S. GOVERNMENT: If Licensee is acquiring the Programs on behalf of any unit or agency of the U.S. Government, the following shall apply: (a) For units of the Department of Defense: the Government shall have only the rights specified in the license under which the commercial computer software or commercial software documentation was obtained, as set forth in subparagraph (a) of the Rights in Commercial Computer Software or Commercial Software Documentation Clause at DFARS 227.7202-3, therefore the rights set forth herein shall apply; and (b) For any other unit or agency: NOTICE: Notwithstanding any other lease or license agreement that may pertain to, or accompany the delivery of, the computer software and accompanying documentation, the rights of the Government regarding its use, reproduction, and disclo- sure are as set forth in Clause 52.227-19 (c)(2) of the FAR. MATLAB, Simulink, Handle Graphics, and Real-Time Workshop are registered trademarks and Stateflow and Target Language Compiler are trademarks of The MathWorks, Inc. Other product or brand names are trademarks or registered trademarks of their respective holders. Printing History: August 1995 First printing February 1996 Reprint
1 Contents Tutorial Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2 What Does this Toolbox Do? . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2 Can I Use the PDE Toolbox? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 What Problems Can I Solve? . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3 In Which Areas Can the Toolbox Be Used? . . . . . . . . . . . . . . . . .1-5 How Do I Define a PDE Problem? . . . . . . . . . . . . . . . . . . . . . . . .1-5 How Can I Solve a PDE Problem? . . . . . . . . . . . . . . . . . . . . . . . .1-6 Can I Use the Toolbox for Nonstandard Problems? . . . . . . . . . .1-6 How Can I Visualize My Results? . . . . . . . . . . . . . . . . . . . . . . . .1-6 Are There Any Applications Already Implemented? . . . . . . . . . .1-7 Can I Extend the Functionality of the Toolbox? . . . . . . . . . . . . .1-7 How Can I Solve 3-D Problems by 2-D Models? . . . . . . . . . . . . .1-8 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-9 Basics of The Finite Element Method . . . . . . . . . . . . . . . . . . .1-18 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . . .1-23 The PDE Toolbox Graphical User Interface . . . . . . . . . . . . . . .1-23 The Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-24 The Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-25 The GUI Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-26 The CSG Model and the Set Formula . . . . . . . . . . . . . . . . . . . .1-27 Creating Rounded Corners . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-28 Suggested Modeling Method . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-31 Object Selection Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-35 Display Additional Information . . . . . . . . . . . . . . . . . . . . . . . . .1-35 Entering Parameter Values as MATLAB Expressions . . . . . . .1-36 Using PDE Toolbox version 1.0 Model M-files . . . . . . . . . . . . . .1-36 i
Using Command-Line Functions . . . . . . . . . . . . . . . . . . . . . . . 1-37 Data Structures and Utility Functions . . . . . . . . . . . . . . . . . . . 1-37 Constructive Solid Geometry Model . . . . . . . . . . . . . . . . . . . 1-38 Decomposed Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-39 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-39 Equation Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-39 Mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-39 Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-40 Post Processing and Presentation . . . . . . . . . . . . . . . . . . . . . 1-40 Hints and Suggestions for Using Command-Line Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-40 2 Examples Examples of Elliptic Problems . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 Poisson’s Equation on Unit Disk . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . . 2-2 Using Command-Line Functions . . . . . . . . . . . . . . . . . . . . . . 2-4 A Scattering Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . . 2-8 A Minimal Surface Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-10 Using Command-Line Functions . . . . . . . . . . . . . . . . . . . . . 2-11 Domain Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12 Examples of Parabolic Problems . . . . . . . . . . . . . . . . . . . . . . . 2-16 The Heat Equation: A Heated Metal Block . . . . . . . . . . . . . . . . 2-16 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-17 Using Command-Line Functions . . . . . . . . . . . . . . . . . . . . . 2-19 Heat Distribution in Radioactive Rod . . . . . . . . . . . . . . . . . . . . 2-21 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-22 Examples of Hyperbolic Problems . . . . . . . . . . . . . . . . . . . . . 2-23 The Wave Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-23 Using Command-Line Functions . . . . . . . . . . . . . . . . . . . . . 2-25 ii Contents
Examples of Eigenvalue Problems . . . . . . . . . . . . . . . . . . . . . 2-27 Eigenvalues and Eigenfunctions for the L-Shaped Membrane. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-27 Using Command-Line Functions . . . . . . . . . . . . . . . . . . . . . 2-28 L-Shaped Membrane with Rounded Corner . . . . . . . . . . . . . . . 2-31 Eigenvalues and Eigenmodes of a Square . . . . . . . . . . . . . . . . 2-32 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-33 Using Command-Line Functions . . . . . . . . . . . . . . . . . . . . . 2-33 Application Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35 The Application Modes and the GUI . . . . . . . . . . . . . . . . . . . . . 2-35 Structural Mechanics - Plane Stress . . . . . . . . . . . . . . . . . . . . . 2-36 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-39 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-39 Structural Mechanics - Plane Strain . . . . . . . . . . . . . . . . . . . . 2-41 Electrostatics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-43 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-44 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-44 Magnetostatics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-46 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-47 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-48 AC Power Electromagnetics . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-51 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-52 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-53 Conductive Media DC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-55 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-55 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-56 Heat Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-57 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-58 Using the Graphical User Interface . . . . . . . . . . . . . . . . . . . 2-59 Diffusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-61 iii
3 The Graphical User Interface PDE Toolbox Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 New . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 Save As . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Edit Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 Paste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 Options Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 Grid Spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10 Axes Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 Draw Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13 Rotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14 Boundary Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15 Specify Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . . 3-16 PDE Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18 PDE Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19 Mesh Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23 Solve Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25 Plot Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30 Additional Plot Control Options . . . . . . . . . . . . . . . . . . . . . . 3-34 Window Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-37 Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-37 The Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-38 iv Contents
4 The Finite Element Method The Elliptic Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 The Elliptic System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10 The Parabolic Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13 The Hyperbolic Equation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16 The Eigenvalue Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17 Nonlinear Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21 Adaptive Mesh Refinement . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26 The Error Indicator Function . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26 The Mesh Refiner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27 The Termination Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28 Fast Solution of Poisson’s Equation . . . . . . . . . . . . . . . . . . . . 4-29 v
5 Reference Commands Grouped by Function . . . . . . . . . . . . . . . . . . . . . . . 5-3 PDE Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 User Interface Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 Geometry Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 Plot Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 Utility Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5 User Defined Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7 Demonstration Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7 PDE Coefficients for Scalar Case . . . . . . . . . . . . . . . . . . . . . 5-20 PDE Coefficients for System Case . . . . . . . . . . . . . . . . . . . . 5-21 Boundary Condition Dialog Box . . . . . . . . . . . . . . . . . . . . . . 5-80 Model M-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-81 Index vi Contents
分享到:
收藏