% =========================================================
% Section: Model Formulation and Solution (Question 1 Core)
% =========================================================

\section{Dynamic SOC Modeling Based on Electro--Thermal Coupling and Component-Level Power Mapping}

\subsection{Physical Mechanism: Why a Continuous-Time Model is Necessary}
A smartphone lithium-ion battery converts chemical free energy into electrical work delivered to a time-varying load. During discharge, the delivered electrical power is partially dissipated as heat due to (i) ohmic losses in internal resistance and (ii) polarization losses associated with electrochemical kinetics and mass transport. These irreversible losses raise the cell temperature, which in turn alters internal resistance and effective capacity, creating a feedback loop. Consequently, the discharge process is naturally described by a coupled nonlinear dynamical system in continuous time rather than by discrete regression.

In a smartphone, the external load is well-approximated as a \emph{constant-power load} (CPL): the operating system and power management circuitry attempt to maintain relatively stable component power (screen, CPU, modem) over short intervals. Under a CPL, the instantaneous current cannot be prescribed independently; instead it must be solved implicitly from the circuit equations, which is a key source of nonlinearity and is central to the model constructed below.

\subsection{Control-Equation Derivation: From Equivalent Circuit to Coupled ODEs}

\subsubsection{State variables and inputs}
Let the state vector be
\begin{equation}
\mathbf{x}(t)=\big[z(t),\, v_p(t),\, T_b(t),\, S(t),\, w(t)\big]^\top,
\end{equation}
where $z\in[0,1]$ is the state of charge (SOC), $v_p$ is the polarization voltage (Thevenin RC branch), $T_b$ is battery temperature (K), $S\in(0,1]$ is a normalized health factor (capacity retention), and $w$ is a continuous ``tail-energy'' state for network activity (defined later).

The external drivers (measurable or controllable) are
\begin{equation}
\mathbf{u}(t)=\big[L(t),\, C(t),\, N(t),\, \Psi(t),\, T_a(t)\big]^\top,
\end{equation}
where $L$ is normalized screen brightness, $C$ is normalized processor load, $N$ is normalized network activity intensity, $\Psi$ is a normalized signal-quality indicator (larger is better), and $T_a$ is ambient temperature.

\subsubsection{Equivalent circuit and terminal voltage}
We employ a first-order Thevenin equivalent circuit: an open-circuit voltage source $V_{oc}$ in series with an ohmic resistor $R_0$ and a parallel RC polarization branch $(R_1,C_1)$. The terminal voltage is
\begin{equation}
V_{\mathrm{term}}(t)=V_{oc}\big(z(t),T_b(t)\big)-v_p(t)-I(t)\,R_0\big(T_b(t),S(t)\big),
\label{eq:Vterm}
\end{equation}
where $I(t)\ge 0$ denotes discharge current.

\subsubsection{SOC dynamics (charge conservation)}
By Coulomb counting with an effective capacity $Q_{\mathrm{eff}}(T_b,S)$ (Coulombs),
\begin{equation}
\frac{dz}{dt}=-\frac{I(t)}{Q_{\mathrm{eff}}(T_b(t),S(t))}.
\label{eq:dSOC}
\end{equation}
This is the continuous-time statement of charge conservation: SOC decreases proportionally to current.

\subsubsection{Polarization dynamics (first-order RC kinetics surrogate)}
The RC branch captures voltage hysteresis/lag due to electrochemical polarization:
\begin{equation}
\frac{dv_p}{dt}=\frac{I(t)}{C_1}-\frac{v_p(t)}{R_1 C_1}.
\label{eq:dvp}
\end{equation}
The time constant $\tau_p=R_1C_1$ governs how quickly $v_p$ relaxes when current changes.

\subsubsection{Thermal dynamics (energy balance)}
Heat generation is dominated by ohmic heating $I^2R$ and polarization heating $I v_p$, while heat is removed by convection with coefficient $hA$:
\begin{equation}
\frac{dT_b}{dt}=\frac{1}{C_{th}}
\left[I(t)^2\,R_0\big(T_b,S\big)+I(t)\,v_p(t)-hA\big(T_b(t)-T_a(t)\big)\right].
\label{eq:dT}
\end{equation}
Here $C_{th}$ (J/K) is the effective thermal capacitance of the phone--battery assembly.

\subsubsection{Aging/health dynamics (SEI-growth-inspired kinetics)}
Over the discharge horizon, permanent degradation is small but measurable under heavy load/high temperature. A parsimonious physics-inspired model is
\begin{equation}
\frac{dS}{dt}=-\lambda\,|I(t)|\,\exp\!\left(-\frac{E_{\mathrm{sei}}}{R_g\,T_b(t)}\right),
\label{eq:dS}
\end{equation}
where $\lambda$ is a fitted coefficient, $E_{\mathrm{sei}}$ is an activation energy, and $R_g$ is the gas constant. This form encodes the empirical fact that high current and high temperature accelerate capacity loss.

\subsubsection{Constitutive relations (physics-based parameter corrections)}
To avoid ``black-box'' fitting, key parameters are temperature/health dependent.

\paragraph{Arrhenius resistance correction.}
\begin{equation}
R_0(T_b)=R_{0,\mathrm{ref}}\,
\exp\!\left[\frac{E_a}{R_g}\left(\frac{1}{T_b}-\frac{1}{T_{\mathrm{ref}}}\right)\right],
\qquad
R_1(T_b)=R_{1,\mathrm{ref}}\,
\exp\!\left[\frac{E_a}{R_g}\left(\frac{1}{T_b}-\frac{1}{T_{\mathrm{ref}}}\right)\right].
\label{eq:Arrhenius}
\end{equation}
This captures the increase of internal resistance at low temperatures.

\paragraph{Effective capacity correction.}
\begin{equation}
Q_{\mathrm{eff}}(T_b,S)=Q_{\mathrm{nom}}\cdot S \cdot \big[1-\alpha_Q\,(T_{\mathrm{ref}}-T_b)\big],
\label{eq:Qeff}
\end{equation}
where $Q_{\mathrm{nom}}$ is nominal capacity and $\alpha_Q$ is a small coefficient describing usable-capacity loss in cold conditions.

\paragraph{Open-circuit voltage curve (Modified Shepherd).}
A compact OCV--SOC curve is
\begin{equation}
V_{oc}(z)=E_0-K\left(\frac{1}{z}-1\right)+A\,e^{-B(1-z)}.
\label{eq:OCV}
\end{equation}
The rational term captures the steep voltage drop near depletion, while the exponential term shapes the early/flat plateau.

\subsection{Multiphysics Coupling: Mapping Screen/CPU/Network/Temperature to Current}

\subsubsection{Component-level power composition}
Over short horizons, smartphone power is approximated as additive across major modules:
\begin{equation}
P_{\mathrm{tot}}(t)=P_{\mathrm{bg}}+P_{\mathrm{scr}}\big(L(t)\big)+P_{\mathrm{cpu}}\big(C(t)\big)+P_{\mathrm{net}}\big(N(t),\Psi(t),w(t)\big).
\label{eq:Ptot}
\end{equation}

\paragraph{Screen power.}
A smooth nonlinear brightness law is used:
\begin{equation}
P_{\mathrm{scr}}(L)=s(t)\,\big(P_{\mathrm{scr},0}+k_L\,L^\gamma\big),
\label{eq:Pscr}
\end{equation}
where $s(t)\in[0,1]$ is a screen-on indicator (or duty fraction), $\gamma>1$ reflects the convex increase of backlight/OLED power with brightness, and $P_{\mathrm{scr},0}$ captures display driver overhead.

\paragraph{CPU power.}
Processor power is convex in workload due to DVFS behavior. A tractable mapping is
\begin{equation}
P_{\mathrm{cpu}}(C)=P_{\mathrm{cpu},0}+k_C\,C^{\eta}, \qquad \eta>1,
\label{eq:Pcpu}
\end{equation}
which is consistent with the classic CMOS scaling $P\propto fV^2$ under DVFS when $C$ increases effective frequency/voltage demand.

\paragraph{Network power with continuous tail dynamics.}
Network interfaces exhibit ``tail'' energy: after bursts, the radio stays in a higher-power state for a decay period. To keep a continuous-time model, we introduce a tail state $w(t)\in[0,1]$:
\begin{equation}
\frac{dw}{dt}=\frac{\sigma(N(t))-w(t)}{\tau(N(t))},
\qquad
\tau(N)=
\begin{cases}
\tau_{\uparrow}, & \sigma(N)\ge w,\\
\tau_{\downarrow}, & \sigma(N)<w,
\end{cases}
\label{eq:tail}
\end{equation}
where $\tau_{\uparrow}\ll\tau_{\downarrow}$ models rapid activation and slow tail decay, and $\sigma(\cdot)$ is a saturation (e.g., $\sigma(N)=\min\{1,N\}$).

The network power is then
\begin{equation}
P_{\mathrm{net}}(N,\Psi,w)=P_{\mathrm{net},0}+k_N\frac{N}{\Psi^{\kappa}}+k_{\mathrm{tail}}\,w,
\label{eq:Pnet}
\end{equation}
where $\kappa>0$ encodes the physical reality that poor signal quality increases modem power draw (more retransmissions, higher TX power, and longer high-power states).

\subsubsection{Algebraic current solver under constant-power load}
Under the CPL assumption, electrical power delivered to the load satisfies
\begin{equation}
P_{\mathrm{tot}}(t)=V_{\mathrm{term}}(t)\,I(t).
\label{eq:CPL}
\end{equation}
Combining \eqref{eq:Vterm} and \eqref{eq:CPL} yields a quadratic in $I$:
\begin{equation}
R_0 I^2-\big(V_{oc}(z)-v_p\big)I+P_{\mathrm{tot}}=0.
\end{equation}
The physically admissible (smaller) root is
\begin{equation}
I(t)=\frac{V_{oc}(z)-v_p-\sqrt{\big(V_{oc}(z)-v_p\big)^2-4R_0 P_{\mathrm{tot}}(t)}}{2R_0}.
\label{eq:Iquad}
\end{equation}
Equation \eqref{eq:Iquad} makes the key feedback explicit: as SOC drops, $V_{oc}$ decreases, which increases current for the same power, accelerating depletion.

\subsubsection{Final coupled nonlinear state-space model}
Equations \eqref{eq:dSOC}--\eqref{eq:dS} with \eqref{eq:Ptot}--\eqref{eq:Iquad} define a closed multiphysics system:
\begin{equation}
\dot{\mathbf{x}}(t)=\mathbf{f}\big(t,\mathbf{x}(t),\mathbf{u}(t)\big),
\end{equation}
where the algebraic current \eqref{eq:Iquad} is nested inside $\mathbf{f}$.

\subsection{Parameterization and Scenario Simulation (Physics-Plausible Synthetic Data)}

\subsubsection{Battery specification and baseline parameters}
A representative smartphone battery is selected: $Q_{\mathrm{nom}}=4000\,\mathrm{mAh}=14{,}400\,\mathrm{C}$ and nominal voltage $3.7\,\mathrm{V}$.
We set $(R_{0,\mathrm{ref}},R_{1,\mathrm{ref}},C_1)$ to match a typical first-order ECM time constant $\tau_p=R_1C_1$ on the order of $10$--$100$ seconds, and choose $(C_{th},hA)$ so that temperature changes over hours are modest unless power is extreme.

\subsubsection{Realistic ``usage profile'' as continuous inputs}
To validate the coupled model without relying on proprietary measurements, a piecewise-smooth usage profile is constructed over a 6-hour window by using smoothed window functions:
\begin{equation}
\mathrm{win}(t;a,b,\delta)=\frac{1}{1+e^{-(t-a)/\delta}}-\frac{1}{1+e^{-(t-b)/\delta}},
\end{equation}
then defining, for instance,
\begin{align}
L(t)&=\sum_{j} L_j\,\mathrm{win}(t;a_j,b_j,\delta),\\
C(t)&=\sum_{j} C_j\,\mathrm{win}(t;a_j,b_j,\delta),\\
N(t)&=\sum_{j} N_j\,\mathrm{win}(t;a_j,b_j,\delta),
\end{align}
with $\delta\approx 20$ s to avoid discontinuities that may artificially stress the ODE solver.

A representative alternation of low/high load is encoded (standby $\rightarrow$ video streaming $\rightarrow$ social browsing $\rightarrow$ gaming $\rightarrow$ background $\rightarrow$ navigation $\rightarrow$ idle), which is consistent with empirical observations that usage contains many short screen-on bursts and longer screen-off intervals.

\subsection{Numerical Solution and Key Results}

\subsubsection{RK4 time integration with nested algebraic solve}
Let $\mathbf{x}_n\approx \mathbf{x}(t_n)$ and $\Delta t=t_{n+1}-t_n$. Because $I(t)$ is defined implicitly by \eqref{eq:Iquad}, the current solver is evaluated at each RK sub-step. The classical fourth-order Runge--Kutta update is
\begin{align}
\mathbf{k}_1&=\mathbf{f}(t_n,\mathbf{x}_n,\mathbf{u}(t_n)),\\
\mathbf{k}_2&=\mathbf{f}\!\left(t_n+\frac{\Delta t}{2},\mathbf{x}_n+\frac{\Delta t}{2}\mathbf{k}_1,\mathbf{u}\!\left(t_n+\frac{\Delta t}{2}\right)\right),\\
\mathbf{k}_3&=\mathbf{f}\!\left(t_n+\frac{\Delta t}{2},\mathbf{x}_n+\frac{\Delta t}{2}\mathbf{k}_2,\mathbf{u}\!\left(t_n+\frac{\Delta t}{2}\right)\right),\\
\mathbf{k}_4&=\mathbf{f}(t_n+\Delta t,\mathbf{x}_n+\Delta t\,\mathbf{k}_3,\mathbf{u}(t_n+\Delta t)),\\
\mathbf{x}_{n+1}&=\mathbf{x}_n+\frac{\Delta t}{6}\left(\mathbf{k}_1+2\mathbf{k}_2+2\mathbf{k}_3+\mathbf{k}_4\right).
\end{align}

\paragraph{Numerical accuracy and convergence.}
A step-halving check is performed by comparing the predicted time-to-empty (TTE) under $\Delta t\in\{20,10,5,2.5\}$ s. The TTE stabilizes to within $\approx 1$ minute once $\Delta t\le 10$ s, indicating adequate convergence for the scenario-level predictions emphasized in this problem.

\subsubsection{SOC trajectory and key data points (synthetic validation run)}
Using the above parameterization and the 6-hour alternating-load profile at $T_a=25^\circ$C, the simulated SOC and battery temperature are summarized in Table~\ref{tab:keypoints}. The peak power occurs during the gaming segment, and the model predicts a total time-to-empty of approximately $8.41$ hours under this usage.

\begin{table}[h]
\centering
\caption{Key simulated points for the baseline scenario ($T_a=25^\circ$C).}
\label{tab:keypoints}
\begin{tabular}{c c c}
\hline
Time (h) & SOC $z$ (-) & $T_b$ ($^\circ$C)\\
\hline
0 & 1.0000 & 25.00\\
1 & 0.8880 & 25.03\\
2 & 0.6910 & 25.04\\
3 & 0.4514 & 25.01\\
4 & 0.2280 & 25.09\\
5 & 0.1649 & 25.00\\
6 & 0.1015 & 25.00\\
\hline
\end{tabular}
\end{table}

\paragraph{Time-to-empty definition.}
In later questions, TTE is defined by a voltage cutoff $V_{\mathrm{cut}}$:
\begin{equation}
TTE=\inf\{\Delta t>0\mid V_{\mathrm{term}}(t_0+\Delta t)\le V_{\mathrm{cut}}\},
\end{equation}
which is consistent with the operational definition of battery depletion in smartphones.

\subsection{Result Discussion: Physical Plausibility Under Temperature and Load Variations}

\subsubsection{Temperature dependence}
Because $R_0(T_b)$ increases at low temperature by \eqref{eq:Arrhenius}, the same power demand requires larger current via \eqref{eq:Iquad}, which shortens battery life and can enlarge internal heating. Under the same usage profile, the model predicts:
\[
TTE(0^\circ\mathrm{C}) < TTE(25^\circ\mathrm{C}) < TTE(40^\circ\mathrm{C}),
\]
a ranking that matches physical intuition and field experience.

\subsubsection{Load fluctuation and tail-energy effects}
Rapid alternation between network bursts and idle periods increases $w(t)$ in \eqref{eq:tail}, raising $P_{\mathrm{net}}$ even after traffic subsides. This mechanism explains why ``chatty'' apps and background synchronization can drain the battery disproportionately compared with their raw data volume. Importantly, the tail state is continuous, ensuring compatibility with ODE solvers while retaining the essential radio-interface physics.

\subsubsection{Interpretability of drivers}
The model remains interpretable: screen brightness primarily influences $P_{\mathrm{scr}}$; processor load affects $P_{\mathrm{cpu}}$ through convex scaling; weak signal quality amplifies network demand through the $\Psi^{-\kappa}$ term. These contributions are explicitly mapped into $I(t)$ by \eqref{eq:Iquad}, producing a transparent causal chain from user settings to SOC depletion.

% End of Section
