ME451 Kinematics and Dynamics of Machine Systems Numerical Integration. Stiffness: Implicit Methods. October 30, 2013 Radu Serban University of Wisconsin-Madison.

Slides:



Advertisements
Similar presentations
Lecture on Numerical Analysis Dr.-Ing. Michael Dumbser
Advertisements

MATLAB EXAMPLES Initial-value problems
Ordinary Differential Equations
1cs542g-term Notes  Notes for last part of Oct 11 and all of Oct 12 lecture online now  Another extra class this Friday 1-2pm.
1cs542g-term Notes  Final exam: December 10, 10am-1pm X736 (CS Boardroom)  Another extra class this Friday 1-2pm.
Total Recall Math, Part 2 Ordinary diff. equations First order ODE, one boundary/initial condition: Second order ODE.
PART 7 Ordinary Differential Equations ODEs
CSE245: Computer-Aided Circuit Simulation and Verification Lecture Note 5 Numerical Integration Spring 2010 Prof. Chung-Kuan Cheng 1.
Efficient Simulation of Physical System Models Using Inlined Implicit Runge-Kutta Algorithms Vicha Treeaporn Department of Electrical & Computer Engineering.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
University of Colorado Boulder ASEN 5070: Statistical Orbit Determination I Fall 2014 Professor Brandon A. Jones Lecture 7: Linearization and the State.
Ordinary Differential Equations (ODEs)
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Daniel Baur ETH Zurich, Institut.
ME451 Kinematics and Dynamics of Machine Systems Dynamics of Planar Systems Tuesday, November 30, 2010 Numerical Solution of IVPs [not in the book] © Dan.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Numerical Solution of Ordinary Differential Equation
MATH 685/ CSI 700/ OR 682 Lecture Notes Lecture 10. Ordinary differential equations. Initial value problems.
MATLAB Ordinary Differential Equations – Part I Greg Reese, Ph.D Research Computing Support Group Academic Technology Services Miami University September.
1 Chapter 6 Numerical Methods for Ordinary Differential Equations.
ME751 Advanced Computational Multibody Dynamics Implicit Integration Methods BDF Methods Handling Second Order EOMs April 06, 2010 © Dan Negrut, 2010 ME751,
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Daniel Baur ETH Zurich, Institut.
ME451 Kinematics and Dynamics of Machine Systems Initial Conditions for Dynamic Analysis Constraint Reaction Forces October 23, 2013 Radu Serban University.
ME451 Kinematics and Dynamics of Machine Systems Newton-Raphson Method October 04, 2013 Radu Serban University of Wisconsin-Madison.
Numerical Solutions to ODEs Nancy Griffeth January 14, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis.
DIFFERENTIAL EQUATIONS, INTEGRATION, POLYNOMIALS, RANDOM NUMBERS MEKANIKA SOFTWARE SEMINARS.
ME451 Kinematics and Dynamics of Machine Systems Dynamics of Planar Systems November 29, 2011 Elements of the Numerical Solution of the Dynamics Problem.
Erin Catto Blizzard Entertainment Numerical Integration.
ME451 Kinematics and Dynamics of Machine Systems
ME451 Kinematics and Dynamics of Machine Systems Numerical Solution of DAE IVP Newmark Method November 1, 2013 Radu Serban University of Wisconsin-Madison.
ME451 Kinematics and Dynamics of Machine Systems Dynamics of Planar Systems December 1, 2011 Solving Index 3 DAEs using Newmark Method © Dan Negrut, 2011.
Modelling & Simulation of Chemical Engineering Systems Department of Chemical Engineering King Saud University 501 هعم : تمثيل الأنظمة الهندسية على الحاسب.
Integration of 3-body encounter. Figure taken from
ENGR-25_Lec-22_ODE_MATLAB.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
ME451 Kinematics and Dynamics of Machine Systems Dynamics of Planar Systems Tuesday, November 23, 2010 Reaction Forces 6.6 Numerical Solution of IVPs [not.
Numerical Methods for Solving ODEs Euler Method. Ordinary Differential Equations  A differential equation is an equation in which includes derivatives.
ME451 Kinematics and Dynamics of Machine Systems Generalized Forces 6.2 October 16, 2013 Radu Serban University of Wisconsin-Madison.
ME451 Kinematics and Dynamics of Machine Systems Introduction to Dynamics 6.1 October 09, 2013 Radu Serban University of Wisconsin-Madison.
ME451 Kinematics and Dynamics of Machine Systems Singular Configurations 3.7 October 07, 2013 Radu Serban University of Wisconsin-Madison.
Large Timestep Issues Lecture 12 Alessandra Nardi Thanks to Prof. Sangiovanni, Prof. Newton, Prof. White, Deepak Ramaswamy, Michal Rewienski, and Karen.
© Imperial College London Numerical Solution of Differential Equations 3 rd year JMC group project ● Summer Term 2004 Supervisor: Prof. Jeff Cash Saeed.
Ordinary Differential Equations (ODEs) 1Michael Sokolov / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Michael Sokolov ETH Zurich, Institut.
Announcements Read Chapters 11 and 12 (sections 12.1 to 12.3)
Intro to Simulink April 15, Copyright , Andy Packard. This work is licensed under the Creative Commons.
ME451 Kinematics and Dynamics of Machine Systems
ME451 Kinematics and Dynamics of Machine Systems
Part 6 Chapter 21 Adaptive Methods and Stiff Systems PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Dr. Mujahed AlDhaifallah ( Term 342)
ME451 Kinematics and Dynamics of Machine Systems Dealing with Differential Equations ~ A Numerical Approach ~ March 12, 2009 © Dan Negrut, 2009 ME451,
ECE 576 – Power System Dynamics and Stability Prof. Tom Overbye Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Game Technology Animation V Generate motion of objects using numerical simulation methods Physically Based Animation.
ME451 Kinematics and Dynamics of Machine Systems Numerical Integration October 28, 2013 Radu Serban University of Wisconsin-Madison.
University of Colorado Boulder ASEN 5070: Statistical Orbit Determination I Fall 2015 Professor Brandon A. Jones Lecture 8: State Transition Matrix, Part.
ME451 Kinematics and Dynamics of Machine Systems Dynamics of Planar Systems December 9, 2010 Solving Index 3 DAEs using Newmark Method © Dan Negrut, 2010.
ME451 Kinematics and Dynamics of Machine Systems Start Position, Velocity, and Acc. Analysis 3.6 October 21, 2010 © Dan Negrut, 2010 ME451, UW-Madison.
ACSL, POSTECH1 MATLAB 입문 CHAPTER 8 Numerical Calculus and Differential Equations.
ME451 Kinematics and Dynamics of Machine Systems Absolute Constraints 3.2 September 20, 2013 Radu Serban University of Wisconsin-Madison.
Intro to Simulink Modified by Gary Balas 20 Feb 2011 Copyright , Andy Packard. This work is licensed under.
ME451 Kinematics and Dynamics of Machine Systems Newton-Euler EOM 6.1.2, October 14, 2013 Radu Serban University of Wisconsin-Madison.
Sec 232: The coefficient tableau 2ed order RK method Expand all f around (x,y) using Taylor expansion in 2d and then choose constants such that the equation.
VEHICLE DYNAMICS SIMULATIONS USING NUMERICAL METHODS VIYAT JHAVERI.
Higher Order Runge-Kutta Methods for Fluid Mechanics Problems Abhishek Mishra Graduate Student, Aerospace Engineering Course Presentation MATH 6646.
Numerical Methods by Dr. Laila Fouad.
CSE245: Computer-Aided Circuit Simulation and Verification
CSE 245: Computer Aided Circuit Simulation and Verification
Sec:25.3 RUNGE-KUTTA METHODS.
Chapter 26.
Sec:5.4 RUNGE-KUTTA METHODS.
ECE 576 POWER SYSTEM DYNAMICS AND STABILITY
MATH 175: Numerical Analysis II
Presentation transcript:

ME451 Kinematics and Dynamics of Machine Systems Numerical Integration. Stiffness: Implicit Methods. October 30, 2013 Radu Serban University of Wisconsin-Madison

2 Before we get started… Last Time: Recovering constraint reaction forces Started discussion on numerical integration Today Stiff differential equations Implicit numerical integration formulas Assignments: Homework 9 – 6.3.3, – due November 4 (12:00pm) Matlab 7 – due tonight, October 30, (11:59pm) Project 1 – due Wednesday, November 6, (11:59pm) Your simEngine2D can now perform complete Kinematic analysis! Test the provided visualization function (available on the SBEL course webpage) Miscellaneous Draft proposals for the Final Project due on Friday, November 1 Midterm 2 – Wednesday, November 6, 12:00pm in ME 1143 Review session – Monday, November 4, 6:30pm in ME 1143

Numerical Integration

4 Basic Concept IVP In general, all we can hope for is approximating the solution at a sequence of discrete points in time Uniform grid (constant step integration) Adaptive grid (variable step integration) The numerical solution is then the sequence of approximations Basic idea: somehow turn the differential problem into an algebraic problem (approximate the derivatives)

5 Simplest method: Forward Euler Starting from the IVP Use the simplest approximation to the derivative Rewrite the above as and use ODE to obtain

6 FE: Geometrical Interpretation IVP Forward Euler integration formula

7 FE: Example

8 Forward Euler: Effect of Step-Size % IVP (RHS + IC) f -0.1*y + sin(t); y0 = 0; tend = 50; % Analytical solution y_an (0.1*sin(t) - cos(t) + exp(-0.1*t)) / (1+0.1^2); % Loop over the various step-size values and plot errors colors = [[0, 0.4, 0]; [1, 0.5, 0]; [0.6, 0, 0]]; Figure, hold on, box on h = [ ]; for ih = 1:length(h) tspan = 0:h(ih):tend; y = zeros(size(tspan)); err = zeros(size(tspan)); y(1) = y0; err(1) = 0; for i = 2:length(tspan) y(i) = y(i-1) + h(ih) * f(tspan(i-1), y(i-1)); err(i) = y(i) - y_an(tspan(i)); end plot(tspan, err, 'color', colors(ih,:)); end legend('h = 0.001', 'h = 0.01', 'h = 0.1');

9 FE: Effect of Step-Size % IVP (RHS + IC) f -0.1*y + sin(t); y0 = 0; tend = 50; % Loop over the various step-size values and plot errors colors = [[0, 0.4, 0]; [1, 0.5, 0]; [0.6, 0, 0]]; Figure, hold on, box on h = [ ]; for ih = 1:length(h) tspan = 0:h(ih):tend; y = zeros(size(tspan)); y(1) = y0; for i = 2:length(tspan) y(i) = y(i-1) + h(ih) * f(tspan(i-1), y(i-1)); end plot(tspan,y, 'color', colors(ih,:)) end legend('h = 0.1', 'h = 1', 'h = 5');

Stiff Differential Equations

11 A Simple IVP Example

12 A Simple IVP Example Analytical Solution

13 Stiff Differential Equations Problems for which explicit integration methods (such as Forward Euler) do not work well Other explicit formulas: Runge-Kutta (RK4), DOPRI5, Adams- Bashforth, etc. Stiff problems require a different class of integration methods: implicit formulas The simplest implicit integration formula: Backward Euler (BE)

14 BE: Geometrical Interpretation IVP Forward Euler integration formula Backward Euler integration formula

15 A Simple IVP Example

16 Forward Euler vs. Backward Euler

17 IVP Also known as Gear method (DIFSUB – 1971) Family of implicit linear multi-step formulas BDF of 1 st order: BDF of 2 nd order: BDF of 3 rd order: BDF of 4 th order: BDF of 5 th order: Backward-Difference Formulas (BDF) C.W. (Bill) Gear b. 1935

18 Curtiss & Hirschfelder Example C.F. Curtiss and J.O. Hirschfelder – “Integration of Stiff Equations” Proc. Nat. Acad. Sci, USA (1952)

Stability and Accuracy of Numerical Integrators

20 Two Key Properties of a Numerical Integrator Two properties are relevant when considering a numerical integrator for finding an approximation of the solution of an IVP Stability Accuracy

21 Stability of a Numerical Integrator

22 Accuracy of a Numerical Integrator

Implicit Integration of Stiff ODEs

24 Implicit Integration and Nonlinear Systems [Examples]

25 Implicit Integration and Nonlinear Systems [Example 1]

26 Implicit Integration and Nonlinear Systems [Example 2]

27 Implicit Integration and Nonlinear Systems [Example 3]

28 Implicit Integration and Nonlinear Systems [Examples]

29 Implicit Integration: Conclusions

Solution of IVPs in Matlab

31 General Call to a Matlab ODE Solver IVP: Example of using Matlab’s ode45 : Use odeset to create an ODE options structure to change default values for various solver parameters [t,y] = ode45(odefun,tspan,y0,options) function dydt = odefun(t,y) [t0 tend] y0 options = odeset(…)

32 Example of IVP Solution with Matlab >> [t,y]=ode45(‘rhs’,[0 20],[2;0]); >> plot(t, y); function yd = rhs(t, y) yd = [y(2); (1-y(1)^2)*y(2)-y(1)]; Convert to 1 st order ODE Convert to vector form

33 ODE Solvers in MATLAB Solver Problem Type Order of Accuracy When to use ode45NonstiffMediumMost of the time. This should be the first solver tried ode23NonstiffLow For problems with crude error tolerances or for solving moderately stiff problems. ode113NonstiffLow to high For problems with stringent error tolerances or for solving computationally intensive problems ode15sStiff Low to medium If ods45 is slow because the problem is stiff ode23sStiffLow If using crude error tolerances to solve stiff systems and the mass matrix is constant ode23t Moderately stiff Low For moderately stiff problems is you need a solution without numerical damping ode23tbStiffLowIf using crude error tolerances to solve stiff systems Use ode45 for non-stiff problems and ode15s for stiff problems

34 A Stiff Problem % specify RHS function rhs [-1,-1;1,-5000]*y; % specify accuracy and turn on stats option options = odeset('RelTol',1e-6,'Stats','on'); % call the ode45 solver fprintf('\n---- ode45 solver statistics ----\n') tic, [~,~] = ode45(rhs, [0, 5], [1; 1], options); toc % call the ode15s solver fprintf('\n---- ode15s solver statistics ----\n') tic, [~,~] = ode15s(rhs, [0, 5], [1; 1], options); toc ---- ode45 solver statistics successful steps 504 failed attempts function evaluations Elapsed time is seconds ode15s solver statistics successful steps 3 failed attempts 288 function evaluations 1 partial derivatives 27 LU decompositions 284 solutions of linear systems Elapsed time is seconds. On a stiff problem, an explicit solver is forced to take small steps to ensure stability an implicit solver can take much larger steps, which reduces overall time to solution; but it must solve algebraic equations at each time step