Контрольная работа: Паутинообразная модель фирмы
Mu = 0: Mv = 0: Mw = 0
Call Model1
Cls
End Sub
Private Sub Form_Load()
frmForm.Show: Cls
End Sub
Модуль общего назначения Model 1
Public Const Tk = 30
Public P(Tk) As Single
Public T As Integer, i As Integer, j As Integer
Public A, B, C, E, Ro, Su, Sv, Sw, Mu, Mv, Mw, Et
Public Sub Model1()
P(l) = (A - C) / (B + E)
P(2) = (A - C) / B - E / B * P(1)
For T = 3 To Tk
For j = 1 To 3
Et = 0
For i = 1 To 12
Et = Et + Rnd
Next
If j = 1 Then Ut = Mu + (Et - 6) * Su
If j = 2 Then Vt = Mv + (Et - 6) * Sv
If j = 3 Then Wt = Mw + (Et - 6) * Sw
Next
DP = P(T - 1) - P(T - 2)
P(T) = (A - C - E * (P(T - 1) - Ro * DP) + Ut + Wt - Vt) / B
If P(T) < 0 Then P(T) = 0
P(T - 2) = P(T - 1): P(T - 1) = P(T)