“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

ExamplesFUN can be specified using @:x = fsolve(@myfun,[2 3 4],optimset('Display','iter'))where MYFUN is a MATLAB function such as:function F = myfun(x)F = sin(x);FUN can also be an anonymous function:x = fsolve(@(x) sin(3*x),[1 4],optimset('Display','off'))If FUN is parameterized, you can use anonymous functions to capture the problemdependentparameters. Suppose you want to solve the system of nonlinearequations 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) - x(2) - exp(a*x(1))-x(1) + 2*x(2) - exp(a*x(2))];To solve the system of equations for a specific value of A, first assign the value to A.Then create a one-argument anonymous function that captures that value of A andcalls MYFUN with two arguments. Finally, pass this anonymous function to FSOLVE:a = -1; % define parameter firstx = fsolve(@(x) myfun(x,a),[-5;-5])

ExamplesFUN can be specified using @:x = fsolve(@myfun,[2 3 4],optimset('Display','iter'))where MYFUN is a MATLAB function such as:function F = myfun(x)F = sin(x);FUN can also be an anonymous function:x = fsolve(@(x) sin(3*x),[1 4],optimset('Display','off'))If FUN is parameterized, you can use anonymous functions to capture the problemdependentparameters. Suppose you want to solve the system of nonlinearequations 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) - x(2) - exp(a*x(1))-x(1) + 2*x(2) - exp(a*x(2))];To solve the system of equations for a specific value of A, first assign the value to A.Then create a one-argument anonymous function that captures that value of A andcalls MYFUN with two arguments. Finally, pass this anonymous function to FSOLVE:a = -1; % define parameter firstx = fsolve(@(x) myfun(x,a),[-5;-5])

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

Saved successfully!

Ooh no, something went wrong!