I was trying to type the following equation, which 2 conditions answer for P(t). However, I don't get what I want. I do appreciate it if someone could please help me. I also required a single equation number for this equation as shown.
\begin{equation} \label{eq31} \begin{aligned}P(t) &= \!\begin{aligned}\Big\{[A(t)-B(t)].\Delta t] &\forall t, when A(t)>B(t) \\ {} 0 \forall t when A(t)\leq B(t) \end{aligned} \\ \end{aligned} \end{equation}
[
]
