% !TeX root = bodegraph.tex \NeedsTeXFormat{LaTeX2e}[1999/01/01] \ProvidesPackage{bodegraph}[2009/04/06] \RequirePackage{tikz} \RequirePackage{ifthen} \RequirePackage{ifsym} \usetikzlibrary{shapes,arrows,backgrounds,decorations.markings} %macros commande schéma-blocs \def\valpi{3.1415957} \def\valpas{10} \def\Unitx{} \def\Unity{} \newcounter{idGnuplot} \newcommand{\OrdBode}[1]{\def\valpas{#1}} \newcommand{\UnitedB}{ \def\Unitx{rad/s} \def\Unity{dB} } \newcommand{\UniteDegre}{ \def\Unitx{rad/s} \def\Unity{$~^\circ$} } \tikzset{ ref points/.style={circle,draw, black, opacity=0.7, fill, minimum size= 2pt, inner sep=0}, gnuplot def/.style={samples=50,id=\arabic{idGnuplot},prefix=gnuplot/\jobname/}, Bode lines/.style={very thick, blue}, Bode lines 2/.style={Bode lines, red}, asymp lines/.style={Bode lines,thin}, asymp lines 2/.style={bode line 2,thin}, semilog lines/.style={line width=0.35mm, red}, semilog lines 2/.style={semilog lines, brown!50 }, semilog half lines/.style={semilog lines 2, dashed }, semilog label x/.style={semilog lines,below,font=\tiny}, semilog label y/.style={semilog lines,right,font=\tiny}, 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=\tiny}, Black label axes/.style={Black grid, font=\tiny}, Nyquist lines/.style={very thick, blue}, Nyquist grid/.style={ultra thin,brown}, Nyquist label axes/.style={Nyquist grid,font=\tiny}, Nyquist label points/.style={font=\tiny}, Temp lines/.style={very thick, blue}, Temp grid/.style={ultra thin,brown}, Temp label axes/.style={Temp grid, font=\tiny}, Temp label points/.style={font=\tiny}, 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]{$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]{$\yy$} -- ({#3},\yy);}; \node[semilog label y, node distance=0.3em]at (#2,#5) { \Unity}; \node[semilog label x, right,node distance=0.8em]at (#3,#4){ \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) {\tiny \Unity}; \node[semilog label x, right,node distance=0.8em]at (#1,0){\tiny \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