Lecture_F11_ECH157_fsolve

Lecture_F11_ECH157_f - F =[2 x(1 x(2 exp-x(1-x(1 2 x(2 exp-x(2 x is the initial guess for the root and fsolve returns the calculated root for the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Solving nonlinear equations using M ATLAB fsolve finds the root for a system of nonlinear equations F ( x ) = 0 where x is a vector and F ( x ) is a vector function of x . For example, x = b x 1 x 2 B (1) F ( x ) = b 2 x 1 - x 2 - e - x 1 - x 1 + 2 x 2 - e - x 2 B (2) The basic syntax is x = fsolve(myfun,x0) where myfun defines the system of nonlin- ear equations you want to solve (usually) in a M ATLAB function file like function F = myfun(x)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: F = [2 * x(1) - x(2) - exp(-x(1));-x(1) + 2 * x(2) - exp(-x(2))]; x is the initial guess for the root and fsolve returns the calculated root for the system of non-linear equations. For more information about fsolve , please see http://www.mathworks.com/help/toolbox/optim/ug/fsolve.html...
View Full Document

This note was uploaded on 01/28/2012 for the course ECH 157 taught by Professor Palagozu during the Fall '08 term at UC Davis.

Ask a homework question - tutors are online