% !TeX encoding = utf-8 \NeedsTeXFormat{LaTeX2e}[1999/01/01] \ProvidesPackage{bodegraph}[version 1.6] \RequirePackage{tikz} \RequirePackage{ifthen} \RequirePackage{ifsym} \RequirePackage{relsize} \usetikzlibrary{shapes,arrows,backgrounds,decorations.markings} %macros commande schéma-blocs \def\valpi{3.1415957} \def\valpas{10} \def\Unitx{} \def\Unity{} \def\NOMgnuplot{} \def\NameGraph{gnuplot} \newcounter{idGnuplot} \newcommand{\OrdBode}[1]{\def\valpas{#1}} \newcommand{\NomGraphe}[1]{\def\NameGraph{#1}} \NomGraphe{gnuplot} \newcommand{\UnitedB}{ \def\Unitx{rad/s} \def\Unity{dB} } \newcommand{\UniteDegre}{ \def\Unitx{rad/s} \def\Unity{$~^\circ$} } \newcommand{\Unites}[2]{ \def\Unitx{#1} \def\Unity{#2} } \newcommand{\NomGnuplot}[1][]{ \def\NOMgnuplot{#1} } \tikzset{ ref points/.style={circle,draw, black, opacity=0.7, fill, minimum size= 2pt, inner sep=0}, gnuplot def/.style={samples=50,id={\NOMgnuplot\arabic{idGnuplot}},prefix=gnuplot/\jobname/}, Bode lines/.style={very thick, blue,line width=0.35mm,}, Bode lines 2/.style={Bode lines, red}, asymp lines/.style={Bode lines,line width=0.25mm,}, asymp lines 2/.style={Bode line 2,line width=0.25mm,}, semilog lines/.style={line width=0.25mm, brown}, semilog lines 2/.style={semilog lines, line width=0.2mm,brown!50 }, semilog half lines/.style={semilog lines 2, dashed }, semilog label x/.style={semilog lines,below,font=\footnotesize}, semilog label y/.style={semilog lines,right,font=\footnotesize}, Black lines/.style={very thick, blue}, Black grid/.style={ultra thin,brown}, Black abaque mag/.style={gray,ultra thin,dashed,smooth}, Black abaque phase/.style={gray,ultra thin,smooth}, Black label points/.style={font=\footnotesize}, Black label axes/.style={Black grid, font=\footnotesize}, Nyquist lines/.style={very thick, blue}, Nyquist grid/.style={ultra thin,brown}, Nyquist label axes/.style={Nyquist grid,font=\footnotesize}, Nyquist label points/.style={font=\footnotesize}, Temp lines/.style={very thick, blue}, Temp grid/.style={ultra thin,brown}, Temp label axes/.style={Temp grid, font=\footnotesize}, Temp label points/.style={font=\footnotesize}, Abaque grid/.style={ultra thin,brown!80}, Abaque lines/.style={thick, blue,smooth}, } \newcommand{\semilog}{\@ifstar\semilogS\semilogNS} \newcommand{\semilogNS}[5][]{ \pgfmathparse{int(#3-1)}\let\Xmax\pgfmathresult \foreach \ee in{#2,...,\Xmax}{ \foreach \x in {1,2,3,4,5,6,7,8,9}{ \draw[semilog lines 2] ({log10(\x)+\ee},#4) -- ({log10(\x)+\ee},#5);} \draw[semilog lines] (\ee,#4)node[semilog label x]{$10^{\ee}$} -- ({\ee},#5); }; \draw[semilog lines] ({#3},#4)node[semilog label x,name=TextX]{$10^{#3}$} -- ({#3},#5); \pgfmathparse{int(#4+\valpas)} \let\Valsuivante\pgfmathresult \foreach \yy in {#4,\Valsuivante,...,#5}{ \draw[semilog lines] (#2,\yy) node[semilog label y,left,name=TextY]{$\yy$} -- ({#3},\yy);}; %\node[semilog label y, node distance=0.3em]at (#2,#5) { \Unity}; \node[semilog label y, above of= TextY,node distance=0.6em,right] { \Unity}; \node[semilog label x, right,node distance=0.8em]at (#3,#4){ \Unitx}; %\node[semilog label x, above right of= TextX,node distance=1.2em]{ \Unitx}; \def\Unitx{} \def\Unity{} } \newcommand{\semilogS}[5][]{ \semilog[#1]{#2}{#3}{#4}{#5} \pgfmathparse{int(#3-1)}\let\Xmax\pgfmathresult \foreach \ee in{#2,...,\Xmax}{ \foreach \x in {1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5}{ \draw[semilog half lines] ({log10(\x)+\ee},#4) -- ({log10(\x)+\ee},#5);} }; } \newcommand{\semilogNG}[2]{ \pgfmathparse{int(#1-1)}\let\Xmax\pgfmathresult \foreach \ee in{0,...,\Xmax}{ \foreach \x in {1,2,3,4,5,6,7,8,9}{ \draw[semilog lines 2] ({log10(\x)+\ee},0) -- ({log10(\x)+\ee},#2);} }; \draw[semilog lines] ({#1},0) -- ({#1},#2); \pgfmathparse{int(0+\valpas)} \let\Valsuivante\pgfmathresult \foreach \yy in {0,\Valsuivante,...,#2}{ \draw[semilog lines] (0,\yy) -- ({#1},\yy);}; \node[semilog label y, node distance=0.3em]at (0,#2) {\footnotesize \Unity}; \node[semilog label x, right,node distance=0.8em]at (#1,0){\footnotesize \Unitx}; \def\Unitx{} \def\Unity{} \pgfmathparse{int(#1-1)}\let\Xmax\pgfmathresult \foreach \ee in{0,...,\Xmax}{ \foreach \x in {1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5}{ \draw[semilog half lines] ({log10(\x)+\ee},0) -- ({log10(\x)+\ee},#2);} }; } \newcommand{\KAmp}[1]{20*log10(abs(#1))} \newcommand{\KArg}[1]{0} \newcommand{\POAmp}[2]{20*log10(abs(#1/sqrt(1+(#2*10**t)**2)))} \newcommand{\POAmpng}[2]{20*log10(abs(#1/sqrt(1+(#2*10^(\t))^2)))} \newcommand{\POAmpAsymp}[2]{(t < log10(1./#2) ? 20*log10(#1) : 20*log10(0.1*10.0*#1/(#2))-20*log10(10**t))} \newcommand{\POArg}[2]{-180/\valpi*atan(#2*10**t)} \newcommand{\POArgAsymp}[2]{(t