# Construction of a Lagrangian function for a circuit

I was reading the paper "Introduction to quantum electromagnetic circuits", by U. Vool and M. Devoret and I am stuck in the construction of a Lagrangian function for the example LC circuit they present there (figure attached).

The recipe says: $$\mathcal{L} = \mathcal{E}_{kin} - \mathcal{E}_{pot},$$ being the subtraction of kinetic energy and potential energy. My problem is with potential term, and just for clarity I will show both of them.

Kinetic energy can be obtained from: $$\mathcal{E}_{kin} = \frac{1}{2}\dot{\phi}^{T}[C]\dot{\phi},$$ being $$\phi = \begin{pmatrix} \phi_a\\ \phi_b \end{pmatrix}$$

the node flux vector, \dot{\phi} its derivative, and $$\[C]\$$ is the capacitance matrix, when you run through an open loop of capacitors, and the potential term is given by $$\mathcal{E}_{pot} = \frac{1}{2} \phi^T[L^{-1}]\phi + \sum_{b} \frac{1}{L_b} (\phi_n - \phi_{n'})\tilde{\Phi}_b.$$ In above equation, $$\[L^{-1}]\$$ is the matrix of inverse of inductances, obtained when you run through the inductances loop and remove row and column of the ground node. The sum in second term of the potential energy extends to all branches that contains an inductor, and $$\\phi_n - \phi_{n'}\$$ is the difference in fluxes between nodes $$\n\$$ and $$\n'\$$.

The potential energy they found in the paper for the circuit in the figure (attached) is:

$$\mathcal{E}_{pot} = \frac{\phi_a^2}{2L_1} + \frac{\phi_b^2}{2L_2} + \frac{(\phi_a - \phi_b + \tilde{\Phi})^2}{2L_3}.$$

The relation between node flux and branch flux is given by: $$\Phi_{b\in T} = \phi_n - \phi_{n'}\\ \Phi_{b\in \bar{T}} = \phi_n - \phi_{n'} + \tilde{\Phi},$$ with $$\\tilde{\Phi}\$$ the magnetic flux through the loop formed by inductors, and T is the spanning tree and $$\\bar{T}\$$ its complement.

The $$\[L^{-1}]\$$ matrix is obtained as following: non diagonal elements are written as $$\-1/L_{j,k}\$$, where $$\L_{j,k}\$$ is the inductance in a branch that connects nodes j and k. The diagonal elements will be the opposite of the sum of values in the corresponding row or column.

Proceeding in this way, I get: $$\begin{pmatrix} \frac{1}{L_1} + \frac{1}{L_3} && -\frac{1}{L_3}\\ -\frac{1}{L_3} && \frac{1}{L_2} + \frac{1}{L_3} \end{pmatrix}$$

I already removed the row and column of the ground node.

For the sum term, I get: $$\sum_{b} \frac{1}{L_b} (\phi_n - \phi_{n'}) \tilde{\Phi}_b = \frac{1}{L_1} (\phi_a + \tilde{\Phi})\phi_a + \frac{1}{L_2} (\phi_b + \tilde{\Phi})\phi_b + \frac{1}{L_3} (\phi_a - \phi_b + \tilde{\Phi})(\phi_a - \phi_b).$$

In above equation, I consider that the flux in ground node is zero.

When I sum all the terms, there is no way to get the same result the authors shown.

If someone is aware of the recipe by Devoret, would be nice to hear from. Is my error in L matrix, in sum over inductive branches term, or both?

-- EDIT: Detailed calculation.

For kinetic energy the capacitances matrix is: $$[C'] = \begin{pmatrix} C_1 + C_2 & -C_1 & -C_2 \\ -C_1 & C_1 + C_3 & -C_3 \\ -C_2 & -C_3 & C_2 + C_3 \end{pmatrix}$$ Being 1 the ground node, I eliminate row 1 column 1, which gives: $$[C] = \begin{pmatrix} C_1 + C_3 & -C_3 \\ -C_3 & C_2 + C_3 \end{pmatrix}$$

Now we must to perform a simple matrix product (see eq. for kinetic energy) to get: $$\mathcal{E}_{kin} = \frac{C_1 \dot{\phi}_a^2}{2} + \frac{C_2 \dot{\phi}_b^2}{2} + \frac{C_3 (\dot{\phi}_a^2 - \dot{\phi}_b^2)}{2},$$ which is the expected result and is given in paper.

For the potential energy, following the recipe, the complete matrix of the inverse of inductances is:

$$[l^{-1}] = \begin{pmatrix} 1/L_1 + 1/L_2 & -1/L_1 & -1/L_2\\ -1/L_1 & 1/L_1 + 1/L_3 & -1/L_3\\ -1/L_2 & -1/L_3 & 1/L_2 + 1/L_3 \end{pmatrix}$$

Now, being again 1 the ground node, I choose to remove column 1 and row 1 to get:

$$[L^{-1}] = \begin{pmatrix} 1/L_1 + 1/L_3 & -1/L_3\\ -1/L_3 & 1/L_2 + 1/L_3 \end{pmatrix}$$

We still have for the potential energy, the branch contribution (see eq. for potential energy).

This development I already showed here. But performing the matrix product together with the sum term, I get:

$$\frac{\tilde{\Phi} \phi_a}{L_1} + \frac{\tilde{\Phi}\phi_a}{L_3} - \frac{3\phi_a^2}{2L_1} + \frac{3\phi_a^2}{2L_3} - \frac{\tilde{\Phi}\phi_b}{L_2} - \frac{\tilde{\Phi}\phi_b}{L_3} - \frac{3\phi_a\phi_b}{L_3} + \frac{3\phi_b^2}{2L_2} + \frac{3\phi_b^2}{2L_3}$$ which is not even close to the expression in paper.

• Axis, I'd like to see more of your development rather than try and do all this from whole cloth on my own. This is a new topic for me. But math is math and the use of lagrangians and all of what you wrote about the use of matrices is pretty clear -- though I think I may disagree about the removal of the ground node row and column. (I just think the rank-nullity theorem may have a few things to say, once I see more about what you are doing.) Commented Mar 4, 2023 at 18:55
• periblepsis, I really appreciate your kindness and willing to help. I will edit my question to show missing points.
– axis
Commented Mar 6, 2023 at 9:42
• Maybe I am missing something in the theory. Maybe a zero magnetic flux in some loop and that I am still considering... In this case, the problem with my math is with branch summation. I don't know.
– axis
Commented Mar 6, 2023 at 17:43
• I haven't had time to read changes, nor the paper. I will, when I get time. I did a quick skim of the paper looking for terms like "summing" and "spanning tree" and found them. So, in the back of my mind is a question about the sums of fluxes in and out of edges, which like KCL must be zero. Which says "nullspace" to me. The spanning tree says rowspace. But it's impossible for Ax=[0] to get any useful (non[0]) vector values to start. So it must be that the sum vector elements in the result must be zero but that specific terms in it can be other than zero. Anyway, I need to read and then think. Commented Mar 7, 2023 at 0:18
• @axis I wonder if you found a solution to this problem in the end since I am struggling like you with finding the proper Lagrangian. Commented Sep 12, 2023 at 19:24