Exemplo n.º 1
0
Arquivo: run.py Projeto: bukhsh/oats
def dcopf(tc='default',solver='ipopt',neos=True,out=0):
    """
    Solves DC optimal power flow problem

    ARGUMENTS:
        **tc** (*.xlsx file)  - OATS test case. See OATS data format for details

        **solver** (str)  - name of a solver. Defualt is 'ipopt'

        **neos** (bool) - If True, the problem is solved using NEOS otherwise using a localy install solver.

        **out** (bool) - If True, the output is displayed on screen.
    """

    if tc == 'default':
        tc = default_testcase
    #options
    opt=({'neos':neos,\
    'solver':solver,'out':out})
    testcase = tc
    model ='DCOPF'
    # ==log==
    logging.info("Solver selected: "+opt['solver'])
    logging.info("Testcase selected: "+testcase)
    logging.info("Model selected: "+model)
    runcase(testcase,model,opt)
    logging.info("Done!")
Exemplo n.º 2
0
Arquivo: run.py Projeto: bukhsh/oats
def model(model,tc='default',solver='cplex',neos=True,out=0):
    """
    Solves a user defined model

    ARGUMENTS:
        **model** (*.py file)  - A model file that describes the optimisation problem using PYOMO modelling language.

        **tc** (*.xlsx file)  - OATS test case. See OATS data format for details

        **solver** (str)  - name of a solver. Defualt is 'ipopt'

        **neos** (bool) - If True, the problem is solved using NEOS otherwise using a localy install solver.

        **out** (bool) - If True, the output is displayed on screen.
    """

    if tc == 'default':
        tc = default_testcase
    #options
    opt=({'neos':neos,\
    'solver':solver,'out':out,'user_def_model':True})
    testcase = tc
    model =model
    # ==log==
    logging.info("Solver selected: "+opt['solver'])
    logging.info("Testcase selected: "+testcase)
    logging.info("Model selected: "+model)
    runcase(testcase,model,opt)
    logging.info("Done!")