Skip to content

[Bug]: TypeError: must be real number, not BoundaryValue when using a callable controller in CustomStepExplicit #5019

Open
@leigedove

Description

@leigedove

PyBaMM Version

25.1.1

Python Version

3.10.16

Describe the bug

Hi PyBaMM team, thanks for your fantastic work on this project.

I’m experimenting with custom control strategies using CustomStepExplicit, where the current is determined by a user-defined callable function that depends on variables like voltage.

However, I'm encountering the following error when running the simulation:
TypeError: must be real number, not BoundaryValue

do not yield plain Python floats, but instead return symbolic objects (likely of type BoundaryValue or similar), which cannot be directly consumed by downstream numerical libraries.

Are there any solutions for these problems?

Thank you!

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions