texlive[68530] Master/texmf-dist: bodeplot (13oct23)
commits+karl at tug.org
commits+karl at tug.org
Fri Oct 13 22:50:07 CEST 2023
Revision: 68530
https://tug.org/svn/texlive?view=revision&revision=68530
Author: karl
Date: 2023-10-13 22:50:07 +0200 (Fri, 13 Oct 2023)
Log Message:
-----------
bodeplot (13oct23)
Modified Paths:
--------------
trunk/Master/texmf-dist/source/latex/bodeplot/bodeplot.dtx
trunk/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/bodeplot/bodeplot-doc.pdf
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/bodeplot/bodeplot.pdf
Added: trunk/Master/texmf-dist/doc/latex/bodeplot/bodeplot-doc.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/bodeplot/bodeplot-doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bodeplot/bodeplot-doc.pdf 2023-10-13 20:49:48 UTC (rev 68529)
+++ trunk/Master/texmf-dist/doc/latex/bodeplot/bodeplot-doc.pdf 2023-10-13 20:50:07 UTC (rev 68530)
Property changes on: trunk/Master/texmf-dist/doc/latex/bodeplot/bodeplot-doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/bodeplot/bodeplot.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/bodeplot/bodeplot.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/bodeplot/bodeplot.dtx 2023-10-13 20:49:48 UTC (rev 68529)
+++ trunk/Master/texmf-dist/source/latex/bodeplot/bodeplot.dtx 2023-10-13 20:50:07 UTC (rev 68530)
@@ -68,7 +68,7 @@
%</driver>
% \fi
%
-% \CheckSum{1641}
+% \CheckSum{1645}
%
% \changes{v1.0}{2021/10/25}{Initial release}
% \changes{v1.0.4}{2021/11/05}{Fixed unintended optional argument macro expansion}
@@ -82,7 +82,7 @@
% \GetFileInfo{bodeplot.sty}
% \DoNotIndex{\newcommand,\xdef,\gdef,\def,\edef,\addplot,\approx,\arabic,\opt,\typ,\obj,\else,\if at pgfarg,\if at Hzarg,\if at radarg,\if at 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.3}
+% \title{The \textsf{bodeplot} package\\version 1.1.4}
% \author{Rushikesh Kamalapurkar \\ \texttt{rlkamalapurkar at gmail.com}}
%
% \maketitle
@@ -103,7 +103,7 @@
% Since version 1.0.8, the |bodeplot| package places all |gnuplot| temporary files in the working directory. The package option |declutter| restores the original behavior where the temporary files are placed in a folder called |gnuplot|.
% \subsection{Limitations}
% \begin{itemize}
-% \item In |pgf| mode, Bode phase plots and Nichols charts in TF form wrap angles so that they are always between 0 and 360$^\circ$ or 0 and $2\pi$ radian. As such, these plots will show phase wrapping discontinuities. Since v1.1.1, in |gnuplot| mode, the package uses the |smooth unwrap| filter to correct wrapping discontinuities. As of now, I have not found a way to do this in |pgf| mode, any merge requests or ideas you may have are welcome!
+% \item In |pgf| mode, Bode phase plots and Nichols charts in TF form wrap angles so that they are always between -180 and 180$^\circ$ or $-\pi$ and $-\pi$ radian. As such, these plots will show phase wrapping discontinuities. Since v1.1.1, in |gnuplot| mode, the package uses the |smooth unwrap| filter to correct wrapping discontinuities. As of now, I have not found a way to do this in |pgf| mode, any merge requests or ideas you may have are welcome! Since v1.1.4, you can redefine the |n at mod| macro using the commands |\makeatletter\renewcommand{\n at mod}{\n at mod@p}\makeatother| to wrap the phase between 0 and 360$^\circ$ or $0$ and $2\pi$ radian. The commands |\makeatletter\renewcommand{\n at mod}{\n at mod@n}\makeatother| will wrap the phase between -360 and 0$^\circ$ or $-2\pi$ and $0$ radian.
% \item Use of the |declutter| option with other directory management tools such as a |tikzexternalize| prefix is not recommended.
% \end{itemize}
% \clearpage
@@ -813,11 +813,14 @@
% \section{Implementation}
% \subsection{Initialization}
% \begin{macro}{\n at mod}
+% \begin{macro}{\n at mod@p}
+% \begin{macro}{\n at mod@n}
% \begin{macro}{\n at pow}
% \begin{macro}{gnuplot at id}
% \begin{macro}{gnuplot at prefix}
% \changes{v1.0.3}{2021/11/03}{Added jobname to gnuplot prefix}
% \changes{v1.0.8}{2022/07/06}{Fixed issue \#6}
+% \changes{v1.1.4}{2023/10/12}{Changed phase wrapping in pgf mode}
% This code is needed to support both |pgfplots| and |gnuplot| simultaneously. New macros are defined for the |pow| and |mod| functions to address differences between the two math engines. We start by processing the class options.
% \begin{macrocode}
\newif\if at pgfarg\@pgfargfalse
@@ -838,9 +841,11 @@
}
\ProcessOptions\relax
% \end{macrocode}
-% Then, we define two new macros to unify |pgfplots| and |gnuplot|.
+% Then, we define new macros to unify |pgfplots| and |gnuplot|.
% \begin{macrocode}
-\newcommand{\n at mod}[2]{(#1)-(floor((#1)/(#2))*(#2))}
+\newcommand{\n at mod}[2]{(#1)-((round((#1)/(#2)))*(#2))}
+\newcommand{\n at mod@p}[2]{(#1)-((floor((#1)/(#2)))*(#2))}
+\newcommand{\n at mod@n}[2]{(#1)-((floor((#1)/(#2))+1)*(#2))}
\if at pgfarg
\newcommand{\n at pow}[2]{(#1)^(#2)}
\pgfplotsset{
@@ -878,6 +883,8 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
% \begin{macro}{bode at style}
% Default axis properties for all plot macros are collected in this |pgf| style.
% \begin{macrocode}
@@ -1026,7 +1033,7 @@
% Parametric function for the true phase of a complex pole.
% \begin{macrocode}
\newcommand*{\PhPole}[2]{((#1 > 0 ? (#2 > 0 ?
- (\n at mod{-atan2((t - (#2)),-(#1))}{2*pi}) :
+ (\n at mod@p{-atan2((t - (#2)),-(#1))}{2*pi}) :
(-atan2((t - (#2)),-(#1)))) :
(-atan2((t - (#2)),-(#1))))*\ph at scale)}
% \end{macrocode}
@@ -1290,7 +1297,7 @@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\BodeTF}
-% Implementation of this macro is very similar to the |\BodeZPK| macro above. The only difference is the lack of linear and asymptotic plots and slightly different parsing of the mandatory arguments. \changes{v1.0.3}{2021/11/03}{Added Tikz option} \changes{v1.1.0}{2022/07/06}{Fixed phase wrapping in gnuplot mode}\changes{v1.1.1}{2022/07/31}{Enabled `Hz' and `rad' units for frequency and phase, respectively}
+% Implementation of this macro is very similar to the |\BodeZPK| macro above. The only difference is the lack of linear and asymptotic plots and slightly different parsing of the mandatory arguments. \changes{v1.0.3}{2021/11/03}{Added Tikz option} \changes{v1.1.0}{2022/07/06}{Fixed phase wrapping in gnuplot mode}\changes{v1.1.1}{2022/07/31}{Enabled `Hz' and `rad' units for frequency and phase, respectively}\changes{v1.1.4}{2023/10/12}{Changed phase wrapping in pgf mode}
% \begin{macrocode}
\newcommand{\BodeTF}[4][]{
\parse at opt{#1}
@@ -1384,7 +1391,7 @@
% \end{macrocode}
%\end{macro}
% \begin{macro}{\addBodeTFPlot}
-% This macro is designed to issues a single |\addplot| macros for the set of coefficients and delay. All of the work is done by the |\build at TF@plot| macro. \changes{v1.1.0}{2022/07/06}{Fixed phase wrapping in gnuplot mode}\changes{v1.1.1}{2022/07/31}{Enabled `Hz' and `rad' units for frequency and phase, respectively}\changes{v1.1.3}{2022/11/02}{Changed implementation to respect user-supplied domain}
+% This macro is designed to issues a single |\addplot| macros for the set of coefficients and delay. All of the work is done by the |\build at TF@plot| macro. \changes{v1.1.0}{2022/07/06}{Fixed phase wrapping in gnuplot mode}\changes{v1.1.1}{2022/07/31}{Enabled `Hz' and `rad' units for frequency and phase, respectively}\changes{v1.1.3}{2022/11/02}{Changed implementation to respect user-supplied domain}\changes{v1.1.4}{2023/10/12}{Changed phase wrapping in pgf mode}
% \begin{macrocode}
\newcommand{\addBodeTFPlot}[3][thick]{
\gdef\plot at macro{}
@@ -1954,7 +1961,7 @@
% \begin{macro}{\addNicholsZPKChart}
% \changes{v1.1.3}{2022/11/02}{Changed implementation to respect user-supplied domain}
% \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}\changes{v1.1.3}{2022/11/02}{Changed implementation to respect user-supplied domain}
+% 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}\changes{v1.1.3}{2022/11/02}{Changed implementation to respect user-supplied domain}\changes{v1.1.4}{2023/10/12}{Changed phase wrapping in pgf mode}
% \begin{macrocode}
\newcommand{\NicholsZPK}[4][]{
\parse at N@opt{#1}
Modified: trunk/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty 2023-10-13 20:49:48 UTC (rev 68529)
+++ trunk/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty 2023-10-13 20:50:07 UTC (rev 68530)
@@ -40,7 +40,9 @@
\@hzargtrue
}
\ProcessOptions\relax
-\newcommand{\n at mod}[2]{(#1)-(floor((#1)/(#2))*(#2))}
+\newcommand{\n at mod}[2]{(#1)-((round((#1)/(#2)))*(#2))}
+\newcommand{\n at mod@p}[2]{(#1)-((floor((#1)/(#2)))*(#2))}
+\newcommand{\n at mod@n}[2]{(#1)-((floor((#1)/(#2))+1)*(#2))}
\if at pgfarg
\newcommand{\n at pow}[2]{(#1)^(#2)}
\pgfplotsset{
@@ -147,7 +149,7 @@
)}
\newcommand*{\MagPoleAsymp}{\MagPoleLin}
\newcommand*{\PhPole}[2]{((#1 > 0 ? (#2 > 0 ?
- (\n at mod{-atan2((t - (#2)),-(#1))}{2*pi}) :
+ (\n at mod@p{-atan2((t - (#2)),-(#1))}{2*pi}) :
(-atan2((t - (#2)),-(#1)))) :
(-atan2((t - (#2)),-(#1))))*\ph at scale)}
\newcommand*{\PhPoleLin}[2]{
More information about the tex-live-commits
mailing list.