回路部品(コンデンサなど)を相互に配置する。回路部品の名前を使用して、「コントロール」でメッシュ矢印を「直感的に」配置する

回路部品(コンデンサなど)を相互に配置する。回路部品の名前を使用して、「コントロール」でメッシュ矢印を「直感的に」配置する

この質問は私の別の私の評判のせいで、回答にコメントを追加することはできません。だから、この機会に感謝したいと思います。ジョン・コルミロ私の最初の質問に対する彼の答えに感謝します。また、私の英語が間違っていたことをお詫びします。

質問に対して:

回路の場合は、次のcircuitikz構文を使用します。例

\begin{circuitikz}
  \draw
  (0,0) to [V = $U$] (0,3)
        to [short, i = $I$, -*] (3,3) -- (6,3)
        to [R = $R_2$, v = $U_2$, i = $I_2$] (6,0) -- (0,0)
  (3,3) to [R = $R_1$, v = $U_1$, i = $I_1$, -*] (3,0);
\end{circuitikz}

これは非常に簡単で直感的です。ただし、回路にメッシュ矢印を追加したい場合は、(上記のコードに加えて、メッシュ 1 を例として) を使用します。

\draw
 %
 % mesh one (detailed explanation of the implementation)
 %
 [<-,% direction of the arrow
 > = triangle 45,% kind of the arrow end
 path picture =% allows ''to paint a picture'' inside of an other ''picture''
 {\node[anchor = center]% position of the inner ''picture''
 at (path picture bounding box.center)% bordering rectangle,
                                      % centered inside the arrow (arrow is the outer ''picture'')
 {$M_1$};}]% text of the inner ''picture''
 (1.75,1)% coordinates of the arrow end
 arc% arc-shaped arrow
 (-60:% angle of the arrow start
 170:% angle of the arrow end
 .5);% radius of the arc

両方のコードの結果については、上記のリンク (私の最初の質問) を参照してください。

「たった」 1 つの矢印のためのこの量のコードは、私にとっては少々多すぎ、複雑で直感的ではないように思えます。

私が欲しいもの:

1.PGFマニュアルの 51 ページ (サブセクション 3.8)の「Petri-Net」の例のように、回路の各部分を (名前の付いたノードとして) 相互に配置します。

ペトリネット

構文と組み合わせますcircuitikz(最初のコード例を参照)。

2.私の最初の質問に対する John Kormylo の回答のように、回路部品の名前を使用してcontrolsマクロで直感的にメッシュ矢印を配置します (マニュアルの 748 ページ)。PGF

\node (M 3) [below] at (0,0) {\phantom{$M_3$}};% reserving space for M 3 under the circuit
\draw
[->, > = triangle 45] (current bounding box.east) .. controls
                      (current bounding box.south east) ..
                      (M 3.south) node[above, pos = .95] {$M_3$};% see below
% above: location of the inscription ''M_3'' relative to the arrow end
% pos=: location of the inscription ''M_3'' on the ''x''-axis (arrow beginning is zero,
%                                                              arrow end is one)

これは可能ですか?もし可能であれば、どうすればいいでしょうか?私の意図を理解していただければ幸いです。

ご回答とご協力をよろしくお願いいたします。

答え1

ノードを円弧の中心に配置する代わりに、円弧をノードの周囲に配置しました。結果は同じで、キー入力が少なくなります。同じオプションを何度も繰り返さないようにする方法もいくつかあります。変更はスコープの期間のみ持続するため、スコープを使用しました。

簡素化の大部分はコメントの削除によるものです。

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenx}
\usepackage{amsmath}
\usepackage[european]{circuitikz}
\usepackage{showframe}
\begin{document}
  \noindent
  \begin{minipage}[t]{.5\linewidth}
    \begin{circuitikz}[baseline=(current bounding box.north)]
      %
      % circuit
      %
      \draw
      (0,0) to [V = $U$] (0,3)
            to [short, i = $I$, -*] (3,3) -- (6,3)
            to [R = $R_2$, v = $U_2$, i = $I_2$] (6,0) -- (0,0)
      (3,3) to [R = $R_1$, v = $U_1$, i = $I_1$, -*] (3,0);
      %
      % mesh arrows
      %
      \begin{scope}[>=triangle 45]
        \draw[<-] (1.5,1.5) node{$M_1$} +(.25,-.433) arc(-60:170:.5);
        \draw[<-] (4.5,1.5) node{$M_2$} +(.25,-.433) arc(-60:170:.5);
        \node (mesh3) [below] at (0,0) {\phantom{$M_3$}};% reserve space below circuit for M_3
        \draw[->, thick] (current bounding box.east)% not the only way, just easy
          .. controls (current bounding box.south east) .. 
          (mesh3.south) node[above,pos=.9] {$M_3$};
      \end{scope}
    \end{circuitikz}
  \end{minipage}
  \hfill
  \begin{minipage}[t]{.45\linewidth}
    %
    % equations for mesh and knot
    %
    \begin{align*}
      &K  : \quad I   = I_1 + I_2\\
      &M_1: \quad -U  = -U_1\Leftrightarrow U = U_1 = R_1I_1\\
      &M_2: \quad U_1 = -U_2\\
      &M_3: \quad -U  = -U_2\Leftrightarrow U = U_2 = R_2I_2
    \end{align*}
  \end{minipage}
\end{document}

関連情報