Skip to content

[FEATURE] PiecewiseEffects for Flows #300

Description

@JonaGL

Prerequisite Checks

  • I have searched the existing issues and confirmed this feature doesn't already exist.

  • I have checked the documentation to ensure this feature isn't already available.

Is your feature request related to a problem?

At the moment I'm not able to model the piecewise (in reality non-linear) relationships between flows and effects.

Describe the solution you'd like

I would like to use PiecewiseEffects in Flow:
flixopt.Flow( ... , effects_per_flow_hour=flixopt.PiecewiseEffects( ... ))

Energy System Use Case

I try to implement pressure losses for transmission objects on a very simplified basis. The pressure loss of a pipe is non-linear in respect to the flow in the pipe. To represent the pressure loss more precisely, I would like to use PiecewiseEffects.

Desired Code Example (optional)

# example with pressure losses, which my_effect takes into account
my_piecewise_effect = fx.PiecewiseEffects(
        piecewise_origin=fx.Piecewise(flow_list),
        piecewise_shares={my_effect.label: fx.Piecewise(pressure_loss_list)},
    )

flixopt.Flow( ... , effects_per_flow_hour=my_piecewise_effect)

Component Category (if applicable)

Network/Grid (transmission, distribution)

Alternatives considered

No response

Additional context

No response

Activity

  1. FBumann commented on Sep 4, 2025

    @FBumann
    Member

    @JonaGL Thanks for your request.
    We will work on this.
    It might also be possible to use a linear Transformer with fx.PiecewiseConversioninstead.
    This would lead to the losses being accounted for in a Flow (with a connected Bus and Sink probably), instead of an Effect.
    You should be able to achieve what you are looking for while we work on a more elegant solution.
    If you have any Questions on this don't hesitate to ask here.

  2. FBumann commented on Sep 10, 2025

    @FBumann
    Member

    @JonaGL I will try to solve this on Friday. I can't promise that I'll finish it, but ill keep you updated.

  3. added theissue type on Sep 10, 2025
  4. JonaGL commented on Sep 11, 2025

    @JonaGL
    Author

    @FBumann Thanks a lot!

  5. self-assigned this
    on Sep 12, 2025
  6. linked a pull request that will close this issueFeature/300 piecewiseeffects for flows #310on Sep 12, 2025
  7. FBumann commented on Sep 18, 2025

    @FBumann
    Member

    @JonaGL i hope you got the news #310 (comment)

  8. modified the milestones: v3.1.0, v3.2.0, v4.0.0 on Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions