diff options
Diffstat (limited to 'graphics/pgf')
-rw-r--r-- | graphics/pgf/contrib/bodeplot/README.md | 86 | ||||
-rw-r--r-- | graphics/pgf/contrib/bodeplot/bodeplot.dtx | 51 | ||||
-rw-r--r-- | graphics/pgf/contrib/bodeplot/bodeplot.pdf | bin | 498916 -> 460394 bytes |
3 files changed, 85 insertions, 52 deletions
diff --git a/graphics/pgf/contrib/bodeplot/README.md b/graphics/pgf/contrib/bodeplot/README.md index f00aca2523..51253697ee 100644 --- a/graphics/pgf/contrib/bodeplot/README.md +++ b/graphics/pgf/contrib/bodeplot/README.md @@ -1,43 +1,43 @@ -# bodeplot
-LaTeX package to plot Bode, Nichols, and Nyquist diagrams.
-
-Inspired by the `bodegraph` package.
-
-Limitation: Phase plots from TF commands are wrapped between 0 and 360 degrees.
-
-Added functionality:
- - New `\BodeZPK` and `\BodeTF` commands to generate Bode plots of any transfer function given either poles, zeros, gain, and delay, or numerator and denominator coefficients and delay
- - Support for unstable poles and zeros.
- - Support for complex poles and zeros.
- - Support for general stable and unstable second order transfer functions.
- - Support for both `gnuplot` (default) and `pgfplots` (package option `pgf`).
- - Support for linear and asymptotic approximation of magnitude and phase plots of any transfer function given poles, zeros, and gain.
-
-Main Bode/Nyquist/Nichols commands:
-Given Zeros, Poles, Gain, and Delay (Bode plots support asymptotic and linear approximation for systems without delays):
- - `\BodeZPK[object1/type1/{options1},object2/type2/{options2},...]{z/{zeros},p/{poles},k/gain,d/delay}{min-frequency}{max-frequency}`
- - `\NicholsZPK[plot/{options},axes/{options}]{z/{zeros},p/{poles},k/gain,d/delay}{min-frequency}{max-frequency}`
- - `\NyquistZPK[plot/{options},axes/{options}]{z/{zeros},p/{poles},k/gain,d/delay}{min-frequency}{max-frequency}`
-
-Given Numerator and denominator coefficients and delay (does not support approximation yet):
- - `\BodeTF[object1/type1/{options1},object2/type2/{options2},...]{num/{coeff},den/{coeff},d/delay}{min-frequency}{max-frequency}`
- - `\NicholsTF[plot/{options},axes/{options}]{num/{coeff},den/{coeff},d/delay}`
- - `\NyquistTF[plot/{options},axes/{options}]{num/{coeff},den/{coeff},d/delay}`
-
-Other new environments and associated commands:
- - `BodePlot` environment
- - `\addBodeZPKPlots[{approximation1/{plot-options1}},{approximation2/{plot-options2}},...]{plot-type (phase or magnitude)}{z/{zeros},p/{poles},k/gain,d/delay}`
- - `\addBodeTFPlot[plot-options]{plot-type (phase or magnitude)}{num/{coeff},den/{coeff},d/delay}`
- - `\addBodeComponentPlot[plot-options]{basic_component_plot_command}`
- - Basic component plot commands: ***(append `Lin` to get linear approximation and `Asymp` to get asymptotic approximation)*** ***(change `Pole` to `Zero` to get inverse plots)*** ***(change `Mag` to `Ph` to get phase plots)***
- - `\MagK{a}` - Pure gain, G(s) = a.
- - `\MagPole{a}{b}` - Single pole at s = a+bi, G(s) = 1/(s - a-bi).
- - `\MagCSPoles{z}{w}` - Cannonical Second order system, G(s) = 1/(s^2 + 2zws + w^2).
- - `\MagSOPoles{a}{b}` - Second Order system, G(s) = 1/(s^2 + as + b).
- - `\MagDel{T}` - Pure delay, G(s) = exp(-Ts) (does not admit asymptotic approximation).
- - `NicholsChart` environment
- - `\addNicholsZPKChart[plot-options]{z/{zeros},p/{poles},k/gain,d/delay}`
- - `\addNicholsTFChart[plot-options]{num/{coeff},den/{coeff},d/delay}`
- - `NyquistPlot` environment
- - `\addNyquistZPKPlot[plot-options]{z/{zeros},p/{poles},k/gain,d/delay}`
- - `\addNyquistTFPlot[plot-options]{num/{coeff},den/{coeff},d/delay}`
+# bodeplot +LaTeX package to plot Bode, Nichols, and Nyquist diagrams. + +Inspired by the `bodegraph` package. + +Limitation: Phase plots from TF commands are wrapped between 0 and 360 degrees. + +Added functionality: + - New `\BodeZPK` and `\BodeTF` commands to generate Bode plots of any transfer function given either poles, zeros, gain, and delay, or numerator and denominator coefficients and delay + - Support for unstable poles and zeros. + - Support for complex poles and zeros. + - Support for general stable and unstable second order transfer functions. + - Support for both `gnuplot` (default) and `pgfplots` (package option `pgf`). + - Support for linear and asymptotic approximation of magnitude and phase plots of any transfer function given poles, zeros, and gain. + +Main Bode/Nyquist/Nichols commands: +Given Zeros, Poles, Gain, and Delay (Bode plots support asymptotic and linear approximation for systems without delays): + - `\BodeZPK[object1/type1/{options1},object2/type2/{options2},...]{z/{zeros},p/{poles},k/gain,d/delay}{min-frequency}{max-frequency}` + - `\NicholsZPK[plot/{options},axes/{options}]{z/{zeros},p/{poles},k/gain,d/delay}{min-frequency}{max-frequency}` + - `\NyquistZPK[plot/{options},axes/{options}]{z/{zeros},p/{poles},k/gain,d/delay}{min-frequency}{max-frequency}` + +Given Numerator and denominator coefficients and delay (does not support approximation yet): + - `\BodeTF[object1/type1/{options1},object2/type2/{options2},...]{num/{coeff},den/{coeff},d/delay}{min-frequency}{max-frequency}` + - `\NicholsTF[plot/{options},axes/{options}]{num/{coeff},den/{coeff},d/delay}` + - `\NyquistTF[plot/{options},axes/{options}]{num/{coeff},den/{coeff},d/delay}` + +Other new environments and associated commands: + - `BodePlot` environment + - `\addBodeZPKPlots[{approximation1/{plot-options1}},{approximation2/{plot-options2}},...]{plot-type (phase or magnitude)}{z/{zeros},p/{poles},k/gain,d/delay}` + - `\addBodeTFPlot[plot-options]{plot-type (phase or magnitude)}{num/{coeff},den/{coeff},d/delay}` + - `\addBodeComponentPlot[plot-options]{basic_component_plot_command}` + - Basic component plot commands: ***(append `Lin` to get linear approximation and `Asymp` to get asymptotic approximation)*** ***(change `Pole` to `Zero` to get inverse plots)*** ***(change `Mag` to `Ph` to get phase plots)*** + - `\MagK{a}` - Pure gain, G(s) = a. + - `\MagPole{a}{b}` - Single pole at s = a+bi, G(s) = 1/(s - a-bi). + - `\MagCSPoles{z}{w}` - Cannonical Second order system, G(s) = 1/(s^2 + 2zws + w^2). + - `\MagSOPoles{a}{b}` - Second Order system, G(s) = 1/(s^2 + as + b). + - `\MagDel{T}` - Pure delay, G(s) = exp(-Ts) (does not admit asymptotic approximation). + - `NicholsChart` environment + - `\addNicholsZPKChart[plot-options]{z/{zeros},p/{poles},k/gain,d/delay}` + - `\addNicholsTFChart[plot-options]{num/{coeff},den/{coeff},d/delay}` + - `NyquistPlot` environment + - `\addNyquistZPKPlot[plot-options]{z/{zeros},p/{poles},k/gain,d/delay}` + - `\addNyquistTFPlot[plot-options]{num/{coeff},den/{coeff},d/delay}` diff --git a/graphics/pgf/contrib/bodeplot/bodeplot.dtx b/graphics/pgf/contrib/bodeplot/bodeplot.dtx index 7ebfd3b754..7b775b916a 100644 --- a/graphics/pgf/contrib/bodeplot/bodeplot.dtx +++ b/graphics/pgf/contrib/bodeplot/bodeplot.dtx @@ -51,8 +51,8 @@ % \DoNotIndex{\newcommand,\xdef,\gdef,\def,\edef,\addplot,\approx,\arabic,\opt,\typ,\obj,\else,\if@pgfarg,\fi,\begin,\end,\feature,\footnotesize,\draw,\detokenize,\DeclareOption,\foreach,\ifdim,\ifodd,\Im,\Re,\let,\newif,\nextgroupplot,\noexpand,\expandafter,\unexpanded,\PackageError,\PackageWarning,\relax,\RequirePackage,\tikzset,\pgfmathsetmacro,\pgfmathtruncatemacro,\ProcessOptions} % % \title{The \textsf{bodeplot} package\thanks{This document -% corresponds to \textsf{bodeplot}~v1.0.4, -% dated November 5, 2021.}} +% corresponds to \textsf{bodeplot}~v1.0.5, +% dated November 15, 2021.}} % \author{Rushikesh Kamalapurkar \\ \texttt{rlkamalapurkar@gmail.com}} % % \maketitle @@ -144,10 +144,21 @@ % \end{figure} % % \DescribeEnv{BodePlot} -% |\begin{BodePlot}|\oarg{axis-options}\marg{min-frequency}\marg{max-frequency}\\ +% |\begin{BodePlot}|\oarg{obj1/\marg{opt1},obj2/\marg{opt2},...}\\ +% \hspace*{3em}\marg{min-frequency}\marg{max-frequency}\\ % \hspace*{2em}|\addBode...|\\ % \hspace*{1.5em}|\end{BodePlot}|\\ -% The |BodePlot| environment works in conjunction with the parametric function generator macros |\addBodeZPKPlots|, |\addBodeTFPlot|, and |\addBodeComponentPlot|. If supplied, |axis-options| are passed directly to the |semilogaxis| environment and the frequency limits are translated to the x-axis limits and the domain of the |semilogaxis| environment. Example usage in the description of |\addBodeZPKPlots|, |\addBodeTFPlot|, and |\addBodeComponentPlot|. +% The |BodePlot| environment works in conjunction with the parametric function generator macros |\addBodeZPKPlots|, |\addBodeTFPlot|, and |\addBodeComponentPlot|. The optional argument is comprised of a comma separated list of tuples, either |obj/{opt}| or just |{opt}|. Each tuple passes options to different |pgfplots| macros that generate the axes and the plots according to: +% \begin{itemize} +% \item Tuples of the form |obj/{opt}|: +% \begin{itemize} +% \item |tikz/{opt}|: modify picture properties by adding options |{opt}| to the |tikzpicture| environment. +% \item |axes/{opt}|: modify axis properties by adding options |{opt}| to the |semilogaxis| environment. +% \item |commands/{opt}|: add any valid TikZ commands inside |semilogaxis| environment. The commands passed to |opt| need to be valid TikZ commands, separated by semicolons as usual. +% \end{itemize} +% \item Tuples of the form |{opt}| are passed directly to the |semilogaxis| environment. +% \end{itemize} +% The frequency limits are translated to the x-axis limits and the domain of the |semilogaxis| environment. Example usage in the description of |\addBodeZPKPlots|, |\addBodeTFPlot|, and |\addBodeComponentPlot|. % % \DescribeMacro{\addBodeZPKPlots} % |\addBodeZPKPlots| \oarg{approx1/\marg{opt1},approx2/\marg{opt2},...}\\ @@ -347,10 +358,21 @@ % \end{figure} % % \DescribeEnv{NyquistPlot} -% |\begin{NyquistPlot}|\oarg{axis-options}\marg{min-frequency}\marg{max-frequency}\\ +% |\begin{NyquistPlot}|\oarg{obj1/\marg{opt1},obj2/\marg{opt2},...}\\ +% \hspace*{3em}\marg{min-frequency}\marg{max-frequency}\\ % \hspace*{2em}|\addNyquist...|\\ % \hspace*{1.5em}|\end{NyquistPlot}|\\ -% The |NyquistPlot| environment works in conjunction with the parametric function generator macros |\addNyquistZPKPlot| and |\addNyquistTFPlot|. If supplied, |axis-options| are passed directly to the |axis| environment and the frequency limits are translated to the x-axis limits and the domain of the |axis| environment. +% The |NyquistPlot| environment works in conjunction with the parametric function generator macros |\addNyquistZPKPlot| and |\addNyquistTFPlot|. The optional argument is comprised of a comma separated list of tuples, either |obj/{opt}| or just |{opt}|. Each tuple passes options to different |pgfplots| macros that generate the axes and the plots according to: +% \begin{itemize} +% \item Tuples of the form |obj/{opt}|: +% \begin{itemize} +% \item |tikz/{opt}|: modify picture properties by adding options |{opt}| to the |tikzpicture| environment. +% \item |axes/{opt}|: modify axis properties by adding options |{opt}| to the |axis| environment. +% \item |commands/{opt}|: add any valid TikZ commands inside |axis| environment. The commands passed to |opt| need to be valid TikZ commands, separated by semicolons as usual. +% \end{itemize} +% \item Tuples of the form |{opt}| are passed directly to the |axis| environment. +% \end{itemize} +% The frequency limits are translated to the x-axis limits and the domain of the |axis| environment. % % \DescribeMacro{\addNyquistZPKPlot} % |\addNyquistZPKPlot|\oarg{plot-options}\\ @@ -392,10 +414,21 @@ % % % \DescribeEnv{NicholsChart} -% |\begin{NicholsChart}|\oarg{axis-options}\marg{min-frequency}\marg{max-frequency}\\ +% |\begin{NicholsChart}|\oarg{obj1/\marg{opt1},obj2/\marg{opt2},...}\\ +% \hspace*{3em}\marg{min-frequency}\marg{max-frequency}\\ % \hspace*{2em}|\addNichols...|\\ % \hspace*{1.5em}|\end{NicholsChart}|\\ -% The |NicholsChart| environment works in conjunction with the parametric function generator macros |\addNicholsZPKChart| and |\addNicholsTFChart|. If supplied, |axis-options| are passed directly to the |axis| environment and the frequency limits are translated to the x-axis limits and the domain of the |axis| environment. +% The |NicholsChart| environment works in conjunction with the parametric function generator macros |\addNicholsZPKChart| and |\addNicholsTFChart|. The optional argument is comprised of a comma separated list of tuples, either |obj/{opt}| or just |{opt}|. Each tuple passes options to different |pgfplots| macros that generate the axes and the plots according to: +% \begin{itemize} +% \item Tuples of the form |obj/{opt}|: +% \begin{itemize} +% \item |tikz/{opt}|: modify picture properties by adding options |{opt}| to the |tikzpicture| environment. +% \item |axes/{opt}|: modify axis properties by adding options |{opt}| to the |axis| environment. +% \item |commands/{opt}|: add any valid TikZ commands inside |axis| environment. The commands passed to |opt| need to be valid TikZ commands, separated by semicolons as usual. +% \end{itemize} +% \item Tuples of the form |{opt}| are passed directly to the |axis| environment. +% \end{itemize} +% The frequency limits are translated to the x-axis limits and the domain of the |axis| environment. % % \DescribeMacro{\addNicholsZPKChart} % |\addNicholsZPKChart|\oarg{plot-options}\\ @@ -1135,7 +1168,7 @@ \xdef\opt@approx{\unexpanded\expandafter{\opt}}% \else \ifnum\pdfstrcmp{\unexpanded\expandafter{\obj}}{commands}=0 - \ifnum\pdfstrcmp{\unexpanded\expandafter{\typ}}{phase}=0 + \ifnum\pdfstrcmp{\unexpanded\expandafter{\typ}}{ph}=0 \xdef\optph@commands{\unexpanded\expandafter{\opt}}% \else \xdef\optmag@commands{\unexpanded\expandafter{\opt}}% diff --git a/graphics/pgf/contrib/bodeplot/bodeplot.pdf b/graphics/pgf/contrib/bodeplot/bodeplot.pdf Binary files differindex bd20ff3dd5..9a7b199985 100644 --- a/graphics/pgf/contrib/bodeplot/bodeplot.pdf +++ b/graphics/pgf/contrib/bodeplot/bodeplot.pdf |