Реферат: Отчет по лабораторной работе Моделирование гидравлической системы в нестационарном режиме.
Const m As Byte = 2 ' Количество решаемых ОДУ
Const np% = 10, nk% = 7, nv% = 7, g! = 9.8
Public del! ' шаг
Private k!
Private y0!(m), x0! ' Начальное значение
Private n% ' Число шагов
Private kv% ' Кратность вывода
Private x1!, y1!(m), i%
Private ki!, ki1!, ki2!, vm!(nk), v!(nk), ak!(nk), p!(np)
Private hg!(m), h!(m), s!(m), pr!(m), ro!, pn!, x!, ipr%, ipr1%
Sub dydx(x As Single, y() As Single, pr!())
' расчет производных для текущих(pr) x,y
Dim j%
For j = 1 To m: h(j) = y(j): Next j
p(9) = pn * hg(1) / (hg(1) - h(1)): p(10) = pn * hg(2) / (hg(2) - h(2))
p(7) = p(9) + ro * g * h(1) * 0.000001: p(8) = p(10) + ro * g * h(2) * 0.000001
v(1) = ak(1) * Sgn(p(1) - p(7)) * Sqr(Abs(p(1) - p(7)))
v(2) = ak(2) * Sgn(p(2) - p(8)) * Sqr(Abs(p(2) - p(8)))
v(3) = ak(3) * Sgn(p(7) - p(3)) * Sqr(Abs(p(7) - p(3)))
v(4) = ak(4) * Sgn(p(8) - p(4)) * Sqr(Abs(p(8) - p(4)))
v(5) = ak(5) * Sgn(p(8) - p(5)) * Sqr(Abs(p(8) - p(5)))
v(6) = ak(6) * Sgn(p(8) - p(6)) * Sqr(Abs(p(8) - p(6)))
v(7) = ak(7) * Sgn(p(8) - p(7)) * Sqr(Abs(p(8) - p(7)))
pr(1) = (v(1) - v(3) + v(7)) / s(1): pr(2) = (-v(4) - v(5) - v(6) + v(2) - v(7)) / s(2)
For j = 1 To nk: vm(j) = v(j) * ro: Next j
With Worksheets("TMP")
' TMP out
'.Cells(ipr, 1) = i: .Cells(ipr, 2) = "p(5-7)": .Cells(ipr, 6) = "vm"
'.Cells(ipr, 3) = p(5): .Cells(ipr, 4) = p(6): .Cells(ipr, 5) = p(7)