Skip to content

Commit

Permalink
Merge pull request #33 from SimonEnsemble/update_to_makie
Browse files Browse the repository at this point in the history
Update to makie
  • Loading branch information
SimonEnsemble authored Jan 24, 2022
2 parents 3f2c946 + f8a441d commit c361b09
Show file tree
Hide file tree
Showing 13 changed files with 414 additions and 130 deletions.
6 changes: 4 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ makedocs(
"Simulation" => "sim.md",
"Visualization" => "viz.md",
"Control systems" => "controls.md",
"FAQ" => "faq.md"],
"FAQ" => "faq.md"
],
format = Documenter.HTML(assets = ["assets/flux.css"])
)

deploydocs(
repo = "github.com/SimonEnsemble/Controlz.jl.git",
devbranch = "main"
devbranch = "main",
push_preview=true
)
Binary file added docs/src/assets/gol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions docs/src/assets/gol.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
\documentclass{standalone} % run wit shell escape

\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{verbatim}

\usepackage{tikz}
\usepackage{color}
\definecolor{honeydew}{rgb}{0.94, 1.0, 0.94}
\definecolor{ivory}{rgb}{1.0, 1.0, 0.94}


\usetikzlibrary{shapes,arrows}
\begin{document}


\tikzstyle{block} = [draw, fill=honeydew!70, rectangle, line width=0.5mm,
minimum height=3em, minimum width=5em]
\tikzstyle{sum} = [draw, fill=ivory!20, circle, node distance=1cm, line width=0.5mm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thick,black}]

\tikzset{
circ/.style={draw, circle, fill=ivory!70}
}


% The block diagram code is probably more verbose than necessary
\begin{tikzpicture}[auto, node distance=1cm,>=latex']
\node [block, node distance=3cm, label=closed loop process] (Gol) {$g_{ol}(s)$};
\node [circ, , line width=0.5mm, label={[label distance=-4.75mm]270:$-$},label={[label distance=-4.75mm]180:$+$}, minimum size=8mm, left of=Gol, node distance=2.5cm] (comparator) {};
\node [input, node distance=2cm, left of=comparator] (Ysp) {};
% \node [sum, right of=process, node distance=2.5cm] (sum) {};
% \node [block, right of=controller, pin={[pinstyle]above:D},
% node distance=3cm] (system) {System};
\node [output, name=output, right of=Gol, node distance=2.0cm] {};
\node [below of=comparator, node distance=1.5cm] (ptbelow) {};

% \draw [->] (input) -- node[name=u] {$u$} (system);
% \node [output, right of=system] (output) {};
%
% \draw [draw,->] (input) -- system {$r$} (sum);
\draw [->, line width=0.5mm] (Gol) -- node[name=y] {$Y_m(s)$} (output);
\draw [->, line width=0.5mm] (comparator) -- node {$E(s)$} (Gol);
\draw [->, line width=0.5mm] (Ysp) -- node {$Y_{sp}(s)$} (comparator);

\draw [-, line width=0.5mm] (y) |- (ptbelow);
\draw [->, line width=0.5mm] (ptbelow) -| (comparator);
% \draw [->] (system) -- node [name=y] {$y$}(output);
\end{tikzpicture}

\end{document}
Binary file added docs/src/assets/simple_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions docs/src/assets/simple_example.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
\documentclass{standalone} % run wit shell escape

\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{verbatim}
\usepackage{amsmath}

\usepackage{tikz}
\usepackage{color}
\definecolor{honeydew}{rgb}{0.94, 1.0, 0.94}
\definecolor{ivory}{rgb}{1.0, 1.0, 0.94}
\usetikzlibrary{shapes,arrows}
\tikzstyle{block} = [draw, fill=honeydew!70, rectangle, line width=0.5mm,
minimum height=3em, minimum width=5em]
\tikzstyle{sum} = [draw, fill=ivory!20, circle, node distance=1cm, line width=0.5mm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thick,black}]

\tikzset{
circ/.style={draw, circle, fill=ivory!70}
}


\begin{document}
% The block diagram code is probably more verbose than necessary
\begin{tikzpicture}[auto, node distance=1cm,>=latex']
\node [block, node distance=1.75cm, label=process] (g) {$\dfrac{4}{4s^2+0.8s+1}$};
\node [input, node distance=2.25cm, left of=g] (U) {};
\node [output, name=output, right of=g, node distance=2.25cm] {$Y(s)$};

\draw [->, line width=0.5mm] (U) -- node {$U(s)$} (g);
\draw [->, line width=0.5mm] (g) -- node {$Y(s)$} (output);
\end{tikzpicture}

\end{document}
14 changes: 9 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

`Controlz.jl` is a pure-[Julia](https://julialang.org/) package to analyze and simulate process dynamics and control systems using transfer function representations.

for example, to simulate the unit step response of a second-order, underdamped system characterized by the transfer function
e.g., the code below simulates the unit step response of a second-order, underdamped system:

$$g(s) = \dfrac{4}{4s^2 + 0.8s +1}$$
![](assets/simple_example.png)

the output $Y(s)$ follows from $g(s)U(s)$, where $U(s)$ is the input.
with
* transfer function $g(s) = \dfrac{4}{4s^2 + 0.8s +1}$
* input $U(s)=\mathcal{L}[u(t)]$
* output $Y(s)=\mathcal{L}[y(t)]=g(s)U(s)$
where $\mathcal{L}[\cdot]$ is the Laplace transform that maps a function in the time domain $t\in\mathbb{R}$ to the frequency domain $s\in\mathbb{C}$.

```julia
using Controlz
Expand All @@ -24,6 +28,6 @@ viz_response(data, plot_title="SO underdamped step response")

# install the `Controlz.jl` package in Julia

`Controlz.jl` is an officially registered Julia package. install in the Julia REPL by typing `]` to go into package mode, then `add Controlz`.
`Controlz.jl` is an officially registered Julia package. install in the Julia REPL by typing `]` to enter package mode, then `add Controlz`.

I recommend interactive [Pluto notebooks](https://github.com/fonsp/Pluto.jl) for coding in Julia, whose automatic package manager installs `Controlz.jl` upon running `using Controlz`.
to write `Controlz.jl` code interactively and display the outputs, use the interactive [Pluto notebook](https://github.com/fonsp/Pluto.jl). Its automatic package manager installs `Controlz.jl` upon running `using Controlz` in a code cell.
Loading

2 comments on commit c361b09

@SimonEnsemble
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/53403

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.0 -m "<description of version>" c361b09296e3e242b568334c12018be42cb0dc00
git push origin v0.3.0

Please sign in to comment.