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

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

Chapter 6: Roots: Open Methods
Fixed point iterations and solution of non-linear functions
Part 2 Chapter 6 Roots: Open Methods
Solution of Equations Example Problem Desire to find the temperature (T) that corresponds to a desired pressure, P.
also known as the “Perceptron”
Dr. Jie Zou PHY Chapter 2 Solution of Nonlinear Equations: Lecture (III)
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.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Newton's Method for Functions of Several Variables
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Linear Algebraic Equations ~ Gauss Elimination Chapter.
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.
Computer Engineering Majors Authors: Autar Kaw
ITERATIVE TECHNIQUES FOR SOLVING NON-LINEAR SYSTEMS (AND LINEAR SYSTEMS)
9/7/ Gauss-Siedel Method Chemical Engineering Majors Authors: Autar Kaw Transforming.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
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.
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.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Roots of Equations ~ Open Methods Chapter 6 Credit:
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)
Chapter 3 Roots of Equations. Objectives Understanding what roots problems are and where they occur in engineering and science Knowing how to determine.
© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
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
Dr. Jie Zou PHY Chapter 2 Solution of Nonlinear Equations: Lecture (II)
Linearization and Newton’s Method. I. Linearization A.) Def. – If f is differentiable at x = a, then the approximating function is the LINEARIZATION of.
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.
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.
2/26/ Gauss-Siedel Method Electrical Engineering Majors Authors: Autar Kaw
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.
Computational Fluid Dynamics Lecture II Numerical Methods and Criteria for CFD Dr. Ugur GUVEN Professor of Aerospace Engineering.
Evolutionary Computation Evolving Neural Network Topologies.
Part 3 Chapter 12 Iterative Methods
One-layer neural networks Approximation problems
بسم الله الرحمن الرحيم.
Gauss-Siedel Method.
6-2 Solving Systems using Substitution
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
ENGG 1801 Engineering Computing
Solving Nonlinear Equation
Lesson 7-4 part 3 Solving Systems by Elimination
Chapter 6.
Lesson 7-4 part 2 Solving Systems by Elimination
Computers in Civil Engineering 53:081 Spring 2003
Simultaneous Equations
Lesson 7-4 part 3 Solving Systems by Elimination
Linear Algebra Lecture 3.
Algorithms and Convergence
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.
Presentation transcript:

ENGG 1801 Engineering Computing MATLAB Lecture 7: Tutorial Weeks 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: x 1 = 4 x 2 = 2

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

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.