Tugas 1 Optimasi
Metode Simpleks
| Kontak | \(\downarrow\) |
| naftaligunawan@gmail.com | |
| https://www.instagram.com/nbrigittag/ | |
| RPubs | https://rpubs.com/naftalibrigitta/ |
| Nama | Naftali Brigitta Gunawan |
| NIM | 20214920002 |
Soal
Selesaikan masalah berikut menggunakan metode subtitusi, metode simpleks menggunakan R studio!
\(Z = 8x1 + 5x2\)
\(x1 + x2 ≤ 6\)
\(9x1 + 5x2 ≤ 45\)
\(x1, x2 ≥ 0\)
Jawab menggunakan Metode Simpleks
library(boot)
# set coefficients of the objective function
f.obj = c(8, 5)
# set matrix corresponding to coefficients of constraints by rows
f.con = matrix(c(1, 1, 9, 5), nrow = 2, byrow = TRUE)
# set right hand side coefficients
f.rhs = c(6, 45)
# final value (z)
z = simplex(a=f.obj, A1 = f.con, b1 = f.rhs, maxi = TRUE)
z##
## Linear Programming Results
##
## Call : simplex(a = f.obj, A1 = f.con, b1 = f.rhs, maxi = TRUE)
##
## Maximization Problem with Objective Function Coefficients
## x1 x2
## 8 5
##
##
## Optimal solution has the following values
## x1 x2
## 3.75 2.25
## The optimal value of the objective function is 41.25.
Kesimpulan :
Nilai x1 adalah \(3.75\)
Nilai x2 adalah \(2.25\)
Nilai maksimum dari fungsi diatas adalah \(41.25\)