LP_solve
-
- Member
- Posts: 45
- Joined: Wed Dec 13, 2017 5:16 pm
- Vensim version: DSS
LP_solve
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.
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.
Re: LP_solve
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.
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.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Member
- Posts: 45
- Joined: Wed Dec 13, 2017 5:16 pm
- Vensim version: DSS
Re: LP_solve
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.
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.
Re: LP_solve
In that case I know exactly what you're after.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: LP_solve
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.
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.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Member
- Posts: 45
- Joined: Wed Dec 13, 2017 5:16 pm
- Vensim version: DSS
Re: LP_solve
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.
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.
Re: LP_solve
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.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: LP_solve
Here's an example that's probably closer to what's needed:
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Member
- Posts: 45
- Joined: Wed Dec 13, 2017 5:16 pm
- Vensim version: DSS
Re: LP_solve
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).
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).
-
- Member
- Posts: 45
- Joined: Wed Dec 13, 2017 5:16 pm
- Vensim version: DSS
Re: LP_solve
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.
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.
Re: LP_solve
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.
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.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Member
- Posts: 45
- Joined: Wed Dec 13, 2017 5:16 pm
- Vensim version: DSS
Re: LP_solve
Hi there,
I thought I'd circle back on this to see if you ever looked into it? A FIND MIN function would still be extremely helpful.
I thought I'd circle back on this to see if you ever looked into it? A FIND MIN function would still be extremely helpful.
Re: LP_solve
I haven't had a chance to work on this. One question: do you have batteries and pumped hydro? I've done the hourly array trick, but intertemporal features screw things up. Something more sophisticated might be needed.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Member
- Posts: 45
- Joined: Wed Dec 13, 2017 5:16 pm
- Vensim version: DSS
Re: LP_solve
We do have batteries and pumped hydro, but they are not part of this solution, we handle them separately because of intertemporal issues, as you suggest. We use the prior year outputs on market revenue to allocate when they are charged (batteries) and discharged (both), and modify the load (both) instead of using them as dispatch resources.
This would primarily be use for generation resources to identify the lowest cost mix to meet system requirements.
This would primarily be use for generation resources to identify the lowest cost mix to meet system requirements.