29

I am a beginner in Latex and I would like to know how I can write this system of equations

enter image description here

But I don't know how.

I have tried this code:

\documentclass{article}
\usepackage{mathtools}
\usepackage{nccmath}
\begin{equation}
\centering
\left\{\begin{split}
\mfrac{k_{i\omega}}{k_{p\omega}} &=2\pi \times 10 \\
|\mfrac{(k_{p\omega}s + k_{i\omega})}{s}.\mfrac{1}{(T s + 1)}| &= 1 \\ 
\end{split}\right.
 \end{equation}
 \end{document}

But I couldn't get the absolute value symbol as shown in the figure above and also I couldn't display the s=jw under the absolute value symbol and also the equations aren't aligned

8 Answers 8

32

A solution using the cases environment:

\documentclass[]{article}

\usepackage{amsmath}

\begin{document}
\begin{equation}
    \begin{cases}
      k_{i\omega}/k_{p\omega}=2\pi\times 10\\
      \left\lvert\frac{k_{p\omega}s+k_{i\omega}}{s}\cdot\frac{1}{Ts+1}\right\rvert_{S=\mathrm{j}\cdot2\pi}=1
    \end{cases}\,.
\end{equation}
\end{document}

enter image description here

2
  • 4
    Personally, I do not prefer using cases if there are no cases semantically speaking (WYSIWYM).
    – ivankokan
    Commented Dec 12, 2019 at 23:01
  • 2
    @ivankokan that's why I've added the cleaner array approach.
    – Skillmon
    Commented Dec 12, 2019 at 23:02
14

A solution using array (no packages needed):

\documentclass[]{article}

\begin{document}
\begin{equation}
  \left\{\begin{array}{@{}l@{}}
    k_{i\omega}/k_{p\omega}=2\pi\times 10\\
    \left|
      \frac{k_{p\omega}s+k_{i\omega}}{s}\cdot\frac{1}{Ts+1}
    \right|_{S=\mathrm{j}\cdot2\pi}=1
  \end{array}\right.\,.
\end{equation}
\end{document}

enter image description here

8
\documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{equation*}
  \left\{
    \begin{aligned}
      & k_{i\omega} / k_{p\omega} = 2\pi \times 10 \\
      & {\left|
        \frac{k_{p\omega}s + k_{i\omega}}{s} \cdot \frac{1}{Ts + 1}
      \right|}_{s = j \cdot 2\pi} = 1
    \end{aligned}
  \right.
\end{equation*}
\end{document}

enter image description here

3
  • 1
    In fact, I want the equations to aligned on the left not based on the equal operator?
    – littleesuf
    Commented Dec 12, 2019 at 22:56
  • 1
    I want the first equation to be on the left too
    – littleesuf
    Commented Dec 12, 2019 at 22:59
  • Edited. In general, use the & to specify the place of alignment.
    – ivankokan
    Commented Dec 12, 2019 at 23:13
6

Here is a way to do it, with the dcases and spreadlines environments, from mathtools. The latter package lets you define additional vertical spacing between rows of a multiline equation, which is necessary here, due to the fractions in each line.

I added another solution with the empheq package.

Unrelated: preferably load nccmath before mathtools, as there might be problems with the \intertext command. Also, I defined an \abs command for the absolute value with the \DeclarePairedDelimiter command from mathtools to have the vertical lines adjusted to their contents.

\documentclass{article}
\usepackage{nccmath}
\usepackage{empheq} %% loads mathtools, which loads amsmath
\DeclarePairedDelimiter{\abs}\lvert\rvert

\begin{document}

\begin{spreadlines}{1ex}
\begin{equation}
\begin{dcases}
\mfrac{k_{i\omega}}{k_{p\omega}} =2\pi \times 10 \\
\abs*{\mfrac{(k_{p\omega}s + k_{i\omega})}{s}\cdot \mfrac{1}{(T s + 1)}}= 1
\end{dcases}
\end{equation}
\end{spreadlines}

\begin{empheq}[left=\empheqlbrace]{equation}
    \begin{aligned}
     & \mfrac{k_{i\omega}}{k_{p\omega}} =2\pi \times 10 \\
     & \abs*{\mfrac{(k_{p\omega}s + k_{i\omega})}{s}\cdot \mfrac{1}{(T s + 1)}}= 1
    \end{aligned}
\end{empheq}

\end{document} 

enter image description here

2
  • What is the purpose of \abs*{stuff} compared with \abs{stuff}?
    – pzorba75
    Commented Dec 13, 2019 at 4:51
  • 2
    It adds a pair of implicit \left ... \right. Another solution would be, say, \abs[\bigg]{stuff}, which adds a pair of implicit \biggl ... \biggr.
    – Bernard
    Commented Dec 13, 2019 at 8:12
4

For those like me that came here just to know how to represent a system with two lines of equations and don't care about the rest:


\[
A =
\left\{ 
    \begin{array}{l}
        a &\\
        b
    \end{array} 
\right.
\]

enter image description here

(screenshot taken from Obsidian markdown editor)


Simple explanation

  • You put your equations inside \begin{array}{l} \end{array}, the l mean align left.
  • You separate every element of the array with & and use \\ to change line and put them on different lines.
  • \left\{ creates the curly brace on the left and \right. means there's no visible delimiter on the right.
  • You can add as many lines as you want, likes this:
\[
A =
\left\{ 
    \begin{array}{l}
        a &\\
        b &\\
        c &\\
        d
    \end{array} 
\right.
\]

enter image description here

3
  • 1
    Your answer adds nothing new to the already existing answers. Commented May 25, 2023 at 16:40
  • 2
    @JoséCarlosSantos I respectfully disagree. It adds a lot because it shows only the basic code that someone trying to represent a system needs with a basic explanation without any of the extra confusing code that will just scare anyone that is not a latex specialist and doesn't have the time to or patience to analyse the entire code of other answers. Any student that needs this information for a project and is already overwhelmed by the lack of time they have will be thankful to see it simplified.
    – Yellow
    Commented May 26, 2023 at 17:32
  • Completely agree, with the above, sometimes is just a simple equation or something fast without the need to use anything else Commented Dec 15, 2023 at 22:48
2

A solution with a customized environment in mathematical expression or equation in the preamble

\newenvironment{system}%
{\left\lbrace\begin{array}{@{}l@{}}}%
{\end{array}\right.}

And in the text for example

\begin{equation}
\begin{system}
equation 1  \\
equation 2 
\end{system}
\end{equation}

This code works but was suggested to me by a friend during I was writing my master's thesis

2
  • This is essentially Skillmon's answer, wrapped in a custom environment. Commented May 12, 2023 at 8:59
  • In fact is more clean in the text if there are more systems of equations. Now is less obscure the compact definition in the preample. But thanks to this community for having improved my knowledge. I'm new and tell me if my answer is useless. My friend was and is still a guru for me in using LaTex...
    – giorgio
    Commented May 13, 2023 at 14:50
1

I added my humble proposal using an array for my MWE. The output is very similar to the previous answers. The screenshot is:

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\begin{document}
$\left\{ \begin{array}{ll}
 k_{i\omega}/k_{p\omega}=2\pi\times 10 &\\
\Bigl|\frac{k_{p\omega}s + k_{i\omega}}{s}\cdot\frac{1}{Ts+1}
\Bigr|_{S=\mathrm{j}\cdot 2\pi}=1
\end{array} \right.$ 
\end{document}
1

For fun:

This uses the amsmath package due to the use of \substack. This avoids any align, aligned, gather, array, ... environments but I had to pay the price of aligning manually.

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
$$\Large\left\{\substack{\hspace{-2.1cm}\,k_{i\omega}/k_{p\omega}\,=\,2\pi\,\times\, 10\vspace{0.2cm}\\\,\left|\frac{k_{p\omega}s\,+\,k_{i\omega}}{s}\,\cdot\,\frac{1}{Ts\,+\,1}\right|_{s\,=\,{\rm j}\,\cdot\,2\pi}\,=\,1}\right.$$
\end{document}

enter image description here

You must log in to answer this question.

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