Graphics Programs Reference
In-Depth Information
x(i) = temp;
jac(:,i) = (f1 - f0)/h;
end
Note that the Jacobianmatrix J ( x ) is recomputedineach iterative loop. Since each
calculation of J ( x ) involves n
1 evaluationsof f ( x )( n is the number of equations),
the expense of computation can behigh depending on n and the complexity of f ( x ).
It is oftenpossible to savecomputer time by neglecting the changes in the Jacobian
matrix betweeniterations, thuscomputing J ( x )only once. This will work provided
that the initial x issufficiently close to the solution.
+
EXAMPLE 4.8
Determine the points of intersectionbetween the circle x 2
y 2
+
=
3 and the hyper-
bola xy
=
1.
Solution The equationstobe solvedare
x 2
y 2
f 1 ( x
,
y )
=
+
3
=
0
(a)
f 2 ( x
,
y )
=
xy
1
=
0
(b)
The Jacobian matrix is
2 x 2 y
y
f 1
/∂
x
f 1
/∂
y
J ( x
,
y )
=
=
f 2 /∂
x
f 2 /∂
y
x
=−
Thus the linear equations J ( x )
x
f ( x ) associatedwith the Newton-Raphson
methodare
2 x 2 y
y
x 2
y 2
x
+
3
=
(c)
x
y
xy
+
1
By plotting the circle and the hyperbola, we see that there arefour points of
intersection. It issufficient, however,tofind only one of these points, as the otherscan
be deduced from symmetry. From the plot we also get arough estimate of the coordi-
nates of an intersectionpoint: x
=
.
,
=
.
0
5
y
1
5, which we use as the starting values.
y
2
1
3
x
-2
-1
1
2
-1
-2
The computations thenproceedas follows.
Search WWH ::




Custom Search