# Best practices for solving overdetermined systems of linear equations

**URL:** <https://root-forum.cern.ch/t/best-practices-for-solving-overdetermined-systems-of-linear-equations/64871>\
**Category:** Newbie\
**Tags:** math\
**Created:** [May 28, 2026, 2:48pm UTC](https://root-forum.cern.ch/t/best-practices-for-solving-overdetermined-systems-of-linear-equations/64871 "2026-05-28T14:48:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaniilKorshkov](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/daniilkorshkov/32/39905_2.png) [@DaniilKorshkov](https://root-forum.cern.ch/u/DaniilKorshkov)\
**Post date:** [May 28, 2026, 2:48pm UTC](https://root-forum.cern.ch/t/best-practices-for-solving-overdetermined-systems-of-linear-equations/64871/1 "2026-05-28T14:48:51Z")

</div>

* * *

_ROOT Version:_ 6.36.04  
_Platform:_ ubuntu linux  
_Compiler:_ g++

* * *

Dear ROOT users,

I would like to know what would be the best practice for solving the following overdetermined system of linear equations (shown as ASCII drawing below):

```auto
/ \ / \ / \
| Ar_01 He_01 CO2_01 | | | | IC_01 |
| Ar_02 He_02 CO2_02 | | Ar__PPM | | IC_02 |
| Ar_03 He_03 CO2_03 | X | He__PPM | = | IC_03 |
| Ar_04 He_04 CO2_04 | | CO2_PPM | | IC_04 |
|... | | | | ... |
| Ar_50 He_50 CO2_50 | | | | IC_50 |
\ / \ / \ /

```

Where matrix at the left side of the equation and vector at the right side of the equation are known; and least-square solution of vector containing “PPM” entries is required.

Would greatly appreciate any help,

Kind regards,

Daniil Korshkov, Carleton University physics department

P.S. Sorry for ASCII drawing being distorted

---

<div class="post-metadata">

**Author:** ![lbreitwi](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/lbreitwi/32/21330_2.png) [@lbreitwi](https://root-forum.cern.ch/u/lbreitwi)\
**Post date:** [May 28, 2026, 3:53pm UTC](https://root-forum.cern.ch/t/best-practices-for-solving-overdetermined-systems-of-linear-equations/64871/2 "2026-05-28T15:53:21Z")

</div>

Hi Daniil,

welcome to the ROOT forum.  
Since your question is about linear algebra rather than ROOT, I’d recommend to discuss this with your supervisor. As a starter you could take a look at [1] or a linear algebra textbook.  
If you do have a ROOT specific question or problem, please let us know.

Lukas

[1] [Overdetermined system - Wikipedia](https://en.wikipedia.org/wiki/Overdetermined_system)

---

<div class="post-metadata">

**Author:** ![DaniilKorshkov](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/daniilkorshkov/32/39905_2.png) [@DaniilKorshkov](https://root-forum.cern.ch/u/DaniilKorshkov)\
**Post date:** [May 28, 2026, 4:27pm UTC](https://root-forum.cern.ch/t/best-practices-for-solving-overdetermined-systems-of-linear-equations/64871/3 "2026-05-28T16:27:17Z")

</div>

Hello Lukas,

Thank you for reaching out.

Since ROOT is a language specifically designed for solving mathematical problems, and due to workplace requirements I need to solve this problem using ROOT (sorry as I forgot to mention it before), I assumed there are plenty of people on this forum who have expertise solving such problems

Kind regards,

Daniil

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [May 29, 2026, 9:14am UTC](https://root-forum.cern.ch/t/best-practices-for-solving-overdetermined-systems-of-linear-equations/64871/5 "2026-05-29T09:14:54Z")

</div>

Maybe [root/tutorials/math/matrix at master · root-project/root · GitHub](https://github.com/root-project/root/tree/master/tutorials/math/matrix) helps  
or [ROOT: Matrix Linear Algebra](https://root.cern/doc/master/group__Matrix.html)  
or [Chapter: Linear Algebra](https://root.cern.ch/root/htmldoc/guides/users-guide/LinearAlgebra.html)

---

<div class="post-metadata">

**Author:** ![Eddy\_Offermann](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eddy_offermann/32/25079_2.png) [@Eddy\_Offermann](https://root-forum.cern.ch/u/Eddy_Offermann)\
**Post date:** [May 29, 2026, 4:46pm UTC](https://root-forum.cern.ch/t/best-practices-for-solving-overdetermined-systems-of-linear-equations/64871/6 "2026-05-29T16:46:00Z")

</div>

Have a look at the tutorial [solveLinear.C](https://nbviewer.org/url/root.cern/doc/master/notebooks/solveLinear.C.nbconvert.ipynb)
