Rardin- Ejercicio 4-2 con matlab

Páginas: 2 (287 palabras) Publicado: 4 de marzo de 2014
b) Resuélvelo con el ordenador. Hay que incluir el programa y la salida de ordenador.
PROGRAMA
%--------+---------+---------+---------+---------+---------+---------+---------+
% La función“linprog” sólo minimiza un PL.
% Para maximizar se usa la propiedad: Max f(x)
equivale
a
- Min [-f(x)]
% Para maximizar una función se calcula el mínimo de la función opuesta
% luego se cambia el signodel valor mínimo hallado.
%Por lo tanto, hay que hallar el mínimo de la función: f(X1,X2) = -g(X1, X2) =
% = -(sum(i=1->3)*sum(j=1->4)Sij*Xij = -S11X11-S12X12-S13X13-S14X14-..-S34X34
%-- Datos---------------------------------------------------------------------S11 = -90;
S21 = -60;
S31 = -70;
R1 = 70;
S12 = -80;
S22 = -70;
S32 = -40;
R2 = 50;
S13 = -10;
S23 = -50;
S33 = -80;
R3 = 85;S14 = -50;
S24 = -65;
S34 = -85;
R4 = 35;
format compact
f
= [ S11 S12 S13 S14
S21 S22 S23 S24
S31 S32 S33 S34 ]';
A
= [];
b
= [];
Aeq
= [ 1
1
1
1
0
0
0
0
0
0
0
0
0
0
00
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
1
0
0
0
1
0
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
0
1
0
0
0
1
0
00
1 ];
beq
= [ 80 80 80 R1 R2 R3 R4 ]';
lb
= zeros( 12, 1);
ub
= [];
x0
= [];
%-- Resolvemos el LP -----------------------------------------------options = optimset('LargeScale', 'off','Simplex','on',...
'disp','iter');
[x, fval, exitflag, output, lambda] = ...
linprog( f, A, b, Aeq, beq, lb, ub, x0, options)

SALIDA

The default starting point is feasible, skipping Phase 1.Phase 2: Minimize using simplex.
Iter
Objective
Dual Infeasibility
f'*x
A'*y+z-w-f
0
0
229.02
1
-6300
189.341
2
-9275
147.986
3
-10075
146.629
4
-13675
116.19
5
-16475
85.5862
6-18575
50
7
-18825
0
Optimization terminated.
exitflag = 1
output = iterations: 7
algorithm: [1x21 char]
cgiterations: []
message: [1x24 char]
constrviolation: 0
lambda = ineqlin:...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • EJERCICIOS 2 3 4
  • ejercicios del 1 4 tutoria 2
  • Ejercicios Matlab
  • Ejercicios En Matlab
  • Ejercicios de matlab
  • Matlab ejercicios
  • ejercicios matlab
  • Ejercicios matlab

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS