Skip to content

Plan for improving performance

This is based on some discussion and prototyping I did with Sander.

1. Maintain a concrete model instance and update parameters.

Example

# suppose you have a model_instance. Then, you can update this way, instead of creating a new instance
del model_instance.e_price
del model_instance.cost_objective
model_instance.e_price = pyo.Param(model_instance.time, mutable=True, initialize=expected_price)
model_instance.cost_objective = ...

The gains depend on how expensive it is to create the cost function relative to the creating a new model instance. We had some encouraging results in this direction.

2. Use persistent solvers

See notebook on persistent solvers.

Related:

Edited by Flavio Hafner
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information