de Boris101 » 11 Mai 2025, 17:26
Comme je n'ai pas les droits je copie colle ici un exemple de circuit du secondaire, il a fallu adapter car les schémas circuitikz ne correspondent pas à ceux que nous utilisons même avec le paramètre européen (G et M), à noter aussi que les courants 'en "red") font appel à des variables de style globales introduite depuis la version 1.7 de circuit (vérifier dans les logs j'ai fait afficher les "files"). Bien entendu les commentaires sont en français mais beaucoup de paramètre sont écrits en anglais sachant que les bibli sont en anglais tout comme la documentation et les exemple, je mélange un peu, moi ça me convient !
\listfiles
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usepackage[european]{circuitikz} % Utilise les symboles européens
\usetikzlibrary{positioning, calc, arrows.meta} % Nécessaire pour positionner et arrows.meta pour les flèches
\usepackage{xcolor} % Pour utiliser les couleurs
\begin{document}
\begin{circuitikz}
% --- Définitions des styles et constantes ---
% 1. Définir les pointes de flèches d'abord
\tikzset{
voltage_arrow_tip/.tip={Stealth[round, length=6pt]}
}
% 2. Ensuite, définir les styles complets qui utilisent ces pointes
\tikzset{
% Style pour les flèches de tension (ligne et pointe)
custom_voltage_arrow/.style={draw=blue, thick, -voltage_arrow_tip},
% Style pour les labels des flèches de tension manuelles (AU-DESSUS de la flèche)
voltage_label_style/.style={midway, above, text=blue, font=\scriptsize}
}
% Constante pour le décalage vertical des flèches de tension au-dessus des dipôles
\def\voltagearrowyshift{14pt}
% Styles globaux pour les flèches et labels de courant automatiques (i=...) attention il faut circuitikz version 1.7.x
\ctikzset{current label style={text=red, font=\scriptsize}} % Style pour les labels de courant (texte)
\ctikzset{current marker style={red}} % AJOUTÉ : Style pour le marqueur de courant (la pointe de flèche) en rouge
% --- Définition des coordonnées principales ---
\coordinate (branch1_v_level) at (0, 4);
\coordinate (branch2_v_level) at (0, 2);
\coordinate (branch3_v_level) at (0, 0);
\coordinate (left_rail_bottom) at (0,0);
\coordinate (left_rail_top) at (0,6);
\coordinate (right_rail_bottom) at (7,0);
\coordinate (right_rail_top) at (7,6);
% --- Dessin des composants et des fils ---
% Rails verticaux
\draw (left_rail_bottom) -- (left_rail_top);
\draw (right_rail_bottom) -- (right_rail_top);
% Fil supérieur horizontal et Générateur personnalisé
\draw (left_rail_top) -- (right_rail_top) node[midway, draw, thick, circle, fill=white, minimum size=8mm, inner sep=1pt, name=Gnode] {G};
% Labels de polarité du générateur (+ à gauche, - à droite)
\node[anchor=south] at ([yshift=-10pt, xshift=-20pt]Gnode.north) {$+$};
\node[anchor=south] at ([yshift=-10pt, xshift=20pt]Gnode.north) {$-$};
% Tension du générateur (pointe de Gnode.east vers Gnode.west, soit de - vers +)
\draw[custom_voltage_arrow] ([yshift=\voltagearrowyshift]Gnode.east) -- ([yshift=\voltagearrowyshift]Gnode.west) node[voltage_label_style] {6V};
% Courant du générateur (sur le fil entre Gnode.west et left_rail_top, pointant vers la gauche)
\draw (Gnode.west) to[short, i=0.6A] (left_rail_top);
% --- Première branche (Moteur + R1) - HORIZONTALE ---
\coordinate (b1_start) at (branch1_v_level -| left_rail_top);
\coordinate (b1_p1) at ($(b1_start) + (1.4,0)$);
\coordinate (b1_node_M_start) at (b1_p1);
\coordinate (b1_node_M_end) at ($(b1_node_M_start) + (1.4,0)$);
\coordinate (b1_p2) at (b1_node_M_end);
\coordinate (b1_p3) at ($(b1_p2) + (1.4,0)$);
\coordinate (b1_node_R1_start) at (b1_p3);
\coordinate (b1_node_R1_end) at ($(b1_node_R1_start) + (1.4,0)$);
\coordinate (b1_p4) at (b1_node_R1_end);
% Fil 1 et flèche de courant
\draw (b1_start) to[short, i=0.3A] (b1_p1);
% Moteur
\node[draw, thick, circle, fill=white, minimum size=8mm, inner sep=1pt, name=Mnode] at ($(b1_node_M_start)!0.5!(b1_node_M_end)$) {M};
\draw (b1_node_M_start) -- (Mnode.west);
\draw (Mnode.east) -- (b1_node_M_end);
% yshift utilise \voltagearrowyshift
\draw[custom_voltage_arrow] ([yshift=\voltagearrowyshift]Mnode.east) -- ([yshift=\voltagearrowyshift]Mnode.west) node[voltage_label_style] {3V};
\draw (b1_p2) -- (b1_p3);
% R1
\draw (b1_node_R1_start) to[R, l_=$R_1$] (b1_node_R1_end);
% yshift utilise \voltagearrowyshift
\draw[custom_voltage_arrow] ([yshift=\voltagearrowyshift]b1_node_R1_end) -- ([yshift=\voltagearrowyshift]b1_node_R1_start) node[voltage_label_style] {3V};
\draw (b1_p4) -- (branch1_v_level -| right_rail_top);
% --- Deuxième branche (3 Lampes) - HORIZONTALE ---
\coordinate (b2_start) at (branch2_v_level -| left_rail_top);
\coordinate (b2_p1) at ($(b2_start) + (1,0)$);
\coordinate (b2_node_L1_start) at (b2_p1);
\coordinate (b2_node_L1_end) at ($(b2_node_L1_start) + (1,0)$);
\coordinate (b2_p2) at (b2_node_L1_end);
\coordinate (b2_p3) at ($(b2_p2) + (1,0)$);
\coordinate (b2_node_L2_start) at (b2_p3);
\coordinate (b2_node_L2_end) at ($(b2_node_L2_start) + (1,0)$);
\coordinate (b2_p4) at (b2_node_L2_end);
\coordinate (b2_p5) at ($(b2_p4) + (1,0)$);
\coordinate (b2_node_L3_start) at (b2_p5);
\coordinate (b2_node_L3_end) at ($(b2_node_L3_start) + (1,0)$);
\coordinate (b2_p6) at (b2_node_L3_end);
% Fil 1 et flèche de courant
\draw (b2_start) to[short, i=0.1A] (b2_p1);
% L1
\draw (b2_node_L1_start) to[lamp, l_=L1] (b2_node_L1_end);
% yshift utilise \voltagearrowyshift
\draw[custom_voltage_arrow] ([yshift=\voltagearrowyshift]b2_node_L1_end) -- ([yshift=\voltagearrowyshift]b2_node_L1_start) node[voltage_label_style] {2V};
\draw (b2_p2) -- (b2_p3);
% L2
\draw (b2_node_L2_start) to[lamp, l_=L2] (b2_node_L2_end);
% yshift utilise \voltagearrowyshift
\draw[custom_voltage_arrow] ([yshift=\voltagearrowyshift]b2_node_L2_end) -- ([yshift=\voltagearrowyshift]b2_node_L2_start) node[voltage_label_style] {2V};
\draw (b2_p4) -- (b2_p5);
% L3
\draw (b2_node_L3_start) to[lamp, l_=L3] (b2_node_L3_end);
% yshift utilise \voltagearrowyshift
\draw[custom_voltage_arrow] ([yshift=\voltagearrowyshift]b2_node_L3_end) -- ([yshift=\voltagearrowyshift]b2_node_L3_start) node[voltage_label_style] {2V};
\draw (b2_p6) -- (branch2_v_level -| right_rail_top);
% --- Troisième branche (R2 + R3) - HORIZONTALE ---
\coordinate (b3_start) at (branch3_v_level -| left_rail_top);
\coordinate (b3_p1) at ($(b3_start) + (1.4,0)$);
\coordinate (b3_node_R2_start) at (b3_p1);
\coordinate (b3_node_R2_end) at ($(b3_node_R2_start) + (1.4,0)$);
\coordinate (b3_p2) at (b3_node_R2_end);
\coordinate (b3_p3) at ($(b3_p2) + (1.4,0)$);
\coordinate (b3_node_R3_start) at (b3_p3);
\coordinate (b3_node_R3_end) at ($(b3_node_R3_start) + (1.4,0)$);
\coordinate (b3_p4) at (b3_node_R3_end);
% Fil 1 et flèche de courant
\draw (b3_start) to[short, i=0.2A] (b3_p1);
% R2
\draw (b3_node_R2_start) to[R, l_=$R_2$] (b3_node_R2_end);
% yshift utilise \voltagearrowyshift
\draw[custom_voltage_arrow] ([yshift=\voltagearrowyshift]b3_node_R2_end) -- ([yshift=\voltagearrowyshift]b3_node_R2_start) node[voltage_label_style] {4V};
\draw (b3_p2) -- (b3_p3);
% R3
\draw (b3_node_R3_start) to[R, l_=$R_3$] (b3_node_R3_end);
% yshift utilise \voltagearrowyshift
\draw[custom_voltage_arrow] ([yshift=\voltagearrowyshift]b3_node_R3_end) -- ([yshift=\voltagearrowyshift]b3_node_R3_start) node[voltage_label_style] {2V};
\draw (b3_p4) -- (branch3_v_level -| right_rail_top);
\end{circuitikz}
\end{document}
il s'agit de la correction de l'exercice dont l'énoncé est :
Ci-joint le circuit suivant :
* Un générateur de tension 6V
* Un moteur qui reçoit une tension de 3V
* La valeur de la résistance 1 est de 10Ω
* Les 3 lampes sont identiques, I(L1) = 100 mA
* I(R2)= 0,2 A et U(R3) = 2V
Complète les tensions et intensités sur le schéma pour chaque dipôle et justifie ci-après en énonçant les lois utilisées avec le vocabulaire approprié (on n’oubliera pas l’intensité fournie par le générateur)
le code du schéma est donc celui de la correction sans les flèches.
Dernière édition par
Boris101 le 12 Mai 2025, 09:57, édité 1 fois.