# state-space model for bidirectional buck-boost with input capacitors

I'm having some trouble simulating the behaviour of a bidirectional buck-boost converter for battery charging purposes. The circuit looks as follows:

I would like to create an averaged state-space presentation for the converter using the following state vector: x = [iL,vC1,vC2]T, the input being u = [io,vi]T (so inputting the battery current and bus voltage), and output y = [ii, vo]T. Here lies the problem, however, as the bus voltage is equal to one of my states, vC1. I want to use the bus voltage as an input when I am charging the battery, but I would like to model the converter as a standalone state-space equation so I can use it later in a bigger project.

In general I am familiar with averaged state-space presentations but the fact that I need to have an input that's equal to one of my states is confusing me... I could take ii (bus current) as the input instead, but doing so I wouldn't be able to make sure that the bus voltage stays at my predefined level. Also, I think it might be problematic to have both ii and io as inputs, would it not? because in the steady-state, you'd end up with an overdetermined system (knowing io, ii and Duty).

Any thoughts on this or a good book recommendation would be highly appreciated!

• Capacitors parallel to ideal voltage sources are totally useless, their current is always zero and can be removed. Infact capacitors are there just to cope with source and load high frequency internal impedance. I believe the best approach for analysis is replacing source and load with appropriate(DC average) current sources so to model worst case, where all the dynamics have to pass through capacitors only. – carloc Aug 16 '18 at 15:51
• In your circuit, by assuming that the state variable is the input voltage, also you have assumed that the capacitor in parallel can charge instantaneously according the input voltage. – Dirceu Rodrigues Jr Aug 16 '18 at 20:46

Consider the output $y(t)$, as typically represented in state-space models: $y(t) = Cx(t)+Du(t)$. If you were to equate one element of $x(t)$ to $u(t)$, then this means the original representation was incorrect in the first place, and rather a representation $y(t) = \tilde{C}\tilde{x}(t)+\tilde{D}u(t)$ was the correct one. Demonstration: if state $x_3$ is equal to $u$:
$$y(t) = Cx(t)+Du(t) = \begin{bmatrix}c1&c2&c3\end{bmatrix}\begin{bmatrix}x_1(t)\\x_2(t)\\u(t)\end{bmatrix}+[d_1]u(t) \\ = \begin{bmatrix}c1&c2\end{bmatrix}\begin{bmatrix}x_1(t)\\x_2(t)\end{bmatrix}+[c_3+d_1]u(t) = \tilde{C}\tilde{x}(t) + \tilde{D}u(t)$$