%%HP: T(0)A(D)F(.);
@ Argumentos: Optimizar
@ Author: Manuel Dario
@ E-mail: manueldariofajardo gmail.com
@ Version: 1
@ Created using HPUserEdit 5 [www.unparche.com]

« 0 0 0 ¨ n ecup var
  « "Optimizacion con 1 restriccion"
    {
    { "F:" "Funcion que se desea optimizar" 0, 6, 9 }
    { "G:" "Restriccion o funcion ligadura" 0, 6, 9 }}
    { 1 0 } { } { }
    INFORM
    DROP
    'ecup' STO
    ecup 1 GET STEQ
    ecup 2 GET 'G' STO
    EQ LNAME 'var' STO
    DROP
    EQ EVAL var DERIV 'EC1' STO 
    G EVAL var DERIV – * «EVAL» MAP 'EC2' STO 
    EC1 SIZE 1 GET 1 + 'n' STO
    1 n 1 - 
    FOR I
      'EC1(I)' 'EC2(I)' = EVAL
    NEXT
    'G' EVAL n ¨ARRY 'Ecuaciones' STO
    var AXL – + AXL 'var' STO 
    'Ecuaciones' EVAL var {1 , n } 1 CON AXL 1 GET AXL MSLV 'Optm' STO
    DROP DROP
    1 n 
    FOR I
      'var(I)' 'Optm(I)' = EVAL
    NEXT
    1 n 1 - 
    FOR I
      'Optm(I)' EVAL 'var(I)' EVAL STO
    NEXT  
    EQ EVAL "Optimo" ¨TAG
    1 n  
    FOR I
      'var(I)' EVAL PURGE
    NEXT  
  »
»