nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
response.hpp
Go to the documentation of this file.
1
3// toolboxes/control/include/nk/control/response/response.hpp
4//
5// Time-domain responses for continuous and discrete LTI systems.
6// Returns column-vector outputs y(t) and the matching time grid t.
7// The implementation discretises continuous models via zero-order
8// hold using a Van-Loan style matrix exponential (Padé with scaling
9// and squaring), then iterates the discrete recurrence.
10
11#pragma once
12
13#include <memory_resource>
14#include <nk/value/value.hpp>
15#include <utility>
16
17namespace nk::control {
18
21
22
47std::pair<Value, Value>
48step_response(const Value &sys, const Value &tArg,
49 std::pmr::memory_resource *mr = nullptr, Value *xOut = nullptr);
50
65std::pair<Value, Value>
66impulse_response(const Value &sys, const Value &tArg,
67 std::pmr::memory_resource *mr = nullptr, Value *xOut = nullptr);
68
85Value lsim(const Value &sys, const Value &u, const Value &t,
86 const Value &x0,
87 std::pmr::memory_resource *mr = nullptr, Value *xOut = nullptr);
88
105std::pair<Value, Value>
106initial_response(const Value &sys, const Value &x0, const Value &tArg,
107 std::pmr::memory_resource *mr = nullptr, Value *xOut = nullptr);
108
109
111} // namespace nk::control
Core MATLAB-compatible multidimensional array and scalar value type.
Definition value.hpp:61
std::pair< Value, Value > initial_response(const Value &sys, const Value &x0, const Value &tArg, std::pmr::memory_resource *mr=nullptr, Value *xOut=nullptr)
Initial-condition response ([y, t] = initial(sys, x0, tArg)).
std::pair< Value, Value > step_response(const Value &sys, const Value &tArg, std::pmr::memory_resource *mr=nullptr, Value *xOut=nullptr)
Unit-step response ([y, t] = step(sys, tFinal_or_t)).
Value lsim(const Value &sys, const Value &u, const Value &t, const Value &x0, std::pmr::memory_resource *mr=nullptr, Value *xOut=nullptr)
Linear simulation with arbitrary input (y = lsim(sys, u, t, x0)).
std::pair< Value, Value > impulse_response(const Value &sys, const Value &tArg, std::pmr::memory_resource *mr=nullptr, Value *xOut=nullptr)
Unit-impulse response ([y, t] = impulse(sys, tFinal_or_t)).