1 / 6

Matlab: Nonlinear Algebraic Systems

Matlab: Nonlinear Algebraic Equations. fzero scalar nonlinear equation solverSyntax: x = fzero(fun',xo)fun' is the name of the user provided Matlab m-file function (fun.m) that evaluates and returns the LHS of f(x) = 0xo is an initial guess for the solution of f(x) = 0Discussed last lecture

shanon
Download Presentation

Matlab: Nonlinear Algebraic Systems

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. Matlab: Nonlinear Algebraic Systems Nonlinear algebraic equation solvers Exothermic chemical reactor example

    2. Matlab: Nonlinear Algebraic Equations fzero scalar nonlinear equation solver Syntax: x = fzero(fun,xo) fun is the name of the user provided Matlab m-file function (fun.m) that evaluates and returns the LHS of f(x) = 0 xo is an initial guess for the solution of f(x) = 0 Discussed last lecture fsolve multivariable nonlinear equation solver Function for solving system of nonlinear algebraic equations Syntax: x = fsolve(fun,xo) Same syntax as fzero, but x is a vector of variables and the function, fun, returns a vector of equation values, f(x) Part of the Matlab Optimization toolbox Multiple algorithms available in options settings (e.g. trust-region dogleg, Gauss-Newton, Levenberg-Marquardt)

    3. Exothermic Chemical Reactor Example Steady-state model Parameter values k0 = 3.493x107 h-1, E = 11843 kcal/kmol (-DH) = 5960 kcal/kmol, rCp = 500 kcal/m3/K UA = 150 kcal/h/K, R = 1.987 kcal/kmol/K V = 1 m3, q =1 m3/h, CAf = 10 kmol/m3, Tf = 298 K, Tj = 298 K. Problem Find all steady-state points:

    4. x = fsolve('cstr',xo,options) 'cstr' name of the Matlab m-file function (cstr.m) for the CSTR model xo initial guess of steady-state solution: xo = [CA T] ' options Matlab structure of optimization parameter values created with the optimset function Example usage >> xo = [10 300]'; >> x = fsolve('cstr',xo,optimset('Display','iter')) Solution of CSTR Model with fsolve

    5. Create m-file cstr.m

More Related