Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Newton Raphson - Problem 4
- close;
- clear;
- clc;
- x = [0;1]; % initial conditions
- for n = 1:50 % n = # iterations
- f = [2*x(1)^2 + x(2)^2 - 8;
- x(1)^2 - x(2)^2 + x(1)*x(2) - 4];
- J = [4*x(1) , 2*x(2)
- 2*x(1) + x(2) , -2*x(2) + x(1)];
- x = x - inv(J)*f;
- end
- fprintf('x1 =');
- disp(x(1,1)); % displays voltage
- fprintf('x2 =');
- disp(x(2,1));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement