diff options
author | Karl Berry <karl@freefriends.org> | 2022-11-02 22:02:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-11-02 22:02:31 +0000 |
commit | 76c0a04ebe2e4c563d667541e62560ddf6ad7e26 (patch) | |
tree | 132b68914b986e4dbaf2d4c9641c8c79213bf710 /Master | |
parent | f03665b88b82c895af34a118db299d4a44a23baf (diff) |
bodeplot (2nov22)
git-svn-id: svn://tug.org/texlive/trunk@64902 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/bodeplot/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/bodeplot/bodeplot.pdf | bin | 1062592 -> 1066728 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/bodeplot/bodeplot.dtx | 44 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty | 27 |
4 files changed, 39 insertions, 34 deletions
diff --git a/Master/texmf-dist/doc/latex/bodeplot/README.md b/Master/texmf-dist/doc/latex/bodeplot/README.md index 31ac7a132fd..70ed10b0ee5 100644 --- a/Master/texmf-dist/doc/latex/bodeplot/README.md +++ b/Master/texmf-dist/doc/latex/bodeplot/README.md @@ -21,6 +21,8 @@ Added functionality: - 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 `rad/s` (default) and `Hz` (package option `Hz` or `pgf` key `frequency unit=Hz` for per-plot change) frequency units. + - Support for `deg` (default) and `rad` (package option `rad` or `pgf` key `phase unit=rad` for per-plot change) phase units. - 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: diff --git a/Master/texmf-dist/doc/latex/bodeplot/bodeplot.pdf b/Master/texmf-dist/doc/latex/bodeplot/bodeplot.pdf Binary files differindex e47b6557404..f866f3ba559 100644 --- a/Master/texmf-dist/doc/latex/bodeplot/bodeplot.pdf +++ b/Master/texmf-dist/doc/latex/bodeplot/bodeplot.pdf diff --git a/Master/texmf-dist/source/latex/bodeplot/bodeplot.dtx b/Master/texmf-dist/source/latex/bodeplot/bodeplot.dtx index aad1eb47d6f..2b8d90fa6e8 100644 --- a/Master/texmf-dist/source/latex/bodeplot/bodeplot.dtx +++ b/Master/texmf-dist/source/latex/bodeplot/bodeplot.dtx @@ -20,6 +20,7 @@ %<package>\ProvidesPackage{bodeplot} %<package>\RequirePackage{pdftexcmds} %<package>\RequirePackage{ifplatform} +%<package>\RequirePackage{environ} %<package>\RequirePackage{pgfplots} %<package> \pgfplotsset{compat=1.18} %<package> \usepgfplotslibrary{groupplots} @@ -67,7 +68,7 @@ %</driver> % \fi % -% \CheckSum{1723} +% \CheckSum{1726} % % \changes{v1.0}{2021/10/25}{Initial release} % \changes{v1.0.4}{2021/11/05}{Fixed unintended optional argument macro expansion} @@ -81,7 +82,7 @@ % \GetFileInfo{bodeplot.sty} % \DoNotIndex{\newcommand,\xdef,\gdef,\def,\edef,\addplot,\approx,\arabic,\opt,\typ,\obj,\else,\if@pgfarg,\if@Hzarg,\if@radarg,\if@declutterarg,\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\\version 1.1.1} +% \title{The \textsf{bodeplot} package\\version 1.1.2} % \author{Rushikesh Kamalapurkar \\ \texttt{rlkamalapurkar@gmail.com}} % % \maketitle @@ -1160,6 +1161,7 @@ Nyquist plots with additional commands, using two different macros % \begin{macro}{\PhSOZerosAsymp} % \begin{macro}{\PhSOZerosLin} % Consider a general second order transfer function $G(s) = \frac{1}{s^2 + a s + b}$. We start with true, linear, and asymptotic magnitude plots for this transfer function. +% \changes{v1.1.2}{2022/10/29}{Fix scaling bug introduced in v1.1.1} % \begin{macrocode} \newcommand*{\MagSOPoles}[2]{ (-20*log10(sqrt(\n@pow{#2 - \n@pow{t}{2}}{2} + \n@pow{#1*t}{2})))} @@ -1172,10 +1174,10 @@ Nyquist plots with additional commands, using two different macros \newcommand*{\PhSOPoles}[2]{((-atan2((#1)*t,((#2) - \n@pow{t}{2})))*\ph@scale)} \newcommand*{\PhSOPolesLin}[2]{((#2>0 ? \PhCSPolesLin{(#1/(2*sqrt(#2)))}{(sqrt(#2))} : - (#1>0 ? -pi : pi))*\ph@scale)} + (#1>0 ? -pi : pi)))} \newcommand*{\PhSOPolesAsymp}[2]{((#2>0 ? \PhCSPolesAsymp{(#1/(2*sqrt(#2)))}{(sqrt(#2))} : - (#1>0 ? -pi : pi))*\ph@scale)} + (#1>0 ? -pi : pi)))} % \end{macrocode} % Plots of the inverse function $G(s)=s^2+as+b$ are defined to be negative of plots of poles. The |0-| is necessary due to a bug in |gnuplot| (fixed in version 5.4, patchlevel 3). % \begin{macrocode} @@ -1459,9 +1461,9 @@ Nyquist plots with additional commands, using two different macros % \end{macrocode} %\end{macro} % \begin{environment}{BodePhPlot} -% An environment to host phase plot macros that pass parametric functions to |\addplot| macros. Uses the defaults specified in |bode@style| to create a shortcut that includes the |tikzpicture| and |semilogaxis| environments.\changes{v1.1.0}{2022/07/20}{Added separate environments for phase and magnitude plots}\changes{v1.1.1}{2022/07/31}{Enabled `Hz' and `rad' units for frequency and phase, respectively} +% An environment to host phase plot macros that pass parametric functions to |\addplot| macros. Uses the defaults specified in |bode@style| to create a shortcut that includes the |tikzpicture| and |semilogaxis| environments.\changes{v1.1.0}{2022/07/20}{Added separate environments for phase and magnitude plots}\changes{v1.1.1}{2022/07/31}{Enabled `Hz' and `rad' units for frequency and phase, respectively}\changes{v1.1.2}{2022/10/29}{Defined using the `NewEnviron' command from the `environ' package to fix conflicts with externalization} % \begin{macrocode} -\newenvironment{BodePhPlot}[3][]{ +\NewEnviron{BodePhPlot}[3][]{ \parse@env@opt{#1} \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}] \noexpand\begin{semilogxaxis}[ @@ -1476,16 +1478,16 @@ Nyquist plots with additional commands, using two different macros ] } \temp@cmd -}{ + \BODY \end{semilogxaxis} \end{tikzpicture} } % \end{macrocode} % \end{environment} % \begin{environment}{BodeMagPlot} -% An environment to host magnitude plot macros that pass parametric functions to |\addplot| macros. Uses the defaults specified in |bode@style| to create a shortcut that includes the |tikzpicture| and |semilogaxis| environments.\changes{v1.1.0}{2022/07/20}{Added separate environments for phase and magnitude plots}\changes{v1.1.1}{2022/07/31}{Enabled `Hz' and `rad' units for frequency and phase, respectively} +% An environment to host magnitude plot macros that pass parametric functions to |\addplot| macros. Uses the defaults specified in |bode@style| to create a shortcut that includes the |tikzpicture| and |semilogaxis| environments.\changes{v1.1.0}{2022/07/20}{Added separate environments for phase and magnitude plots}\changes{v1.1.1}{2022/07/31}{Enabled `Hz' and `rad' units for frequency and phase, respectively}\changes{v1.1.2}{2022/10/29}{Defined using the `NewEnviron' command from the `environ' package to fix conflicts with externalization} % \begin{macrocode} -\newenvironment{BodeMagPlot}[3][]{ +\NewEnviron{BodeMagPlot}[3][]{ \parse@env@opt{#1} \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}] \noexpand\begin{semilogxaxis}[ @@ -1500,16 +1502,16 @@ Nyquist plots with additional commands, using two different macros ] } \temp@cmd -}{ + \BODY \end{semilogxaxis} \end{tikzpicture} } % \end{macrocode} % \end{environment} % \begin{environment}{BodePlot} -% Same as |BodeMagPlot|. The |BodePlot| environment is deprecated as of v1.1.0, please use the |BodePhPlot| and |BodeMagPlot| environments instead.\changes{v1.0.3}{2021/11/03}{Added tikz option to environments}\changes{v1.1.0}{2022/02/20}{Deprecated BodePlot environment}\changes{v1.1.1}{2022/07/31}{Enabled `Hz' and `rad' units for frequency and phase, respectively} +% Same as |BodeMagPlot|. The |BodePlot| environment is deprecated as of v1.1.0, please use the |BodePhPlot| and |BodeMagPlot| environments instead.\changes{v1.0.3}{2021/11/03}{Added tikz option to environments}\changes{v1.1.0}{2022/02/20}{Deprecated BodePlot environment}\changes{v1.1.1}{2022/07/31}{Enabled `Hz' and `rad' units for frequency and phase, respectively}\changes{v1.1.2}{2022/10/29}{Defined using the `NewEnviron' command from the `environ' package to fix conflicts with externalization} % \begin{macrocode} -\newenvironment{BodePlot}[3][]{ +\NewEnviron{BodePlot}[3][]{ \parse@env@opt{#1} \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}] \noexpand\begin{semilogxaxis}[ @@ -1523,7 +1525,7 @@ Nyquist plots with additional commands, using two different macros ] } \temp@cmd -}{ + \BODY \end{semilogxaxis} \end{tikzpicture} } @@ -1896,9 +1898,9 @@ Nyquist plots with additional commands, using two different macros % \end{macrocode} %\end{macro} %\begin{macro}{NyquistPlot} -% An environment to host |\addNyquist...| macros that pass parametric functions to |\addplot|. Uses the defaults specified in |bode@style| to create a shortcut that includes the |tikzpicture| and |axis| environments. \changes{v1.0.3}{2021/11/03}{Added tikz option to environments} +% An environment to host |\addNyquist...| macros that pass parametric functions to |\addplot|. Uses the defaults specified in |bode@style| to create a shortcut that includes the |tikzpicture| and |axis| environments. \changes{v1.0.3}{2021/11/03}{Added tikz option to environments}\changes{v1.1.2}{2022/10/29}{Defined using the `NewEniron' command from the `environ' package to fix conflicts with externalization} % \begin{macrocode} -\newenvironment{NyquistPlot}[3][]{ +\NewEnviron{NyquistPlot}[3][]{ \parse@env@opt{#1} \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}] \noexpand\begin{axis}[ @@ -1911,8 +1913,8 @@ Nyquist plots with additional commands, using two different macros ] } \temp@cmd - \addplot [only marks,mark=+,thick,red] (-1 , 0); -}{ + \addplot [only marks,mark=+,thick,red] (-1 , 0); + \BODY \end{axis} \end{tikzpicture} } @@ -1956,7 +1958,7 @@ Nyquist plots with additional commands, using two different macros % \begin{macro}{\NicholsTF} % \changes{v1.0.3}{2021/11/03}{Added commands and tikz options} % \begin{macro}{NicholsChart} -% \changes{v1.0.3}{2021/11/03}{Added tikz option to environments} +% \changes{v1.0.3}{2021/11/03}{Added tikz option to environments}\changes{v1.1.2}{2022/10/29}{Defined using the `NewEniron' command from the `environ' package to fix conflicts with externalization} % \begin{macro}{\addNicholsZPKChart} % \begin{macro}{\addNicholsTFChart} % These macros and the |NicholsChart| environment generate Nichols charts, and they are implemented similar to their Nyquist counterparts.\changes{v1.1.1}{2022/07/31}{Enabled `Hz' and `rad' units for frequency and phase, respectively} @@ -2041,7 +2043,7 @@ Nyquist plots with additional commands, using two different macros \end{axis} \end{tikzpicture} } -\newenvironment{NicholsChart}[3][]{ +\NewEnviron{NicholsChart}[3][]{ \parse@env@opt{#1} \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}] \noexpand\begin{axis}[ @@ -2054,7 +2056,7 @@ Nyquist plots with additional commands, using two different macros ] } \temp@cmd -}{ + \BODY \end{axis} \end{tikzpicture} } @@ -2115,4 +2117,4 @@ Nyquist plots with additional commands, using two different macros % \end{macro} % \end{macro} % \Finale -\endinput
\ No newline at end of file +\endinput diff --git a/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty b/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty index 0fdbc3bcb23..bc5dbf859c9 100644 --- a/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty +++ b/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty @@ -18,6 +18,7 @@ \ProvidesPackage{bodeplot} \RequirePackage{pdftexcmds} \RequirePackage{ifplatform} +\RequirePackage{environ} \RequirePackage{pgfplots} \pgfplotsset{compat=1.18} \usepgfplotslibrary{groupplots} @@ -206,10 +207,10 @@ \newcommand*{\PhSOPoles}[2]{((-atan2((#1)*t,((#2) - \n@pow{t}{2})))*\ph@scale)} \newcommand*{\PhSOPolesLin}[2]{((#2>0 ? \PhCSPolesLin{(#1/(2*sqrt(#2)))}{(sqrt(#2))} : - (#1>0 ? -pi : pi))*\ph@scale)} + (#1>0 ? -pi : pi)))} \newcommand*{\PhSOPolesAsymp}[2]{((#2>0 ? \PhCSPolesAsymp{(#1/(2*sqrt(#2)))}{(sqrt(#2))} : - (#1>0 ? -pi : pi))*\ph@scale)} + (#1>0 ? -pi : pi)))} \newcommand*{\MagSOZeros}{0-\MagSOPoles} \newcommand*{\MagSOZerosLin}{0-\MagSOPolesLin} \newcommand*{\MagSOZerosAsymp}{0-\MagSOPolesAsymp} @@ -433,7 +434,7 @@ }; \fi } -\newenvironment{BodePhPlot}[3][]{ +\NewEnviron{BodePhPlot}[3][]{ \parse@env@opt{#1} \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}] \noexpand\begin{semilogxaxis}[ @@ -448,11 +449,11 @@ ] } \temp@cmd -}{ + \BODY \end{semilogxaxis} \end{tikzpicture} } -\newenvironment{BodeMagPlot}[3][]{ +\NewEnviron{BodeMagPlot}[3][]{ \parse@env@opt{#1} \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}] \noexpand\begin{semilogxaxis}[ @@ -467,11 +468,11 @@ ] } \temp@cmd -}{ + \BODY \end{semilogxaxis} \end{tikzpicture} } -\newenvironment{BodePlot}[3][]{ +\NewEnviron{BodePlot}[3][]{ \parse@env@opt{#1} \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}] \noexpand\begin{semilogxaxis}[ @@ -485,7 +486,7 @@ ] } \temp@cmd -}{ + \BODY \end{semilogxaxis} \end{tikzpicture} } @@ -807,7 +808,7 @@ }; \fi } -\newenvironment{NyquistPlot}[3][]{ +\NewEnviron{NyquistPlot}[3][]{ \parse@env@opt{#1} \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}] \noexpand\begin{axis}[ @@ -820,8 +821,8 @@ ] } \temp@cmd - \addplot [only marks,mark=+,thick,red] (-1 , 0); -}{ + \addplot [only marks,mark=+,thick,red] (-1 , 0); + \BODY \end{axis} \end{tikzpicture} } @@ -931,7 +932,7 @@ \end{axis} \end{tikzpicture} } -\newenvironment{NicholsChart}[3][]{ +\NewEnviron{NicholsChart}[3][]{ \parse@env@opt{#1} \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}] \noexpand\begin{axis}[ @@ -944,7 +945,7 @@ ] } \temp@cmd -}{ + \BODY \end{axis} \end{tikzpicture} } |