Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from matplotlib import pyplot as plt
- from matplotlib import pylab
- import metodslau_kramer
- # def kusochnolineynay(arr):
- arr = [[1, 1], [2, 0], [3, 3], [4, 10], [5, 5], [6, 1], [7, 1], [8, -1], [9, 12], [10, 11], [11, 0], [12, 10]]
- n = 10000
- arrnew = []
- for i in range(0,len(arr)-1):
- koef = metodslau_kramer.kramermethod(2,[[1,arr[i][0]],[1,arr[i+1][0]]],[arr[i][1],arr[i+1][1]])
- h = (i + 1 - i) / n
- for k in range(n):
- znacheniye = koef[0]+koef[1] * (arr[i][0] + k * h)
- arrnew.append([arr[i][0] + k * h,znacheniye])
- plt.plot([x[0] for x in arrnew], [y[1] for y in arrnew])
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement