備忘録 キーワード SOC,Li-ion,線形補完
Sub hokan()
Dim i, k, v, count As Long
s = Range("E6:O7").Value
For i = 1 To 11
Cells(1, i).Value = s(2, i)
Next i
Dim Delta, Delta1, Delta_y, Delta_y1
Dim x() As Integer
Dim z(10000, 10000) As String
z(1, 1) = s(1, 1)
z(2, 1) = s(2, 1)
count = 1
For v = 1 To 4
Delta = (s(1, 2) - s(1, 1)) / 4
Delta1 = s(1, 1) + Delta * v
z(1, v + 1) = Delta1
Delta_y = (s(2, 2) - s(2, 1)) / 4
Delta_y1 = s(2, 1) + Delta_y * v
z(2, v + 1) = Delta_y1
Next v
For k = 2 To 10
For v = 1 To 4
Delta = (s(1, k + 1) - s(1, k)) / 4
Delta1 = s(1, k) + Delta * v
z(1, v + count * 4) = Delta1
Delta_y = (s(2, k + 1) - s(2, k)) / 4
Delta_y1 = s(2, k) + Delta_y * v
z(2, v + count * 4) = Delta_y1
Next v
count = count + 1
Next k
For i = 1 To 50
Cells(2, i).Value = z(1, i)
Cells(3, i).Value = z(2, i)
Next i
End Sub