Email : nikitaindriyni.com
RPubs : https://https://rpubs.com/nikitaindriyani/
Jawaban
Optimasi adalah salah satu disiplin ilmu dalam matematika yang fokus untuk mendapatkan nilai minimum atau maksimum secara sistematis dari suatu fungsi.
Optimisasi ialah suatu proses untuk mencapai hasil yang ideal atau optimal. Dalam disiplin matematika optimisasi merujuk pada studi permasalahan yang mencoba untuk mencari nilai minimal atau maximal dari suatu fungsi riil.
optimalisasi adalah pencarian nilai terbaik dari yang tersedia dari beberapa fungsi yang diberikan pada suatu konteks
Dari penjelasan diatas memiliki tujuan yang sama yaitu mencari nilai terbaik
Jawaban
Optimasi terbatas adalah salah satu alat dasar dalam ekonomi dan dalam kehidupan nyata. Konsumen memaksimalkan utilitas mereka tunduk pada banyak kendala, dan satu kendala yang signifikan adalah kendala anggaran mereka.
Memaksimalkan utilitas subyek u=f(x,y)=xy pada kendala g(x,y)=x+4y=240. Harga per unit x adalah 1, harga y adalah 4, dan anggaran yang tersedia untuk membeli x dan y adalah 240. Pecahkan masalah dengan menggunakan pendekatan geometris!
Optimasi yang tidak dibatasi melibatkan menemukan maksimum atau minimal fungsi yang dapat dibedakan dari beberapa variabel di atas satu set yang bagus. Untuk memenuhi kompleksitas masalah, sistem aljabar komputer dapat digunakan untuk melakukan perhitungan yang diperlukan.
minimize the outer area of a cylinder subject to a fixed volume. Objective function F(x) = 2??r2 + 2??rh, x = [r h]
Tentukan ekstrim mutlak dari fungsi f(x)=x5???2x+10 pada selang [1,6]
## $minimum
## [1] 0.3333333
##
## $objective
## [1] 0
f <- function(x) ifelse(x > -1, ifelse(x < 4, exp(-1/abs(x - 1)), 10), 10)
fp <- function(x) { print(x); f(x) }
plot(f, -2,5, ylim = 0:1, col = 2)
## [1] 5.167184
## [1] 10.83282
## [1] 14.33437
## [1] 16.49845
## [1] 17.83592
## [1] 18.66253
## [1] 19.1734
## [1] 19.48913
## [1] 19.68427
## [1] 19.80487
## [1] 19.8794
## [1] 19.92547
## [1] 19.95393
## [1] 19.97153
## [1] 19.9824
## [1] 19.98913
## [1] 19.99328
## [1] 19.99585
## [1] 19.99743
## [1] 19.99841
## [1] 19.99902
## [1] 19.99939
## [1] 19.99963
## [1] 19.99977
## [1] 19.99986
## [1] 19.99991
## [1] 19.99995
## [1] 19.99995
## $minimum
## [1] 19.99995
##
## $objective
## [1] 10
## [1] 3.313082
## [1] 9.686918
## [1] -0.6261646
## [1] 1.244956
## [1] 1.250965
## [1] 0.771827
## [1] 0.2378417
## [1] 1.000451
## [1] 0.9906964
## [1] 0.9955736
## [1] 0.9980122
## [1] 0.9992315
## [1] 0.9998411
## [1] 0.9996083
## [1] 0.9994644
## [1] 0.9993754
## [1] 0.9993204
## [1] 0.9992797
## [1] 0.9992797
## $minimum
## [1] 0.9992797
##
## $objective
## [1] 0
# Import lpSolve package
library(lpSolve)
# Set coefficients of the objective function
f.obj <- c(5, 9)
# Set matrix corresponding to coefficients of constraints by rows
# Do not consider the non-negative constraint; it is automatically assumed
f.con <- matrix(c(1, 2,
0, 1,
3, 1), nrow = 3, byrow = TRUE)
# Set unequality signs
f.dir <- c("<=",
"<=",
"<=")
# Set right hand side coefficients
f.rhs <- c(16,
19,
8)
# Final value (z)
lp("max", f.obj, f.con, f.dir, f.rhs)
## Success: the objective function is 72
## [1] 0 8
## [1] -1.000000e+30 1.666667e+00
## [1] 27 10
## [1] 27 10
# Dual Values (first dual of the constraints and then dual of the variables)
# Duals of the constraints and variables are mixed
lp("max", f.obj, f.con, f.dir, f.rhs, compute.sens=TRUE)$duals
## [1] 4.4 0.0 0.2 0.0 0.0
## [1] 2.666667e+00 -1.000000e+30 8.000000e+00 -1.000000e+30 -1.000000e+30
## [1] 1.6e+01 1.0e+30 4.8e+01 1.0e+30 1.0e+30
objective.in <- c(25, 20)
const.mat <- matrix(c(20, 12, 1/15, 1/15), nrow=2,
byrow=TRUE)
const.rhs <- c(1800, 8)
const.dir <- c("<=", "<=")
optimum <- lp(direction="max", objective.in, const.mat,
const.dir, const.rhs)
## [1] 45 75
## [1] 2625
library(linprog) # install.packages("linprog")
#> Loading required package: lpSolve
# example of Steinhauser, Langbehn and Peters (1992)
cvec <- c(1800, 600, 600) # gross margins
names(cvec) <- c("Cows", "Bulls", "Pigs")
bvec <- c(40, 90, 2500) # endowment
names(bvec) <- c("Land", "Stable", "Labor")
Amat <- rbind(c(0.7, 0.35, 0),
c( 1.5, 1, 3),
c( 50, 12.5, 20))
# run solver
res <- solveLP(cvec, bvec, Amat, maximum = TRUE)
print(res)
##
##
## Results of Linear Programming / Linear Optimization
##
## Objective function (Maximum): 93600
##
## Iterations in phase 1: 0
## Iterations in phase 2: 2
## Solution
## opt
## Cows 44
## Bulls 24
## Pigs 0
##
## Basic Variables
## opt
## Cows 44.0
## Bulls 24.0
## S Land 0.8
##
## Constraints
## actual dir bvec free dual dual.reg
## Land 39.2 <= 40 0.8 0.0 0.8
## Stable 90.0 <= 90 0.0 240.0 15.0
## Labor 2500.0 <= 2500 0.0 28.8 1375.0
##
## All Variables (including slack variables)
## opt cvec min.c max.c marg marg.reg
## Cows 44.0 1800 900 2400.000 NA NA
## Bulls 24.0 600 450 1200.000 NA NA
## Pigs 0.0 600 -Inf 1296.000 -696.0 6.25
## S Land 0.8 0 NA 731.092 0.0 NA
## S Stable 0.0 0 -Inf 240.000 -240.0 15.00
## S Labor 0.0 0 -Inf 28.800 -28.8 1375.00
Optimasi diperlukan dalam berbagai bidang, diantaranya bidang ekonomi. Misalnya, penerapan sederhananya adalah optimasi digunakan untuk memaksimalkan keuntungan yang akan diraih atau meminimumkan biaya yang akan dikeluarkan oleh perusahaan.