Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Imports System.Collections.Generic
Public Class cHEVctrl
Public STEfile As String
Private lSOC As List(Of Single)
Private lSTE As List(Of Single)
Private strDim As Integer
Public vEVu As Single '[m/s]
Public vEVo As Single '[m/s]
Public SOC_OW As Single
Public SOC_UW As Single
Public Sub New()
lSOC = New List(Of Single)
lSTE = New List(Of Single)
End Sub
Public Sub CleanUp()
lSOC = Nothing
lSTE = Nothing
End Sub
Public Function readSTE() As Boolean
Dim file As cFile_V3
Dim line As String()
file = New cFile_V3
If Not file.OpenRead(STEfile) Then
Return False
End If
lSOC.Clear()
lSTE.Clear()
strDim = -1
vEVu = file.ReadLine(0) / 3.6
vEVo = file.ReadLine(0) / 3.6
SOC_UW = file.ReadLine(0)
SOC_OW = file.ReadLine(0)
Do While Not file.EndOfFile
strDim += 1
line = file.ReadLine
lSOC.Add(CSng(line(0)))
lSTE.Add(CSng(line(1)))
Loop
file.Close()
Return True
End Function
Public Function STEintp(ByVal SOC As Single) As Single
Dim i As Int32
'Extrapolation für x < x(1)
If lSOC(0) >= SOC Then
' ....Int1D_ERROR = True
i = 1
GoTo lbInt
End If
i = 0
Do While lSOC(i) < SOC And i < strDim
i += 1
Loop
'Extrapolation für x > x(imax)
If lSOC(i) < SOC Then
' ....Int1D_ERROR = True
End If
lbInt:
'Interpolation
Return ((SOC - lSOC(i - 1)) * (lSTE(i) - lSTE(i - 1)) / (lSOC(i) - lSOC(i - 1)) + lSTE(i - 1))
End Function
End Class