1 |
|
2 |
|
3 | # Function lsolve
|
4 |
|
5 | Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix.
|
6 |
|
7 | `L * x = b`
|
8 |
|
9 |
|
10 | ## Syntax
|
11 |
|
12 | ```js
|
13 | math.lsolve(L, b)
|
14 | ```
|
15 |
|
16 | ### Parameters
|
17 |
|
18 | Parameter | Type | Description
|
19 | --------- | ---- | -----------
|
20 | `L` | Matrix, Array | A N x N matrix or array (L)
|
21 | `b` | Matrix, Array | A column vector with the b values
|
22 |
|
23 | ### Returns
|
24 |
|
25 | Type | Description
|
26 | ---- | -----------
|
27 | DenseMatrix | Array | A column vector with the linear system solution (x)
|
28 |
|
29 |
|
30 | ## Examples
|
31 |
|
32 | ```js
|
33 | const a = [[-2, 3], [2, 1]]
|
34 | const b = [11, 9]
|
35 | const x = lsolve(a, b) // [[-5.5], [20]]
|
36 | ```
|
37 |
|
38 |
|
39 | ## See also
|
40 |
|
41 | [lup](lup.md),
|
42 | [slu](slu.md),
|
43 | [usolve](usolve.md),
|
44 | [lusolve](lusolve.md)
|