LP_solve

Use this forum to post Vensim related questions.
Post Reply
RobbieOrvis
Member
Posts: 43
Joined: Wed Dec 13, 2017 5:16 pm
Vensim version: DSS

LP_solve

Post by RobbieOrvis »

Hello,

I came across documentation on the ability to use LP_solve in Vensim and am interested in exploring this capability. However, I am getting errors that Vensim cannot open MultiExtLib.dll nor the VenextLP.dll.

Does Vensim still support the use of these plugins? It looks old (~2013) so perhaps it just hasn't been updated for use on the newest versions.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: LP_solve

Post by tomfid »

Right - it hasn't been updated. It would probably work with an older version, 6 or 7.

Is there a particular problem you're looking to solve? LP_SOLVE is a pain to incorporate because it's under the LGPL license, but we've been thinking of adding some LP-based functions for some time.
RobbieOrvis
Member
Posts: 43
Joined: Wed Dec 13, 2017 5:16 pm
Vensim version: DSS

Re: LP_solve

Post by RobbieOrvis »

Thanks Tom, we are making forays into more detailed electricity capacity expansion modeling to integrate with the EPS. Dedicated capacity expansion models use linear programming to solve for deployment since the goal is to minimize a cost function with many different options. Happy to share more detail on how some other models approach this.

We recognize that Vensim isn't necessarily designed to be a LP solver, but if the functionality were there, we'd definitely explore using it for this.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: LP_solve

Post by tomfid »

In that case I know exactly what you're after.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: LP_solve

Post by tomfid »

I should add that there's another way to solve the problem: FIND ZERO. The computational load may be heavier because it can handle nonlinear effects, which may not be needed.

The basic idea is to compute a node price that clears the market between supply and demand simultaneously. Then demand = f(devices,price) and supply = g(capacity,price). f() is probably something like referenceDemand*(price/referencePrice)^elasticity, and g() could be something like a logistic curve, such that a plant's utilization = 50% when price = their operating cost.

To handle capacity shortfalls, you can add an "unserved energy" source that kicks in at a high threshold.

This can also be extended to include multiple nodes with transmission.
RobbieOrvis
Member
Posts: 43
Joined: Wed Dec 13, 2017 5:16 pm
Vensim version: DSS

Re: LP_solve

Post by RobbieOrvis »

An extremely belated reply here, but do you have any examples of the FIND ZERO application used in the way you mentioned? I've got the example .mdl file downloaded and am looking at that, but thought I would check.

I think perhaps the example above is for electricity generation, which we actually have handled alright as is. The main issue is with building new capacity where demand is predetermined elsewhere in the model.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: LP_solve

Post by tomfid »

Here's an example that's not quite what you need, but hopefully easily adaptable. This was built to explore a bug in FIND MARKET PRICE in a narrow use case (excess demand, CES type 5 curves), but the second view illustrates how to do allocation with FIND ZERO. I'll see if I have a better example.
DEMAND AT PRICE TYPE 5-TF 1D.mdl
(21.3 KiB) Downloaded 82 times
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: LP_solve

Post by tomfid »

Here's an example that's probably closer to what's needed:
elec load alloc.mdl
(6.98 KiB) Downloaded 73 times
RobbieOrvis
Member
Posts: 43
Joined: Wed Dec 13, 2017 5:16 pm
Vensim version: DSS

Re: LP_solve

Post by RobbieOrvis »

Thanks for this. Will have a look!

By the way, Jeff and I are working on an 8760 dispatch model within an annual timestep model within the EPS that you might find interesting and we hope to have soon. We mapped hours onto a subscript and the model solves using ALLOCATE AVAILABLE for each hour. We backed out the hourly marginal price by identifying the Z-scores and using the mean and standard deviation fed into the allocation. From there, we have hourly dispatch and hourly market prices. Happy to share when it's done (and it will be included in our next EPS release).
RobbieOrvis
Member
Posts: 43
Joined: Wed Dec 13, 2017 5:16 pm
Vensim version: DSS

Re: LP_solve

Post by RobbieOrvis »

I've been playing around with this a bit, starting from the FIND ZERO example and trying to build something for electricity capacity. However, this has proven to be very tough. I tried developing a formula that would get closer to zero with a growing difference in future system costs with additions that lower the cost, subject to some constraints, but I think the nonlinearity of the penalties and the structure of FIND ZERO don't really lend it well to calculating this correctly. I definitely got some odd behavior too, probably because I wasn't quite using FIND ZERO as it was intended.

I'm not sure there are plans to do it, but a variation of this function but FIND MIN would basically be exactly what's needed, where the formula could iteratively test and narrow to a solution that reduces to a tolerance level.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: LP_solve

Post by tomfid »

I'd be interested to see any of your nonworking experiments.

FIND MIN would be very much in the spirit of a linear programming approach. It would probably be easy to repurpose the Powell optimizer for this, though I'm not sure what performance would be like. I'll look into it.
Post Reply