0

I would like to align these equations as shown in the picture by eq. 3.1. Optimal control problem

I tried to use the command \begin{align*} unsuccessfully. My equations are automatically set to the centre, I've also tried to itemise the equations but I do get an error.

% --------------
%\begin{align*}
\begin{subequations} \label{eq:optimalsteuerungsprob_zeitkont}
    \begin{equation} \label{eq:optProb_J_Phi_l}
        \min_{\textbf{u} \in \mathcal{A}} \quad J[\textbf{u}(\cdot)] = \varphi\big(t_f, \textbf{x}(t_f)\big) + \int_{t_s}^{t_f} l\big(t,\textbf{x}(t),\textbf{u}(t)\big)\,\mathrm{d}t
    \end{equation}
    \begin{equation}
        \text{u.B.v.} \quad \dot{\textbf{x}}(t) = \textbf{f}(t,\textbf{x}(t), \textbf{u}(t)) \qquad , \qquad \textbf{x}(0)=\textbf{x}_{0}
    \end{equation}
    \begin{equation} \label{eq:optProb_endbedin_PSI}
        \psi\big(\,t_f,\textbf{x}(t_f)\big) = \textbf{0}
    \end{equation}
    \begin{equation}
        \textbf{h}\big(t,\textbf{x}(t),\textbf{u}()t\big) \le \textbf{0} \quad , \quad \forall t \in [t_{s},t_{f}]
    \end{equation}
\end{subequations}
%\end{align*}
%-----------------

Could You please help me in this task for my final thesis?

Many thanks

0

3 Answers 3

1

Here is how to do that with alignat. I systematically replaced \textbf with \mathbf. Note there also exists a package for optimisation problems formatting, optidef.

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{subequations} \label{eq:optimalsteuerungsprob_zeitkont}
    \begin{alignat}{3} \label{eq:optProb_J_Phi_l}
         & \min_{\mathbf{u} \in \mathcal{A}} & & J[\mathbf{u}(\cdot)] = \varphi\big(t_f, \mathbf{x}(t_f)\big)+ {}& & \int_{t_s}^{t_f} l\big(t,\mathbf{x}(t),\mathbf{u}(t)\big)\,\mathrm{d}t \\[2ex]
         & \text{u.B.v.} & \quad & \dot{\mathbf{x}}(t) = \mathbf{f}(t,\mathbf{x}(t), \mathbf{u}(t)),%
         & & \mathbf{x}(0)=\mathbf{x}_{0} \\ \label{eq:optProb_endbedin_PSI}
         & & & \psi\big(\,t_f,\mathbf{x}(t_f)\big) = \mathbf{0} \\
         & & & \mathbf{h}\big(t,\mathbf{x}(t),\mathbf{u}()t\big) \le \mathbf{0}, %
         & & \forall t \in [t_{s},t_{f}]
    \end{alignat}
\end{subequations}

 \end{document} 

enter image description here

2

I would use alignat inside subequations without any additional space between columns. The code:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{subequations} \label{eq:optimalsteuerungsprob_zeitkont}
\begin{alignat}{2}
  \min_{\textbf{u} \in \mathcal{A}} \quad &J[\textbf{u}(\cdot)] = \varphi\big(t_f, \textbf{x}(t_f)\big)+{}&&\int_{t_s}^{t_f}
        l\big(t,\textbf{x}(t),\textbf{u}(t)\big)\,\mathrm{d}t\label{eq:optProb_J_Phi_l}\\
        \text{u.B.v.} \quad &\dot{\textbf{x}}(t) = \textbf{f}(t,\textbf{x}(t), \textbf{u}(t)),
  &&\textbf{x}(0)=\textbf{x}_{0}\\
  &\psi\big(\,t_f,\textbf{x}(t_f)\big) = \textbf{0}\label{eq:optProb_endbedin_PSI}\\
  &\textbf{h}\big(t,\textbf{x}(t),\textbf{u}()t\big) \le \textbf{0}, &&\forall t \in [t_{s},t_{f}]
\end{alignat}
\end{subequations}
\end{document}

The result (see that the second columns in rows 2 and 4 are aligned to the integral sign): enter image description here

1

The layout and numbering seems a little unusual, I ended up having to have align immediately following another display, then correcting for the bad space that causes.

enter image description here

Because you are numbering each line of the conditions in the same sequence as the equation you can't use aligned as a sub-term, which is what I'd normally use here.

\documentclass{article}

\usepackage{amsmath}

\begin{document}

% --------------

\begin{subequations} \label{eq:optimalsteuerungsprob_zeitkont}
\begin{equation}
    \label{eq:optProb_J_Phi_l}
        \min_{\textbf{u} \in \mathcal{A}} \quad J[\textbf{u}(\cdot)] = \varphi\bigl(t_f, \textbf{x}(t_f)\bigr) + \int_{t_s}^{t_f} l\bigl(t,\textbf{x}(t),\textbf{u}(t)\bigr)\,\mathrm{d}t
\end{equation}
\vspace{-\baselineskip}% sigh
\begin{align}
        \text{u.B.v.} \quad&\dot{\textbf{x}}(t) = \textbf{f}(t,\textbf{x}(t), \textbf{u}(t)), && \textbf{x}(0)=\textbf{x}_{0}
\\ & \label{eq:optProb_endbedin_PSI}
        \psi\bigl(\,t_f,\textbf{x}(t_f)\bigr) = \textbf{0}
\\&
        \textbf{h}\bigl(t,\textbf{x}(t),\textbf{u}()t\bigr) \le \textbf{0},&& \forall t \in [t_{s},t_{f}]
    \end{align}
\end{subequations}
%\end{align*}
%-----------------
\end{document}

You must log in to answer this question.

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