From bc5a3e8923cb8efedbbd5b88e212eb0e9009cf87 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Thu, 5 Oct 2017 20:02:59 -0300 Subject: Add copyright on files and documentation update --- Project/TransferFunction.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'Project/TransferFunction.h') diff --git a/Project/TransferFunction.h b/Project/TransferFunction.h index aab4bd2..fd83ba4 100644 --- a/Project/TransferFunction.h +++ b/Project/TransferFunction.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2017 Thales Lima Oliveira + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef TRANSFERFUNCTION_H #define TRANSFERFUNCTION_H @@ -36,7 +53,7 @@ class TransferFunction : public ControlElement virtual SpaceState GetSpaceState() { return m_ss; } virtual void CalculateSpaceState(int maxIteration = 100, double error = 1e-3); virtual bool Solve(double input, double timeStep); - + virtual Element* GetCopy(); protected: -- cgit From 89befdb9b259d02249876e39ec6fd28860272439 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Fri, 6 Oct 2017 17:06:15 -0300 Subject: A lot of documentation written --- Project/TransferFunction.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Project/TransferFunction.h') diff --git a/Project/TransferFunction.h b/Project/TransferFunction.h index fd83ba4..af84ba5 100644 --- a/Project/TransferFunction.h +++ b/Project/TransferFunction.h @@ -25,6 +25,13 @@ class TransferFunctionForm; +/** + * @class TransferFunction + * @author Thales Lima Oliveira + * @date 06/10/2017 + * @brief Calculates the time response by a frequency domain transfer function. + * @file TransferFunction.h + */ class TransferFunction : public ControlElement { public: @@ -51,7 +58,21 @@ class TransferFunction : public ControlElement virtual void UpdateTFText(); virtual void UpdateText() { UpdateTFText(); } virtual SpaceState GetSpaceState() { return m_ss; } + /** + * @brief Convert the transfer function to space state on controllable canonical form (CCF). + * @param maxIteration Max number of solution iteration. + * @param error Tolerance for calculation. + */ virtual void CalculateSpaceState(int maxIteration = 100, double error = 1e-3); + /** + * @brief Calculates the time response by the space state form of transfer function. + * + * Uses the implicit trapezoidal rule to solve: + *
\f$ y_{n+1}=y_n+\frac{1}{2}h(y'_n+y'_{n+1}) \f$
+ * @param input Input value. + * @param timeStep Time step. + * @return true if the calculation converges, false otherwise. + */ virtual bool Solve(double input, double timeStep); virtual Element* GetCopy(); -- cgit