This question is about Numerical Mathematics and Computing.I am not familiar wit
ID: 3108773 • Letter: T
Question
This question is about Numerical Mathematics and Computing.I am not familiar with matlab...Please give me a code with matlab and with a short explain if you like.Thank you soooooooo much and I will give you a good thumb if the answer is correct or nearly correct.
the lecture note is here(it is use to tell you how to solve problem like this one, I know the note and know how to solve these kind of problem, but I do not know what this problem meaning and how to use matlab to solve it..):
Problem 4. (20%) C the example of solving a system of nonlinear equations onsider by Newton's method, as given on Pages 95-97 of the Lecture notes. Write a program to carry out this iteration, using Gauss elimination to solve the 2 by 2 linear systems that arise. Use each of the following 16 initial data sets for the Newton iteration: (0) (0) (i, j), i 0,1, 2, 3, j-0, 1,2,3 Present and discuss your numerical results in a concise mannerExplanation / Answer
clc;
clear all;
x1=2; x2=2; %initial guess
n=0;
while(n<5)
f1=x1^2*x2-1; % your g1
f2=x2-x1^4; % your g2
f11=2*x1*x2
f12=x1^2;
f21=-4*x1^3;
f22=1;
J=[f11 f12 ; f21 f22]; %jacobian matrix
J1=inv(J); %inverse of jacobi
%J1*[f1; f2];
Z=[x1;x2]-J1*[f1; f2]; %newton formula
n=n+1 %next interation
%next interation intial guess
x1=Z(1);
x2=Z(2);
Z
end
% reuslts
n =
1
Z =
1.5368
1.1765
n =
2
Z =
1.2156
0.9151
n =
3
Z =
1.0422
0.9378
n =
4
Z =
1.0012
0.9944
n =
5
Z =
1.0000
1.0000
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.