summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/pgf/contrib/bodeplot/README.md86
-rw-r--r--graphics/pgf/contrib/bodeplot/bodeplot.dtx112
-rw-r--r--graphics/pgf/contrib/bodeplot/bodeplot.pdfbin403982 -> 492471 bytes
-rw-r--r--graphics/pstricks/contrib/pst-func/Changes1
-rw-r--r--graphics/pstricks/contrib/pst-func/doc/pst-func-doc.pdfbin4063463 -> 4050523 bytes
-rw-r--r--graphics/pstricks/contrib/pst-func/doc/pst-func-doc.tex41
-rw-r--r--graphics/pstricks/contrib/pst-func/dvips/pst-func.pro2
-rw-r--r--graphics/pstricks/contrib/pst-func/latex/pst-func.sty6
-rw-r--r--graphics/pstricks/contrib/pst-func/tex/pst-func.tex8
9 files changed, 138 insertions, 118 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 7c5f8c204a..eff87445fd 100644
--- a/graphics/pgf/contrib/bodeplot/bodeplot.dtx
+++ b/graphics/pgf/contrib/bodeplot/bodeplot.dtx
@@ -20,6 +20,8 @@
%<package> \ProvidesPackage{bodeplot}
%<package> \RequirePackage{tikz}
%<package> \RequirePackage{pgfplots}
+%<package> \RequirePackage{pdftexcmds}
+%<package> \RequirePackage{ifplatform}
%<package> \pgfplotsset{compat=1.18,variable=t}
%<package> \usepgfplotslibrary{groupplots}
%
@@ -38,7 +40,7 @@
%</driver>
% \fi
%
-% \CheckSum{0}
+% \CheckSum{1162}
%
% \changes{v1.0}{2021/10/25}{Initial release}
%
@@ -52,7 +54,7 @@
% \author{Rushikesh Kamalapurkar \\ \texttt{rlkamalapurkar@gmail.com}}
%
% \maketitle
-%
+% \tableofcontents
% \section{Introduction}
%
% Generate Bode, Nyquist, and Nichols plots for transfer functions in the canonical (TF) form \begin{equation}G(s) = e^{-Ts}\frac{b_ms^m+\cdots+b_1s+b_0}{a_ns^n+\cdots+a_1s+a_0}\label{eq:TF}\end{equation} and the zero-pole-gain (ZPK) form \begin{equation}G(s) = Ke^{-Ts}\frac{(s-z_1)(s-z_2)\cdots(s-z_m)}{(s-p_1)(s-p_2)\cdots(s-p_n)}.\label{eq:ZPK}\end{equation} In the equations above, $b_m,\cdots,b_0$ and $a_n,\cdots,a_0$ are real coefficients, $T\geq 0$ is the loop delay, $z_1,\cdots,z_m$ and $p_1,\cdots,p_n$ are complex zeros and poles of the transfer function, respectively, and $K\in \Re$ is the loop gain. For transfer functions in the ZPK format in (\ref{eq:ZPK}) with zero delay, this package also supports linear and asymptotic approximation of Bode plots.
@@ -72,6 +74,7 @@
% \begin{itemize}
% \item |plot/typ/{opt}|: modify plot properties by adding options |{opt}| to the |\addplot| macro for the magnitude plot if |typ| is |mag| and the phase plot if |typ| is |ph|.
% \item |axes/typ/{opt}|: modify axis properties by adding options |{opt}| to the |\nextgroupplot| macro for the magnitude plot if |typ| is |mag| and the phase plot if |typ| is |ph|.
+% \item |commands/typ/{opt}|: add any valid TikZ commands (including the the parametric function generator macros in this package, such as |\addBodeZPKPlots|, |\addBodeTFPlot|, and |\addBodeComponentPlot|) to the magnitude axes plot if |typ| is |mag| and the phase plot if |typ| is |ph|. The commands passed to |opt| need to be valid TikZ commands, separated by semicolons as usual. For example, a TikZ command is used in the description of the |\BodeTF| macro below to mark the gain crossover frequency on the Bode Magnitude plot.
% \end{itemize}
% \item Tuples of the form |obj/{opt}|:
% \begin{itemize}
@@ -86,17 +89,18 @@
% The options |{opt}| can be any |key=value| options that are supported by the |pgfplots| macros they are added to. \textit{Linear or asymptotic approximation of transfer functions that include a transport delay is not supported.}
% For example, given a transfer function \begin{equation}G(s) = 10\frac{s(s+0.1+0.5\mathrm{i})(s+0.1-0.5\mathrm{i})}{(s+0.5+10\mathrm{i})(s+0.5-10\mathrm{i})},\label{eq:ZPKExample}\end{equation} its Bode plot over the frequency range $[0.01,100]$ can be generated using\\
-% |\BodeZPK|\\
+% |\BodeZPK [blue,thick]|\\
% | {z/{0,{-0.1,-0.5},{-0.1,0.5}},p/{{-0.5,-10},{-0.5,10}},k/10}|\\
% | {0.01}{100}|\\
% which generates the plot in Figure \ref{simpleBode}. If a delay is not specified, it is assumed to be zero. If a gain is not specified, it is assumed to be 1. By default, each of the axes, excluding ticks and labels, are 5cm wide and 2.5cm high. The width and the height, along with other properties of the plots, the axes, and the group can be customized using native |pgf| keys as shown in the example below.
%
% \begin{figure}
% \begin{center}
-% \BodeZPK{z/{0,{-0.1,-0.5},{-0.1,0.5}},p/{{-0.5,-10},{-0.5,10}},k/10}{0.01}{100}
+% \BodeZPK[blue,thick]{z/{0,{-0.1,-0.5},{-0.1,0.5}},p/{{-0.5,-10},{-0.5,10}},k/10}{0.01}{100}
% \cprotect\caption{\label{simpleBode}Output of the default |\BodeZPK| macro.}
% \end{center}
% \end{figure}
+% As demonstrated in this example, if a single comma-separated list of options is passed, it applies to both the magnitude and the phase plots. Without any optional arguments, we gets a thick black Bode plot.
%
% A linear approximation of the Bode plot with customization of the plots, the axes, and the group can be generated using\\
% |\BodeZPK[plot/mag/{red,thick},plot/ph/{blue,thick},|\\
@@ -123,15 +127,16 @@
% \noindent Plots the Bode plot of a transfer function given in TF format. The three mandatory arguments include: (1) a list of tuples comprised of the coefficients in the numerator and the denominator of the transfer function and the transport delay, (2) the lower end of the frequency range for the $x-$ axis, and (3) the higher end of the frequency range for the $x-$axis. The coefficients are entered as a comma-separated list, in order from the highest degree of $s$ to the lowest, with zeros for missing degrees. The optional arguments are the same as |\BodeZPK|, except that linear/asymptotic approximation is not supported, so |approx/...| is ignored.
%
% For example, given the same transfer function as (\ref{eq:ZPKExample}) in TF form and with a small transport delay, \begin{equation}G(s) = e^{-0.01s}\frac{s(10s^2+2s+2.6)}{(s^2+s+100.25)},\label{eq:TFExample}\end{equation} its Bode plot over the frequency range $[0.01,100]$ can be generated using\\
-% |\BodeTF[blue,thick]|\\
+% |\BodeTF[commands/mag/{\node at (axis cs: 2.1,0) |\\
+% | [circle,fill,inner sep=0.05cm,label=below:{$\omega_{gc}$}]{};}]|\\
% | {num/{10,2,2.6,0},den/{1,0.2,100},d/0.01}|\\
% | {0.01}{100}|\\
-% which generates the plot in Figure \ref{simpleBodeTF}. Note the $0$ added to the numerator coefficients to account for the fact that the numerator does not have a constant term in it. As demonstrated in this example, if a single comma-separated list of options is passed, it applies to both the magnitude and the phase plots.
+% which generates the plot in Figure \ref{simpleBodeTF}. Note the $0$ added to the numerator coefficients to account for the fact that the numerator does not have a constant term in it. Note the semicolon after the TikZ command passed to the |\commands| option.
%
% \begin{figure}
% \begin{center}
-% \BodeTF[blue,thick]{num/{10,2,2.6,0},den/{1,1,100.25},d/0.01}{0.01}{100}
-% \cprotect\caption{\label{simpleBodeTF}Output of the |\BodeTF| macro.}
+% \BodeTF[commands/mag/{\node at (axis cs: 2.1,0) [circle,fill,inner sep=0.05cm,label=below:{$\omega_{gc}$}] {};}]{num/{10,2,2.6,0},den/{1,1,100.25},d/0.01}{0.01}{100}
+% \cprotect\caption{\label{simpleBodeTF}Output of the |\BodeTF| macro with an optional TikZ command used to mark the gain crossover frequency.}
% \end{center}
% \end{figure}
%
@@ -139,14 +144,14 @@
% |\begin{BodePlot}|\oarg{axis-options}\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 |\addBodeComponentPlots|. 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 |\addBodeComponentPlots|.
+% 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|.
%
% \DescribeMacro{\addBodeZPKPlots}
% |\addBodeZPKPlots| \oarg{approx1/\marg{opt1},approx2/\marg{opt2},...}\\
% \hspace*{2em}\marg{plot-type}\\
% \hspace*{2em}\marg{z/\marg{zeros},p/\marg{poles},k/\marg{gain},d/\marg{delay}}
%
-% \noindent Generates the appropriate parametric functions and supplies them to multiple |\addplot| macros, one for each |approx/{opt}| pair in the optional argument. If no optional argument is supplied, then a single |\addplot| command corresponding to the true Bode plot is generated. This macro can be used inside any |semilogaxis| environment as long as a domain for the x-axis is supplied through either the |approx/{opt}| interface or directly in the optional argument of the |semilogaxis| environment. Use with the |BodePlot| environment supplied with this package is recommended. The second mandatory argument, |plot-type| is either magnitude or |phase|. If it is not equal to |phase|, it is assumed to be |magnitude|. The last mandatory argument is the same as |\BodeZPK|.
+% \noindent Generates the appropriate parametric functions and supplies them to multiple |\addplot| macros, one for each |approx/{opt}| pair in the optional argument. If no optional argument is supplied, then a single |\addplot| command corresponding to a thick true Bode plot is generated. If an optional argument is supplied, it needs to be one of |true/{opt}|, |linear/{opt}|, or |asymptotic/{opt}|. This macro can be used inside any |semilogaxis| environment as long as a domain for the x-axis is supplied through either the |approx/{opt}| interface or directly in the optional argument of the |semilogaxis| environment. Use with the |BodePlot| environment supplied with this package is recommended. The second mandatory argument, |plot-type| is either |magnitude| or |phase|. If it is not equal to |phase|, it is assumed to be |magnitude|. The last mandatory argument is the same as |\BodeZPK|.
%
% For example, given the transfer function in (\ref{eq:ZPKExample}), its linear, asymptotic, and true Bode plots can be superimposed using
%\begin{verbatim}
@@ -410,7 +415,6 @@
% \begin{macrocode}
\RequirePackage{ifluatex}%
\ifluatex
- \RequirePackage{pdftexcmds}%
\let\pdfstrcmp\pdf@strcmp
\fi
% \end{macrocode}
@@ -420,7 +424,6 @@
% \begin{macro}{idGnuplot}
% \begin{macro}{gnuplot def}
% \begin{macro}{gnuplot degrees}
-% \begin{macro}{bodeStyle}
% 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 |pgf| class option.
% \begin{macrocode}
\newif\if@pgfarg\@pgfargfalse
@@ -458,9 +461,21 @@
\fi
}%
}
+% \end{macrocode}
+% If the operating system is not Windows, we create the |gnuplot| folder if it does not already exist. \changes{v1.0.2}{2021/11/01}{Fixed issue \#1}
+% \begin{macrocode}
+ \ifwindows\else
+ \immediate\write18{mkdir -p gnuplot}%
+ \fi
\fi
% \end{macrocode}
-% Default axis properties for all plot macros are collected in the following |pgf| style.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{bodeStyle}
+% Default axis properties for all plot macros are collected in this |pgf| style.
% \begin{macrocode}
\pgfplotsset{%
bodeStyle/.style = {%
@@ -478,11 +493,6 @@
}
% \end{macrocode}
% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
% \subsection{Parametric function generators for poles, zeros, gains, and delays.}
% \begin{macro}{\MagK}
% \begin{macro}{\MagKAsymp}
@@ -732,9 +742,9 @@
% \subsection{Commands for Bode plots}
% \subsubsection{User macros}
% \begin{macro}{\BodeZPK}
-% This macro takes lists of complex poles and zeros of the form |{re,im}|, and values of gain and delay as inputs and constructs parametric functions for the Bode magnitude and phase plots. This is done by adding together the parametric functions generated by the macros for individual zeros, poles, gain, and delay, described above. The parametric functions are then plotted in a |tikzpicture| environment using the |\addplot| macro. Unless the package is loaded with the option |pgf|, the parametric functions are evaluated using |gnuplot|.
+% This macro takes lists of complex poles and zeros of the form |{re,im}|, and values of gain and delay as inputs and constructs parametric functions for the Bode magnitude and phase plots. This is done by adding together the parametric functions generated by the macros for individual zeros, poles, gain, and delay, described above. The parametric functions are then plotted in a |tikzpicture| environment using the |\addplot| macro. Unless the package is loaded with the option |pgf|, the parametric functions are evaluated using |gnuplot|. \changes{v1.0.1}{2021/10/29}{Pass arbitrary TikZ commands as options.}
% \begin{macrocode}
-\newcommand{\BodeZPK}[4][]{%
+\newcommand{\BodeZPK}[4][approx/true]{%
% \end{macrocode}
% Most of the work is done by the |\parse@opt| and the |\build@ZPK@plot| macros, described in the 'Internal macros' section. The former is used to parse the optional arguments and the latter to extract poles, zeros, gain, and delay from the first mandatory argument and to generate macros |\func@mag| and |\func@ph| that hold the magnitude and phase parametric functions.
% \begin{macrocode}
@@ -761,12 +771,14 @@
\if@pgfarg
\expandafter\nextgroupplot\expandafter[ytick distance=20,
ylabel={Gain (dB)},xmajorticks=false,\optmag@axes]
- \edef\temp@cmd{\noexpand\addplot[red,thick,\optmag@plot]}%
+ \edef\temp@cmd{\noexpand\addplot[thick,\optmag@plot]}%
\temp@cmd {\func@mag};
+ \optmag@commands;
\expandafter\nextgroupplot\expandafter[ytick distance=45,
ylabel={Phase ($^{\circ}$)},xlabel={Frequency (rad/s)},\optph@axes]
- \edef\temp@cmd{\noexpand\addplot[red,thick,\optph@plot]}%
+ \edef\temp@cmd{\noexpand\addplot[thick,\optph@plot]}%
\temp@cmd {\func@ph};
+ \optph@commands;
\else
% \end{macrocode}
% In |gnuplot| mode, we increment the |idGnuplot| counter before every plot to make sure that new and reusable |.gnuplot| and |.table| files are generated for every plot.
@@ -774,15 +786,18 @@
\stepcounter{idGnuplot}
\expandafter\nextgroupplot\expandafter[ytick distance=20,
ylabel={Gain (dB)},xmajorticks=false,\optmag@axes]
- \edef\temp@cmd{\noexpand\addplot[red,thick,\optmag@plot]}%
+ \edef\temp@cmd{\noexpand\addplot[thick,\optmag@plot]}%
\temp@cmd gnuplot[gnuplot degrees,gnuplot def] {\func@mag};
+ \optmag@commands;
\stepcounter{idGnuplot}
\expandafter\nextgroupplot\expandafter[ytick distance=45,
ylabel={Phase ($^{\circ}$)},xlabel={Frequency (rad/s)},\optph@axes]
- \edef\temp@cmd{\noexpand\addplot[red,thick,\optph@plot]}%
+ \edef\temp@cmd{\noexpand\addplot[thick,\optph@plot]}%
\temp@cmd gnuplot[gnuplot degrees,gnuplot def] {\func@ph};
+ \optph@commands;
\fi
- \end{groupplot}\end{tikzpicture}}
+ \end{groupplot}\end{tikzpicture}
+}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\BodeTF}
@@ -806,31 +821,36 @@
\if@pgfarg
\expandafter\nextgroupplot\expandafter[ytick distance=20,
ylabel={Gain (dB)},xmajorticks=false,\optmag@axes]
- \edef\temp@cmd{\noexpand\addplot[red,thick,\optmag@plot]}%
+ \edef\temp@cmd{\noexpand\addplot[thick,\optmag@plot]}%
\temp@cmd {\func@mag};
+ \optmag@commands;%
\expandafter\nextgroupplot\expandafter[ytick distance=45,
ylabel={Phase ($^{\circ}$)},xlabel={Frequency (rad/s)},\optph@axes]
- \edef\temp@cmd{\noexpand\addplot[red,thick,\optph@plot]}%
+ \edef\temp@cmd{\noexpand\addplot[thick,\optph@plot]}%
\temp@cmd {\func@ph};
+ \optph@commands;%
\else
\stepcounter{idGnuplot}%
\expandafter\nextgroupplot\expandafter[ytick distance=20,
ylabel={Gain (dB)},xmajorticks=false,\optmag@axes]
- \edef\temp@cmd{\noexpand\addplot[red,thick,\optmag@plot]}%
+ \edef\temp@cmd{\noexpand\addplot[thick,\optmag@plot]}%
\temp@cmd gnuplot[gnuplot degrees,gnuplot def] {\func@mag};
+ \optmag@commands;%
\stepcounter{idGnuplot}%
\expandafter\nextgroupplot\expandafter[ytick distance=45,
ylabel={Phase ($^{\circ}$)},xlabel={Frequency (rad/s)},\optph@axes]
- \edef\temp@cmd{\noexpand\addplot[red,thick,\optph@plot]}%
+ \edef\temp@cmd{\noexpand\addplot[thick,\optph@plot]}%
\temp@cmd gnuplot[gnuplot degrees,gnuplot def] {\func@ph};
+ \optph@commands;%
\fi
- \end{groupplot}\end{tikzpicture}}
+ \end{groupplot}\end{tikzpicture}
+}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\addBodeZPKPlots}
-% This macro is designed to issues multiple |\addplot| macros for the same set of poles, zeros, gain, and delay. All of the work is done by the |\build@ZPK@plot| macro.
+% This macro is designed to issues multiple |\addplot| macros for the same set of poles, zeros, gain, and delay. All of the work is done by the |\build@ZPK@plot| macro. \changes{v1.0.1}{2021/10/29}{Improved optional argument handling.}
% \begin{macrocode}
-\newcommand{\addBodeZPKPlots}[3][{}]{%
+\newcommand{\addBodeZPKPlots}[3][true/{}]{%
\foreach \approx/\opt in {#1} {%
\gdef\plot@macro{}%
\gdef\temp@macro{}%
@@ -840,11 +860,11 @@
\build@ZPK@plot{\plot@macro}{\temp@macro}{\approx}{#3}%
\fi
\if@pgfarg
- \edef\temp@cmd{\noexpand\addplot[red,thick,\opt]}%
+ \edef\temp@cmd{\noexpand\addplot[thick,\opt]}%
\temp@cmd {\plot@macro};
\else
\stepcounter{idGnuplot}%
- \edef\temp@cmd{\noexpand\addplot[red,thick,\opt]}
+ \edef\temp@cmd{\noexpand\addplot[thick,\opt]}
\temp@cmd gnuplot[gnuplot degrees,gnuplot def] {\plot@macro};
\fi
}%
@@ -854,7 +874,7 @@
% \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@TF@plot| macro.
% \begin{macrocode}
-\newcommand{\addBodeTFPlot}[3][red,thick]{%
+\newcommand{\addBodeTFPlot}[3][thick]{%
\gdef\plot@macro{}%
\gdef\temp@macro{}%
\ifnum\pdfstrcmp{#2}{phase}=0
@@ -874,7 +894,7 @@
% \begin{macro}{\addBodeComponentPlot}
% This macro is designed to issue a single |\addplot| macro capable of plotting linear combinations of the basic components described in Section \ref{sec:BasicComponents}. The only work to do here is to handle the |pgf| package option.
% \begin{macrocode}
-\newcommand{\addBodeComponentPlot}[2][red,thick]{%
+\newcommand{\addBodeComponentPlot}[2][thick]{%
\if@pgfarg
\addplot[#1]{#2};
\else
@@ -1064,6 +1084,8 @@
\gdef\optmag@plot{}%
\gdef\opt@group{}%
\gdef\opt@approx{}%
+ \xdef\optph@commands{}%
+ \xdef\optmag@commands{}%
\foreach \obj/\typ/\opt in {#1} {%
\ifnum\pdfstrcmp{\obj}{plot}=0
\ifnum\pdfstrcmp{\typ}{mag}=0
@@ -1093,10 +1115,18 @@
\xdef\opt@group{\opt@group,\opt}%
\else
\ifnum\pdfstrcmp{\obj}{approx}=0
- \xdef\opt@approx{\typ}%
+ \xdef\opt@approx{\opt}%
\else
- \xdef\optmag@plot{\optmag@plot,\obj}%
- \xdef\optph@plot{\optph@plot,\obj}%
+ \ifnum\pdfstrcmp{\obj}{commands}=0
+ \ifnum\pdfstrcmp{\typ}{phase}=0
+ \xdef\optph@commands{\unexpanded\expandafter{\opt}}%
+ \else
+ \xdef\optmag@commands{\unexpanded\expandafter{\opt}}%
+ \fi
+ \else
+ \xdef\optmag@plot{\optmag@plot,\obj}%
+ \xdef\optph@plot{\optph@plot,\obj}%
+ \fi
\fi
\fi
\fi
@@ -1273,7 +1303,7 @@
samples=500,
\opt@axes]}
\temp@cmd
- \edef\temp@cmd{\noexpand\addplot[red,thick,\opt@plot]}%
+ \edef\temp@cmd{\noexpand\addplot[thick,\opt@plot]}%
\if@pgfarg
\temp@cmd ( {\func@ph} , {\func@mag} );
\else
@@ -1298,7 +1328,7 @@
samples=500,
\opt@axes]}
\temp@cmd
- \edef\temp@cmd{\noexpand\addplot[red,thick,\opt@plot]}%
+ \edef\temp@cmd{\noexpand\addplot[thick,\opt@plot]}%
\if@pgfarg
\temp@cmd ( {\func@ph} , {\func@mag} );
\else
diff --git a/graphics/pgf/contrib/bodeplot/bodeplot.pdf b/graphics/pgf/contrib/bodeplot/bodeplot.pdf
index e21ce245d5..f2dd0879b8 100644
--- a/graphics/pgf/contrib/bodeplot/bodeplot.pdf
+++ b/graphics/pgf/contrib/bodeplot/bodeplot.pdf
Binary files differ
diff --git a/graphics/pstricks/contrib/pst-func/Changes b/graphics/pstricks/contrib/pst-func/Changes
index 82e56e9c02..9ecb5349bb 100644
--- a/graphics/pstricks/contrib/pst-func/Changes
+++ b/graphics/pstricks/contrib/pst-func/Changes
@@ -1,4 +1,5 @@
..... pst-func.tex
+0.99 2021-11-03 - fix for psLorenz (missing sort routine)
0.98 2021-10-30 - fix for Gini coefficiant
0.97 2021-10-29 - fix and extension for \psLorenz curve
0.96 2021-04-06 - added start/endAngle for \psLame
diff --git a/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.pdf b/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.pdf
index bb11138494..b791d5e480 100644
--- a/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.pdf
+++ b/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.pdf
Binary files differ
diff --git a/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.tex b/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.tex
index 119d23f317..8e87d3a6d3 100644
--- a/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.tex
+++ b/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.tex
@@ -55,6 +55,7 @@
\tableofcontents
\psset{unit=1cm}
+
\clearpage
\begin{abstract}
@@ -65,6 +66,7 @@ All should be already part of your local \TeX\ installation. If not, or in case
of having older versions, go to \url{http://www.CTAN.org/} and load the newest version.
\vfill\noindent
+{\raggedright
Thanks to \\
Rafal Bartczuk,
Jean-C\^ome Charpentier,
@@ -76,8 +78,9 @@ Thanks to \\
Attila Gati,
Horst Gierhardt,
Jürgen Gilg,
+ Michel Hoppe,
Christophe Jorssen,
- Lars Kotthoff,
+ Lars Kotthoff,
Marcel Krüger,
Buddy Ledger,
Pablo Gonzáles Luengo,
@@ -90,8 +93,7 @@ Thanks to \\
Timothy Van Zandt,
Michael Zedler,
and last but not least
- \url{http://mathworld.wolfram.com}.
-
+ \url{http://mathworld.wolfram.com}.\par}
\end{abstract}
@@ -1129,6 +1131,7 @@ the constant value can only be set with \Lkeyword{cosCoeff}=\verb+a0+.
\clearpage
\section{\Lcs{psBessel}}
+\subsection{Default type}
The Bessel function of order $n$ is defined as
%
\begin{align}
@@ -1202,8 +1205,8 @@ way, at the cost of some reduction in graphics resolution.
}
\end{LTXexample}
-\clearpage
-\section{Modfied Bessel function of first order}
+%\clearpage
+\subsection{Modfied Bessel function of first order}
The modified Bessel function of first order is defined as
%
\begin{align}
@@ -2115,7 +2118,8 @@ example.
\end{LTXexample}
\clearpage
-\section{\nxLcs{psLorenz}, Lorenz curve}
+\section{Special Functions}
+\subsection{\nxLcs{psLorenz} -- Lorenz curve}
The so-called \Index{Lorenz curve} is used in economics to describe inequality in
wealth or size. The Lorenz curve is a function of the cumulative proportion of
\textit{ordered individuals} mapped onto the corresponding cumulative proportion
@@ -2169,23 +2173,8 @@ origin of the coordinate system.
\endpsgraph
\end{LTXexample}
-
-\begin{LTXexample}[pos=t,preset=\centering]
-\psset{lly=-13mm,llx=-5mm}
-\psgraph[Dx=0.2,Dy=0.2,axesstyle=frame](0,0)(1,1){6cm}{6cm}
-\psline[linestyle=dashed](1,1)
-\psLorenz[Gini,linecolor=red,linewidth=1.5pt]<.2 .2 .2 .2 .2>{.1 .1 .1 .35 .35 }
-\psLorenz[Gini,linecolor=blue,linestyle=dashed,linewidth=1.5pt]{.1 .1 .1 .35 .35 }
-\endpsgraph
-\end{LTXexample}
-
-
-
-
-
-
\clearpage
-\section{\nxLcs{psLame} -- Lam\'e Curve, a superellipse}
+\subsection{\nxLcs{psLame} -- Lam\'e Curve, a superellipse}
A superellipse is a curve with Cartesian equation
%
\begin{align}
@@ -2268,7 +2257,7 @@ and unit.
\egroup
\clearpage
-\section{\nxLcs{psThomae} -- the popcorn function}
+\subsection{\nxLcs{psThomae} -- the popcorn function}
\Index{Thomae's function}, also known as the \Index{popcorn function},
the \Index{raindrop function}, the \Index{ruler function} or the
\Index{Riemann function}, is a modification of the \Index{Dirichlet} function.
@@ -2300,7 +2289,7 @@ The plotted number of points is the third parameter.
\clearpage
-\section{\nxLcs{psWeierstrass} -- a pathological function}
+\subsection{\nxLcs{psWeierstrass} -- a pathological function}
The Weierstrass function is an example of a pathological real-valued function
on the real line. The function has the property that it is continuous
@@ -2352,7 +2341,7 @@ The original Weierstraß function can be used with the optional argument:
\clearpage
-\section{\nxLcs{psplotImp} -- plotting implicit defined functions}
+\subsection{\nxLcs{psplotImp} -- plotting implicit defined functions}
For a given area, the macro calculates in a first step row by row for every pixel (1pt)
the function $f(x,y)$ and checks for a changing of the value from $f(x,y)<0$ to $f(x,y)>0$
or vice versa. If this happens, then the pixel must be part of the curve of
@@ -2502,7 +2491,7 @@ The data then can be read back to get a continous line of the plot.
\fi
\clearpage
-\section{\nxLcs{psVolume} -- Rotating functions around the x-axis}
+\subsection{\nxLcs{psVolume} -- Rotating functions around the x-axis}
This macro shows the behaviour of a \Index{rotated function} around the $x$-axis.
\begin{BDef}
diff --git a/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro b/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro
index 25c4a831d1..f752442e87 100644
--- a/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro
+++ b/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro
@@ -16,7 +16,7 @@
%% `pst-func' is a PSTricks package to plot special math functions
%%
%%
-%% version 0.18 / 2021-10-30 Herbert Voss
+%% version 0.17 / 2018-12-13 Herbert Voss
%
/tx@FuncDict 100 dict def
tx@FuncDict begin
diff --git a/graphics/pstricks/contrib/pst-func/latex/pst-func.sty b/graphics/pstricks/contrib/pst-func/latex/pst-func.sty
index e70a9ebe55..ff1038570d 100644
--- a/graphics/pstricks/contrib/pst-func/latex/pst-func.sty
+++ b/graphics/pstricks/contrib/pst-func/latex/pst-func.sty
@@ -1,5 +1,5 @@
\RequirePackage{pstricks}
-\ProvidesPackage{pst-func}[2021/10/30 package wrapper for pst-func.tex (hv)]
+\ProvidesPackage{pst-func}[2018/12/13 package wrapper for pst-func.tex (hv)]
\RequirePackage{pst-plot}
\RequirePackage{pst-math}
\RequirePackage{pst-tools}
@@ -10,7 +10,7 @@
\ProvidesFile{pst-func.tex}
[\filedate\space v\fileversion\space `PST-func' (hv)]
\IfFileExists{pst-func.pro}{%
- \ProvidesFile{pst-func.pro}[2021/10/30 v. 0.18, PostScript prologue file (hv)]
+ \ProvidesFile{pst-func.pro}[2018/12/13 v. 0.17, PostScript prologue file (hv)]
\@addtofilelist{pst-func.pro}}{}%
\endinput
-%% $Id: pst-func.sty 308 2021-10-30 14:11:45Z herbert $
+%% $Id: pst-func.sty 306 2021-10-29 14:48:08Z herbert $
diff --git a/graphics/pstricks/contrib/pst-func/tex/pst-func.tex b/graphics/pstricks/contrib/pst-func/tex/pst-func.tex
index 1f51fba97c..1e982ddb2b 100644
--- a/graphics/pstricks/contrib/pst-func/tex/pst-func.tex
+++ b/graphics/pstricks/contrib/pst-func/tex/pst-func.tex
@@ -31,8 +31,8 @@
% interface to the `xkeyval' package
\pst@addfams{pst-func}
%
-\def\fileversion{0.98}
-\def\filedate{2021/10/30}
+\def\fileversion{0.99}
+\def\filedate{2021/11/03}
\message{`PST-func' v\fileversion, \filedate\space (hv)}
%
\pstheader{pst-func.pro}
@@ -1607,14 +1607,14 @@ grestore
\def\Lorenz@code{
25 dict begin
[ #2 ] dup length /nVal ED
- /Yval ED
+ bubblesort /Yval ED
Yval arraySum /Ysum ED
Yval { Ysum div } forall nVal array astore /YvalRel ED % Pred dist
\if$#1$
/temp {1 nVal div} bind def
[ nVal { temp } repeat ] /XvalRel ED
[ 1 1 nVal { nVal div } for ] /XvalRelCum ED
- YvalRel bubblesort /YvalRel ED
+ %YvalRel bubblesort /YvalRel ED
\else
[ #1 ] /Xval ED
Xval arraySum /Xsum ED