Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Support for Dymola in the Modeling and Simulation of Physical Systems.

Slides:



Advertisements
Similar presentations
PARMA UNIVERSITY SIMULATIONS OF THE ISOLATED BUILDING TEST CASE F. AURELI, A. MARANZONI & P. MIGNOSA DICATeA, Parma University Parco Area delle Scienze.
Advertisements

Plausible motion simulation Ronen Barzel (on leave from PIXAR) John Hughes (on sabbatical from Brown)
Partial Differential Equations (PDEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE Daniel Baur ETH Zurich, Institut für Chemie-
Chapter 8 Elliptic Equation.
Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 World3 in Modelica: Creating System Dynamics Models in the Modelica Framework.
P. Venkataraman Mechanical Engineering P. Venkataraman Rochester Institute of Technology DETC2013 – 12269: Continuous Solution for Boundary Value Problems.
Start Presentation November 8, 2012 Planar Mechanics We shall now look at a first application of multi- bond graphs: planar mechanics. We shall notice.
Chapter 13 MIMs - Mobile Immobile Models. Consider the Following Case You have two connected domains that can exchange mass
1 Predator-Prey Oscillations in Space (again) Sandi Merchant D-dudes meeting November 21, 2005.
The Dymola Bond Graph Library
Nazgol Haghighat Supervisor: Prof. Dr. Ir. Daniel J. Rixen
Fourier Transforms - Solving the Diffusion Equation.
Wrapping Multi-bond Graphs: A Structured Approach to Modeling Complex Multi-body Dynamics François E. Cellier and Dirk Zimmer ETH Zürich.
Quantized State System Simulation in Dymola/Modelica Using the DEVS Formalism Tamara Beltrame VTT, Industrial Systems PO Box 1000, VM Espoo, Finland.
Dirk Zimmer François E. Cellier Institute of Computational Science Department of Computer Science ETH Zürich A bondgraphic modeling tool and its application.
Start Presentation Eurosim 2007, Ljubljana September 10, 2007 Electronic Circuit Modeling and Simulation in Modelica François E. Cellier ETH Zürich, Switzerland.
Object-oriented Modeling of Mechatronics Systems in Modelica Using Wrapped Bond Graphs François E. Cellier and Dirk Zimmer ETH Zürich.
Start of Presentation © Prof. Dr. François E. Cellier 3 rd MODPROD Workshop – Keynote February 4, 2009 Technologies for Creating Easily Maintainable Component.
François E. Cellier and Matthias Krebs
Chapter 1 Introduction to Object- Oriented Programming and Problem Solving.
Start of Presentation Maple soft Conference 2006 The Need for Formulae Manipulation in the Object-oriented Modeling of Physical Systems François E. Cellier,
Chapter 4 Numerical Solutions to the Diffusion Equation.
Numerical Schemes for Advection Reaction Equation Ramaz Botchorishvili Faculty of Exact and Natural Sciences Tbilisi State University GGSWBS,Tbilisi, July.
Chapter 12: Simulation and Modeling Invitation to Computer Science, Java Version, Third Edition.
Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Lecture 9 Instructor: Tim Warburton.
CHAPTER 8 APPROXIMATE SOLUTIONS THE INTEGRAL METHOD
Numerical methods for PDEs PDEs are mathematical models for –Physical Phenomena Heat transfer Wave motion.
© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
Start Presentation November 29, th Homework – Solution In this homework, we shall attempt the modeling of a planar mechanical system. We shall.
1 Web Based Interface for Numerical Simulations of Nonlinear Evolution Equations Ryan N. Foster & Thiab Taha Department of Computer Science The University.
Chapter 12: Simulation and Modeling
Finite Differences Finite Difference Approximations  Simple geophysical partial differential equations  Finite differences - definitions  Finite-difference.
1 Chapter No 3 ICT IN Science,Maths,Modeling, Simulation.
Start Presentation November 22, th Homework In this homework, we shall attempt the modeling of a planar mechanical system. We shall do so once.
Start Presentation October 25, 2012 Thermal Modeling of Buildings This lecture deals with the model of a space heating system of a building by means of.
Start PresentationSeptember 21, 2009 Modeling Chemical Reactions in Modelica By Use of Chemo-bonds Prof. Dr. François E. Cellier Department of Computer.
A Spring 2005 CS 426 Senior Project By Group 15 John Studebaker, Justin Gerthoffer, David Colborne CSE Dept., University of Nevada, Reno Advisors (CSE.
MathCore Engineering AB Experts in Modeling & Simulation WTC.
Partial Differential Equations Finite Difference Approximation.
1 Spring 2003 Prof. Tim Warburton MA557/MA578/CS557 Lecture 5a.
Discontinuous Galerkin Methods and Strand Mesh Generation
Lecture 3.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Discontinuous Galerkin Methods Li, Yang FerienAkademie 2008.
Discontinuous Galerkin Methods for Solving Euler Equations Andrey Andreyev Advisor: James Baeder Mid.
7. Introduction to the numerical integration of PDE. As an example, we consider the following PDE with one variable; Finite difference method is one of.
Akram Bitar and Larry Manevitz Department of Computer Science
Engineering Analysis – Computational Fluid Dynamics –
Introduction to MATLAB 7 MATLAB Programming for Engineer Hassan Migdadi Spring 2013.
Start Presentation November 1, 2012 Treatment of Discontinuities II We shall today once more look at the modeling of discontinuous systems. First, an additional.
1 Advanced Finite Difference Methods for Financial Instrument Pricing Core Processes PDE theory in general Applications to financial engineering State.
Final Project Topics Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Partial Derivatives Example: Find If solution: Partial Derivatives Example: Find If solution: gradient grad(u) = gradient.
Multi-bond Graphs We shall today look at vectors of bonds, called multi-bonds. Especially when dealing with 2D and 3D mechanics, the d’Alembert principle.
Start Presentation October 4, 2012 Efficient Solution of Equation Systems This lecture deals with the efficient mixed symbolic/numeric solution of algebraically.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
An Introduction to Computational Fluids Dynamics Prapared by: Chudasama Gulambhai H ( ) Azhar Damani ( ) Dave Aman ( )
Computational Fluid Dynamics Lecture II Numerical Methods and Criteria for CFD Dr. Ugur GUVEN Professor of Aerospace Engineering.
EEE 431 Computational Methods in Electrodynamics
Numerical Solutions to the Diffusion Equation
Chapter 12: Simulation and Modeling
EEE 431 Computational Methods in Electrodynamics
Chapter 30.
Objectives of the Presentation
Convergence in Computational Science
Objective of This Course
Comparison of CFEM and DG methods
6th Lecture : Numerical Methods
Akram Bitar and Larry Manevitz Department of Computer Science
Presentation transcript:

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Support for Dymola in the Modeling and Simulation of Physical Systems with Distributed Parameters Farid Dshabarow ABB Turbo Systems, Switzerland François E. Cellier ETH Zürich, Switzerland Dirk Zimmer ETH Zürich, Switzerland

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 History of General Purpose PDE Solvers In the 1970s, a number of general-purpose PDE solvers for parabolic and hyperbolic PDEs in one and two space dimensions were developed. The most versatile among those was FORSIM VI, a FORTRAN library for simulating such systems. FORSIM was based on the Method of Lines, a technique that discretizes the spatial axes of a PDE, while leaving the time axis continuous, thereby converting a PDE into a set of ODEs.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 History of General Purpose PDE Solvers II FORSIM VI offered a set of FORTRAN subroutines that the user could call for computing approximations of spatial derivatives and for integrating the resulting ODE system over time. The tool was versatile but not user-friendly. It was versatile, because it offered the user all of the tools that s/he needed for solving a PDE problem, but it wasn’t user-friendly, because it forced the user to manually decompose the problem down to a fairly low level. Other tools, such as PDEL and LEANS III offered higher- level interfaces, but this came at the price of these tools being more specialized tools that could only solve problems belonging to predefined sets of PDEs.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 History of General Purpose PDE Solvers III In the long run, none of these tools survived, because engineers wanted to solve more and more complex problems, and neither of these tools were versatile and/or efficient enough to do so. Consequently, most engineers and physicists created their own spaghetti codes written for solving one particular PDE problem only in as efficient a manner as possible. Evidently, this caused a lot of duplication of very similar code segments that were rewritten by many programmers over and over again, and ultimately, it must be recognized that this approach is wasteful in terms of human resource utilization.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 History of General Purpose PDE Solvers IV Only quite recently, a renaissance of general-purpose PDE codes could be observed. The best and most advanced among these second-generation codes is FEMLAB (COMSOL). FEMLAB essentially copied the approach taken earlier by PDEL and LEANS III, i.e., it offers solutions to a pre- defined set of PDE problems that are being parameterized to allow a user access to this tool who knows very little about the properties of numerical PDE solvers. Compared to the earlier tools, FEMLAB offers a much improved user interface with neat graphing capabilities. The code has been rather successful and is being widely accepted as the state of the art in numerical PDE technology.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 PDELib We chose to take the other route and re-implement facets of FORSIM VI in Dymola/Modelica, making use of the built-in matrix manipulation capabilities of Modelica and the graphical user interface of Dymola. In this way, simple PDE problems can be coded graphically without forcing the user to write any programming code directly. Of course, we pay a heavy price in that users of PDELib will have to be somewhat knowledgeable about the algorithms underlying numerical PDE solvers.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 PDELib II Yet, the object-oriented nature of Modelica allows to wrap PDELib codes, offering a “mathematical” user interface, into higher-level abstractions, promoting a “physical” user interface. At that higher level of abstraction, users won’t need to understand the underlying numerical algorithms any longer. Yet, as these higher-level codes will be mapped onto PDELib first, maintaining these higher-level codes will be much easier than if these higher-level codes were programmed in C++ directly, for example. Due to the symbolic formulae manipulation techniques offered by tools such as Dymola, the resulting codes can be made to run as efficiently as any hand-written spaghetti codes of the past.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Method of Lines Let us explain by means of a simple example how the method of lines operates. Given the 1D diffusion equation: The method of lines discretizes the space dimension: leading to:

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Method of Lines II Programmed in PDELib:

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Simulation Results The spatial axis had been discretized into 40 segments. The numerical solution is compared to the analytical solution. With 40 segments, the results are not yet highly accurate. Dymola doesn’t offer nifty 3D graphics capabilities yet. The results could have been exported to MATLAB for graphing, but we chose not to do so.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Finite Volume Method A second method implemented in PDELib is the Finite Volume method. It works as follows. The space gets subdivided into a finite number of cells. The i th cell can be written as: The average value of the solution u(t) for this cell can be written as: Mass conservation can be written as: where f(t) is the flux function.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Finite Volume Method II We integrate: from t to t+  t, and divide by  t and by  x:

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Finite Volume Method III With the abbreviation: we can rewrite as follows: which can be reinterpreted as: In this way, we have once again converted a PDE to a set of ODEs. The only remaining question is how we approximate the average flux values.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Advection Equation advection equationinitial conditionboundary condition Method of Lines Finite Volume Method

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Simulation Results Method of Lines Finite Volume Method

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Burger’s Equation Burger’s equationinitial conditionboundary conditions Method of Lines Finite Volume Method

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Simulation Results Method of Lines Finite Volume Method The MoL solution is more accurate, but less stable. With 10 segments, the solution remains stable, but is very inaccurate. With 20 segments, it is more accurate, but turns unstable after 0.6 sec. With 40 segments, it is always unstable. The FVM solution is less accurate, but remains numerically stable for an arbitrarily large number of segments. Hence a numerically accurate solution can be obtained using sufficiently many segments.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 MoL vs. FVM The method of lines works well for parabolic PDEs. It has a tendency to lead to numerically unstable solutions in the case of hyperbolic PDEs, unless a geometric integration algorithm is being used (not currently available in Dymola). The MoL solution of hyperbolic PDEs can frequently be stabilized also by use of an upwind discretization scheme. The finite volume method is not as straightforward. However, it can be stabilized more easily. The FVM was designed for hyperbolic PDEs primarily. Whereas the method can sometimes be abused to solve parabolic PDEs as well, the user has no reason to do so.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Conclusions The first release of PDELib only considers parabolic and hyperbolic PDEs in a single space dimension. Later versions will extend the tool to 2D and 3D problems also. However, this requires finite element approximations in space, which haven’t been implemented yet (similar to what FEMLAB does). Whereas 1D problems lead to ODE sets in a few dozen ODEs, 2D problems quickly lead to thousands of ODEs, and 3D problems almost immediately lead to problems with several hundreds of thousands of ODEs. Hence efficiency matters. Boundary conditions are much more difficult to satisfy in 2D and 3D problems.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 Conclusions II At the current time, PDELib is only a test bed implementation. It can be used for solving toy problems, and also for teaching purposes, but not yet for solving real engineering problems as they need to be solved in practice. Future versions shall enhance the tool, as well as offer higher-level (physical layer) abstractions for dealing with complex problems in a more user- friendly fashion.

Start Presentation Conference 2008 © Prof. Dr. François E. Cellier March 4, 2008 References Dshabarow, F. (2007), Support for Dymola in the Modeling and Simulation of Physical Systems with Distributed Parameters, MS Thesis, Department of Computer Science, ETH Zurich, Switzerland.Support for Dymola in the Modeling and Simulation of Physical Systems with Distributed Parameters