2022-03-01 13:04:09 +01:00

56 lines
1.4 KiB
Markdown

---
layout: default
---
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
<h1 id="function-lsolve">Function lsolve <a href="#function-lsolve" title="Permalink">#</a></h1>
Finds one solution of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix. Throws an error if there's no solution.
`L * x = b`
<h2 id="syntax">Syntax <a href="#syntax" title="Permalink">#</a></h2>
```js
math.lsolve(L, b)
```
<h3 id="parameters">Parameters <a href="#parameters" title="Permalink">#</a></h3>
Parameter | Type | Description
--------- | ---- | -----------
`L` | Matrix, Array | A N x N matrix or array (L)
`b` | Matrix, Array | A column vector with the b values
<h3 id="returns">Returns <a href="#returns" title="Permalink">#</a></h3>
Type | Description
---- | -----------
DenseMatrix &#124; Array | A column vector with the linear system solution (x)
<h3 id="throws">Throws <a href="#throws" title="Permalink">#</a></h3>
Type | Description
---- | -----------
<h2 id="examples">Examples <a href="#examples" title="Permalink">#</a></h2>
```js
const a = [[-2, 3], [2, 1]]
const b = [11, 9]
const x = lsolve(a, b) // [[-5.5], [20]]
```
<h2 id="see-also">See also <a href="#see-also" title="Permalink">#</a></h2>
[lsolveAll](lsolveAll.html),
[lup](lup.html),
[slu](slu.html),
[usolve](usolve.html),
[lusolve](lusolve.html)