﻿ SysSolve – Algosim documentation
Algosim documentation: SysSolve

# SysSolve

Solves a system of linear equations.

## Syntax

• `SysSolve(A)`

• `A` is an `n×(n+1)` matrix

• `SysSolve(A, y)`

• `A` is an `n×n` matrix

• `v` is an `n`-dimensional vector

## Description

If `A` is a non-singular `n×n` matrix and `y` an `n`-dimensional vector, then `SysSolve(A, y)` returns the unique `n`-dimensional vector `x` such that `A⋅x = y`. If `A` is non-square or singular or if `y` is of the wrong dimension, an error is generated.

`SysSolve(A)` is defined as `SysSolve(lessen(A), last(cols(A)))`. Equivalently, `SysSolve(A, y)` is the same as `SysSolve(aug(A, y))`.

`x` can also be obtained as `A^−1 ⋅ y` or `inv(A)⋅y`.

## Examples

`A ≔ ❨❨5, 0, 1, 2, 5❩, ❨0, 1, 3, 2, 8❩, ❨4, 2, 6, 3, 9❩, ❨1, 2, 0, 5, 3❩, ❨5, 4, 7, 0, 1❩❩`
```⎛5  0  1  2  5⎞
⎜0  1  3  2  8⎟
⎜4  2  6  3  9⎟
⎜1  2  0  5  3⎟
⎝5  4  7  0  1⎠
```
`y ≔ ❨19, 17, 34, 12, 29❩`
``` ⎛19⎞
⎜17⎟
e⎜34⎟
⎜12⎟
⎝29⎠
```
`x ≔ SysSolve(A, y)`
``` ⎛2⎞
⎜1⎟
e⎜2⎟
⎜1⎟
⎝1⎠
```
`A⋅x`
``` ⎛19⎞
⎜17⎟
e⎜34⎟
⎜12⎟
⎝29⎠
```
`A^−1 ⋅ y`
``` ⎛2⎞
⎜1⎟
e⎜2⎟
⎜1⎟
⎝1⎠
```