# How to write a system of ODEs in proper state-space form?

I have the following system of differential equations:

$\dot{x}_1=f_1\left(\dot{x}_1,x_1,x_2\right)\\ \dot{x}_2=f_2\left(\dot{x}_1,x_1,x_2\right)$

where $\dot{x}_1$ and $\dot{x}_2$ are time derivatives of $x_1$ and $x_2$, respectively. The functions $f_1$, $f_2$ are differentiable, but strongly nonlinear. Thus, I cannot express $\dot{x}_1$ and $\dot{x}_2$ on the left hand side as functions of only the state space variables $x_1$ and $x_2$.

Is there a way to transform the above equations into proper state-space form?

Maybe not the answer you are looking for. To get a more specific answer, more information about the function $f_i$ are required. In some sense the question is as hard as finding an explicit form for an implicit equation.

Theoretical local state-space form

If you consider the function $$g_i(y_i,x_1,x_2) := y_i - f_i(y_i,x_1,x_2)$$ and let $\widetilde p = (\widetilde y_1, \widetilde x_1, \widetilde x_2)$ be a point with $g(\widetilde p) = 0$. Then, an application of the implicit function theorem yields a function $\phi_i(x_1,x_2)$ locally defined around $\widetilde p$, such that for all $(y_i,x_1,x_2)$ close to $\widetilde p$ we have $$y_i = \phi_i(x_1,x_2) \iff y_i - f_i(y_i,x_1,x_2) = 0.$$

Therefore, a local state space form is given by $\dot x_i = \phi_i(x_1,x_2)$.

The requirements on $f_i$ are, that $\frac{\partial f_i}{\partial y_i}(\widetilde p) \neq 0$ and that $f_i$ is (at least) continuously differentiable.

Calculus

The derivatives of $\phi_i$ can be expressed in terms of the derivatives of $f_i$, therefore this approach also allows you to carry out some local analysis.

Theoretical global state-space form

This is in general not possible. Take $$f(\dot x,x) = (\dot x-1)(\dot x+1),$$ obviously, the local state-space forms are either $$\dot x = 1 \quad \text{or} \quad \dot x = -1.$$ But none of these are global and it depends on the initial conditions which track you follow. The situation can be arbitrary complex.

Therefore, I would doubt that a general trick exists, which transforms you system into an explicit equation without strict assumptions on $f_i$.

Numerics

Depending on our task, it might be sufficient to use some root-finding algorithm to get the value of $\phi_i$. (But you need to provide initial guesses for $\dot x_i$, for example the previously computed value of $\phi_i$.)

But, I'm not too familiar with numerics for implicit ODEs.

• Dear Steffen, thank you for the answer. I considered the implicit function theorem, but I am afraid that its local manner obstructs its applicability to my particular problem. Maybe I should give a try and check whether the deviations from the numerical solution are acceptable. Unfortunately, I can use numerical solutions only for limited purposes, because eventually, I would like to use these equations in a control system design problem where I need a proper state-space representation. Commented Sep 16, 2018 at 12:13
• In addition, I have some obscure ideas about extending the above system by an additional state variable $\dot{\hat{x}}_1$ and algebraic constraint equation $\dot{x}_1-\dot{\hat{x}}_1 = 0$. However, this might be completely wrong. I don't have any elaborated result yet. Commented Sep 16, 2018 at 12:14
• I already expected that you tried the implicit function theorem before. About the DAE approach, I couldn't make it work either. If you introduce $\dot x_i = y_i$, and the constraint $y_i = f_i(y_i,x_1,x_2)$, you have a DAE and a state-space equation (but with nonlinear state space). Since a lot of theory of DAEs also depends on the implicit function theorem, this is maybe only of limited help. Anyway, maybe someone else has a better idea... Commented Sep 16, 2018 at 14:10