https://github.com/konimarti/lti
General state-space representation of linear, time-invariant systems in Golang
https://github.com/konimarti/lti
control-systems control-theory golang linear lti lti-system state-space state-space-representation state-space-systems
Last synced: 3 months ago
JSON representation
General state-space representation of linear, time-invariant systems in Golang
- Host: GitHub
- URL: https://github.com/konimarti/lti
- Owner: konimarti
- License: mit
- Created: 2019-02-06T14:24:29.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-03-25T21:12:32.000Z (about 4 years ago)
- Last Synced: 2025-10-07T10:01:12.757Z (7 months ago)
- Topics: control-systems, control-theory, golang, linear, lti, lti-system, state-space, state-space-representation, state-space-systems
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 6
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Linear and time-invariant systems in Golang
[](https://github.com/konimarti/lti/blob/master/LICENSE)
[](https://godoc.org/github.com/konimarti/lti)
[](https://goreportcard.com/report/github.com/konimarti/lti)
```go get github.com/konimarti/lti```
* State-space representation and estimation of linear, time-invariant systems for control theory in Golang
```math
x'(t) = A * x(t) + B * u(t)
```
and
```math
y(t) = C * x(t) + D * u(t)
```
* Can be used as an input for a [Kalman filter](http://github.com/konimarti/kalman).
## Usage
```go
// define time-continuous linear system
system, err := lti.NewSystem(
...
)
// check system properties
fmt.Println("Observable=", system.MustObservable())
fmt.Println("Controllable=", system.MustControllable())
// define initial state (x) and control (u) vectors
...
// get derivative vector for new state
fmt.Println(system.Derivative(x, u))
// get output vector for new state
fmt.Println(system.Response(x, u))
// discretize LTI system and propagate state by time step dt
discrete, err := system.Discretize(dt)
fmt.Println("x(k+1)=", discrete.Predict(x, u))
}
```
### Example
See example [here](example/lti.go).
## More information
For additional materials on state-space models for control theory, check out the following links:
* A practical guide to state-space control [here](https://github.com/calcmogul/state-space-guide)
* State-space model impelmentation for Arduinos [here](https://github.com/tomstewart89/StateSpaceControl)
## Credits
This software package has been developed for and is in production at [Kalkfabrik Netstal](http://www.kfn.ch/en).