Debian Codegraph @

texmf-dist/doc/latex/bondgraph/bondgraph_example.tex

raw
1 %% bondgraph_example.tex
2 %% Copyright (c) 2010, Jean-Francois Dupuis
3 %
4 % This work may be distributed and/or modified under the
5 % conditions of the LaTeX Project Public License, either version 1.3
6 % of this license or (at your option) any later version.
7 % The latest version of this license is in
8 % http://www.latex-project.org/lppl.txt
9 % and version 1.3 or later is part of all distributions of LaTeX
10 % version 2005/12/01 or later.
11 %
12 % This work has the LPPL maintenance status `maintained'.
13 %
14 % The Current Maintainer of this work is Jean-Francois Dupuis.
15 %
16 % This work consists of the files bondgraph.sty, bondgraph_arrows.tex
17 % and bondgraph_example.tex.
18
19 \documentclass{article}
20 \usepackage[x11names, rgb]{xcolor}
21 \usepackage[utf8]{inputenc}
22 \usepackage{bondgraph}
23
24 \begin{document}
25
26 \begin{figure}
27 \centering
28 \begin{tikzpicture}
29 [node distance=1.5cm]
30 \bgComponentNoBond{S}{$S_f$}
31 \bgComponent{}{J11}{1}{right=0.5cm of}{S}{newelement,inbonde}
32 \bgComponent{nodemodpoint}{J01}{0}{right of=}{J11}{inbonde}
33 \bgComponentWithBondMarkupTagged{}{C1}{$C_1$}{above of=}{J11}{inbonde}{bondmodpoint}{2}
34 \bgComponentWithBondLabel{}{R1}{$R_1$}{right of=}{J01}{inbonde}{}{$e_1$}{$f_1$}
35 \bgComponentWithBondLabel{}{R2}{$R_2$}{above of=}{J01}{inbonde}{color=red}{}{$f_2$}
36 \bgComponentWithBondLabel{}{I1}{$I_1$}{below of=}{J01}{inbonde}{}{$e_3$}{$f_3$}
37 \bgComponentWithBondMarkup{}{Sw}{$Sw$}{below of=}{J11}{inbonde}{bondmodpoint}
38 %\bgComponent{}{Sw}{$Sw$}{below of}{J11}{outbondf}
39 \end{tikzpicture}
40 \caption{Simplified bond graph definition.}
41 \end{figure}
42
43 \begin{figure}
44 \centering
45 \begin{tikzpicture}
46 [
47 node distance=1.5cm,
48 mynewelement/.style={
49 color=blue!50!black!75,
50 thick
51 },
52 mybondmodpoint/.style={
53 % The shape:
54 rectangle,
55 % The size:
56 minimum size=3mm,
57 % The border:
58 very thick,
59 draw=red!50!black!50, % 50% red and 50% black, and that mixed with 50% white
60 % Seperation
61 outer sep=2pt
62 }
63 ]
64
65 \node [nodemodpoint] (S) {$Sf$};
66 \node (J11) [right of=S]{1}
67 edge [inbonde] node [below]{$f_{1}$} (S);
68 \node (J01) [right of=J11] {0}
69 edge [newelement,inbonde] node [color=black] [above]{$e_{2}$} (J11);
70 \node (R1) [right of=J01] {$R_1$}
71 edge [inbonde] (J01);
72 \node (Sw) [above of=J01] {$Sw$}
73 edge [outbond] node [mybondmodpoint] {} (J01);
74
75
76 \node [nodemodpoint] (S2) [below of=S]{$Se$};
77 \node (J02) [right of=S2]{0}
78 edge [inbondf] node [above]{$e_{1}$} (S2);
79 \node (J12) [right of=J02]{1}
80 edge [newelement,inbondf] node [below]{$f_{2}$} (J02);
81 \node [mynewelement] (R2) [right of=J12]{$R_2$}
82 edge [inbondf] (J12);
83 \node (C1) [below of=J12] {$C_1$}
84 edge [inbond] (J12);
85 \end{tikzpicture}
86
87 \caption{Bond graph example.}
88
89 \end{figure}
90 \end{document}