-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
55 lines (42 loc) · 1.97 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "75%"
)
```
# labsimplex
This package implements the simplex algorithms (fixed and variable step-size) for laboratory and proccess optimizations.
## Installation
The development versión of labsimplex can be installed using `install_github()` function from `devtools` package:
```{r, eval = FALSE}
devtools::install_github(repo = 'crparedes/labsimplex', build_vignettes = TRUE)
```
The released version of labsimplex is available from [CRAN](https://CRAN.R-project.org) with:
```{r, eval = FALSE}
install.packages("labsimplex")
```
## Example
This basic example shows how to start an optimization process:
Suppose there is a reaction taking place in water at determinate pH and temperature. Both variables have shown to affect the yield of the reaction, and the purpose is to maximize it. Usually, the reaction is made at 350 °C and pH 5.5, which will be the starting point. Rational changes can be made in steps of 10°C and 0.5 units of pH for each variable, as presented below.
```{r example1}
library(labsimplex)
yield <- labsimplex(n = 2, start = c(350, 5.5), var.name = c('Temp', 'pH'),
stepsize = c(10, 0.5))
print(yield)
```
It is possible to plot the simplex object to visualize the coordinates of the vertexes:
```{r example2}
plot(yield)
```
The experiments corresponding to the Temp. and pH values indicated for each vertex must be performed and the response must be recorded. Suppose the responses for vertexes 1 to 3 were 57\%, 65\% and 54\% respectively. The new vertex can be generated and the simplex movement can be visualized again ploting the simplex.
```{r example3}
generateVertex(simplex = yield, qflv = c(57, 65, 54), overwrite = TRUE)
plot(yield)
```
For more information, read the package manual and vignette.