ENGG 1801 Engineering Computing

Slides:



Advertisements
Similar presentations
M. Dumbser 1 / 23 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.
Advertisements

Lecture 5 Fixed point iteration Download fixedpoint.m From math.unm.edu/~plushnik/375.
Chapter 6: Roots: Open Methods
Fixed point iterations and solution of non-linear functions
Part 2 Chapter 6 Roots: Open Methods
Numerical Solution of Nonlinear Equations
Solution of Equations Example Problem Desire to find the temperature (T) that corresponds to a desired pressure, P.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 20 Solution of Linear System of Equations - Iterative Methods.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 19 Solution of Linear System of Equations - Iterative Methods.
ENGG 1801 Engineering Computing MATLAB Lecture 7: Tutorial Weeks Solution of nonlinear algebraic equations (II)
Nonlinear Algebraic Systems 1.Iterative solution methods 2.Fixed-point iteration 3.Newton-Raphson method 4.Secant method 5.Matlab tutorial 6.Matlab exercise.
Newton's Method for Functions of Several Variables
7 = 7 SOLUTION EXAMPLE 1 Check the intersection point Use the graph to solve the system. Then check your solution algebraically. x + 2y = 7 Equation 1.
Thinking Mathematically Algebra: Graphs, Functions and Linear Systems 7.3 Systems of Linear Equations In Two Variables.
Assignment Solving System of Linear Equations Using MPI Phạm Trần Vũ.
Computer Engineering Majors Authors: Autar Kaw
ITERATIVE TECHNIQUES FOR SOLVING NON-LINEAR SYSTEMS (AND LINEAR SYSTEMS)
Analytical vs. Numerical Minimization Each experimental data point, l, has an error, ε l, associated with it ‣ Difference between the experimentally measured.
ME451 Kinematics and Dynamics of Machine Systems Numerical Solution of DAE IVP Newmark Method November 1, 2013 Radu Serban University of Wisconsin-Madison.
Numerical Methods Applications of Loops: The power of MATLAB Mathematics + Coding 1.
Start Presentation October 4, 2012 Solution of Non-linear Equation Systems In this lecture, we shall look at the mixed symbolic and numerical solution.
Using Partitioning in the Numerical Treatment of ODE Systems with Applications to Atmospheric Modelling Zahari Zlatev National Environmental Research Institute.
10/17/ Gauss-Siedel Method Industrial Engineering Majors Authors: Autar Kaw
Chapter 3 Solution of Algebraic Equations 1 ChE 401: Computational Techniques for Chemical Engineers Fall 2009/2010 DRAFT SLIDES.
Loop Application: Numerical Methods, Part 1 The power of Matlab Mathematics + Coding.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Efficient Integration of Large Stiff Systems of ODEs Using Exponential Integrators M. Tokman, M. Tokman, University of California, Merced 2 hrs 1.5 hrs.
Derivatives In modern structural analysis we calculate response using fairly complex equations. We often need to solve many thousands of simultaneous equations.
MATLAB Harri Saarnisaari, Part of Simulations and Tools for Telecommunication Course.
10/26/ Gauss-Siedel Method Civil Engineering Majors Authors: Autar Kaw Transforming.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
Quadrature rules 1Michael Sokolov / Numerical Methods for Chemical Engineers / Numerical Quadrature Michael Sokolov ETH Zurich, Institut für Chemie- und.
Boundary Value Problems l Up to this point we have solved differential equations that have all of their initial conditions specified. l There is another.
Solution of Nonlinear Functions
Newton’s Method, Root Finding with MATLAB and Excel
Circuits Theory Examples Newton-Raphson Method. Formula for one-dimensional case: Series of successive solutions: If the iteration process is converged,
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
Applications of Loops: The power of MATLAB Mathematics + Coding
Systems of Linear Equations in Two Variables. 1. Determine whether the given ordered pair is a solution of the system.
Lecture 6 - Single Variable Problems & Systems of Equations CVEN 302 June 14, 2002.
Basis of Mathematical Modeling LECTURE 3 Numerical Analysis with MATLAB Dr. N.K. Sakhnenko, PhD, Professor Associate.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Part 3 Chapter 12 Iterative Methods
Computers in Civil Engineering 53:081 Spring 2003 Lecture #8 Roots of Equations: Systems of Equations.
3/6/ Gauss-Siedel Method Major: All Engineering Majors Author: دکتر ابوالفضل رنجبر نوعی
Solving Systems of Linear Equations by Elimination; Applications Solve systems of linear equations using elimination. 2.Solve applications using.
Project on Newton’s Iteration Method Presented by Dol Nath Khanal Project Advisor- Professor Dexuan Xie 05/11/2015.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
One-layer neural networks Approximation problems
بسم الله الرحمن الرحيم.
Warm Up 3x + 5y = 25 4x + 7y = 34 Find the value of x and y so that both equations are true.
Autar Kaw Benjamin Rigsby
Solve a system of linear equation in two variables
Solving Nonlinear Equation
Lesson 7-4 part 3 Solving Systems by Elimination
Chapter 6.
Lesson 7-4 part 2 Solving Systems by Elimination
ME 123 Computer Applications I Lecture 24: Character Strings 4/18/03
Computers in Civil Engineering 53:081 Spring 2003
Lesson 7-4 part 3 Solving Systems by Elimination
Linear Algebra Lecture 3.
Algorithms and Convergence
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Objectives Identify solutions of linear equations in two variables.
Engineering Analysis ENG 3420 Fall 2009
Chapter 6.
Programming assignment #1 Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
ME 123 Computer Applications I Lecture 25: MATLAB Overview 4/28/03
Pivoting, Perturbation Analysis, Scaling and Equilibration
Presentation transcript:

ENGG 1801 Engineering Computing MATLAB Lecture 7: Tutorial Weeks 11-13 Solution of nonlinear algebraic equations (II)

Outline of lecture Solving sets of nonlinear equations Multivariable Newton’s method Example (2 equations in 2 unknowns) Solving example problem in Matlab Functions Conclusions

Sets of Nonlinear Equations Equation sets can be large 100’s (1000’s) of equations Initial solution estimate can be a challenge Fewer solution options Plotting and direct substitution are not options Most widely used approach ? Multivariable Newton’s method

Multivariable Newton’s Method Single variable algorithm Each iteration solves a linear approximation to function Multivariable algorithm Each function approximated by a linear equation Each iteration solves a set of linear equations Scalar equation Vector-matrix equation

Example (I) Solve the pair of equations: Elements of the Jacobian matrix Solution is: x1 = 4 x2 = 2

Example (II) Use as initial estimate for solution (3, 3) Next estimate obtained from: Functions evaluated at old point New point = (3.5714, 2.0952) Jacobian evaluated at old point Old point = (3, 3)

Solution in Matlab counter = 1; error = 10; xold = [3;3]; while error > 1e-3 & counter < 10 fold(1) = xold(1) - xold(2)^2; fold(2) = xold(1)*xold(2) - 8; J(1,1) = 1; J(1,2) = -2*xold(2); J(2,1) = xold(2); J(2,2) = xold(1); xnew = xold - inv(J)*fold' error = max(abs(xnew(1)-xold(1)),abs(xnew(2)-xold(2))); counter = counter + 1; xold = xnew; end

Advice on Iterative Methods Follow one cycle through code by hand Initially use modest convergence criterion Put in a ‘counter’ ( to prevent infinite loop ) Check final solution Be prepared for multiple solutions Initial guess has a big impact: On the final solution obtained On the time taken to converge to solution

Functions Breaking up complex calculations into simpler blocks. Main program a = 2; b = 3; [answer, diff] = my_function(a,b) Separate file, my_function.m; outputs calculated inside function using input arguments (in1 & in2) function [answ, differ] = my_function(in1,in2) answ = in1 + in2; differ = in1 – in2; One to one correspondence between inputs, outputs in calling statement and in function

Conclusions Solution of nonlinear equation sets ? Very common problem in engineering Built-in Matlab functions ( e.g. fsolve from MATLAB’s Optimization Toolbox) User supplied Jacobian speeds convergence If unavailable → Matlab gets by finite differencing User has to supply initial estimate of solution Make your own functions to split up a big problem into simpler pieces.