Elements of Matlab and Simulink Lecture 7

Similar documents
11.3 MATLAB for Partial Differential Equations

Partial Differential Equation Toolbox User s Guide. R2013a

Classification of partial differential equations and their solution characteristics

MATH 333: Partial Differential Equations

Solution of Differential Equation by Finite Difference Method

MAE/MSE502 Partial Differential Equations in Engineering. Spring 2019 Mon/Wed 6:00-7:15 PM Classroom: CAVC 101

Solving Pure Torsion Problem and Modelling Radionuclide Migration Using Radial Basis Functions

Solving Differential Equations on 2-D Geometries with Matlab

Discretization of PDEs and Tools for the Parallel Solution of the Resulting Systems

INTRODUCTION TO PDEs

Introduction to PDEs and Numerical Methods: Exam 1

PDEs, part 1: Introduction and elliptic PDEs

Comparison of an Analytical Method and Matlab to Model Electromagnetic Distribution in a Trough

LECTURE # 0 BASIC NOTATIONS AND CONCEPTS IN THE THEORY OF PARTIAL DIFFERENTIAL EQUATIONS (PDES)

Multiphysics Modeling

Spotlight on Laplace s Equation

Chapter 12 Partial Differential Equations

MAE502/MSE502 Partial Differential Equations in Engineering. Spring 2012 Mon/Wed 5:00-6:15 PM

WILEY. Differential Equations with MATLAB (Third Edition) Brian R. Hunt Ronald L. Lipsman John E. Osborn Jonathan M. Rosenberg

Math 126 Winter 2012: Rough lecture notes

Scientific Computing: An Introductory Survey

Applied Linear Algebra in Geoscience Using MATLAB

Introduction to PARTIAL DIFFERENTIAL EQUATIONS THIRD EDITION

Numerical Solutions to Partial Differential Equations

Index. C 2 ( ), 447 C k [a,b], 37 C0 ( ), 618 ( ), 447 CD 2 CN 2

ENGI 9420 Lecture Notes 8 - PDEs Page 8.01

Numerical Solution for Two Dimensional Laplace Equation with Dirichlet Boundary Conditions

CHAPTER 2. COULOMB S LAW AND ELECTRONIC FIELD INTENSITY. 2.3 Field Due to a Continuous Volume Charge Distribution

where is the Laplace operator and is a scalar function.

Numerical Methods for Partial Differential Equations: an Overview.

Introduction. Finite and Spectral Element Methods Using MATLAB. Second Edition. C. Pozrikidis. University of Massachusetts Amherst, USA

Table 17 1 Some general field equation terms. Heat Power. Current Source. 0 0 Boundary Current Porous Media Flow. Flow Source

A new 9-point sixth-order accurate compact finite difference method for the Helmholtz equation

A simple Galerkin boundary element method for three-dimensional crack problems in functionally graded materials

NUMERICAL MODELING OF TRANSIENT ACOUSTIC FIELD USING FINITE ELEMENT METHOD

Math 124A October 11, 2011

Numerical Methods for PDEs

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs

Fundamental Solutions and Green s functions. Simulation Methods in Acoustics

Block-Structured Adaptive Mesh Refinement

Module 7: The Laplace Equation

1 Solution of Electrostatics Problems with COM- SOL

PDE Solvers for Fluid Flow

ELECTROMAGNETISM. Volume 2. Applications Magnetic Diffusion and Electromagnetic Waves ASHUTOSH PRAMANIK

Problems of Corner Singularities

Electromagnetic wave propagation. ELEC 041-Modeling and design of electromagnetic systems

Finite Difference Method for PDE. Y V S S Sanyasiraju Professor, Department of Mathematics IIT Madras, Chennai 36

Introduction to Partial Differential Equations

Introduction to Partial Differential Equations

Numerical Solution Techniques in Mechanical and Aerospace Engineering

Altered Jacobian Newton Iterative Method for Nonlinear Elliptic Problems

Finite Element Modules for Enhancing Undergraduate Transport Courses: Application to Fuel Cell Fundamentals

Compact Local Stencils Employed With Integrated RBFs For Fourth-Order Differential Problems

Lecture6. Partial Differential Equations

The purpose of this lecture is to present a few applications of conformal mappings in problems which arise in physics and engineering.

Chapter 10. Applied projects on Differential Equations

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C.

Partial Differential Equations and Image Processing. Eshed Ohn-Bar

Second-Order Linear ODEs (Textbook, Chap 2)

2.29 Numerical Fluid Mechanics Spring 2015 Lecture 13

Mathématiques appliquées (MATH0504-1) B. Dewals, Ch. Geuzaine

An inverse problem for a system of steady-state reaction-diffusion equations on a porous domain using a collage-based approach

ADAM PIŁAT Department of Automatics, AGH University of Science and Technology Al. Mickiewicza 30, Cracow, Poland

Before we look at numerical methods, it is important to understand the types of equations we will be dealing with.

Lecture 1. Finite difference and finite element methods. Partial differential equations (PDEs) Solving the heat equation numerically

FDM for parabolic equations

Mathematics Qualifying Exam Study Material

Calculation of Sound Fields in Flowing Media Using CAPA and Diffpack

Numerically Solving Partial Differential Equations

Multigrid Method for 2D Helmholtz Equation using Higher Order Finite Difference Scheme Accelerated by Krylov Subspace

DISCRETE MAXIMUM PRINCIPLES in THE FINITE ELEMENT SIMULATIONS

Table of Contents. II. PDE classification II.1. Motivation and Examples. II.2. Classification. II.3. Well-posedness according to Hadamard

Chapter 5 Types of Governing Equations. Chapter 5: Governing Equations

AND NONLINEAR SCIENCE SERIES. Partial Differential. Equations with MATLAB. Matthew P. Coleman. CRC Press J Taylor & Francis Croup

The One Dimensional Heat Equation

Lecture Introduction

Finite Elements. Colin Cotter. January 15, Colin Cotter FEM

ENGI 4430 PDEs - d Alembert Solutions Page 11.01

Partial Differential Equations and the Finite Element Method

Video 15: PDE Classification: Elliptic, Parabolic and Hyperbolic March Equations 11, / 20

Relevant self-assessment exercises: [LIST SELF-ASSESSMENT EXERCISES HERE]

Partial Differential Equations. Examples of PDEs

Numerical Solutions of Partial Differential Equations

FINITE ELEMENT SOLUTION OF POISSON S EQUATION IN A HOMOGENEOUS MEDIUM

Module 1: Introduction to Finite Difference Method and Fundamentals of CFD Lecture 1: Finite Difference Method

21 Laplace s Equation and Harmonic Functions

Lecture 2. Introduction to FEM. What it is? What we are solving? Potential formulation Why? Boundary conditions

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF MATHEMATICS ACADEMIC YEAR / EVEN SEMESTER QUESTION BANK

AM 205: lecture 14. Last time: Boundary value problems Today: Numerical solution of PDEs

Introduction to Partial Differential Equation - I. Quick overview

Partial Differential Equations

One dimensional steady state diffusion, with and without source. Effective transfer coefficients

Chapter 1 Mathematical Foundations

Numerical Computation of Sturm-Liouville Problem with Robin Boundary Condition

AMS 529: Finite Element Methods: Fundamentals, Applications, and New Trends

Advanced numerical methods for nonlinear advectiondiffusion-reaction. Peter Frolkovič, University of Heidelberg

APPLIED PARTIAL DIFFERENTIAL EQUATIONS

5. FVM discretization and Solution Procedure

BOUNDARY-VALUE PROBLEMS IN RECTANGULAR COORDINATES

Elliptic Problems / Multigrid. PHY 604: Computational Methods for Physics and Astrophysics II

Transcription:

Elements of Matlab and Simulink Lecture 7 Emanuele Ruffaldi 12th May 2009 Copyright 2009,Emanuele Ruffaldi. This work is licensed under the Creative Commons Attribution-ShareAlike License.

PARTIAL DIFFERENTIAL EQUATIONS

Introducing PDE Ordinary Differential Equation Derivatives respect a single independent variable Solution is a function with arbitrary constants Partial Differential Equation Differential relationship of multiple variables Solution is an arbitrary function Solution determined by fixing boundary conditions Notation

Elements of a PDE Equation Domain Boundary Conditions

Heat Equation Heat (or diffusion) equation: models the diffusion of temperature from an initially concentrated distribution u_t = u_xx Example of solution is: u(x,t) = 1/sqrt(t) exp(-x^2/4*t) Verify using MATLAB Symbolic Toolbox >> Example lecture7_diffuse

Boundary Problem The Dirichlet problem is the general problem of finding a function u which solves a PDE for which the values are known on the boundary of a given region Given a PDE over R N Given a function f that has values over a boundary region of Ω Find a function u solving PDE that is differentiable twice in the interior and once on the boundary and assumes the values of f on the boundary The Neumann problem involves a boundary condition relative to a derivative of the target function Expressed as u_n

Heat Equation 2D Heat Equation 2D: diffusion of a quantity along the space and time u_t = u_xx + u_yy The general formulation is u_t = div grad u Example Metal block with a rectangular crack. The left side is heated at 100 degrees, the right side heat is flowing to air at constant rate. The others sides are insulated u = 100 (Dirichlet condition) u_n = -10 on the right side (Neumann condition) u_n = 0 on the other boundaries (Neumann condition)

Linear Advection Equation Linear advection equation: models the constant movement of an initial distribution of u with a speed of c along x axis. Shape is preserved u_t = c u_x For any function q a solution is q(w) where w = x+ct u(x,t) = q(w) = q(x+ct) >> Example lecture7_advection

Wave Equation Linear Wave u_tt = c^2 u_xx A typical solution is u(x,t)=sin(x+ct) Spherical Wave u_tt = c^2 (u_rr + 2/r u_r) If we put in evidence (ur) the solution is the same as above u(t,r) = 1/r [F(r-ct)+G(r+ct)] >> Example lecture7_wave

Laplace Equation Laplace Equation u_xx + u_yy = 0 Poisson Equation u_xx + u_yy = g(x,y,z) Helmholt s Equation u_xx + u_yy + f(x,y) u = g(x,y,z) Require boundary conditions for resolution

Basics of FEM How we can solve PDE numerically when no analytical solution is available? The Finite Element Method is the most common solution 1. Decompose the Domain in subspaces 2. Approximate the Function with piecewise linear function defined inside each subspace 3. Find the numerical solution for every subspace given the conditions FDM is the Finite Difference Method is possible but it works better with rectangular domains

FEM 1D Space discretization Interpolation Function Linear Combination (Basis)

FEM 2D Air Silicon Generalized approach by decomposing the domain in unit elements

Families of PDE and use Elliptic and Parabolic Steady and unsteady heat transfer in solids Flows in porous media and diffusion problems Electrostatics of dielectric and conductive media Potential flow Hyperbolic Transient and harmonic wave propagation in acoustics and electromagnetics Transverse motions of membranes Eigenvalue Determining natural vibration states in membranes and structural mechanics problems

MATLAB Partial Differential Equation Toolbox Solves some families of PDE: elliptics, parabolic, hyperbolic and eigenvalue PDE Toolbox works in the easiest way with 2D Boundary User Interface (pdetool) and Command line Steps 1. Define the Domain 2. Define the Boundary function 3. Solve 4. Plot results

Expressing the Geometry The boundary is expressed by Constructive Solid Geometry Set composition of fundamental entities The CSG allows to compose basic entities 1 3 2 4 -Graphical editing (pdetool) -initmesh and decsg -Understand CSG expression

Geometry as Mesh The FEM resolution uses a triangular mesh for the spatial discretization of the problem The Constructive Geometry produces a closed surface that is later transformed in Mesh Refine mesh for improving details on borders or surface features (number of triangles increases) Jiggle mesh (quality improves) Draw Mode Mesh Mode

Expressing the Boundary Conditions Two types of Boundary Conditions Dirichlet h u=r Neumann n c grad(u) + qu = g e.g. n c grad(u) = 0 means no flux Coefficients in bold can be specified with PDE tool Export Decomposed geometry and Boundary into Workspace variables

Resolution of PDE Solver function depend on the type of problem u1=parabolic(u0,tlist,b,p,e,t,c,a,f,d) u0 is the initial condition (sized as size(p,2)) tlist is the time in which let system evolve b boundary p,e,t geometry [c,a,f,d] parameters of Automatic Refinement of problem [u,p,e,t]=adaptmesh(g,b,c,a,f,options) The parabolic equation can be solved keeping time fixed and starting at given condition Time Discretization (stages) Method of lines Allows PDEs in Simulink

Heat Equation 2D Example Metal block with a rectangular crack. The left side is heated at 100 degrees, the right side heat is flowing to air at constant rate. The others sides are insulated u = 100 (left side) u_n = -10 on the right side u_n = 0 on the other boundaries u_t = u_xx + u_yy Create Domain Set Boundary conditions Set PDE Solve Test >> Example lecture7_heat2d_pde.m with pdetool

PDE for Simulink Simulink Solves ODE equations Use Method of Line for making the PDE an ODE problem We are interested in using the dynamic resolution of a PDE as part of our simulation Update the PDE parameters and inputs along time Integration performed by Simulink If using Discrete simulation we can let MATLAB do the math States One for every node PDE Problem Simulink Block Input Time depending Outputs Statitsics (max/min) Value at node

PDE in Simulink Practical We use S-Functions Level-2 Block Initialization The output is the state of the PDE that depends on the number of nodes of the Geometry Derivatives Update the Derivatives from the Method of Lines Output Computation Return statistics about the states, and eventually return sampled values from some nodes

Matrix Form of the FEM Basic Matrix Formulation Dirichlet Neumann Integrated Equation

Thermal Regulation Problem If the diffusion is fast there is no need for space information What if we want to use the exact position of the Thermostat? PDE is Parabolic Simulink just needs the Elliptic

Thermal Regulation PDE Geometry Boundary Walls: n grad(t)=0 Glass: n grad(t)=q (u(1)-t) Where u(1) is exterior temperature, T is the internal temperature and q is the thermal conductivity Equation T' = div( K grad(t) ) + Th u(2) u(2) is the heater on or off Th is the function of heat flow from the heater based on its position

Thermal Regulation Simulink The solution for this integration is an S-Function written as M-file Parameters Coordinates of Heater xh,yh and Radius Node of the Thermostat Initial Temperature T0 Heater Temperature Th Input State of the Heater External Temperature Output State of the Heater Maximum Temperature in Room Temperature at Thermostat

References Books An Introduction to Partial Differential Equations with MATLAB,Coleman M., CRC Press, 2005 Introduction to Partial Differential Equations with MATLAB, Cooper J.M., Birkhause, 1998 Beginners Guide to Simulation for Physical Engineering: Practical Usage of MATLAB and PDEase, Yutaka Abe, 1999 Courses Introduction to Partial Differential Equations, Doug Moore, 2003 Introduction to Partial Differential Equations, Showalter, Oregon State University MAE502 Partial Differential Equations in Engineering, ASU,2009