[Scilab-users] Solving linear problem in scilab using Karmarkar and Primal Affine Scaling Method

Paul BIGNIER paul.bignier at scilab-enterprises.com
Fri Oct 11 16:26:07 CEST 2013


Hello Jennifer,

Are you certain that our problems are worrectly written?

For intstance, why is there a "2" alone in a line of the first problem ? 
And why do your right-hand side elements all have "x" ("0x", "1x", "15x")?

I cannot rewrite them but I can tell you that yes, karmarkar allows to 
solve such problems.
Just have a look at its help page : 
http://help.scilab.org/docs/5.4.1/fr_FR/karmarkar.html

Your first problem should look something like this:
c = [1 -2 0 0 4]'; // Main problem
Aeq = [1 0 -1 0 0 ; ? ? ? ? ? ; 1 -2 4  0 -4 ; ? 2 0 1 -4 ; ? 1 1 1 1]; 
// Equations
beq = [0 ? 0 0 1]; // Right-hand side

[xopt, fopt, exitflag, iter, yopt] = karmarkar(Aeq, beq, c)

If the solution is not all positive (inequality constraint), add an 
inequality matrix A, like in the help page.

Hope that helps,
Paul.


On 10/10/2013 05:38 AM, Jennifer Basbas wrote:
> Dear All,
>
> I am new to Scilab and I'm wondering if anyone can help me solve the 
> following minimization problem in linear programming using Scilab:
>
> 1. Apply Karmarkar's algorithm to solve
> Minimize -
> x1 - 2x2 + 4x5subject to
> x2 - x3 = 0
> 2
> x1 - 2x2 + 4x3 - 4x5 = 0x
> 1 + 2x2 + x4 - 4x5 = 0x
> 1 + x2 + x3 + x4 + x5 = 1x
> 1, x2, x3, x4, x5 >= 0
>
> 2. Apply the primal affne scaling algorithm to solve
> Minimize -
> 2x1 + x2subject to
> x1 - x2 + x3 = 15x
> 2 + x4 = 15x
> 1, x2, x3, x4 >= 0
> Hint: The optimal solution is
> x* = [30 15 0 0]T with optimal value -45.
> Any inputs will be greatly appreciated. Thank you.
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users


-- 
Paul BIGNIER
Scilab Engineer & Xcos Developer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.69
http://www.scilab-enterprises.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20131011/00ba1c9c/attachment.htm>


More information about the users mailing list