1 / 7

ECE602 BME I Nonlinear Equations in Biomedical Engineering (Cont’d)

ECE602 BME I Nonlinear Equations in Biomedical Engineering (Cont’d). Newton-Raphson method. x 0 : initial guess Iterative formula: Terminating condition:. Convergence condition: x 0 should be close to x*. Newton’s method for Nonlinear System. x 0 : initial guess

lars-barton
Download Presentation

ECE602 BME I Nonlinear Equations in Biomedical Engineering (Cont’d)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ECE602 BME I Nonlinear Equations in Biomedical Engineering (Cont’d)

  2. Newton-Raphson method • x0: initial guess • Iterative formula: • Terminating condition: Convergence condition: x0 should be close to x*.

  3. Newton’s method for Nonlinear System • x0: initial guess • Iterative formula: • Terminating condition: Convergence condition: x0should be close to x*.

  4. Implementation Issues How to define a math function ? How to use a math function as an argument? Ex. function x=fn2(fn,x0) %fn: function name x=feval(fn,x0); function f=fn1(x) f=x.^3-10*x.^2+29*x-20; >> f=fn2('fn1',5) f = 0

  5. Implementation Issues How to define a math function ? How to use a math function as an argument? Ex. function f=fn3(v) x=v(1); y=v(2); f=zeros(2,1); f(1)=x^2+y^2-4; f(2)=x*y-1; >> x0=[1;1]; >> feval('fn3',x0) ans = -2 0

  6. Implementation Issues How to define a math function ? How to use a math function as an argument? Ex. function jf=fn4(v) %Jacobian matrix definition x=v(1); y=v(2); jf=zeros(2,2); jf(1,:)=[2*x 2*y]; jf(2,:)=[y x]; >> x0=[1;1]; >> feval('fn4',x0) ans = 2 2 1 1

  7. \ Backslash or left matrix divide. If A is an N-by-N matrix and B is a column vector with N components, or a matrix with several such columns, then X = A\B is the solution to the equation A*X = B computed by Gaussian elimination. A warning message is printed if A is badly scaled or nearly singular. Implementation Issues >> A=rand(4,4) A = 0.9501 0.8913 0.8214 0.9218 0.2311 0.7621 0.4447 0.7382 0.6068 0.4565 0.6154 0.1763 0.4860 0.0185 0.7919 0.4057 >> b=A*ones(4,1) b = 3.5846 2.1761 1.8550 1.7021 >> x=A\b x = 1.0000 1.0000 1.0000 1.0000

More Related