PyBaMM icon indicating copy to clipboard operation
PyBaMM copied to clipboard

Should initial conditions be a parameter?

Open aabills opened this issue 4 months ago • 4 comments

It's a bit strange that we force passing the initial_soc via the solve method. Also, it's confusing to users sometimes that initial_soc can be a voltage (and non-obvious how to make it a voltage). What if instead, we passed an Initial voltage [V] or Initial SOC parameter in the parameter values (I think this could be an input parameter), and then used model options to decide between initializing between SOC and voltage.

aabills avatar Aug 12 '25 19:08 aabills

My opinion is that anything to do with the "state" of the model (initial SOC/voltage, initial temperature, etc.) shouldn't be part of the parameter set and instead should be passed at solve time. This would require us to specify the total cyclable Li in the parameter set (or something equivalent).

rtimms avatar Aug 12 '25 19:08 rtimms

We effectively already supply initial lithium, and we already supply the state via other parameters because of the Initial concentration in <Electrode> electrode... parameter

        if self.known_value == "cyclable lithium capacity":
            Q_Li = parameter_values.evaluate(
                self.param.Q_Li_particles_init, inputs=inputs
            )
            all_inputs = {**inputs, "Q_n": Q_n, "Q_p": Q_p, "Q_Li": Q_Li}

we also already supply initial temperature as a parameter

aabills avatar Aug 12 '25 19:08 aabills

yeah, so the way we do it is backwards IMO. we should get "initial..." parameters from others

rtimms avatar Aug 14 '25 14:08 rtimms

I think it's fine as a separate dict, but I don't think we should maintain the current simulation kwarg structure.

aabills avatar Aug 19 '25 22:08 aabills