Skip to content

Electricity-Only example fails to complete clustering with HiGHs and SCIP ("Solver scip does not support quadratic problems"). #2092

@ZilentKnight

Description

@ZilentKnight

Version Checks (indicate both or one)

  • I have confirmed this bug exists on the lastest release of PyPSA-Eur.

  • I have confirmed this bug exists on the current master branch of PyPSA-Eur.

Issue Description

Hi!

I am trying to run the tutorial electricity-only but I keep getting an error when it reaches clustering and tries to solve the problem using open-source solvers (HiGHs, SCIP, CoinCBC).
ValueError: Solver scip does not support quadratic problems.

I have not modified config.electricity.yaml and I could not find anyone else raising the same error.
It work when I tried to use Gurobi's solver (without a license), but this is not an option for my future application.

Thank you in advance.

Log

Clustering network to 6 clusters
localrule cluster_network:
    input: resources/test-elec/networks/base_s.nc, resources/test-elec/admin_shapes.geojson, resources/test-elec/regions_onshore_base_s.geojson, resources/test-elec/regions_offshore_base_s.geojson, resources/test-elec/electricity_demand_base_s.nc
    output: resources/test-elec/networks/base_s_6.nc, resources/test-elec/regions_onshore_base_s_6.geojson, resources/test-elec/regions_offshore_base_s_6.geojson, resources/test-elec/busmap_base_s_6.csv, resources/test-elec/linemap_base_s_6.csv
    log: logs/test-elec/cluster_network_base_s_6.log
    jobid: 18
    benchmark: benchmarks/test-elec/cluster_network_base_s_6
    reason: Missing output files: resources/test-elec/networks/base_s_6.nc, resources/test-elec/busmap_base_s_6.csv, resources/test-elec/regions_onshore_base_s_6.geojson, resources/test-elec/regions_offshore_base_s_6.geojson
    wildcards: clusters=6
    resources: tmpdir=C:\Users\user\AppData\Local\Temp, mem_mb=10000, mem=10 GB, mem_mib=9537
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1771924503.963646   43676 instrument.cc:563] Metric with name 'grpc.resource_quota.calls_dropped' registered more than once. Ignoring later registration.
E0000 00:00:1771924503.963812   43676 instrument.cc:563] Metric with name 'grpc.resource_quota.calls_rejected' registered more than once. Ignoring later registration.
E0000 00:00:1771924503.963852   43676 instrument.cc:563] Metric with name 'grpc.resource_quota.connections_dropped' registered more than once. Ignoring later registration.
E0000 00:00:1771924503.963880   43676 instrument.cc:563] Metric with name 'grpc.resource_quota.instantaneous_memory_pressure' registered more than once. Ignoring later registration.
E0000 00:00:1771924503.963914   43676 instrument.cc:563] Metric with name 'grpc.resource_quota.memory_pressure_control_value' registered more than once. Ignoring later registration.
WARNING:pypsa.network.io:Importing network from PyPSA version v1.0.7 while current version is v1.1.2. Read the release notes at `https://go.pypsa.org/release-notes` to prepare your network for import.
INFO:pypsa.network.io:Imported network 'PyPSA-Eur (osm vlatest)' has buses, carriers, lines, shapes
INFO:__main__:The configured solver `highs` does not support quadratic objectives. Falling back to `scip`.
INFO:linopy.model: Solve problem using Scip solver
ERROR:root:Uncaught exception
Traceback (most recent call last):
  File "C:\Users\user\github\pypsa-eur_test\.snakemake\scripts\tmp8p52w33p.cluster_network.py", line 676, in <module>
    n_clusters_c = distribute_n_clusters_to_countries(
        n,
    ...<3 lines>...
        solver_name=solver_name,
    )
  File "C:\Users\user\github\pypsa-eur_test\.snakemake\scripts\tmp8p52w33p.cluster_network.py", line 346, in distribute_n_clusters_to_countries
    m.solve(solver_name=solver_name)
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\github\pypsa-eur_test\.pixi\envs\default\Lib\site-packages\linopy\model.py", line 1352, in solve
    raise ValueError(
        f"Solver {solver_name} does not support quadratic problems."
    )

Reproducible Example

pixi shell
snakemake -call results/test-elec/networks/base_s_6_elec_.nc --configfile config/test/config.electricity.yaml

Expected Behavior

Clustering cannot be solved because "Solver SCIP does not support quadratic problems".

Traceback (most recent call last):
  File "C:\Users\user\github\pypsa-eur_test\.snakemake\scripts\tmp8p52w33p.cluster_network.py", line 676, in <module>
    n_clusters_c = distribute_n_clusters_to_countries(
        n,
    ...<3 lines>...
        solver_name=solver_name,
    )
  File "C:\Users\user\github\pypsa-eur_test\.snakemake\scripts\tmp8p52w33p.cluster_network.py", line 346, in distribute_n_clusters_to_countries
    m.solve(solver_name=solver_name)
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\github\pypsa-eur_test\.pixi\envs\default\Lib\site-packages\linopy\model.py", line 1352, in solve
    raise ValueError(
        f"Solver {solver_name} does not support quadratic problems."
    )

Installed Versions

I have attached the pixi.lock-file, as its content was too large.
pixi.lock.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions