<<CheminPackLocaux`

Résistance ohmique

Clear[r];

r[{x1_,y1_},{x2_,y2_},t_]:=Module[{dx},dx=((x2-x1)/5);{{GrayLevel[1],Rectangle[{x1,y1-dx},{x2,y2+dx}]},
		{Line[{{x1,y1-dx},{x2,y2-dx},{x2,y2+dx},{x1,y1+dx},{x1,y1-dx}}],Text[t,{((x1+x2)/2),((y1+y2)/2)}]}}/;Abs[x2-x1]>Abs[y2-y1]]

r[{x1_,y1_},{x2_,y2_},t_]:=Module[{dy},dy=((y2-y1)/5);{{GrayLevel[1],Rectangle[{x1-dy,y1},{x2+dy,y2}]},
		{Line[{{x1-dy,y1},{x2-dy,y2},{x2+dy,y2},{x1+dy,y1},{x1-dy,y1}}],Text[t,{((x1+x2)/2),((y1+y2)/2)},{0,0},{0,1}]}}]

Show[Graphics[{f[{0,3},{2,3}],r[{2,3},{4,3},"\!\(\*SubscriptBox[\(R\), \(1\)]\)"],f[{4,3},{6,3}]}],PlotRange->All,AspectRatio->Automatic,ImageSize->{100,70}]

Générateur

Clear[u]

u[{x1_,y1_},{x2_,y2_},t_]:=Module[{dx},dx=((x2-x1)/5);
	{Line[{{x1,y1},{x1+dx,y1}}],
					Text["○",{x1+dx,y1}],
				Text["∼",{((x1+x2)/2),((y1+y2)/2)+0.7dx}],
			   Text["○",{x2-dx,y2}],
					Line[{{x2-dx,y2},{x2,y2}}],
				Text[t,{((x1+x2)/2),((y1+y2)/2)-0.7dx},{0,0},{1,0}]}/;Abs[x2-x1]>Abs[y2-y1]]

u[{x1_,y1_},{x2_,y2_},t_]:=Module[{dy},dy=((y2-y1)/5);
	{Line[{{x1,y1},{x1,y1+dy}}],
					Text["○",{x1,y1+dy}],
				Text["∼",{((x1+x2)/2)-0.7dy,((y1+y2)/2)},{0,0},{0,1}],
			   Text["○",{x2,y2-dy}],
					Line[{{x2,y2-dy},{x2,y2}}],
				Text[t,{((x1+x2)/2)+0.7dy,((y1+y2)/2)},{0,0},{0,1}]}]

Show[Graphics[{f[{0,3},{2,3}],u[{2,3},{4,3},"U"],f[{4,3},{6,3}]}],PlotRange->All,AspectRatio->Automatic,ImageSize->{100,70}]

Condensateur de capacité C

Clear[c]

c[{x1_,y1_},{x2_,y2_},t_]:=Module[{dx},dx=((x2-x1)/5);
	{Line[{{x1,y1},{x1+2.2 dx,y1}}],
					{Thickness[0.005],Line[{{x1+2.2 dx,y1-2dx},{x1+2.2dx,y1+2 dx}}],
				Line[{{x2-2.2 dx,y2-2dx},{x2-2.2 dx,y2+2dx}}]},
			Line[{{x2-2.2 dx,y2},{x2,y2}}],
				Text[t,{x1+2.5 dx,y1-3 dx},{0,0},{1,0}]}/;Abs[x2-x1]>Abs[y2-y1]]

c[{x1_,y1_},{x2_,y2_},t_]:=Module[{dy},dy=((y2-y1)/5);
	{Line[{{x1,y1},{x1,y1+2.2 dy}}],
				{Thickness[0.005],Line[{{x1-2 dy,y1+2.2 dy},{x1+2 dy,y1+2.2 dy}}],
				Line[{{x2-2 dy,y2-2.2 dy},{x2+2 dy,y2-2.2 dy}}]},
					Line[{{x2,y2-2.2 dy},{x2,y2}}],
				Text[t,{x1+3 dy,y1+2.5 dy},{0,0},{0,1}]}]

Show[Graphics[{f[{0,3},{2,3}],c[{2,3},{4,3},"\!\(\*SubscriptBox[\(C\), \(1\)]\)"],f[{4,3},{6,3}]}],PlotRange->All,AspectRatio->Automatic,ImageSize->{100,70}]

Bobine d'inductance L

Clear[l]

l[{x1_,y1_},{x2_,y2_},t_]:=Module[{r,n,v},n=8 (*n pair*);r=((x2-x1)/5);v=((x2-x1-2 r)/((n+1) π));
	{Point[{x1,y1}],
			First[ParametricPlot[{x1+r+v(k+π)+r Cos[k],y1+r Sin[k]},{k,-π,n π},PlotStyle->{Thickness[0.002]},Compiled->False,DisplayFunction->Identity]],
					Point[{x2,y2}],
				Text[t,{((x1+x2)/2),y1-2 r},{0,0},{1,0}]}/;Abs[x2-x1]>Abs[y2-y1]]

l[{x1_,y1_},{x2_,y2_},t_]:=Module[{r,n,v},n=8 (*n pair*);r=((y2-y1)/5);v=((y2-y1-2 r)/((n+1) π));
	{Point[{x1,y1}],
			First[ParametricPlot[{x1+r Sin[k],y1+r+v(k+π)+r Cos[k]},{k,-π,n π},PlotStyle->{Thickness[0.002]},Compiled->False,DisplayFunction->Identity]],
					Point[{x2,y2}],
				Text[t,{x1+2 r,((y1+y2)/2)},{0,0},{0,1}]}]

Show[Graphics[{f[{0,3},{2,3}],l[{2,3},{4,3},"\!\(\*SubscriptBox[\(L\), \(1\)]\)"],f[{4,3},{6,3}]}],PlotRange->All,AspectRatio->Automatic,ImageSize->{100,70}]