- 文章信息
- 作者: kaiwu
- 点击数:3410
软件名称:Scimago Graphica
官方网站:www.graphica.app
开发机构:SCImago Lab (www.scimagolab.com)
软件大小:264兆
更新日期:2021-9-30
A new way to explore, visually communicate and make sense of data. Scimago Graphica is completely free, but if you need even more features, we are working on a pro version.
Scimago Graphica作为Scimago Journal & Country Rank(SJR期刊排名)的数据可视化工具(www.scimagojr.com/viztools.php),完全免费,支持windows,mac和linux系统,目前提供了30种图形和示例数据,支持交互功能,很多方面已经很接近商业软件tableau了(www.tableau.com)。
- 文章信息
- 作者: kaiwu
- 点击数:658
https://gs.statcounter.com/browser-market-share/desktop/worldwide/#monthly-200901-202301
The market share of web browsers for desktop.
全球桌面电脑网页浏览器软件的市场份额,数据来自statcounter.com
1.Google chrome
https://www.google.com/chrome/
https://pc.qq.com/detail/1/detail_2661.html
2.Microsoftware IE,Edge_Legacy,Edge
https://www.microsoft.com/edge
3.Firefox
https://www.mozilla.org/en-US/firefox/new/
http://www.firefox.com.cn/
4.Apple Safari
https://www.apple.com.cn/safari/
5.Opera
https://www.opera.com/browsers/opera
- 文章信息
- 作者: kaiwu
- 点击数:715
R Notebook
1.参考资料
1.1 Modern optimization with R
Cortez, P. (2021). Modern optimization with R.Springer.
cover_modern_optimization_with_R.jpg
1.2 Modeling and Solving Linear Programming with R
1.3 Linear Programming with R: Exploring the “lpSolve” R package
Roberto Salazar,Nov 17, 2019
Linear Programming with R: Exploring the “lpSolve” R package
1.4 lpSolveAPI Package Users Guide by Kjell Konis
2. prepraration
2.1 import libraries
# Import lpSolve package
library(lpSolve)
library(XLConnect)
2.2 the problem: 班次安排问题
## 2.3 连接Excel文件
mybook<-loadWorkbook("D:/kedu/teaching_datasets/Excel_model/sm_solver.xls")
rsheets<-getSheets(mybook)
rsheets
[1] "table-chair" "beef" "transport" "staff"
3. linear programming
3.1 Set coefficients of the objective function
设定目标函数,因为是求和,所以矩阵是1,1,1,1,1,1 matrix在这里非常重要 研究一下如何生成重复的相同元素
#f.obj <- c(4, 2)
f.obj <-as.matrix(rep(1,each=7))
3.2 Set matrix corresponding to coefficients of constraints by rows
Do not consider the non-negative constraint; it is automatically assumed
就是员工工作的可用矩阵 注意:这里面通常包含标题,默认header=TRUE,那么startRow=7
#f.con <- matrix(c(5, 15,20, 5), nrow = 2, byrow = TRUE)
f.con <-as.matrix(readWorksheet(mybook, sheet = "staff", startRow = 8, endRow = 14,
startCol = 17, endCol = 23,header=FALSE))
3.3 Set unequality signs
设置不等式符号 可以每行设置不同的符号
f.dir <- as.matrix(rep(">=",each=7))
3.4 Set right hand side coefficients
约束条件的范围
#f.rhs <- c(50,40)
f.rhs <-as.matrix(readWorksheet(mybook, sheet = "staff", startRow = 8, endRow =14,
startCol = 27, endCol = 27,header=FALSE))
3.5 设定变量取整数 f.intvec,例如f.intvec <- c(1,2)表示x1,x2取整数
如果自变量全都是整数,那么 all.int = TRUE就可以了
#f.intvec <- c(1,2)
3.6 Final value (z)
计算结果
#report_lp<-lp("min", f.obj, f.con, f.dir, f.rhs,int.vec = f.intvec)
# 部分变量取整数:int.vec = f.intvec
report_lp<-lp("min", f.obj, f.con, f.dir, f.rhs, all.int = TRUE)
report_lp
Success: the objective function is 9
report_lp$objval
[1] 9
# output the final value
writeWorksheet(mybook,report_lp$objval,sheet = "staff", startRow =16,startCol = 25,header = FALSE)
saveWorkbook(mybook)
3.7 Variables final values
report_solution<-report_lp$solution
report_solution
[1] 0 1 0 0 1 3 4
## 保存变量取值
## 结果是一个矩阵(1列),所以为了在excel变为1行,需要转置,t()
writeWorksheet(mybook,t(report_solution),sheet = "staff", startRow =16,startCol = 17,header = FALSE)
saveWorkbook(mybook)
3.8 Sensitivities
敏感度分析
report_lp<-lp("min", f.obj, f.con, f.dir, f.rhs, all.int = TRUE,compute.sens=TRUE)
report_lp$sens.coef.from
[1] 1e+00 -1e+30 0e+00 0e+00 0e+00 0e+00 0e+00
report_lp$sens.coef.to
[1] 1.000000e+30 1.000000e+30 1.333333e+00 1.000000e+00 1.333333e+00
[6] 1.333333e+00 1.333333e+00
3.9 Dual Values (first dual of the constraints and then dual of the variables)
Duals of the constraints and variables are mixed
report_lp$duals
[1] 0 1 0 0 0 0 0 0 1 0 0 0 0 0
3.10 Duals lower and upper limits
report_lp$duals.from
[1] -1e+30 -1e+30 7e+00 6e+00 6e+00 5e+00 4e+00 -1e+30 -1e+30 -1e+30
[11] -1e+30 -1e+30 -1e+30 -1e+30
report_lp$duals.to
[1] 1.000000e+30 1.000000e+30 8.333333e+00 8.666667e+00 8.666667e+00
[6] 9.000000e+00 9.333333e+00 1.250000e+00 2.500000e-01 1.000000e+30
[11] 1.000000e+30 1.000000e+30 1.000000e+30 1.000000e+30
- 文章信息
- 作者: kaiwu
- 点击数:668
https://www.ted.com/talks/juan_enriquez_how_technology_changes_our_sense_of_right_and_wrong