Question: In this problem, you will solve for the flow rates in each pipe in the water distribution network shown in Figure 1. (Please complete all

In this problem, you will solve for the flow rates in each pipe in the water distribution network shown in Figure 1.

(Please complete all parts and include Matlab codes, Thank You)

In this problem, you will solve for the flow rates in each

pipe in the water distribution network shown in Figure 1. (Please complete

all parts and include Matlab codes, Thank You) function newton_sys_new.m is provided

function newton_sys_new.m is provided here:

function [solution,it_count,error] = newton_sys_new(x_init,...

err_tol,max_iterates,func_name,jacobian_func_name) % % The calling sequence for newton_sys_new.m is % solution = newton_sys_new(x_init,err_tol,max_iterates) % This solves n nonlinear equations in n unknowns, % F(x) = 0 % with F(x) a column vector of length n. The definitions of F(x) % and the Jacobian matrix for F(x) are provided in the input function % names. % % x_init is a vector of length n, and it is an initial guess % at the solution. % % The parameters err_tol and max_iterates are upper limits on % the desired error in the solution and the maximum number of % iterates to be computed. % % Initialization. n=length(x_init);

x0=zeros(n,1); for i=1:n x0(i) = x_init(i); end

error = inf; it_count = 0;

% Begin the main loop. while error > err_tol & it_count

% Return with the solution. solution = x1; if it_count == max_iterates disp(' ') disp('*** Your answers may possibly not satisfy your error tolerance.') end

Example definitions of functions fsys.m and deriv_fsys.m ( Please do not use if they are not correct ones)

function f_val = fsys1(x) % The equations being solved are % x(1)^2 + 4*x(2)^2 - 9 = 0 % 18*x(2) - 14*x(1)^2 + 45 = 0 % f_val = [x(1)^2+4*x(2)^2-9, 18*x(2)-14*x(1)^2+45]';

function f_val = fsys1(x) % The equations being solved are % x(1)^2 + 4*x(2)^2 - 9 = 0 % 18*x(2) - 14*x(1)^2 + 45 = 0 % f_val = [x(1)^2+4*x(2)^2-9, 18*x(2)-14*x(1)^2+45]';

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!