Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maximum_power setter not called #207

Open
jaredthomas68 opened this issue Aug 25, 2023 · 0 comments
Open

maximum_power setter not called #207

jaredthomas68 opened this issue Aug 25, 2023 · 0 comments

Comments

@jaredthomas68
Copy link
Collaborator

When I try to run examples/optimization/hybrid_sizing_problem.py as in the draft pull request from jaredthomas68/branch:setter_bug, it appears that the setter for maximum_power in the PowerStorageDispatch class is not being called. I tried making sure the PowerStorageDispatch class was inheriting from object ultimately, but that did not seem to help.

Traceback (most recent call last): File "hybrid_sizing_problem.py", line 72, in <module> hybrid_plant.battery.dispatch.set_fixed_dispatch(fixed_dispatch, grid_limit=np.ones(len(fixed_dispatch))) File "/HOPP/hopp/simulation/technologies/dispatch/power_storage/simple_battery_dispatch_heuristic.py", line 50, in set_fixed_dispatch self._set_power_fraction_limits(gen, grid_limit) File "/HOPP/hopp/simulation/technologies/dispatch/power_storage/simple_battery_dispatch_heuristic.py", line 67, in _set_power_fraction_limits self.max_charge_fraction[t] = self.enforce_power_fraction_simple_bounds(gen[t] / self.maximum_power) File "/HOPP/hopp/simulation/technologies/dispatch/power_storage/power_storage_dispatch.py", line 319, in maximum_power return self.blocks[t].maximum_power.value File "/opt/anaconda3/envs/hopp/lib/python3.8/site-packages/pyomo/core/base/param.py", line 212, in value return self() File "/opt/anaconda3/envs/hopp/lib/python3.8/site-packages/pyomo/core/base/param.py", line 867, in __call__ return super(ScalarParam, self).__call__(exception=exception) File "/opt/anaconda3/envs/hopp/lib/python3.8/site-packages/pyomo/core/base/param.py", line 199, in __call__ raise ValueError( ValueError: Error evaluating Param value (heuristic_battery[0].maximum_power): The Param value is currently set to an invalid value. This is typically from a scalar Param or mutable Indexed Param without

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant