2019
1. Problem Statement
Menentukan viskositas air dengan Interpolasi Lagrange
2. Mathematical Equation
result *= (xx - x[t])/(x[p]-x[t])
3. Algoritma
3.1 Mulai
3.2 Import numpy
3.3 Definisikan Li(xx, x, y, p):
3.3.1 result = 1
3.3.2 For t in range (0, len(x)):
3.3.2.1 If t != p:
3.3.2.1.1 result *= (xx - x[t])/(x[p]-x[t])
3.3.4 Return result
3.3 Inisiasi a = 60 , X = [0, 10, 30, 50, 70, 90, 100], Y = [1.792, 1.308, 0.801, 0.549, 0.406, 0.317,
0.284], H=[]
3.4 Cetak judul tabel
3.5 For i in range (0,len(X)):
3.5.1 LI = Li(a, X, Y, i)
3.5.2 H.append(LI*Y[i])
3.6 Cetak tabel
3.7 Cetak hasil
3.8 Selesai
4. Flowchart
Mulai
Import numpy
Def Li
For i in range
(0,len(X))
Result = 1
For t in range
(0, len(x))
If t != p
Return