Browse Source

First commit

master
Martins Eglitis 1 year ago
commit
4d88617778

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
*~
\#*

+ 8
- 0
README.md View File

@@ -0,0 +1,8 @@
# Control Theory

My homework in Control Theory at Riga Technical University written using LyX (LaTeX based processor), gnuplot and MATLAB.

## Notes

- Make sure to set Document->Settings->Language->Language to Latvian and Document->Settings->Language->Lanuage package to None.
- Replace the Document->Settings->LaTeX Preamble with the content of `src/preamble.txt`.

BIN
output/rtu.pdf View File


BIN
output/rtu2.pdf View File


+ 18
- 0
src/gnuplot/ex1.gpi View File

@@ -0,0 +1,18 @@
set encoding utf8
set terminal pngcairo size 400, 300
set output "ex1.png"

set grid
set angles degrees

set log x
set xrange [0.1:10000]
set xlabel "{/Symbol w} rad/s"
set yrange [0:2 * 10]
set ylabel "G^* dB"

set label 1 '{/Symbol f} = 0^o' at 100, 15

g(x) = 10

plot g(x) title 'G^*({/Symbol w})'

BIN
src/gnuplot/ex1.png View File


+ 18
- 0
src/gnuplot/ex2.gpi View File

@@ -0,0 +1,18 @@
set encoding utf8
set terminal pngcairo size 400, 300
set output "ex2.png"

set grid
set angles degrees

set log x
set xrange [0.1:10000]
set xlabel "{/Symbol w} rad/s"
set yrange [-90:90]
set ylabel "G^* dB"

set label 1 '{/Symbol f} = -90^o' at 100, 60

g(x) = 20 * log10(1./((1./695.) * x))

plot g(x) title 'G^*({/Symbol w})'

BIN
src/gnuplot/ex2.png View File


+ 18
- 0
src/gnuplot/ex3.gpi View File

@@ -0,0 +1,18 @@
set encoding utf8
set terminal pngcairo size 400, 300
set output "ex3.png"

set grid
set angles degrees

set log x
set xrange [0.1:10000]
set xlabel "{/Symbol w} rad/s"
set yrange [0:80]
set ylabel "G^* dB"

set label 1 '{/Symbol f} = 90^o' at 100, 60

g(x) = 20 * log10(45.171 * 10**(-3) * x)

plot g(x) title 'G^*({/Symbol w})'

BIN
src/gnuplot/ex3.png View File


+ 44
- 0
src/gnuplot/ex4.gpi View File

@@ -0,0 +1,44 @@
set encoding utf8
set terminal pngcairo size 800, 600
set output "ex4.png"

set grid
set angles degrees

set log x
set xrange [0.1:1000]
set xlabel "{/Symbol w} rad/s"

omega = 3.738

set multiplot layout 2, 1

set key right bottom

set yrange [-90:0]
set ylabel "{/Symbol f} ^o"

phi(x) = atan(-1./(x * 0.0107 * 25))

set arrow 1 from omega, graph 0 to omega, phi(omega) nohead dashtype 2
set arrow 2 from graph 0, first phi(omega) to omega, phi(omega) nohead dashtype 2

plot phi(x) title '{/Symbol f}({/Symbol w})'

unset arrow 1
unset arrow 2

set yrange [0:80]
set ylabel "G^* dB"

g(x) = 20 * log10(sqrt(625 + 1./(0.0107**2 * x**2)))

set arrow 1 from omega, graph 0 to omega, g(omega) nohead dashtype 2
set arrow 2 from graph 0, first g(omega) to omega, g(omega) nohead dashtype 2

plot g(x) title 'G^*({/Symbol w})'

unset arrow 1
unset arrow 2

unset multiplot

BIN
src/gnuplot/ex4.png View File


+ 44
- 0
src/gnuplot/ex5.gpi View File

@@ -0,0 +1,44 @@
set encoding utf8
set terminal pngcairo size 800, 600
set output "ex5.png"

set grid
set angles degrees

set log x
set xrange [1:10000]
set xlabel "{/Symbol w} rad/s"

omega = 327.332

set multiplot layout 2, 1

set key right bottom

set yrange [0:90]
set ylabel "{/Symbol f} ^o"

phi(x) = atan(x * 0.0611 / 20)

set arrow 1 from omega, graph 0 to omega, phi(omega) nohead dashtype 2
set arrow 2 from graph 0, first phi(omega) to omega, phi(omega) nohead dashtype 2

plot phi(x) title '{/Symbol f}({/Symbol w})'

unset arrow 1
unset arrow 2

set yrange [0:80]
set ylabel "G^* dB"

g(x) = 20 * log10(sqrt(400 + 0.0611**2 * x**2))

set arrow 1 from omega, graph 0 to omega, g(omega) nohead dashtype 2
set arrow 2 from graph 0, first g(omega) to omega, g(omega) nohead dashtype 2

plot g(x) title 'G^*({/Symbol w})'

unset arrow 1
unset arrow 2

unset multiplot

BIN
src/gnuplot/ex5.png View File


+ 64
- 0
src/gnuplot/ex6.gpi View File

@@ -0,0 +1,64 @@
set encoding utf8
set terminal pngcairo size 800, 600
set output "ex6.png"

set grid
set angles degrees

set log x
set xrange [0.01:1000]
set xlabel "{/Symbol w} rad/s"

set multiplot layout 2, 1

set yrange [-180:0]
set ylabel "{/Symbol f} ^o"

omega1 = 0.909

omega2 = 5

phi1(x) = atan(-x * 1.1)

phi2(x) = atan(-x * 0.2)

phiTotal(x) = phi1(x) + phi2(x)

set arrow 1 from omega1, graph 0 to omega1, phi1(omega1) nohead dashtype 2
set arrow 2 from graph 0, first phi1(omega1) to omega1, phi1(omega1) nohead dashtype 2

set arrow 3 from omega2, graph 0 to omega2, phi2(omega2) nohead dashtype 2
set arrow 4 from graph 0, first phi2(omega2) to omega2, phi2(omega2) nohead dashtype 2

plot phi1(x) title '{/Symbol f}_1({/Symbol w})', phi2(x) title '{/Symbol f}_2({/Symbol w})', phiTotal(x) title '{/Symbol f}_T({/Symbol w})'

unset arrow 1
unset arrow 2

unset arrow 3
unset arrow 4

set yrange [-80:80]
set ylabel "G^* dB"

omega1(x) = 20 * log10(15/(sqrt(1. + 1.1**2 * x**2)))

omega2(x) = 20 * log10(25/(sqrt(1. + 0.2**2 * x**2)))

omegaTotal(x) = 20 * log10((375 * sqrt((1 - 1.1 * 0.2 * x**2)**2 + (1.1 + 0.2)**2 * x**2))/((1 + 1.1**2 * x**2) * (1 + 0.2**2 * x**2)))

set arrow 1 from omega1, graph 0 to omega1, omega1(omega1) nohead dashtype 2
set arrow 2 from graph 0, first omega1(omega1) to omega1, omega1(omega1) nohead dashtype 2

set arrow 3 from omega2, graph 0 to omega2, omega2(omega2) nohead dashtype 2
set arrow 4 from graph 0, first omega2(omega2) to omega2, omega2(omega2) nohead dashtype 2

plot omega1(x) title 'G_1^*({/Symbol w})', omega2(x) title 'G_2^*({/Symbol w})', omegaTotal(x) title 'G_T^*({/Symbol w})'

unset arrow 1
unset arrow 2

unset arrow 3
unset arrow 4

unset multiplot

BIN
src/gnuplot/ex6.png View File


+ 8
- 0
src/gnuplot/plot.sh View File

@@ -0,0 +1,8 @@
#!/bin/bash

gnuplot ex1.gpi
gnuplot ex2.gpi
gnuplot ex3.gpi
gnuplot ex4.gpi
gnuplot ex5.gpi
gnuplot ex6.gpi

BIN
src/labs/Martins_Eglitis.ods View File


BIN
src/labs/PI_T_0.png View File


BIN
src/labs/PI_delta.png View File


BIN
src/labs/PI_t_p.png View File


BIN
src/labs/P_T_0.png View File


BIN
src/labs/P_delta.png View File


BIN
src/labs/P_sigma.png View File


BIN
src/labs/P_t_p.png View File


BIN
src/labs/Proportional_Integral_Derivative_Regulator_Martins_Eglitis.jpg View File


BIN
src/labs/Proportional_Integral_Derivative_Regulator_Martins_Eglitis.slx View File


BIN
src/labs/Proportional_Integral_Regulator_Martins_Eglitis.slx View File


BIN
src/labs/Proportional_Regulator_Martins_Eglitis.slx View File


+ 66
- 0
src/preamble.txt View File

@@ -0,0 +1,66 @@
% Variables to change every new document
\newcommand{\hmwkClass}{Regulēšanas Teorijas Pamati} % Course/class
\newcommand{\hmwkNumber}{1} % Assignment number

% Constants to set once
\newcommand{\hmwkAuthorName}{Mārtiņš Eglītis} % Your name
\newcommand{\hmwkUserID}{Klausītājs} % User ID
\newcommand{\hmwkStudentNumber}{10} % Student number

% Packages
\usepackage{fancyhdr} % Required for custom headers
\usepackage{lastpage} % Required to determine the last page for the footer
\usepackage{extramarks} % Required for headers and footers
\usepackage{siunitx} % Required for SI units
\usepackage{cleveref} % Required for SI units

% Margins
\topmargin=-0.45in
\evensidemargin=0in
\oddsidemargin=0in
\textwidth=6.5in
\textheight=9.0in
\headsep=0.25in

% General document properties
\linespread{1.1} % Line spacing
\setlength\parindent{0pt} % Removes all indentation from paragraphs

% Required to not count titlepage in page numbering
\addtocounter {page} {-1}

% Make a simple command for use in document body
\newcommand{\start}{
\maketitle
\thispagestyle{empty}
\newpage
}

% Set up the header and footer
\pagestyle{fancy}
\lhead{\hmwkAuthorName} % Top left header
\rhead{\hmwkClass:\ Mājasdarbs}
\lfoot{\lastxmark} % Bottom left footer
\cfoot{} % Bottom center footer
\rfoot{Lapa\ \thepage\ no\ \protect\pageref{LastPage}} % Bottom right footer
\renewcommand\headrulewidth{0.4pt} % Size of the header rule
\renewcommand\footrulewidth{0.4pt} % Size of the footer rule

% The following 2 commands setup the title page
\title{
\vspace{2in}
\textmd{\textbf{\hmwkClass:\ Mājasdarbs}}\\
\normalsize\vspace{0.1in}\small{ 2017.gada 23.oktobrī }\\
\vspace{3in}
}

\author{
\textbf{\hmwkAuthorName} \\
\texttt{\hmwkUserID \hspace{0.1in}- \hmwkStudentNumber}
}

% Do not display standard date since we use a custom date
\date{}

\renewcommand{\figurename}{Attēls}
\renewcommand{\tablename}{Tabula}

+ 3706
- 0
src/rtu.lyx
File diff suppressed because it is too large
View File


+ 3941
- 0
src/rtu2.lyx
File diff suppressed because it is too large
View File


BIN
src/schematics/ex1.png View File


BIN
src/schematics/ex10.png View File


BIN
src/schematics/ex2.png View File


BIN
src/schematics/ex3.png View File


BIN
src/schematics/ex4.png View File


BIN
src/schematics/ex5.png View File


BIN
src/schematics/ex6.png View File


BIN
src/schematics/ex7.png View File


BIN
src/schematics/ex8.png View File


BIN
src/schematics/ex9.png View File


+ 147
- 0
src/template.lyx View File

@@ -0,0 +1,147 @@
#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass article
\begin_preamble
% Variables to change every new document
\newcommand{\hmwkClass}{CLASS 101} % Course/class
\newcommand{\hmwkNumber}{1} % Assignment number

% Constants to set once
\newcommand{\hmwkAuthorName}{Mārtiņš Eglītis} % Your name
\newcommand{\hmwkUserID}{Klausītājs} % User ID
\newcommand{\hmwkStudentNumber}{Klausītājs} % Student number

% Packages
\usepackage{fancyhdr} % Required for custom headers
\usepackage{lastpage} % Required to determine the last page for the footer
\usepackage{extramarks} % Required for headers and footers

% Margins
\topmargin=-0.45in
\evensidemargin=0in
\oddsidemargin=0in
\textwidth=6.5in
\textheight=9.0in
\headsep=0.25in

% General document properties
\linespread{1.1} % Line spacing
\setlength\parindent{0pt} % Removes all indentation from paragraphs

% Required to not count titlepage in page numbering
\addtocounter {page} {-1}

% Make a simple command for use in document body
\newcommand{\start}{
\maketitle
\thispagestyle{empty}
\newpage
}

% Set up the header and footer
\pagestyle{fancy}
\lhead{\hmwkAuthorName} % Top left header
\rhead{\hmwkClass:\ Assignment\ \#\hmwkNumber}
\lfoot{\lastxmark} % Bottom left footer
\cfoot{} % Bottom center footer
\rfoot{Page\ \thepage\ of\ \protect\pageref{LastPage}} % Bottom right footer
\renewcommand\headrulewidth{0.4pt} % Size of the header rule
\renewcommand\footrulewidth{0.4pt} % Size of the footer rule

% The following 2 commands setup the title page
\title{
\vspace{2in}
\textmd{\textbf{\hmwkClass:\ Assignment\ \#\hmwkNumber}}\\
\normalsize\vspace{0.1in}\small{ \today }\\
\vspace{3in}
}

\author{
\textbf{\hmwkAuthorName} \\
\texttt{\hmwkUserID \hspace{0.1in}- \hmwkStudentNumber}
}

% Do not display standard date since we use a custom date
\date{}
\end_preamble
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 0
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip bigskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
start
\end_layout

\end_inset


\end_layout

\begin_layout Standard

\end_layout

\end_body
\end_document

Loading…
Cancel
Save