How to format a system of differential equations in latex?
You need nothing really special. I'd avoid all those 20pt
that are too much.
Just to avoid issuing \displaystyle
each time, I used dcases
from mathtools
.
The physics
package redefines \div
(which is not a good thing); instead of loading it just for that, use a simple definition of \Div
.
In order to simplify input, I defined a \pder
command and also a \vect
command for vectors to make the input more semantic.
The two subscripts in the first equation should be upright, because they're words rather than symbols.
The lines are equally spaced with the trick of inserting a phantom partial derivative in the last two rows (the second one smashed at the bottom). The \mystrut
command is temporary, just for that equation
environment.
Note that \bigg
should instead be either \biggl
or \biggr
(left and right delimiters). I removed all \big
(that should be \bigl
or \bigr
), because they don't seem really necessary.
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath,mathtools}
\usepackage{amssymb}
\usepackage{bm}
%\usepackage{physics} % I'd recommend avoiding it
\newcommand{\pder}[2]{\frac{\partial#1}{\partial#2}} % or use diffcoeff
\newcommand{\vect}[1]{\mathbf{#1}}
\newcommand{\Div}{\bm{\nabla}\cdot}
\begin{document}
\begin{equation}
\newcommand{\mystrut}{\vphantom{\pder{}{}}}
\begin{dcases}
\chi \biggl( C_{m} \pder{v}{t} + I_{\mathrm{ion}}(v,\vect{w},\vect{c}) \biggr) =
\Div (\vect{D_{M}} \Div v) + I_{\mathrm{app}}
& \Omega_{0}^{s} \times (0,T]
\\[1ex]
\pder{\vect{w}}{t} = \vect{R}(v,\vect{w},\vect{c})
& \Omega_{0}^{s} \times (0,T]
\\[1ex]
\pder{\vect{w}}{t} = \vect{S} (v,\vect{w},\vect{c} )
& \Omega_{0}^{s} \times (0,T]
\\[1ex]
\mystrut
(\vect{D_M} \Div v ) \cdot \vect{N_S} = 0
& \partial\Omega_{0}^{s} \times (0,T]
\\[1ex]
\smash[b]{\mystrut}
v = v_{0} \quad \vect{w} = \vect{w_{0}} \quad \vect{c} = \vect{c_{0}}
& \partial\Omega_{0}^{s} \times \{ 0 \}
\end{dcases}
\end{equation}
\end{document}
If you want right aligned boundary conditions, you can use alignedat
:
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath,mathtools}
\usepackage{amssymb}
\usepackage{bm}
%\usepackage{physics} % I'd recommend avoiding it
\newcommand{\pder}[2]{\frac{\partial#1}{\partial#2}} % or use diffcoeff
\newcommand{\vect}[1]{\mathbf{#1}}
\newcommand{\Div}{\bm{\nabla}\cdot}
\begin{document}
\begin{equation}
\newcommand{\mystrut}{\vphantom{\pder{}{}}}
\left\lbrace
\begin{alignedat}{2}
&\chi \biggl( C_{m} \pder{v}{t} + I_{\mathrm{ion}}(v,\vect{w},\vect{c}) \biggr) =
\Div (\vect{D_{M}} \Div v) + I_{\mathrm{app}}
&\quad \Omega_{0}^{s} \times (0,T]
\\[1ex]
&\pder{\vect{w}}{t} = \vect{R}(v,\vect{w},\vect{c})
&\quad \Omega_{0}^{s} \times (0,T]
\\[1ex]
&\pder{\vect{w}}{t} = \vect{S} (v,\vect{w},\vect{c} )
&\quad \Omega_{0}^{s} \times (0,T]
\\[1ex]
&\mystrut
(\vect{D_M} \Div v ) \cdot \vect{N_S} = 0
&\quad \Omega_{0}^{s} \times (0,T]
\\[1ex]
&\smash[b]{\mystrut}
v = v_{0} \quad \vect{w} = \vect{w_{0}} \quad \vect{c} = \vect{c_{0}}
&\quad \Omega_{0}^{s} \times \{ 0 \}
\end{alignedat}
\right.
\end{equation}
\end{document}
Explanation: alignedat
makes pairs of right-left aligned columns. So the equations are in the “left aligned part” of the first pair, whereas the boundary conditions are in the “right aligned part” of the second pair.
No need to employ a cases
environment. I suggest you employ an alignedat
environment instead.
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath} % for 'alignedat' environment
\usepackage{amssymb,physics}
\begin{document}
\begin{equation}
\addtolength{\jot}{5pt}
\left\{
\begin{alignedat}{2}
\chi \smash[b]{ \Bigl[ C_{m} \frac{\partial v}{\partial t}
+ I_{\mathrm{ion}}( v,\mathbf{w},\mathbf{c}) \Bigr] }
= \div ( \mathbf{D}_{\mathrm{M}} \div v ) + I_{\mathrm{app}}
&\qquad&& \Omega_{0}^{s} \times (0,T]\\
\frac{\partial \mathbf{w}}{\partial t}
= \mathbf{R}(v,\mathbf{w},\mathbf{c} )
&&&\Omega_{0}^{s} \times (0,T] \\
\frac{\partial \mathbf{w} }{ \partial t}
= \mathbf{S} (v,\mathbf{w},\mathbf{c} )
&&& \Omega_{0}^{s} \times (0,T] \\
( \mathbf{D}_{\mathrm{M}} \nabla v ) \cdot \mathbf{N_S} = 0
&&& \partial \Omega_{0}^{s} \times (0,T] \\
v = v_{0} \quad \mathbf{w} = \mathbf{w}_{0} \quad \mathbf{c} = \mathbf{c}_{0}
&&& \partial \Omega_{0}^{s} \times \{ 0 \}
\end{alignedat}
\right.
\end{equation}
\end{document}
You might find some of the environments in mathtools
useful for this. In particular, dcases
is like cases, but each line is in display mode, and spreadlines
changes the line spacing of aligned environments. I also used aligned
, from amsmath
, to add more alignment points.
I also took the liberty of defining a \vectorsym
macro, for readability and so you can change the formatting of all your vectors in one place.
This MWE uses LuaLaTeX, but the body should work fine with your own preamble (You can use isomath
for \vectorsym
in PDFTeX, should you need to.)
i also declared some of your paired delimiters with a \DeclarePairedDelimiter
command, which takes an optional size argument.
\documentclass[10pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage{mathtools}
\usepackage{newcomputermodern}
\newcommand\vectorsym[1]{\symbfit{#1}}
\DeclarePairedDelimiter\closedopen{\lbrack}{\rparen}
\begin{document}
\begin{spreadlines}{2ex}
\begin{equation}
\begin{dcases}
\begin{aligned}
\chi \bigg[ C_{m} \frac{\partial v}{\partial t} + I_{ion}\big( v,\vectorsym{w},\vectorsym{c} \big) \bigg] &=
\nabla \big( \vectorsym{D_{M}} \nabla v \big) + I_{app} \qquad &\Omega_{0}^{s} &\times \closedopen[\big]{0,T} \\
\frac{\partial \vectorsym{w}}{\partial t} &=
\vectorsym{R}(v,\vectorsym{w},\vectorsym{c} \big) \qquad &\Omega_{0}^{s} &\times \closedopen[\big]{0,T} \\
\frac{\partial \vectorsym{w} }{ \partial t} &=
\vectorsym{S} \big(v,\vectorsym{w},\vectorsym{c} \big) \qquad &\Omega_{0}^{s} &\times \closedopen[\big]{0,T} \\
\big( \vectorsym{D_M} \nabla v ) \cdot \vectorsym{N_S} &=
0 \qquad &\partial \Omega_{0}^{s} &\times \closedopen[\big]{0,T} \\
v = v_{0} \quad \vectorsym{w} = \vectorsym{w_{0}} \quad \vectorsym{c} &=
\vectorsym{c_{0}} &\partial \Omega_{0}^{s} &\times \{ 0 \}
\end{aligned}
\end{dcases}
\end{equation}
\end{spreadlines}
\end{document}
Also, physics
(which I’m not too familiar with) seems to redefine \div
to mean \nabla\cdot
, but in standard LaTeX, that means ÷. I’m editing now because that tripped me up, and I’d recommend you not use ambiguous code like this.