Question

In: Computer Science

6) Solving for method Newton-Rapson starting from (1,1,1) in matlab (with algorithm) 1) sin(x) + y^2...

6) Solving for method Newton-Rapson starting from (1,1,1) in matlab (with algorithm)

1) sin(x) + y^2 + ln(z) – 7 = 0

2) 3x + 2^y – z^3 + 1 = 0

3) x + y + z – 5 = 0

Solutions

Expert Solution

Answer : Given data

* Method Newton-Rapson starting from (1,1,1) in matlab .

1) sin(x) + y^2 + ln(z) – 7 = 0

2) 3x + 2^y – z^3 + 1 = 0

3) x + y + z – 5 = 0

clear
   clc
%function
f=@(x)[sin(x(1))+x(2)^2+log(x(3))-7;3*x(1)+2^(x(2))-x(3)^3+1;x(1)+x(2)+x(3)-5];
%Jacobian
J=@(x)[cos(x(1)) 2*x(2) 1/x(3);3 x(2)*2^(x(2)-1) -3*x(3)^2;1 1 1];

%initial guess:
t=[1;1;1];
tol = 10e-8;%edit tolerance accordingly
error=1;
while (error>tol)
xold = t;
t = t - J(t)\f(t);%equation of newton method for a system of equation
error = norm(t-xold)/norm(t);
end
fprintf('x = %f\ny = %f\nz = %f\n',t)

_____________THE END___________________


Related Solutions

Solve the following equations using the Newton-Raphason method. ( using matlab) x^2+x*y^2 = 9 ?3x^2 *...
Solve the following equations using the Newton-Raphason method. ( using matlab) x^2+x*y^2 = 9 ?3x^2 * y - y^3 = 4    ?initial estimation of (x,y) = (1.2, 2.5) ?please help.. using matlab and matlab code
Use method of variation of parameters to solve y'' + y = sin^2(x)
Use method of variation of parameters to solve y'' + y = sin^2(x)
Case 2 Method: y" + 3y' + 2y = 7cos(x) - sin(x)
Case 2 Method: y" + 3y' + 2y = 7cos(x) - sin(x)
f(x,y)=sin(2x)sin(y) intervals for x and y: -π/2 ≤ x ≤ π/2 and -π ≤ y ≤...
f(x,y)=sin(2x)sin(y) intervals for x and y: -π/2 ≤ x ≤ π/2 and -π ≤ y ≤ π find extrema and saddle points In the solution, I mainly interested how to findcritical points in case of the system of trigonometric equations (fx=0 and fy=0). ,
a. (5 Marks) 1 1 cos(x)cos(y) = -cos(x-y) + -cos(x + y) 1 l sin(x)sin(y) =...
a. 1 1 cos(x)cos(y) = -cos(x-y) + -cos(x + y) 1 l sin(x)sin(y) = -cos(x-y)--cos(x+ y) 1 l sin(x)cos(y) =—sin(x-y) +-sin(x + y) A DSB-FC (double sideband-full carrier) signal s(t) is given by, s(t) = n cos(2rr/cf)+ cos(2«-/mt)cos(2«-fct) What is the numeric value for the AM index of modulation, m, fors(f) ?
Implement in MATLAB the Newton-Raphson method to find the roots of the following functions. (a) f(x)...
Implement in MATLAB the Newton-Raphson method to find the roots of the following functions. (a) f(x) = x 3 + 3x 2 – 5x + 2 (b) f(x) = x2 – exp(0.5x) Define these functions and their derivatives using the @ symbol. For example, the function of part (a) should be f=@(x)x^3 + 3*x.^2 - 5*x + 2, and its derivative should be f_prime=@(x)3*x.^2 + 6*x - 5. For each function, use three initial values for x (choose between -10...
Let f ( x , y ) = x^ 2 + y ^3 + sin ⁡...
Let f ( x , y ) = x^ 2 + y ^3 + sin ⁡ ( x ^2 + y ^3 ). Determine the line integral of f ( x , y ) with respect to arc length over the unit circle centered at the origin (0, 0).
Write your own MATLAB code to solve the system 10 − x + sin(x + y)...
Write your own MATLAB code to solve the system 10 − x + sin(x + y) − 1 = 0 8y − cos2 (z − y) − 1 = 0 12z + sin(z) − 1 = 0 using a residual tolerance of 10^−6 and the initial guess, ~x 0 = [0.1, 0.25, 0.08]^T . Print out the values for x, y and z for each iteration in a table similar to the one you created for the problems of the...
find the volume of the region bounded by y=sin(x) and y=x^2 revolved around y=1
find the volume of the region bounded by y=sin(x) and y=x^2 revolved around y=1
USING MATLAB.... a.) Create anonymous functions: fa(x)=sin(x^2) fb(x)=sin^2(x) b.) Evaluate them both at x=1/2 pi c.)Evaluate...
USING MATLAB.... a.) Create anonymous functions: fa(x)=sin(x^2) fb(x)=sin^2(x) b.) Evaluate them both at x=1/2 pi c.)Evaluate them both at x=(0,1,2,...,10)^T d.) Calculate fa(fb(2)) and fb(fa(2))
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT