Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Can you help with a powerful Sage code to solve the system in N-R method or other numerical methods ?

I want to approximate the zeros of the following nonlinear system using Newton-Raphson process/ any other method. $$F(x,y)=x+\frac{y^{3^2}}{3}+\frac{x^{3^5}}{3^2}+\frac{y^{3^7}}{3^3}+\frac{x^{3^{10}}}{3^4}=0,$$ $$G(x,y)=y+\frac{x^{3^3}}{3}+\frac{y^{3^5}}{3^2}+\frac{x^{3^{8}}}{3^3}+\frac{y^{3^{10}}}{3^4}=0.$$


For the following easier system $$f(x,y)=x+\frac{y^{2^2}}{2}+\frac{x^{2^5}}{2^2}+\frac{y^{2^7}}{2^3}=0 , $$ $$g(x,y)=y+\frac{x^{2^3}}{2}+\frac{y^{2^5}}{2^2}+\frac{x^{2^8}}{2^3}=0,$$ we can use the initial guess $(-1,-1)$, and checked that the N-R process converges at $8$th iteration.


IR = RealField(150)

var('x,y');

f = x + y^4/2 + x^32/4 + y^128/8

g = y + x^4/2 + y^32/4 + x^256/8

a, b = IR(-1), IR(-1)

J = matrix(2, 2, [diff(f, x), diff(f, y), diff(g, x), diff(g, y)])

v = vector(IR, 2, [IR(a), IR(b)])

for k in range(9):

a, b = v[0], v[1]
fv, gv = f.subs({x : a, y : b}), g.subs({x : a, y : b})
print(f'x{k} = {a}\ny{k} = {b}')
print(f'f(x{k}, y{k}) = {fv}\ng(x{k}, y{k}) = {gv}\n')
v = v - J.subs({x : a, y : b}).inverse() * vector(IR, 2, [fv, gv])

That is all about the code.

Unfortunately the same code seems to be inefficient to solve the above system

$$F(x,y)=0,$$ $$G(x,y)=0.$$

It seems this system is associated with higher degrees.

I think this code needs to be modified.

Can you help with a powerful Sage code to solve the system in N-R method or other numerical methods ?

click to hide/show revision 2
None

Can you help with a powerful Sage code to solve the system in N-R method or other numerical methods ?

I want to approximate the zeros of the following nonlinear system using Newton-Raphson process/ any other method. $$F(x,y)=x+\frac{y^{3^2}}{3}+\frac{x^{3^5}}{3^2}+\frac{y^{3^7}}{3^3}+\frac{x^{3^{10}}}{3^4}=0,$$ $$G(x,y)=y+\frac{x^{3^3}}{3}+\frac{y^{3^5}}{3^2}+\frac{x^{3^{8}}}{3^3}+\frac{y^{3^{10}}}{3^4}=0.$$


For the following easier system $$f(x,y)=x+\frac{y^{2^2}}{2}+\frac{x^{2^5}}{2^2}+\frac{y^{2^7}}{2^3}=0 , $$ $$g(x,y)=y+\frac{x^{2^3}}{2}+\frac{y^{2^5}}{2^2}+\frac{x^{2^8}}{2^3}=0,$$ we can use the initial guess $(-1,-1)$, and checked that the N-R process converges at $8$th iteration.


IR = RealField(150)

var('x,y');

RealField(150) var('x,y'); f = x + y^4/2 + x^32/4 + y^128/8

y^128/8 g = y + x^4/2 + y^32/4 + x^256/8

x^256/8 a, b = IR(-1), IR(-1)

IR(-1) J = matrix(2, 2, [diff(f, x), diff(f, y), diff(g, x), diff(g, y)])

y)]) v = vector(IR, 2, [IR(a), IR(b)])

IR(b)]) for k in range(9):

range(9):

    a, b = v[0], v[1]
 fv, gv = f.subs({x : a, y : b}), g.subs({x : a, y : b})
 print(f'x{k} = {a}\ny{k} = {b}')
 print(f'f(x{k}, y{k}) = {fv}\ng(x{k}, y{k}) = {gv}\n')
 v = v - J.subs({x : a, y : b}).inverse() * vector(IR, 2, [fv, gv])

That is all about the code.

Unfortunately the same code seems to be inefficient to solve the above system

$$F(x,y)=0,$$ $$G(x,y)=0.$$

It seems this system is associated with higher degrees.

I think this code needs to be modified.

Can you help with a powerful Sage code to solve the system in N-R method or other numerical methods ?