Linp                   package:LIM                   R Documentation

_S_o_l_v_e_s _a _l_i_n_e_a_r _i_n_v_e_r_s_e _m_o_d_e_l _u_s_i_n_g _l_i_n_e_a_r _p_r_o_g_r_a_m_m_i_n_g.

_D_e_s_c_r_i_p_t_i_o_n:

     Solves a linear inverse model using linear programming

     Input presented either as:


        *  matrices E, F, A, B, G, H (Linp.double) or

        *  as a list (Linp.lim) or

        *  as a lim input file (Linp.limfile)

_U_s_a_g_e:

     Linp(...)
     Linp.lim(lim,cost=NULL,ispos=lim$ispos,...)
     Linp.limfile(file, verbose=TRUE,...)
     Linp.character(...)
     Linp.double(...) 

_A_r_g_u_m_e_n_t_s:

    lim : a list that contains the linear inverse model specification,
          as  generated by function 'setup.limfile'. 

   file : name of the inverse input file. 

verbose : if 'TRUE': when reading the file, prints warnings and
          messages to the screen. 

   cost : if not 'NULL', a vector with the coefficients of the cost
          function (to be minimised). 

  ispos : if 'TRUE': all x-values have to be positive. 

    ... : other arguments passed to function linp from
          package'limSolve'. 

_D_e_t_a_i_l_s:

     Solves the following inverse problem:

                        min(sum {Cost_i*x_i})

     or

                       max(sum {Profit_i*x_i})

     subject to

                                x_i>=0


                                 Ax=B


                                Gx>=H


     and where Cost_i or Profit_i are weighting coefficients

_V_a_l_u_e:

     a list containing: 

      X : vector containing the solution of the linear programming
          problem. 

unconstrained.solution : vector containing the unconstrained solution
          of the linear programming problem. 

residualNorm : scalar, the sum of residuals of equalities and violated
          inequalities. 

solutionNorm : scalar, the value of the quadratic function at the
          solution. 

IsError : logical, 'TRUE' if an error occurred. 

  Error : linp error text. 

   type : linp. 

_A_u_t_h_o_r(_s):

     Karline Soetaert <k.soetaert@nioo.knaw.nl>

_R_e_f_e_r_e_n_c_e_s:

     Michel Berkelaar and others (2005). lpSolve: Interface to Lpsolve
     v. 5 to solve linear/integer programs. R package version 1.1.9.

_S_e_e _A_l_s_o:

     'linp', the more general function from package 'lpSolve'

     'Ldei', to solve the linear inverse problem by least distance
     programming

     'Lsei', to solve the linear inverse problem by lsei (least squares
     with equality and inequality constraints)

     function 'linp' from package'limSolve'

_E_x_a_m_p_l_e_s:

       # the Blending example
       Linp(LIMBlending)

       # the E coli example: two functions to maximimise
       Linp(LIMEcoli)
       # E coli example, but only first function optimised..
       Linp(LIMEcoli,cost=-LIMEcoli$Profit[1,])

       # a foodweb example: need to specify the cost function
       # here just sum of absolute values of flows...
       Linp(LIMRigaAutumn,cost=(rep(1,LIMRigaAutumn$NUnknowns)))

