19

Following Problem: I have a PDE and two boundary conditions what i actually want is:

PDE (1)

BC1 (1a)

BC2 (1b)

and what i have is:

PDE (1)

BC1 (2a)

BC2 (2b)

is there something which provides a functionallity like this?

MWE:

\documentclass[standalone]{article}
\usepackage[utf8x]{inputenc}    
\usepackage{amsmath}
\begin{document}
\begin{equation}
    \nonumber \frac{\partial}{\partial t}\left(\widetilde{c}_{\text{s}}\left(r,z,t\right)+c_{\text{s,0}}\right)=\frac{D_{\text{s}}}{r^{2}}\frac{\partial}{\partial r}\left(r^{2}\frac{\partial \left(\widetilde{c}_{\text{s}}\left(r,z,t\right)+c_{\text{s,0}}\right)}{\partial r}\right)
\label{eq:litdiff}
\end{equation}
The boundary conditions of Eq. \eqref{eq:litdiff} are given by
\begin{subequations}
    \begin{align}
        D_{\text{s}}\frac{\partial}{\partial r} \widetilde{c}_{\text{s}}(0,z,t)&=0\label{eq:diffusionpartialdiff_boundaries0}\\
        D_{\text{s}}\frac{\partial}{\partial r} \widetilde{c}_{\text{s}}(R_{\text{s}},z,t) &= -j(z,t)\label{eq:diffusionpartialdiff_boundariesRs}
        \intertext{and the initial condition is given by}
        \widetilde{c}_{\text{s}}(r,z,0) = 0 \quad r\in \left[0;R_{\text{s}}\right]. \label{eq:diffusionpartialdiff_init}
    \end{align}
\end{subequations}
\end{document}
4
  • The easiest way is to remove \nonumber in the main equation and use \addtocounter{equation}{-1} just before \begin{subequations}
    – user31729
    Commented Dec 30, 2014 at 10:50
  • 1
    utf8x option to inputenc is outdated, the standalone option has no effect to article
    – user31729
    Commented Dec 30, 2014 at 10:56
  • In fact you have PDEs, not ODEs...
    – user31729
    Commented Dec 30, 2014 at 11:06
  • \nonumber was a failure because of copy and paste; yes it's PDE...too focused on the Latex-Problem. i'll edit it.
    – user69453
    Commented Dec 30, 2014 at 12:18

2 Answers 2

18

Use \tag and the fact that \label at the start of a subequations environment refers to the current main equation number.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\subs}{\textup{s}}

\begin{document}
\begin{subequations}\label{eq:litdiff}
\begin{equation}
\frac{\partial}{\partial t}(\widetilde{c}_{\subs}(r,z,t)+c_{\subs,0})=
  \frac{D_{\subs}}{r^{2}}\frac{\partial}{\partial r}
    \left(
      r^{2}\frac{\partial (\widetilde{c}_{\subs}(r,z,t)+c_{\subs,0})}{\partial r}
    \right)
\tag{\ref{eq:litdiff}}
\end{equation}
The boundary conditions of Eq.~\eqref{eq:litdiff} are given by
\begin{align}
D_{\subs}\frac{\partial}{\partial r} \widetilde{c}_{\subs}(0,z,t)
  &=0\label{eq:diffusionpartialdiff_boundaries0}\\
D_{\subs}\frac{\partial}{\partial r} \widetilde{c}_{\subs}(R_{\subs},z,t)
  &= -j(z,t)\label{eq:diffusionpartialdiff_boundariesRs}
\end{align}
and the initial condition is given by
\begin{equation}
\widetilde{c}_{\subs}(r,z,0) = 0 \quad r\in [0;R_{\subs}]. 
  \label{eq:diffusionpartialdiff_init}
\end{equation}
\end{subequations}
\end{document}

I removed all the superfluous \left and \right. Also \text{s} has been changed to \subs for better readability and input (note that _{\text{s,0}} is wrong and should be _{\text{s},0}).

The last equation needs equation, not being in the align.

Important. Don't forget ~ in cases such as Eq.~\eqref{eq:litdiff}.

enter image description here

8

A \addtocounter{equation}{-1} will do. However, I don't get the nonumber directive in a equation you refer to later, so I deleted it:

\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}

\begin{document}
\begin{equation}
    \frac{\partial}{\partial t}\left(\widetilde{c}_{\text{s}}\left(r,z,t\right)+c_{\text{s,0}}\right)=\frac{D_{\text{s}}}{r^{2}}\frac{\partial}{\partial r}\left(r^{2}\frac{\partial \left(\widetilde{c}_{\text{s}}\left(r,z,t\right)+c_{\text{s,0}}\right)}{\partial r}\right)
\label{eq:litdiff}
\end{equation}
The boundary conditions of Eq. \eqref{eq:litdiff} are given by\addtocounter{equation}{-1}
\begin{subequations}
    \begin{align}
        D_{\text{s}}\frac{\partial}{\partial r} \widetilde{c}_{\text{s}}(0,z,t)&=0\label{eq:diffusionpartialdiff_boundaries0}\\
        D_{\text{s}}\frac{\partial}{\partial r} \widetilde{c}_{\text{s}}(R_{\text{s}},z,t) &= -j(z,t)\label{eq:diffusionpartialdiff_boundariesRs}
        \intertext{and the initial condition is given by}
        \widetilde{c}_{\text{s}}(r,z,0) = 0 \quad r\in \left[0;R_{\text{s}}\right]. \label{eq:diffusionpartialdiff_init}
    \end{align}
\end{subequations}

From condition \eqref{eq:diffusionpartialdiff_boundaries0}, we see that…

\end{document} 

enter image description here

2
  • 1
    Personally, I think this one is a little cleaner than the OP's preferred answer. And it seems less "hack"-y to me.
    – grfrazee
    Commented Aug 11, 2015 at 19:35
  • This doesn't seem to work for equations with a number greater than 1. Commented Jul 2, 2023 at 22:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .