Multiband enterprises adalah suatu perusahaan yang memproduksi dua macam produk, yaitu radio portabel (PR) dan radio citizen band (CB). Manajer pemasaran menyatakan bahwa perusahaan selalu dapat menjual semua produk dihasilkan. Selanjutnya sang manajer pemasaran ini bertanya ke manajer operasi tentang besarnya kapasitas produksi/bulan. Manajer operasi menyatakan bahwa kapasitas output tergantung produk mana yang diproduksi. Selanjutnya manajer operasi menyatakan bahwa ada 3 jenis pekerjaan dilakukan dalam pembuatan produk radio tersebut, yaitu subbassembly, assembly dan inspeksi. Kedua produk tersebut membutuhkan waktu pengerjaan yang berbeda untuk setiap jenis pekerjaan tadi. Jadi kapasitas produksinya tergantung pada produk mana yang akan diproduksi.
Waktu yang tersedia untuk pekerjaan subassembly setiap bulannya adalah 326 jam, untuk assembly adalah 354 jam dan inspeksi adalah 62 jam. Sedangkan setiap unit radio CB membutuhkan 0,4 jam untuk pekerjaan subassembly, 0,5 jam untuk assemblya dan 0,05 jam untuk inspeksi. Radio portable untuk setiap unitnya membutuhkan waktu 0,5 jam untuk pekerjaan subassembly, 0,3 jam untuk assembly dan 0,1 jam inspeksi. Wakil direktur menyatakan bahwa untuk setiap CB yang terjual diperoleh keuntungan sebesar $50 dan untuk setiap PR didapat $40. Jadi beberapa kapasitas output dari multiband setiap bulannya (beberapa CB dan PR yang harus diproduksi) agar keuntungan yang diperoleh sebesar mungkin?
Cara penyelesaian :
Langkah pertama
Untuk menyelesaikan contoh kasus diatas, hal pertama yang dilakukan adalah membuat model matematikanya.
0,5 x1 + 2 x2
Sumber daya (z) adalah memaksimalkan jumlah produk
Max z = 50 x1 + 40 x2
Kendala =
0,4 x1 + 0,5 x2
≤326
0,5 x1 + 0,3 x2≤ 354
0,05 x1 + 0,1 x2≤ 62
x1, x2 ≥0
Langkah kedua
Pengubahan bentuk baku
Z = 50 x1 + 40 x2 + 0 S1 + 0 S2 + 0 S3
0,4 x1 + 0,5 x2 + S1 = 326
0,5 x1 + 0,3 x2 + S1= 354
0,05 x1 + 0,1 x2 + S1 = 62
Kolom kerja adalah nilai negative terbesar
Baris pivot adalah perbandingan nilai solusi dengan nilai pada kolom kerja.
Kemudian rubah nilai pada baris pivot dengan cara membaginya dengan 0,5 (nilai pivot/ perpotongan antara x dan S.
Lakukan iterasi sampai baris pertama pada tabel tidak ada nilai negative.
Berikut adalah perhitungannya dengan menggunakan VB.
Berikut source coding lengkapnya :
Private Sub Command1_Click()
'txt_cb.text = NK3
'txt_pr.text = NK2
If s2_cb.Caption = "CB" Then
txt_cb.Text = NK3.Text
End If
If s1_pr.Caption = "PR" Then
txt_pr.Text = NK2
End If
If Label19.Caption = "CB" Then
txt_cb.Text = NK4
End If
If Label19.Caption = "PR" Then
txt_pr.Text = NK4
End If
End Sub
'
Private Sub DISS_Click()
'kolom pivot
If Int(X1A) < Int(X2A) Then
kk1 = X1A
KK2 = X1B
KK3 = X1C
KK4 = X1D
Label21.Caption = "CB"
VGANTI_BP = "CB"
Else
kk1 = X2A
KK2 = X2B
KK3 = X2C
KK4 = X2D
Label22.Caption = "PR"
VGANTI_BP = "PR"
End If
'mencari baris pivot
If KK2 = 0 Then
a = 0
Else
a = NK2 / KK2
If KK3 = 0 Then
b = 0
Else
b = NK3 / KK3
If KK4 = 0 Then
c = 0
Else
c = NK4 / KK4
End If
End If
End If
'mencari baris baru
If a < b And b < c And a < c Then
x = a
f = KK2
P = Z2 / f
Q = X1B / f
R = X2B / f
s = S1B / f
T = S2B / f
U = S3B / f
V = NK2 / f
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * s)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * s)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)
Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * s)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z2.Text = P
X1B.Text = Q
X2B.Text = R
S1B.Text = s
S2B.Text = T
S3B.Text = U
NK2.Text = V
s1_pr.Caption = VGANTI_BP
'menampilkan hasil akhir
'If s1_pr.Caption = "PR" Then
'txt_pr.text = NK2
'End If
'If a < b And b < c And a = c Then'
'tak mungkin'
ElseIf a < b And b > c And a > c Then
x = c
f = KK4
P = Z4 / f
Q = X1D / f
R = X2D / f
s = S1D / f
T = S2D / f
U = S3D / f
V = NK4 / f
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * s)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * s)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * s)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)
Z4.Text = P
X1D.Text = Q
X2D.Text = R
S1D.Text = s
S2D.Text = T
S3D.Text = U
NK4.Text = V
Label19.Caption = "CB"
ElseIf a < b And b > c And a < c Then
x = a
f = KK2
P = Z2 / f
Q = X1B / f
R = X2B / f
s = S1B / f
T = S2B / f
U = S3B / f
V = NK2 / f
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * s)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * s)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)
Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * s)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z2.Text = P
X1B.Text = Q
X2B.Text = R
S1B.Text = s
S2B.Text = T
S3B.Text = U
NK2.Text = V
s1_pr.Caption = VGANTI_BP
'menampilkan hasil akhir
'f s1_pr.Caption = "PR" Then
'txt_pr.text = NK2
' End If
'ElseIf a < B And B > c And a = c Then'
'tak mungkin'
'ElseIf a < b And b = c And a > c Then
'tak mungkin'
ElseIf a < b And b = c And a < c Then
x = a
f = KK2
P = Z2 / f
Q = X1B / f
R = X2B / f
s = S1B / f
T = S2B / f
U = S3B / f
V = NK2 / f
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * s)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * s)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)
Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * s)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z2.Text = P
X1B.Text = Q
X2B.Text = R
S1B.Text = s
S2B.Text = T
S3B.Text = U
NK2.Text = V
s1_pr.Caption = VGANTI_BP
'menampilkan hasil akhir
'If s1_pr.Caption = "PR" Then
' txt_pr.text = NK2
'End If
'ElseIf a < b And b = c And a = c Then
'tak mungkin'
ElseIf a > b And b < c And a > c Then
x = b
f = KK3
P = Z3 / f
Q = X1C / f
R = X2C / f
s = S1C / f
T = S2C / f
U = S3C / f
V = NK3 / f
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * s)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * s)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * s)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z3.Text = P
X1C.Text = Q
X2C.Text = R
S1C.Text = s
S2C.Text = T
S3C.Text = U
NK3.Text = V
s2_cb.Caption = VGANTI_BP
'manampilkan hasil aKhir
'If s2_cb.Caption = "CB" Then
' txt_cb.text = NK3
'End If
ElseIf a > b And b < c And a < c Then
x = b
f = KK3
P = Z3 / f
Q = X1C / f
R = X2C / f
s = S1C / f
T = S2C / f
U = S3C / f
V = NK3 / f
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * s)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * s)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * s)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z3.Text = P
X1C.Text = Q
X2C.Text = R
S1C.Text = s
S2C.Text = T
S3C.Text = U
NK3.Text = V
s2_cb.Caption = VGANTI_BP
'manampilkan hasil aKhir
'If s2_cb.Caption = "CB" Then
'txt_cb.text = NK3
'End If
ElseIf a > b And b < c And a = c Then
x = b
f = KK3
P = Z3 / f
Q = X1C / f
R = X2C / f
s = S1C / f
T = S2C / f
U = S3C / f
V = NK3 / f
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * s)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * s)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * s)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z3.Text = P
X1C.Text = Q
X2C.Text = R
S1C.Text = s
S2C.Text = T
S3C.Text = U
NK3.Text = V
s2_cb.Caption = VGANTI_BP
'manampilkan hasil aKhir
'If s2_cb.Caption = "CB" Then
'txt_cb.text = NK3
'End If
ElseIf a > b And b > c And a > c Then
x = c
f = KK4
P = Z4 / f
Q = X1D / f
R = X2D / f
s = S1D / f
T = S2D / f
U = S3D / f
V = NK4 / f
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * s)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * s)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * s)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)
Z4.Text = P
X1D.Text = Q
X2D.Text = R
S1D.Text = s
S2D.Text = T
S3D.Text = U
NK4.Text = V
Label19.Caption = VGANTI_BP
'ElseIf a > b And b > c And a < c Then
'tak mungkin'
'/ElseIf a > b And b > c And a = c Then
'tak mungkin'
'ElseIf a > b And b = c And a > c Then
'tak mungkin'
'ElseIf a > b And b = c And a < c Then
'tak mungkin'
'ElseIf a > b And b = c And a = c Then
'tak mungkin'
'ElseIf a = b And b < c And a > c Then
'tak mungkin'
'ElseIf a = b And b < c And a < c Then
'tak mungkin'
'ElseIf a = b And b < c And a = c Then
'tak mungkin'
Else
If a = b And b > c And a > c Then
x = c
f = KK4
P = Z4 / f
Q = X1D / f
R = X2D / f
s = S1D / f
T = S2D / f
U = S3D / f
V = NK4 / f
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * s)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NKZ2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * s)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * s)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)
Z4.Text = P
X1D.Text = Q
X2D.Text = R
S1D.Text = s
S2D.Text = T
S3D.Text = U
NK4.Text = V
Label19.Caption = VGANTI_BP
'ElseIf a = b And b > c And a < c Then
'tak mungkin '
'ElseIf a = b And b > c And a = c Then
'tak mungkin'
'ElseIf a = b And b = c And a > c Then
'tak mungkin'
'ElseIf a = b And b = c And a < c Then
'tak mungkin'
'ElseIf a = b And b = c And a = c Then
'tak mungkin'
'end blok yang benar
End If
End If
End Sub
Private Sub HSL_Click()
On Error GoTo salah
Z1.Text = 1
Z2.Text = 0
Z3.Text = 0
Z4.Text = 0
X1A.Text = (CB * -1)
X1B.Text = CB1
X1C.Text = CB2
X1D.Text = CB3
X2A.Text = (PR * -1)
X2B.Text = PR1
X2C.Text = PR2
X2D.Text = PR3
S1A.Text = 0
S1B.Text = 1
S1C.Text = 0
S1D.Text = 0
S2A.Text = 0
S2B.Text = 0
S2C.Text = 1
S2D.Text = 0
S3A.Text = 0
S3B.Text = 0
S3C.Text = 0
S3D.Text = 1
NK1.Text = 0
NK2.Text = TOTAL1
NK3.Text = TOTAL2
NK4.Text = TOTAL3
Exit Sub
salah:
MsgBox "ISI DULU YANG KOSONG!!!!", vbInformation
CB.SetFocus
End Sub
Private Sub KELUAR_Click()
Unload Me
End Sub
Private Sub ULANG_Click()
CB.Text = ""
PR.Text = ""
CB1.Text = ""
CB2.Text = ""
CB3.Text = ""
PR1.Text = ""
PR2.Text = ""
PR3.Text = ""
TOTAL1.Text = ""
TOTAL2.Text = ""
TOTAL3.Text = ""
Z1.Text = ""
Z2.Text = ""
Z3.Text = ""
Z4.Text = ""
X1A.Text = ""
X1B.Text = ""
X1C.Text = ""
X1D.Text = ""
X2A.Text = ""
X2B.Text = ""
X2C.Text = ""
X2D.Text = ""
S1A.Text = ""
S1B.Text = ""
S1C.Text = ""
S1D.Text = ""
S2A.Text = ""
S2B.Text = ""
S2C.Text = ""
S2D.Text = ""
S3A.Text = ""
S3B.Text = ""
S3C.Text = ""
S3D.Text = ""
NK1.Text = ""
NK2.Text = ""
NK3.Text = ""
NK4.Text = ""
txt_cb.Text = ""
txt_pr.Text = ""
CB.SetFocus
End Sub