# How are the voltages calculated?

Quote from momos on July 1, 2024, 2:07 pmHello,

i was wondering how the voltages are calculated. After looking at the source code it obviously is calculated with a matrix.

Is it based on the nodal analysis https://en.wikipedia.org/wiki/Nodal_analysis?

I am genuinely interested in how a simulator like this works, and having access to the sourcecode is fascinating.

Thank you very much.

Hello,

i was wondering how the voltages are calculated. After looking at the source code it obviously is calculated with a matrix.

Is it based on the nodal analysis https://en.wikipedia.org/wiki/Nodal_analysis?

I am genuinely interested in how a simulator like this works, and having access to the sourcecode is fascinating.

Thank you very much.

Quote from arcachofo on July 1, 2024, 3:42 pmYes, you got it right, it is nodal analysis.

Using matrixes is just an algebraic method to solve the system of linear equations: one equation per node (just apply KCL).

Yes, you got it right, it is nodal analysis.

Using matrixes is just an algebraic method to solve the system of linear equations: one equation per node (just apply KCL).