State Space Model for diff equations

Hello. I have read the reference about State Space Model and cannot catch one moment.
Suppose we have a simple RC network consting from one capacitor and one resistor (passive differentiator).
Supply voltage is u_In and output is u_R
By means of KVL:
u_In == u_C + u_R
voltage accross capacitor is a state
then

components = {Subscript[u, C][t]' == 1/C i[t], 
  Subscript[u, R] == i[t] R}
kirchhoff = {Subscript[u, in][t] == 
   Subscript[u, C][t] + Subscript[u, R][t]}
StateSpaceModel[Join[components, kirchhoff], {Subscript[u, C][t]}, 
 Subscript[u, in][t], Subscript[u, R][t], t]

But ouptut repeats input
cannot create state space.

the same problem arrises when I try to create ssm of other circuits. when i am wrong? what is my mistake?

All variables of time must be either a state variable or input.

StateSpaceModel[Join[components, kirchhoff], 
{Subscript[u, C][t], Subscript[u, R][t], i[t]}, Subscript[u, in][t], Subscript[u, R][t], t]

will give a descriptor state-space model.

Thank You. That was my mistake.
OK. All variables of time must be either a state variable or input, but after entering

StateSpaceModel[Join[components, kirchhoff], 
{Subscript[u, C][t], Subscript[u, R][t], i[t]}, Subscript[u, in][t], Subscript[u, R][t], t]

I have
StateSpaceModel::invrlzn: The system of equations {Subscript[u, C]^\==i/C,Subscript[u, R]==R i,Subscript[u, in]==Subscript[u, C]+Subscript[u, R]} with outputs {Subscript[u, R]} does not possess a state-space realization.

google, but nothing. please, help!

There was another mistake in your original code that I forgot to mention. The expression is Subscript[u, C]’ not Subscript[u, C]'.

Here’s the complete set of inputs

components = {Subscript[u, C]'[t] == 1/C i[t], Subscript[u, R] == i[t] R};
kirchhoff = {Subscript[u, in][t] == Subscript[u, C][t] + Subscript[u, R][t]};
StateSpaceModel[Join[components, kirchhoff], 
     {Subscript[u, C][t], Subscript[u, R][t], i[t]}, Subscript[u, in][t], Subscript[u, R][t], t]

Thank You :slight_smile: