Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to solve linear equation systems using CP

    Posted 04/13/16 07:41 AM

    Originally posted by: memo85


    Hi,

    I would like to solve the linear equations systems like the one given below by using CP. 

    A unique solution of this equation systems is given below,

    The solutions are continuous float values. But CP does not support the continuous variable. So, I did not model the equation system and solve it. How can I find a unique solution for any linear equation systems by using CP? Thank you in advance. 

    Regards. 

     

     


    #ConstraintProgramming-General
    #DecisionOptimization


  • 2.  Re: How to solve linear equation systems using CP

    Posted 04/13/16 10:26 AM

    Hi,

    why not using CPLEX ?

    dvar float l[1..3];

    subject to
    {
    l[1]-0.1*l[2]-0.05*l[3]==5;
    -0.75*l[1]+l[2]==0;
    -0.25*l[1]-0.9*l[2]+l[3]==0;
    }

    gives your solution.

    regards


    #ConstraintProgramming-General
    #DecisionOptimization


  • 3.  Re: How to solve linear equation systems using CP

    Posted 04/13/16 10:37 AM

    Originally posted by: memo85


    Hi, Alex. 

    thank you very much for your reply. I do not think about using CPLEX. Your reply is really a helpful answer for me. Nevertheless, I wonder that whether it is possible by using CP, or not? 

    Regards. 


    #ConstraintProgramming-General
    #DecisionOptimization


  • 4.  Re: How to solve linear equation systems using CP

    Posted 04/13/16 10:45 AM

    Well then you could write

    using CP;
     
     int scale=100000;
    dvar int lscale[1..3] in -10*scale..10*scale;

    dexpr float l[i in 1..3]=lscale[i]/scale;

    subject to
    {
    abs(l[1]-0.1*l[2]-0.05*l[3]-5)<=0.0001;
    abs(-0.75*l[1]+l[2])<=0.0001;
    abs(-0.25*l[1]-0.9*l[2]+l[3])<=0.0001;
    }

    execute
    {
    writeln(l);
    }

    But I wonder why you do not want to use CPLEX.

    Regards


    #ConstraintProgramming-General
    #DecisionOptimization


  • 5.  Re: How to solve linear equation systems using CP

    Posted 04/13/16 10:53 AM

    Originally posted by: memo85


    Thank you very much. Similar that equation system is part of my integrated model. And my model is CP based. So, firstly I think that I can model the equations by using CP. Also, I want to learn how to model continuous variable in CP. Using an integer scale is very advisable. 

    Best regards. 


    #ConstraintProgramming-General
    #DecisionOptimization