带有 circuitikz 的传输线

带有 circuitikz 的传输线

使用彩色矩形(条带)绘制传输线更加方便,如下图电路所示

在此处输入图片描述

而不是使用标准circuitikz符号 在此处输入图片描述

我对 TeX 的了解不够,无法做到这一点,但是您能否提供解决方案,让一个人可以控制传输线的矩形符号的长度,或者灰色矩形的行为类似于电阻器的端口?

答案1

一个简单的选项;),绘制传输线是使用库decorations.markings,在我的示例的情况下,声明了 3 个标记,一个声明起始坐标,一个包含标签,一个包含最终坐标并绘制一个矩形,如示例所示,以下是 circuitikz 中的代码,留下空格然后绘制每条传输线,因为对于我的解决方案,我无法将它与包的电路语法集成。

结果: 在此处输入图片描述

梅威瑟:

\documentclass[border=20pt]{standalone}
\usepackage{circuitikz}
\usepackage{siunitx}
\usetikzlibrary{decorations.markings}

\begin{document}
    \begin{tikzpicture}[
        %Environment Config
        line width=0.75,
        %Style Variable
        text pos/.store in=\tpos,text pos=0.5,
        text anchor/.store in=\tanchor,text anchor={north:12pt},
        Tline/.style={%Style for the voltage reference
            draw,
            postaction={decorate,decoration={markings,mark=at position 10pt with {\coordinate (a) at (90:3.5pt);}}},
            postaction={decorate,decoration={markings,mark=at position \tpos with {\node at (\tanchor){\small #1};}}},
            postaction={decorate,decoration={markings,mark=at position \pgfdecoratedpathlength-10pt with {\coordinate (b) at (-90:3.5pt);\draw[fill=black!40](a) rectangle (b);}}}
        },
        Myground/.style={
            ground,
            scale=1.5,
            yshift=5pt
        }
    ]
    %Size adjust
    \ctikzset{nodes width/.initial=0.1}
    \ctikzset{bipoles/length=0.8cm}
    %Draw circuit
    \draw
    (0,0) node[nigfetd,scale=1.7](N1){} % Discrete component node at 0,0 named N1
    (N1)++(-6pt,0) %Draw a circle decoration 
        circle (23pt)
    (N1.E)%From emiter relativa coordinate to node ground.
        -- ++(0,-1) coordinate (gnd-0) node[Myground]{} 
    (N1.G)%From gate
        to[short,-*]++(-0.5,0) coordinate (divG) % Division in gate
        to[R,l=$R_1$,-*]++(0,2) coordinate (divGR) % Division in gate resistance.
        to[C]++(1.2,0) node[rotate=90,Myground]{}
    (divGR)%From divGr
        to[short]++(0,0.5) node[ocirc,scale=1.5,label=90:$V_g$]{}
    (divG)++(-2,0) coordinate (divG-1)%Declare a point shifted ++(-2,0) to draw the Transmission line.
    (divG-1)%Continue drawing from divG-1
        to[C,l=$C_2$,*-] (divG-1 |- gnd-0) node[Myground]{}
    (divG-1)
        to[C,l_=$C_1$] ++ (-1.5,0)
        to[short] ++ (0,-2.5) coordinate(divG-2)
    (N1.D)++(1,0) coordinate (temp)
    (N1.D) 
        -| (temp |- divG)
        to[short,-*]++(1,0) coordinate (divD)
    (divD)++(0,2) coordinate (divD-1)
    (divD-1)
        to[C,*-]++(1.2,0) node[rotate=90,Myground]{}
    (divD-1)
        to[short]++(0,0.5) node[ocirc,scale=1.5,label=90:$V_{dd}$]{}
    (divD)++(2,0) coordinate (divD-2)
    (divD-2)++(2,0) coordinate (divD-3)
    (divD-3)
        to[C,l_={\raisebox{-10pt}{$C_3$\hspace{-5pt}}},*-] (divD-3 |- gnd-0) node[Myground]{}
    (divD-3)
        to[C,l_=$C_4$] ++ (1,0) coordinate(divD-4)
    (divD-4)++(2,0) coordinate (divD-5)
    (divD-5)
        to[short]++(0.5,0) node[ocirc,scale=1.5,label=0:$P_{out}$]{}
    (divD-5)++(0,-0.5) coordinate (divD-6)
    (divD-6)
        to[R,l=$50\si{\ohm}$] ++ (0,-2) node[Myground]{}
    (divG-2 -| divD-4)
        to[short] (divD-4 |- divD-6);

    \fill (N1)++(0,-7.6pt) circle (2pt);

    \draw[Tline=$Z_0$,text anchor=-90:12pt](divG) -- (divG-1);
    \draw[Tline=${Z_{03}=50\si{\ohm}, \theta_3}$,text pos=0.25](divG-2) -- (divG-2 -| divD-4);
    \draw[Tline,text anchor=-90:12pt](divD-4 |- divD-6) -- (divD-6);
    \draw[Tline=$\lambda/4$,text anchor=-90:15pt](divD) -- (divD-1);
    \draw[Tline=${Z_0, \theta_1}$,text anchor=-90:15pt](divD) -- (divD-2);
    \draw[Tline=${Z_0, \theta_2}$,text anchor=-90:20pt](divD-2) -- ++(0,2);
    \draw[Tline=${Z_0}$,text anchor=-90:15pt](divD-2) -- (divD-3);
    \draw[Tline=$\lambda/4$](divD-4) -- (divD-5);
    \end{tikzpicture}
\end{document}

相关内容