Giter VIP home page Giter VIP logo

yalps's People

Contributors

ivordir avatar ozonep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ozonep

yalps's Issues

Types missing in "exports"

When importing YALPS, I get the following issue:

There are types at '/.../node_modules/yalps/lib/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'yalps' library may need to update its package.json or typings.

`timedout` when `options.timeout` is not set

The model:

{
  direction: 'maximize',
  objective: 'p1',
  constraints: {
    p1: { min: 0 },
    p2: { min: 2704 },
    p3: { min: 4221 },
    p4: { min: 0 },
    cost: { max: 11004 }
  },
  variables: {
    s1: { cost: 10, p1: 19, p2: 6, p3: 6 },
    s2: { cost: 10, p2: 24, p3: 6 },
    s3: { cost: 10, p2: 6, p3: 26 },
    s4: { cost: 10, p1: 31 },
    s5: { cost: 15, p1: 31, p2: 8, p3: 8 },
    s6: { cost: 15, p2: 36, p3: 8 },
    s7: { cost: 15, p2: 8, p3: 39 },
    s8: { cost: 15, p1: 46 },
    s9: { cost: 20, p1: 46, p2: 8, p3: 8 },
    s10: { cost: 20, p1: 8, p2: 51 },
    s11: { cost: 20, p1: 8, p3: 55 },
    s12: { cost: 20, p1: 61 }
  },
  integers: [
    's1',  's2',  's3',
    's4',  's5',  's6',
    's7',  's8',  's9',
    's10', 's11', 's12'
  ]
}

Help needed how to model

Hi @Ivordir (or others!). I'm new to Linear Solvers, and I need help modeling a simple battery charging scheme. To understand how it works I built a model that doesn't make sense in the real world, but it should help me understand why it doesn't work right now.

So I want to maximize the cost for charging a battery, and am looking for the optimum charge speed and discharge speed
The cost function that needs to be maximized is:

totalCost = 0.5*cs - 0.3*ds (where cs is charge speed, and ds is discharge speed)

There is a constraint for how full the battery can be loaded:
SoC must stay between 0 and 5
the SoC is calculated as a function from charge speed and discharge speed:
SoC = 2*cs - 1.5*ds

{
  direction: 'maximize',
  objective: 'totalCost',
  constraints: { SoC: { min: 0, max: 5 } },
  variables: {
    totalCost: { cs: 0.5, ds: -0.3 },
    SoC: { cs: 2, ds: -1.5 }
  }
}
{ status: 'optimal', result: -0, variables: [] }

So when running the model, I would expect that the maximum cost is where the battery is loaded to its maximum capacity. That would be where ds = 0 and cs = 5 / 2 = 2.5. The totalCost would then be 2.5 * 0.5 = 1.25

But as you can see I get result:-0 and no variables. What is wrong in my model? How do I get the expected result?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.