“ANÁLISIS DE SISTEMAS DE DISTRIBUCIÓN DE GAS POR ... - inicio

“ANÁLISIS DE SISTEMAS DE DISTRIBUCIÓN DE GAS POR ... - inicio “ANÁLISIS DE SISTEMAS DE DISTRIBUCIÓN DE GAS POR ... - inicio

tesis.luz.edu.ve
from tesis.luz.edu.ve More from this publisher
20.08.2015 Views

[X,RESNORM,RESIDUAL,EXITFLAG,OUTPUT,LAMBDA]=LSQNONLIN(FUN,X0,...)returns the set of Lagrangian multipliers, LAMBDA, at the solution: LAMBDA.lowerfor LB and LAMBDA.upper for UB.[X,RESNORM,RESIDUAL,EXITFLAG,OUTPUT,LAMBDA,JACOBIAN]=LSQNONLIN(FUN,X0,...) returns the Jacobian of FUN at X.ExamplesFUN can be specified using @:x = lsqnonlin(@myfun,[2 3 4])where MYFUN is a MATLAB function such as:function F = myfun(x)F = sin(x);FUN can also be an anonymous function:x = lsqnonlin(@(x) sin(3*x),[1 4])If FUN is parameterized, you can use anonymous functions to capture the problemdependentparameters. Suppose you want to solve the non-linear least squaresproblem given in the function MYFUN, which is parameterized by its secondargument A. Here MYFUN is an M-file function such asfunction F = myfun(x,a)F = [ 2*x(1) - exp(a*x(1))-x(1) - exp(a*x(2))x(1) - x(2) ];To solve the least squares problem for a specific value of A, first assign the value toA. Then create a one-argument anonymous function that captures that value of Aand calls MYFUN with two arguments. Finally, pass this anonymous function toLSQNONLIN:a = -1; % define parameter firstx = lsqnonlin(@(x) myfun(x,a),[1;1])

FSOLVEsolves systems of nonlinear equations of several variables.FSOLVE attempts to solve equations of the form:F(X)=0where F and X may be vectors or matrices.X=FSOLVE(FUN,X0) starts at the matrix X0 and tries to solve the equations in FUN.FUN accepts input X and returns a vector (matrix) of equation values F evaluated atX.X=FSOLVE(FUN,X0,OPTIONS) minimizes with the default optimization parametersreplaced by values in the structure OPTIONS, an argument created with theOPTIMSET function. See OPTIMSET for details. Used options are Display, TolX,TolFun, DerivativeCheck, Diagnostics, FunValCheck, Jacobian, JacobMult,JacobPattern, LineSearchType, LevenbergMarquardt, MaxFunEvals, MaxIter,DiffMinChange and DiffMaxChange, LargeScale, MaxPCGIter, PrecondBandWidth,TolPCG, TypicalX. Use the Jacobian option to specify that FUN also returns asecond output argument J that is the Jacobian matrix at the point X. If FUN returns avector F of m components when X has length n, then J is an m-by-n matrix whereJ(i,j) is the partial derivative of F(i) with respect to x(j). (Note that the Jacobian J is thetranspose of the gradient of F.)[X,FVAL]=FSOLVE(FUN,X0,...) returns the value of the equations FUN at X.[X,FVAL,EXITFLAG,OUTPUT]=FSOLVE(FUN,X0,...) returns a structure OUTPUTwith the number of iterations taken in OUTPUT.iterations, the number of functionevaluations in OUTPUT.funcCount, the algorithm used in OUTPUT.algorithm, thenumber of CG iterations (if used) in OUTPUT.cgiterations, the first-order optimality (ifused) in OUTPUT.firstorderopt, and the exit message in OUTPUT.message.[X,FVAL,EXITFLAG,OUTPUT,JACOB]=FSOLVE(FUN,X0,...) returns the Jacobian ofFUN at X.

[X,RESNORM,RESIDUAL,EXITFLAG,OUTPUT,LAMBDA]=LSQNONLIN(FUN,X0,...)returns the set of Lagrangian multipliers, LAMBDA, at the solution: LAMBDA.lowerfor LB and LAMBDA.upper for UB.[X,RESNORM,RESIDUAL,EXITFLAG,OUTPUT,LAMBDA,JACOBIAN]=LSQNONLIN(FUN,X0,...) returns the Jacobian of FUN at X.ExamplesFUN can be specified using @:x = lsqnonlin(@myfun,[2 3 4])where MYFUN is a MATLAB function such as:function F = myfun(x)F = sin(x);FUN can also be an anonymous function:x = lsqnonlin(@(x) sin(3*x),[1 4])If FUN is parameterized, you can use anonymous functions to capture the problemdependentparameters. Suppose you want to solve the non-linear least squaresproblem given in the function MYFUN, which is parameterized by its secondargument A. Here MYFUN is an M-file function such asfunction F = myfun(x,a)F = [ 2*x(1) - exp(a*x(1))-x(1) - exp(a*x(2))x(1) - x(2) ];To solve the least squares problem for a specific value of A, first assign the value toA. Then create a one-argument anonymous function that captures that value of Aand calls MYFUN with two arguments. Finally, pass this anonymous function toLSQNONLIN:a = -1; % define parameter firstx = lsqnonlin(@(x) myfun(x,a),[1;1])

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!