summaryrefslogtreecommitdiff
path: root/src/main.py
blob: 551595e1bcf1c3260cb97b4b64962c0bb49cf4b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from simple import SIMPLE

problem = SIMPLE((1, 2), (0.7, 0.5), 0.02, 120)
problem.prep()

error = 1
iteration = 0
while error > 10 ** -7:
    iteration += 1
    problem.iterate()
    error = problem.avg_error()
    print(f'Iteration {iteration}')
    print(f'Avg error: {error}')

    if iteration % 5 == 0 or iteration == 1:
        problem.plot(True, 2)