Coder Social home page Coder Social logo

Constants about gpkit HOT 3 CLOSED

convexengineering avatar convexengineering commented on July 22, 2024
Constants

from gpkit.

Comments (3)

bqpd avatar bqpd commented on July 22, 2024

Ooh, neat. How about a new 'sub' function in Monomial and Posynomial?

(moving 'matrix of exponents associated with each constant in each constraint' to the GP class thread)

L , D, rho, C_L, C_D, S = gpkit.monify('L D rho C_L C_D S')
slf = [ L >= 0.5*rho*C_L*S*V**2,
        D >= 0.5*rho*C_D*S*V**2 ]

constants = {'rho': 1.2, 'V': 50}

# apply constants
cost = (0.5*rho*C_D*S*V**2).sub(constants)
constraints = [ p.sub(constants) for p in slf+other_constraints ]
sol = gpkit.minimize(cost, constraints)

from gpkit.

whoburg avatar whoburg commented on July 22, 2024

Finally getting around to seeing how this works -- this is pretty cool.

from gpkit.

bqpd avatar bqpd commented on July 22, 2024

Still a bit hacky, since it just replaces all of the constants each time, instead of updating them efficiently.

from gpkit.

Related Issues (20)

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.