Newtons method for bivariate function Ive managed to comple
Newton\'s method for bivariate function - I\'ve managed to complexify the equation, and break down f to f1 & f2 where f1(x,y)=x^2-y^2+1 & f2(x,y)=2xyi. Hoping for insight on how to run newton\'s method and plot the function
Solution
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<stdio.h>
#include<math.h>
float f(float x)
{
return x*log10(x) - 1.2;
}
float df (float x)
{
return log10(x) + 0.43429;
}
void main()
{
int itr, maxmitr;
float h, x0, x1, allerr;
printf(\"\ Enter x0, allowed error and maximum iterations\ \");
scanf(\"%f %f %d\", &x0, &allerr, &maxmitr);
for (itr=1; itr<=maxmitr; itr++)
{
h=f(x0)/df(x0);
x1=x0-h;
printf(\" At Iteration no. %3d, x = %9.6f\ \", itr, x1);
if (fabs(h) < allerr)
{
printf(\"After %3d iterations, root = %8.6f\ \", itr, x1);
return 0;
}
x0=x1;
}
printf(\" The required solution does not converge or iterations are insufficient\ \");
return 1;
}

