All problems
Newton for 2x2 System One Step
Problem
Take one Newton step for the system f1 = x^2 + y^2 - 25 = 0 and f2 = x - y - 1 = 0.
The Jacobian is [[2x, 2y], [1, -1]]. Solve J * [dx, dy] = -[f1, f2] with Cramer's rule and return the updated point [x + dx, y + dy].
Hint
Evaluate f and J at the current point, then solve the 2x2 linear system.
Test cases
case 1
in: [[3,4]]
expected: [4.142857142857142,3.142857142857143]
case 2
in: [[4,3]]
expected: [4,3]
case 3
in: [[5,0]]
expected: [5,4]
case 4
in: [[1,1]]
expected: [7.25,6.25]
Starter codePython
def newton_system_2x2(point):
# Your code here
pass4 test cases · run your code against them in the editor