h=ntent-transfer-encoding:to:subject:message-id:date:from
:mime-version:x-gm-message-state:from:to:cc;
bh=WLxmAnsIOOynn+5yRdphCblQt6+2ybaZlEyE24kZE=;
b=SjD+vzAWfmKwjV/ixl9ef8kMSjDpbjemDAEveJybIJmk5WNYEUF7aUXPkqjdW1igwr
QJiu/1sY3HB5QR+LJXglbe9DJlFUwuFYNX/i9Ltp5ozV9raDTyt4jx2k/JtCO/J+gVIE
LOdVNZDN26SSIuFCA7t8PdBW2kgyQMWUQ/u2LW6OuBF0oNPdWyDd4uN/Vw15NUXUciAe
xcHPTar9hdeCvQZpsaWqn8bpdbB+Ns853zmzXBHbS1nRtWqpb0HMK0iO5kWhPqTOljwG
vUkMjmeezlLYhIe05pjSELvnqcz68bjorsVkARSfXp/qLk02c0IS8CvATsnZgm4NJFUg
KMzQ=X-Gm-Message-State: AJIora8il7dg3XsAt6wmwYUUAnu4lol+LT9Ce1I5+T9dNWhET3qVKV06
WeOql6MybYgtkkHiEgogckC+YyPoT5uj9i1lJ0BCclI9mN2y+A=X-Google-Smtp-Source: AGRyM1tqeufBEs6oS5HawbBkNWLxPgDiQYTBQnfeUEhEVfy7cApP3kEN92xFN8Ud4q+uD2V8cA0JA055r00ZSdStlFIX-Received: by 2002:a05:6e02:1c86:b0:2de:89f:ccd1 with SMTP id
w6-20020a056e021c8600b002de089fccd1mr10638086ill.5.1659540144772; Wed, 03 Aug
2022 08:22:24 -0700 (PDT)
MIME-Version: 1.0
From: Sebastian Kruk <residuo.solow en gmail.com>
Date: Wed, 3 Aug 2022 12:22:51 -0300
Message-ID: <CAMn86NexyY9pqjtoCAt7PLj4F0Rx9EG6NF3gMi8RKxvHcc3GCg en mail.gmail.com>
To: Lista R <r-help-es en r-project.org>
X-Newsl: is not newsletter (2.0/5.0) position : 0, not decisive
X-MailCleaner-MachineLearning0: is not spam (23.714926838874817%)
(200728-ALL-10L) (es)
X-MailCleaner-MachineLearning1: is not spam (92.98120141029358%)
(200728-ALL-50S) (es)
X-NiceBayes: is not spam (50.13%) position : 3, not decisive
X-Spamc: is not spam (0.0/5.0) position : 7, ham decisive
X-MailCleaner-Information: Please contact servicedesk en id.ethz.ch for more
information
X-MailCleaner-ID: 1oJGCY-00039v-Oi
X-MailCleaner: Found to be clean
X-MailCleaner-SpamCheck: not spam, Newsl (score=0, required=5.0,
MC_NEWS_NIPRBL= position : 0, not decisive),
MachineLearning (23.714926838874817% es, position : 2, not decisive),
MachineLearning (92.98120141029358% es, position : 2, not decisive),
NiceBayes (50.13%, position : 3, not decisive), Spamc (score=0,
required=0, FREEMAIL_FROM 0.0, RCVD_IN_DNSWL_NONE -0.0,
DKIM_VALID -0.3, MC_SPF_PASS -0.0, DKIM_VALID_AU -0.3,
RCVD_IN_MSPIKE_H2 -0.0, DKIM_SIGNED 0.6, position : 7, ham decisive)
X-MailCleaner-ReportURL: https://mailcleaner.ethz.ch/rs.php
Subject: [R-es] Rglpk_solve_LP
X-BeenThere: r-help-es en r-project.org
X-Mailman-Version: 2.1.25+j1
Precedence: list
List-Id: =so-8859-1?q?Ayuda_sobre_R_en_español?= <r-help-es.r-project.org>
List-Unsubscribe: <https://stat.ethz.ch/mailman/options/r-help-es>,
<mailto:r-help-es-request en r-project.org?subject=subscribe>
List-Archive: <https://stat.ethz.ch/pipermail/r-help-es/>
List-Post: <mailto:r-help-es en r-project.org>
List-Help: <mailto:r-help-es-request en r-project.org?subject=lp>
List-Subscribe: <https://stat.ethz.ch/mailman/listinfo/r-help-es>,
<mailto:r-help-es-request en r-project.org?subject=bscribe>
Content-Type: text/plain; charset=so-8859-1"
Content-Transfer-Encoding: quoted-printable
Errors-To: r-help-es-bounces en r-project.org
Sender: "R-help-es" <r-help-es-bounces en r-project.org>
X-FEAS-SPF: spf-result=ss, ip9.132.119.208, helo=hypatia.math.ethz.ch, mailFrom=r-help-es-bounces en r-project.org
X-FEAS-DKIM: Valid
X-FE-Policy-ID: 21:3:1:uca.es
Estimados usuarios-R:
Estoy probando el solver GLPK.
Me pasaron un programa en Octave y lo convertà a R pero me da siempre
que la solución es 0.
En R me quedó asÃ:
######################################################
#1) Datos
#PerÃodo de estudio (dÃas)
T = 10
#Demanda diaria
dda = 10*matrix(1,T,1)
#Capacidad de camión (m3)
K=30
#Capacidad de tanque (m3)
cap_tqe=40
#Stock inicial (m3)
s0=15
#Max cantdad diaria de camiones
x_max=10
##################################
#2) Modelo simple, puede entregar todos los dÃas, camiones enteros
#
# Variables: z=[x; s], cant camiones x(t) y stock final s(t)
c = matrix(rep(1:0,each = T))
vlb = matrix(rep(0,2*T))
vub = matrix(c(x_max*rep(1,T),cap_tqe*rep(1,T)))
#Rest de balance: s(t)=s(t-1)+K*x(t)-dda(t)
A1=matrix(0,nrow=T,ncol=2*T)
A1[,1:T]=diag(K,dim(A1[,1:T]))
T2 = T+1
T3 = 2*T
library(pracma)
A1[,T2:T3]=-diag(1,T,T)+Diag(rep(1,T-1),-1)
b1 = dda
b1[1] = b1[1]-s0
#Tipo de variables y restricciones
varint=rep("I",T)
varcont=rep("C",T)
ctype=rep("S",T)
#vartype=[varint varcont];
vartype=c(varcont, varcont)
#-----
sense=1;
Rglpk_solve_LP(obj = c, mat =A1, dir = rep("<=",nrow(A1)),rhs = b1,max
= F, types = vartype)
######################################################
¿Cuál será el problema?
Gracias,
Sebastián.