diff options
author | Nao Pross <np@0hm.ch> | 2024-02-12 15:23:24 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-02-12 15:23:24 +0100 |
commit | fbd6758fb4649b146176dbbc2dfe9384c69ef58d (patch) | |
tree | 0993d5c74a5cd1773ff9a572e4926d3102c0299f /src/control.h.old | |
parent | Move into version control (diff) | |
download | fsisotool-fbd6758fb4649b146176dbbc2dfe9384c69ef58d.tar.gz fsisotool-fbd6758fb4649b146176dbbc2dfe9384c69ef58d.zip |
Remove old stuff with Eigen
Diffstat (limited to '')
-rw-r--r-- | src/control.h.old | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/src/control.h.old b/src/control.h.old deleted file mode 100644 index 3a147fc..0000000 --- a/src/control.h.old +++ /dev/null @@ -1,104 +0,0 @@ -#pragma once - -#include "Eigen/Dense" -#include <complex> - -#ifndef CONTROL_H -#define CONTROL_H - - -namespace ct -{ - // Fwd declarations - template<typename T, int n, int m, int k> struct SSModel; - template<typename T, int p, int z> struct TransferFn; - - namespace math - { - template<typename T, int n, int m> - Eigen::Vector<T, n + m - 1> convolve1d( - const Eigen::Ref<Eigen::Vector<T, n>>& x - const Eigen::Ref<Eigen::Vector<T, m>>& y) - { - Eigen::Vector<T, n + m -1> out; - - return out; - } - - Eigen::VectorXd convolve1d( - const Eigen::Ref<Eigen::VectorXd>& x, - const Eigen::Ref<Eigen::VectorXd>& y) - { - - } - } - - /* Transfer Functions for SISO and frequency domain analysis */ - template<typename T, int p, int z> - struct TransferFn - { - Eigen::Vector<std::complex<T>, z> zeros; - Eigen::Vector<std::complex<T>, p> poles; - - explicit operator SSModel<T, p, 1, 1>() const - { - - } - }; - - typedef TransferFn<std::complex<double>, Eigen::Dynamic, Eigen::Dynamic> TransferFnXd; - - template<typename T, typename CT = std::complex<T>> - struct FreqSeries - { - size_t nsamples; - T start, end; - Eigen::VectorX<T> f; - Eigen::VectorX<CT> data; - }; - - typedef FreqSeries<double> FreqSeriesD; - - /* State space modelling and time domain simulaiton */ - - template<typename T, int n, int m, int k> - struct SSModel - { - /* State space model with - * - n dimensional state x - * - m dimensional input u - * - k dimensional output y - */ - Eigen::Matrix<T, n, n> A; - Eigen::Matrix<T, n, m> B; - Eigen::Matrix<T, k, m> C; - Eigen::Matrix<T, k, m> D; - - // SSModel(Eigen::VectorX<T> zeros, Eigen::VectorX<T> poles); - }; - - typedef SSModel<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::Dynamic> SSModelXd; - - template<typename T> - struct TimeSeries - { - size_t nsamples; - T start, end; - Eigen::VectorX<T> t; - Eigen::MatrixX<T> u, x, y; - - template<int n, int m, int k> - explicit TimeSeries(size_t nsamples, T start, T end, const SSModel<T, n, m, k>& ss); - }; - - typedef TimeSeries<double> TimeSeriesD; - - template<typename T, int n, int m, int k> - void response(SSModel<T, n, m, k> ss, TimeSeries<T>& ts); - - template<typename T, int n, int m, int k> - void step(SSModel<T, n, m, k> ss, TimeSeries<T>& ts); -} - -#endif // CONTROL_H -// vim:ts=2 sw=2 noet: |