MATLAB PARTIAL DIFFERENTIAL EQUATION TOOLBOX 1 Bedienungsanleitung Seite 6

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 18
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 5
6
MATLAB environment you will find p, e, and t in your workspace as matrices. To get more
information on how each of these variables contain mesh data refer to the online help for the
function initmesh. In particular, note that the t matrix contains information for each of the
triangles in the mesh and its second dimension can be used to determine how many elements are
in the mesh.
Solution
To solve the problem go to the Solve menu and select Solve PDE. After the PDE toolbox gives
you a plot of the temperature solution, export this solution for post-processing by going to the
Solve menu and selecting Export Solution. This will export the solution into the MATLAB
environment as the variable u that will be a vector whose length will be the same as the number
of nodes in the domain. For this problem, it will give the temperature at each node. Again, the
export step is not saved in your script file, so you will have to do it manually every time.
At this point you should save your file as a “.m” file. After it has been saved exit the PDE
toolbox and open up the file in the MATLAB editor. Notice that it is a list of all the functions
called in MATLAB by the PDE toolbox GUI to obtain the solution thus far. It is called a “script
file” simply indicating that it is a list of instructions. You can get back to where you exited the
PDE toolbox by typing the name of the file without the “.m” in the MATLAB Command
Window. Note that there are many comment lines and that all the functions called are described
in the help menu. Thus, you can edit the “.m” file to run different cases such as for different
boundary conditions or levels of mesh refinement.
Post-processing
Under the Plot menu, you can change the type and appearance of the plots displayed. For
example, when you go to the Plot menu and select Parameters, a color contour plot of
temperature is the default. Try changing the Colormap (I prefer ‘jet’) and updating the display by
selecting Plot from the Plot Selection dialog box. Also, try plotting heat flux vectors by selecting
Arrows from the Plot type: (note that you can leave Color selected to have the plots displayed
together) and heat flux from the Property: selections and again select Plot to redisplay.
The exported mesh and temperature data can now be manipulated from within the MATLAB
environment. Here is a list of some of the most useful functions along with a short description:
pdemesh(p, e, t) plots the mesh specified by the mesh data p, e, and t
pdeplot(p, e, t, ‘xydata’, u, ’colormap’, ’jet’, ’contour’, ’on’) displays the PDE solution u(x,y)
uxy = tri2grid(p, t, u, x, y) computes the values of u at the grid points defined by the vectors x
and y which you must define with increasing values. The result is a matrix of u values with
dimensions equal to the x-vector length by the y-vector length. Values are computed using
linear interpolation in the triangle containing the grid point. This is useful for comparing your
FEM results on an unstructured mesh to your finite difference results on a structured mesh.
Seitenansicht 5
1 2 3 4 5 6 7 8 9 10 11 ... 17 18

Kommentare zu diesen Handbüchern

Keine Kommentare