Добавил:
ddaren_223
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:коды / 8
.2.py import numpy as np
def fixpoint(f, G, x, eps=0.03):
while np.linalg.norm(f(x)) > eps:x = G(x)
return x, f(x)
def f(x):x, y = x;return np.array([np.sin(x+1.5)-y,1.2*np.sqrt(0.16-x**2)+y])
def G(x):x, y = x;return np.array([-(6*x)/(np.sqrt(4-25*x**2)),-np.sin(x+1.5)])
x, y = fixpoint(f, G, [0.3, 0.3])
print(x, y, sep="\n")
def fixpoint(f, G, x, eps=0.03):
while np.linalg.norm(f(x)) > eps:x = G(x)
return x, f(x)
def f(x):x, y = x;return np.array([np.sin(x+1.5)-y,1.2*np.sqrt(0.16-x**2)+y])
def G(x):x, y = x;return np.array([-(6*x)/(np.sqrt(4-25*x**2)),-np.sin(x+1.5)])
x, y = fixpoint(f, G, [0.3, 0.3])
print(x, y, sep="\n")
Соседние файлы в папке коды