# Initial temperature input does not work

**URL:** <https://pybamm.discourse.group/t/initial-temperature-input-does-not-work/435>\
**Category:** General\
**Created:** [16 January 2026 10:10 UTC](https://pybamm.discourse.group/t/initial-temperature-input-does-not-work/435 "2026-01-16T10:10:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oarcelus](https://avatars.discourse-cdn.com/v4/letter/o/46a35a/32.png) [@oarcelus](https://pybamm.discourse.group/u/oarcelus)\
**Post date:** [16 January 2026 10:10 UTC](https://pybamm.discourse.group/t/initial-temperature-input-does-not-work/435/1 "2026-01-16T10:10:26Z")

</div>

Hi, I have seen this entry on GitHub where PyBamm is used to solve the electrical problem, while the thermal problem is handled in Simulink ([GitHub - FaradayInstitution/pybamm\_simulink\_example: An example of how to run pybamm in simulink](https://github.com/FaradayInstitution/pybamm_simulink_example/))

I am having a problem in understanding how PyBamm should be setup for this. I want to solve the electrical problem in PyBamm at a given “isothermal” condition, the heat generated in a solution step will then be handled by a external thermal model, that will then loop back the temperature as an input for the next step in PyBamm.

I have tried a minimal example. Where I setup two “Initial temperature [K]” values using the ORegan2022 parameter set (which includes temperature dependencies on transport). But there is no differences in the voltage response. Am I doing something wrong?

```auto
import pybamm
import matplotlib.pyplot as plt

model = pybamm.lithium_ion.DFN()
parameters = pybamm.ParameterValues(“ORegan2022”)

parameters[“Initial temperature [K]”] = “[input]”

solver = pybamm.IDAKLUSolver()

sim = pybamm.Simulation(model=model, solver=solver, parameter_values=parameters)

solamb = sim.solve([0, 2000], inputs={“Initial temperature [K]”: 298.0})
solamb1 = sim.solve([0, 2000], inputs={“Initial temperature [K]”: 215.0})

time = solamb[“Time [s]”].entries
time1 = solamb1[“Time [s]”].entries
voltage = solamb[‘Voltage [V]’]
voltage1 = solamb1[‘Voltage [V]’]

y_model = voltage(time)
y_model1 = voltage1(time1)

fig = plt.figure()
plt.plot(time, y_model, label=“pSOC”)
plt.plot(time1, y_model1, label=“pSOC”)
plt.show()

```

---

<div class="post-metadata">

**Author:** ![srawat77](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@srawat77](https://pybamm.discourse.group/u/srawat77)\
**Post date:** [23 January 2026 18:42 UTC](https://pybamm.discourse.group/t/initial-temperature-input-does-not-work/435/2 "2026-01-23T18:42:59Z")

</div>

Hi Oarcelus,

You can do it this way:

import pybamm

import matplotlib.pyplot as plt

# Model and parameters

model = pybamm.lithium\_ion.DFN()

parameter\_values= pybamm.ParameterValues(“ORegan2022”)

parameter\_values[“Initial temperature [K]”] = pybamm.InputParameter(“Temperature [K]”)

parameter\_values[“Ambient temperature [K]”] = pybamm.InputParameter(“Temperature [K]”)

import pybamm

import matplotlib.pyplot as plt

sim = pybamm.Simulation(model, parameter\_values=parameter\_values)

plt.figure()

for T0 in [280, 298, 320]:  
soln = sim.solve(  
[0, 3600], inputs={“Temperature [K]”: T0}  
)

plt.plot(

```
    soln\["Time \[s\]"\].entries,

    soln\["Voltage \[V\]"\].entries,

    label=f"{T0} K"

)

```

plt.xlabel(“Time [s]”)

plt.ylabel(“Terminal voltage [V]”)

plt.legend()

plt.show()

Here, `T0` can also come from an external function if needed.  
Note that **both the ambient and initial temperatures must be overridden** , otherwise the isothermal model will not show any temperature effect — the ambient temperature is what effectively controls the isothermal behaviour.

Regards,

Sunil
