Lab - Introduction to Finite Element Methods and MATLAB s PDEtoolbox

Similar documents
Partial Differential Equation Toolbox

Partial Differential Equation Toolbox User s Guide. R2011b

Digests from his work is presented in this chapter partly rewritten/restructured

LAB 4: Introduction to MATLAB PDE Toolbox and SolidWorks Simulation

Tutorial 3: Constructive Editing (2D-CAD)

3D AUTOCAD. The view we ve been working in is a top or plan view. From this view even a 3D drawing will appear 2D.

How to create shapes. Drawing basic shapes. Adobe Photoshop Elements 8 guide

Chapter 2 Surfer Tutorial

AutoCAD 2009 Configuration for MUS

Exercise Guide. Published: August MecSoft Corpotation

Digitizing and Editing Polygons in the STS Gypsy Moth Project. M. Dodd 2/10/04

Generating Vectors Overview

QuickTutor. An Introductory SilverScreen Modeling Tutorial. Solid Modeler

Assignment in The Finite Element Method, 2017

Paint/Draw Tools. Foreground color. Free-form select. Select. Eraser/Color Eraser. Fill Color. Color Picker. Magnify. Pencil. Brush.

PLAY VIDEO. Fences can be any shape from a simple rectangle to a multisided polygon, even a circle.

MET 107 Drawing Tool (Shapes) Notes Day 3

Appendix B: Creating and Analyzing a Simple Model in Abaqus/CAE

Objectives This tutorial demonstrates how to use feature objects points, arcs and polygons to make grid independent conceptual models.

Technique or Feature Where Introduced

form are graphed in Cartesian coordinates, and are graphed in Cartesian coordinates.

Adobe InDesign CS6 Tutorial

Press the Plus + key to zoom in. Press the Minus - key to zoom out. Scroll the mouse wheel away from you to zoom in; towards you to zoom out.

Ansoft HFSS Windows Screen Windows. Topics: Side Window. Go Back. Contents. Index

L E S S O N 2 Background

GstarCAD Complete Features Guide

CECOS University Department of Electrical Engineering. Wave Propagation and Antennas LAB # 1

2D & 3D Finite Element Method Packages of CEMTool for Engineering PDE Problems

Let s Make a Front Panel using FrontCAD

This is the opening view of blender.

Adobe PageMaker Tutorial

Spring 2011 Workshop ESSENTIALS OF 3D MODELING IN RHINOCEROS February 10 th 2011 S.R. Crown Hall Lower Core Computer Lab

The Department of Construction Management and Civil Engineering Technology CMCE-1110 Construction Drawings 1 Lecture Introduction to AutoCAD What is

The Villa Savoye ( ), Poisy, Paris.

Introduction to FEM calculations

Lesson 1: Creating T- Spline Forms. In Samples section of your Data Panel, browse to: Fusion 101 Training > 03 Sculpt > 03_Sculpting_Introduction.

Part 1: Basics. Page Sorter:

Tutorial 01 Quick Start Tutorial

3D ModelingChapter1: Chapter. Objectives

JASCO CANVAS PROGRAM OPERATION MANUAL

Case Study 1: Piezoelectric Rectangular Plate

Mesh Quality Tutorial

GeoGebra. 10 Lessons. maths.com. Gerrit Stols. For more info and downloads go to:

VIEWZ 1.3 USER MANUAL

For more info and downloads go to: Gerrit Stols

Custom Components for Precast Concrete Tekla Structures 12.0 Basic Training September 19, 2006

Guide to WB Annotations

Lesson 5 Solid Modeling - Constructive Solid Geometry

Basic Modeling 1 Tekla Structures 12.0 Basic Training September 19, 2006

ezimagex2 User s Guide Version 1.0

Randy H. Shih. Jack Zecher PUBLICATIONS

Autodesk Inventor Design Exercise 2: F1 Team Challenge Car Developed by Tim Varner Synergis Technologies

SETTING UP A. chapter

Module 4A: Creating the 3D Model of Right and Oblique Pyramids

EDITING SHAPES. Lesson overview

CREATING DESMOS ETOOLS

Acknowledgement INTRODUCTION

LAB # 2 3D Modeling, Properties Commands & Attributes

Exercise 1: Introduction to MapInfo

Module 5: Creating Sheet Metal Transition Piece Between a Square Tube and a Rectangular Tube with Triangulation

Xyron Wishblade Software Manual (PC)

FSA Algebra 1 EOC Practice Test Guide

v Overview SMS Tutorials Prerequisites Requirements Time Objectives

Adobe Photoshop Sh S.K. Sublania and Sh. Naresh Chand

solidthinking Environment...1 Modeling Views...5 Console...13 Selecting Objects...15 Working Modes...19 World Browser...25 Construction Tree...

Autodesk Fusion 360: Model. Overview. Modeling techniques in Fusion 360

Paint Tutorial (Project #14a)

Use the Move tool to drag A around and see how the automatically constructed objects (like G or the perpendicular and parallel lines) are updated.

The Rectangular Problem

A QUICK TOUR OF ADOBE ILLUSTRATOR CC (2018 RELEASE)

Graphing Calculator Tutorial

Vectorworks Essential Tutorial Manual by Jonathan Pickup. Sample

Lesson 1 Parametric Modeling Fundamentals

ROSE-HULMAN INSTITUTE OF TECHNOLOGY

A Guide to Autodesk Maya 2015

3 AXIS STANDARD CAD. BobCAD-CAM Version 28 Training Workbook 3 Axis Standard CAD

Xyron Wishblade Software Manual (Mac)

Quickstart for Web and Tablet App

COMPUTER AIDED ARCHITECTURAL GRAPHICS FFD 201/Fall 2013 HAND OUT 1 : INTRODUCTION TO 3D

Spreadsheet View and Basic Statistics Concepts

2. Getting Started When you start GeoGebra, you will see a version of the following window. 1

StickFont Editor v1.01 User Manual. Copyright 2012 NCPlot Software LLC

AutoCAD 2009 Tutorial

Quickstart for Desktop Version

Firstly, I would like to thank ProFantasy for hosting this tutorial on the RPGMaps Blog. Thank you!

Impress Guide Chapter 11 Setting Up and Customizing Impress

Recipes4Success. Draw and Animate a Rocket Ship. Frames 5 - Drawing Tools

Adding Objects Creating Shapes Adding. Text Printing and Exporting Getting Started Creating a. Creating Shapes Adding Text Printing and Exporting

Quick Tips to Using I-DEAS. Learn about:

TUTORIAL 2. OBJECTIVE: Use SolidWorks/COSMOS to model and analyze a cattle gate bracket that is subjected to a force of 100,000 lbs.

Google SketchUp. and SketchUp Pro 7. The book you need to succeed! CD-ROM Included! Kelly L. Murdock. Master SketchUp Pro 7 s tools and features

Simulink Basics Tutorial

Geogebra Introductory Activity

Adobe Illustrator CC 2018 Tutorial

Draw Guide. Chapter 3 Working with Objects and Object Points

Creating a Title Block & Border Using Chief Architect. Architectural Design & Residential Construction Penncrest High School

Introduction to Electrostatic FEA with BELA

Word 2003: Flowcharts Learning guide

Controlling the Control Palette

4 TRANSFORMING OBJECTS

Transcription:

Scientific Computing III 1 (15) Institutionen för informationsteknologi Beräkningsvetenskap Besöksadress: ITC hus 2, Polacksbacken Lägerhyddsvägen 2 Postadress: Box 337 751 05 Uppsala Telefon: 018 471 0000 (växel) Telefax: 018 51 19 25 Hemsida: http:/www.it.uu.se/ Department of Information Technology Division of Scientific Computing Visiting address: ITC bldg 2, Polacksbacken Lägerhyddsvägen 2 Postal address: Box 337 SE-751 05 Uppsala SWEDEN Telephone: +46 18 471 0000 (switch) Telefax: +46 18 51 19 25 Web page: http:/www.it.uu.se/ Lab - Introduction to Finite Element Methods and MATLAB s PDEtoolbox Using the finite element method to compute solution to partial differential equations Consider the following partial differential equation (Poisson s equation), u(x; y) = f(x; y); (x; y) 2 Ω; (1) u(x; y) = r(x; y); (x; y) 2 @Ω: The computational domain Ω is a bounded domain in the xy-plane. For a given domain Ω, source term f(x; y) and boundary condition r(x; y), in general this problem has no analytical solution. Instead we use numerical approximations, in this case the finite element method (FEM). One of the most important features of finite element methods is that they are based on unstructured grids. (Finite difference methods use structured grids.) This means that FEM is more flexible with respect to the geometry. For example, in two dimensions, we don t need the computational domain Ω to be rectangular or something that can be mapped onto a rectangle. A FEM solution to problem (1) has the general form u h (x; y) = NX j=1 c j j (x; y); (2) where c j are coefficients and j (x; y) are basis functions. The subscript h refers to the mesh that was used and is computed as the largest distance between two neighboring points in the mesh. The coefficients c j are found by solving a linear system of equations. (The theory for assembling the linear system of equations will be discussed in detail in the coming lectures.) An example of an unstructured mesh and one basis function j (x; y) are shown in the figures below. Basis functions can be of different types. The type shown below is called a linear hat function. These functions are piecewise linear and have the value 1 at one node and 0 at all other nodes. The solution 2 will then be piecewise linear in the domain Ω and the corresponding linear system of equations will be of size N N where N is the number of nodes in the mesh.

2 (15) 1 Mesh with h = 0.17583 0.5 y 0 0.5 1 1 0.5 0 0.5 1 x A linear hat function 1 0.5 0 1 0.5 0 y 0.5 1 1 0.5 x 0 0.5 1 Using MATLAB PDEtoolbox MATLAB s PDEtoolbox is based on the finite element method to solve partial differential equations. The following pages are copied from MAT- LAB s user guide. Work through the given example in MATLAB.

Poisson s Equation with Complex 2-D Geometry Poisson s Equation with Complex 2-D Geometry This example shows how to solve the Poisson's equation, Δu = f using the PDE app. This problem requires configuring a 2-D geometry with Dirichlet and Neumann boundary conditions. To start the PDE app, type the command pdetool at the MATLAB prompt. The PDE app looks similar to the following figure, with exception of the grid. Turn on the grid by selecting Grid from the Options menu. Also, enable the snap-to-grid feature by selecting Snap from the Options menu. The snap-to-grid feature simplifies aligning the solid objects. 1-11

1 Getting Started The first step is to draw the geometry on which you want to solve the PDE. The PDE app provides four basic types of solid objects: polygons, rectangles, circles, and ellipses. The objects are used to create a Constructive Solid Geometry model (CSG model). Each solid object is assigned a unique label, and by the use of set algebra, the resulting geometry can be made up of a combination of unions, intersections, and set differences. By default, the resulting CSG model is the union of all solid objects. To select a solid object, either click the button with an icon depicting the solid object that you want to use, or select the object by using the Draw pull-down menu. In this case, rectangle/square objects are selected. To draw a rectangle or a square starting at a corner, click the rectangle button without a + sign in the middle. The button with the + sign is used when you want to draw starting at the center. Then, put the cursor at the desired corner, and click-and-drag using the left mouse button to create a rectangle with the desired side lengths. (Use the right mouse button to create a square.) Click and drag from ( 1,.2) to (1,.2). Notice how the snap-to-grid feature forces the rectangle to line up with the grid. When you release the mouse, the CSG model is updated and redrawn. At this stage, all you have is a rectangle. It is assigned the label R1. If you want to move or resize the rectangle, you can easily do so. Click-and-drag an object to move it, and doubleclick an object to open a dialog box, where you can enter exact location coordinates. From the dialog box, you can also alter the label. If you are not satisfied and want to restart, you can delete the rectangle by clicking the Delete key or by selecting Clear from the Edit menu. Next, draw a circle by clicking the button with the ellipse icon with the + sign, and then click-and-drag in a similar way, starting near the point (.5,0) with radius.4, using the right mouse button, starting at the circle center. 1-12

Poisson s Equation with Complex 2-D Geometry The resulting CSG model is the union of the rectangle R1 and the circle C1, described by set algebra as R1+C1. The area where the two objects overlap is clearly visible as it is drawn using a darker shade of gray. The object that you just drew the circle has a black border, indicating that it is selected. A selected object can be moved, resized, copied, and deleted. You can select more than one object by Shift+clicking the objects that you want to select. Also, a Select All option is available from the Edit menu. Finally, add two more objects, a rectangle R2 from (.5,.6) to (1,1), and a circle C2 centered at (.5,.2) with radius.2. The desired CSG model is formed by subtracting the circle C2 from the union of the other three objects. You do this by editing the set formula that by default is the union of all objects: C1+R1+R2+C2. You can type any other valid set formula into Set formula edit field. Click in the edit field and use the keyboard to change the set formula to 1-13

1 Getting Started (R1+C1+R2)-C2 If you want, you can save this CSG model as a file. Use the Save As option from the File menu, and enter a filename of your choice. It is good practice to continue to save your model at regular intervals using Save. All the additional steps in the process of modeling and solving your PDE are then saved to the same file. This concludes the drawing part. You can now define the boundary conditions for the outer boundaries. Enter the boundary mode by clicking the Ω icon or by selecting Boundary Mode from the Boundary menu. You can now remove subdomain borders and define the boundary conditions. The gray edge segments are subdomain borders induced by the intersections of the original solid objects. Borders that do not represent borders between, e.g., areas with 1-14

Poisson s Equation with Complex 2-D Geometry differing material properties, can be removed. From the Boundary menu, select the Remove All Subdomain Borders option. All borders are then removed from the decomposed geometry. The boundaries are indicated by colored lines with arrows. The color reflects the type of boundary condition, and the arrow points toward the end of the boundary segment. The direction information is provided for the case when the boundary condition is parameterized along the boundary. The boundary condition can also be a function of x and y, or simply a constant. By default, the boundary condition is of Dirichlet type: u = 0 on the boundary. Dirichlet boundary conditions are indicated by red color. The boundary conditions can also be of a generalized Neumann (blue) or mixed (green) type. For scalar u, however, all boundary conditions are either of Dirichlet or the generalized Neumann type. You select the boundary conditions that you want to change by clicking to select one boundary segment, by Shift+clicking to select multiple segments, or by using the Edit menu option Select All to select all boundary segments. The selected boundary segments are indicated by black color. For this problem, change the boundary condition for all the circle arcs. Select them by using the mouse and Shift+click those boundary segments. 1-15

1 Getting Started Double-clicking anywhere on the selected boundary segments opens the Boundary Condition dialog box. Here, you select the type of boundary condition, and enter the boundary condition as a MATLAB expression. Change the boundary condition along the selected boundaries to a Neumann condition, u/ n = 5. This means that the solution has a slope of 5 in the normal direction for these boundary segments. In the Boundary Condition dialog box, select the Neumann condition type, and enter -5 in the edit box for the boundary condition parameter g. To define a pure Neumann condition, leave the q parameter at its default value, 0. When you click the OK button, notice how the selected boundary segments change to blue to indicate Neumann boundary condition. 1-16

Poisson s Equation with Complex 2-D Geometry Next, specify the PDE itself through a dialog box that is accessed by clicking the button with the PDE icon or by selecting PDE Specification from the PDE menu. In PDE mode, you can also access the PDE Specification dialog box by double-clicking a subdomain. That way, different subdomains can have different PDE coefficient values. This problem, however, consists of only one subdomain. In the dialog box, you can select the type of PDE (elliptic, parabolic, hyperbolic, or eigenmodes) and define the applicable coefficients depending on the PDE type. This problem consists of an elliptic PDE defined by the equation - ( c u)+ au = f, with c = 1.0, a = 0.0, and f = 10.0. 1-17

1 Getting Started Finally, create the triangular mesh that Partial Differential Equation Toolbox software uses in the Finite Element Method (FEM) to solve the PDE. The triangular mesh is created and displayed when clicking the button with the icon or by selecting the Mesh menu option Initialize Mesh. If you want a more accurate solution, the mesh can be successively refined by clicking the button with the four triangle icon (the Refine button) or by selecting the Refine Mesh option from the Mesh menu. Using the Jiggle Mesh option, the mesh can be jiggled to improve the triangle quality. Parameters for controlling the jiggling of the mesh, the refinement method, and other mesh generation parameters can be found in a dialog box that is opened by selecting Parameters from the Mesh menu. You can undo any change to the mesh by selecting the Mesh menu option Undo Mesh Change. Initialize the mesh, then refine it once and finally jiggle it once. 1-18

Poisson s Equation with Complex 2-D Geometry We are now ready to solve the problem. Click the = button or select Solve PDE from the Solve menu to solve the PDE. The solution is then plotted. By default, the plot uses interpolated coloring and a linear color map. A color bar is also provided to map the different shades to the numerical values of the solution. If you want, the solution can be exported as a vector to the MATLAB main workspace. 1-19

1 Getting Started There are many more plot modes available to help you visualize the solution. Click the button with the 3-D solution icon or select Parameters from the Plot menu to access the dialog box for selection of the different plot options. Several plot styles are available, and the solution can be plotted in the PDE app or in a separate figure as a 3-D plot. 1-20

Poisson s Equation with Complex 2-D Geometry Now, select a plot where the color and the height both represent u. Choose interpolated shading and use the continuous (interpolated) height option. The default colormap is the cool colormap; a pop-up menu lets you select from a number of different colormaps. Finally, click the Plot button to plot the solution; click the Close button to save the plot setup as the current default. The solution is plotted as a 3-D plot in a separate figure window. The following solution plot is the result. You can use the mouse to rotate the plot in 3- D. By clicking-and-dragging the axes, the angle from which the solution is viewed can be changed. 1-21

1 Getting Started 1-22

15 (15) Extra To learn to use the toolbox and to get some feeling of how the PDE behaves, play around with the model; change coefficients in the PDE, boundary conditions and geometry. View different plots of the solution.